aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/gregtech/GT_Mod.java3
-rw-r--r--src/main/java/gregtech/api/GregTech_API.java1219
-rw-r--r--src/main/java/gregtech/api/enums/OrePrefixes.java2
-rw-r--r--src/main/java/gregtech/api/enums/TextureSet.java300
-rw-r--r--src/main/java/gregtech/api/enums/Textures.java1712
-rw-r--r--src/main/java/gregtech/api/interfaces/metatileentity/IConnectable.java16
-rw-r--r--src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java2643
-rw-r--r--src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java1457
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java878
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java1056
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java6
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java199
-rw-r--r--src/main/java/gregtech/api/util/GT_LanguageManager.java4
-rw-r--r--src/main/java/gregtech/api/util/GT_ModHandler.java39
-rw-r--r--src/main/java/gregtech/common/GT_Client.java1284
-rw-r--r--src/main/java/gregtech/common/GT_Proxy.java3795
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Item_Machines.java4
-rw-r--r--src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java2
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java2
-rw-r--r--src/main/java/gregtech/loaders/oreprocessing/ProcessingPipe.java107
-rw-r--r--src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java9
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_DL.pngbin0 -> 410 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_DOWN.pngbin0 -> 309 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_DR.pngbin0 -> 406 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_LEFT.pngbin0 -> 316 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_LR.pngbin0 -> 428 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_ND.pngbin0 -> 499 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_NL.pngbin0 -> 493 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_NR.pngbin0 -> 498 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_NU.pngbin0 -> 499 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_RIGHT.pngbin0 -> 320 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_UD.pngbin0 -> 408 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_UL.pngbin0 -> 398 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_UP.pngbin0 -> 302 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_UR.pngbin0 -> 408 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/pipeNonuple.pngbin0 -> 433 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/pipeQuadruple.pngbin0 -> 448 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/pipeNonuple.pngbin0 -> 497 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/pipeQuadruple.pngbin0 -> 521 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/pipeNonuple.pngbin0 -> 433 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/pipeQuadruple.pngbin0 -> 448 bytes
89 files changed, 7636 insertions, 7101 deletions
diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java
index 4cf75781ab..ef54af48e8 100644
--- a/src/main/java/gregtech/GT_Mod.java
+++ b/src/main/java/gregtech/GT_Mod.java
@@ -287,6 +287,9 @@ public class GT_Mod implements IGT_Mod {
gregtechproxy.enableRedGraniteOres = GregTech_API.sWorldgenFile.get("general", "enableRedGraniteOres", gregtechproxy.enableRedGraniteOres);
gregtechproxy.enableMarbleOres = GregTech_API.sWorldgenFile.get("general", "enableMarbleOres", gregtechproxy.enableMarbleOres);
gregtechproxy.enableBasaltOres = GregTech_API.sWorldgenFile.get("general", "enableBasaltOres", gregtechproxy.enableBasaltOres);
+ gregtechproxy.gt6Pipe = tMainConfig.get("general", "GT6StyledPipesConnection", true).getBoolean(true);
+ gregtechproxy.gt6Cable = tMainConfig.get("general", "GT6StyledWiresConnection", true).getBoolean(true);
+ gregtechproxy.costlyCableConnection = tMainConfig.get("general", "CableConnectionRequiresSolderingMaterial", false).getBoolean(false);
GregTech_API.mUseOnlyGoodSolderingMaterials = GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.harderrecipes, "useonlygoodsolderingmaterials", GregTech_API.mUseOnlyGoodSolderingMaterials);
gregtechproxy.mChangeHarvestLevels = GregTech_API.sMaterialProperties.get("havestLevel", "activateHarvestLevelChange", false);//TODO CHECK
diff --git a/src/main/java/gregtech/api/GregTech_API.java b/src/main/java/gregtech/api/GregTech_API.java
index 61ad8bab53..2d29c44bdf 100644
--- a/src/main/java/gregtech/api/GregTech_API.java
+++ b/src/main/java/gregtech/api/GregTech_API.java
@@ -1,605 +1,614 @@
-package gregtech.api;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.IDamagableItem;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.internal.IGT_RecipeAdder;
-import gregtech.api.interfaces.internal.IThaumcraftCompat;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.items.GT_CoolantCellIC_Item;
-import gregtech.api.items.GT_CoolantCell_Item;
-import gregtech.api.items.GT_Tool_Item;
-import gregtech.api.metatileentity.BaseMetaTileEntity;
-import gregtech.api.objects.GT_Cover_Default;
-import gregtech.api.objects.GT_Cover_None;
-import gregtech.api.objects.GT_HashSet;
-import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.threads.GT_Runnable_MachineBlockUpdate;
-import gregtech.api.util.*;
-import gregtech.api.world.GT_Worldgen;
-import net.minecraft.block.Block;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-import net.minecraftforge.fluids.Fluid;
-
-import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
-
-import static gregtech.api.enums.GT_Values.*;
-
-/**
- * Please do not include this File in your Mod-download as it ruins compatiblity, like with the IC2-API
- * You may just copy those Functions into your Code, or better call them via reflection.
- * <p/>
- * The whole API is the basic construct of my Mod. Everything is dependent on it.
- * I change things quite often so please don't include any File inside your Mod, even if it is an Interface.
- * Since some Authors were stupid enough to break this simple Rule, I added Version checks to enforce it.
- * <p/>
- * In these Folders are many useful Functions. You can use them via reflection if you want.
- * I know not everything is compilable due to API's of other Mods, but these are easy to fix in your Setup.
- * <p/>
- * You can use this to learn about Modding, but I would recommend simpler Mods.
- * You may even copypaste Code from these API-Files into your Mod, as I have nothing against that, but you should look exactly at what you are copying.
- *
- * @author Gregorius Techneticies
- */
-public class GregTech_API {
- @Deprecated
- public static final long MATERIAL_UNIT = M, FLUID_MATERIAL_UNIT = L;
- /**
- * Fixes the HashMap Mappings for ItemStacks once the Server started
- */
- public static final Collection<Map<GT_ItemStack, ?>> sItemStackMappings = new ArrayList<Map<GT_ItemStack, ?>>();
- public static final Collection<Map<Fluid, ?>> sFluidMappings = new ArrayList<Map<Fluid, ?>>();
- /**
- * The MetaTileEntity-ID-List-Length
- */
- public static final short MAXIMUM_METATILE_IDS = Short.MAX_VALUE - 1;
- /**
- * My Creative Tab
- */
- public static final CreativeTabs TAB_GREGTECH = new GT_CreativeTab("Main", "Main"), TAB_GREGTECH_MATERIALS = new GT_CreativeTab("Materials", "Materials"), TAB_GREGTECH_ORES = new GT_CreativeTab("Ores", "Ores");
- /**
- * A List of all registered MetaTileEntities
- * <p/>
- * 0 - 749 are used by GregTech.
- * 750 - 999 are reserved for Alkalus.
- * 1000 - 2047 are used by GregTech.
- * 2048 - 2559 are reserved for OvermindDL.
- * 2560 - 3071 are reserved for Immibis.
- * 3072 - 3583 are reserved for LinusPhoenix.
- * 3584 - 4095 are reserved for BloodyAsp.
- * 4096 - 5095 are used for GregTech Frames.
- * 5096 - 6099 are used for GregTech Pipes.
- * 6100 - 8191 are used for GregTech Decoration Blocks.
- * 8192 - 8703 are reserved for ZL123.
- * 8704 - 9215 are reserved for Mr10Movie.
- * 9216 - 9727 are used for GregTech Automation Machines.
- * 9728 - 10239 are reserved for 28Smiles.
- * 10240 - 10751 are reserved for VirMan.
- * 10752 - 11263 are reserved for Briareos81.
- * 11264 - 12000 are reserved for the next one who asks me.
- * 9728 - 32766 are currently free.
- * <p/>
- * Contact me if you need a free ID-Range, which doesn't conflict with other Addons.
- * You could make an ID-Config, but we all know, what "stupid" customers think about conflicting ID's
- */
- public static final IMetaTileEntity[] METATILEENTITIES = new IMetaTileEntity[MAXIMUM_METATILE_IDS];
- /**
- * The Icon List for Covers
- */
- public static final Map<GT_ItemStack, ITexture> sCovers = new ConcurrentHashMap<GT_ItemStack, ITexture>();
- /**
- * The List of Cover Behaviors for the Covers
- */
- public static final Map<GT_ItemStack, GT_CoverBehavior> sCoverBehaviors = new ConcurrentHashMap<GT_ItemStack, GT_CoverBehavior>();
- /**
- * The List of Circuit Behaviors for the Redstone Circuit Block
- */
- public static final Map<Integer, GT_CircuitryBehavior> sCircuitryBehaviors = new ConcurrentHashMap<Integer, GT_CircuitryBehavior>();
- /**
- * The List of Blocks, which can conduct Machine Block Updates
- */
- public static final Map<Block, Integer> sMachineIDs = new ConcurrentHashMap<Block, Integer>();
- /**
- * The Redstone Frequencies
- */
- public static final Map<Integer, Byte> sWirelessRedstone = new ConcurrentHashMap<Integer, Byte>();
- /**
- * The IDSU Frequencies
- */
- public static final Map<Integer, Integer> sIDSUList = new ConcurrentHashMap<Integer, Integer>();
- /**
- * A List of all Books, which were created using @GT_Utility.getWrittenBook the original Title is the Key Value
- */
- public static final Map<String, ItemStack> sBookList = new ConcurrentHashMap<String, ItemStack>();
- /**
- * The List of all Sounds used in GT, indices are in the static Block at the bottom
- */
- public static final Map<Integer, String> sSoundList = new ConcurrentHashMap<Integer, String>();
- /**
- * The List of Tools, which can be used. Accepts regular damageable Items and Electric Items
- */
- public static final GT_HashSet<GT_ItemStack> sToolList = new GT_HashSet<GT_ItemStack>(), sCrowbarList = new GT_HashSet<GT_ItemStack>(), sScrewdriverList = new GT_HashSet<GT_ItemStack>(), sWrenchList = new GT_HashSet<GT_ItemStack>(), sSoftHammerList = new GT_HashSet<GT_ItemStack>(), sHardHammerList = new GT_HashSet<GT_ItemStack>(), sSolderingToolList = new GT_HashSet<GT_ItemStack>(), sSolderingMetalList = new GT_HashSet<GT_ItemStack>();
- /**
- * The List of Hazmat Armors
- */
- public static final GT_HashSet<GT_ItemStack> sGasHazmatList = new GT_HashSet<GT_ItemStack>(), sBioHazmatList = new GT_HashSet<GT_ItemStack>(), sFrostHazmatList = new GT_HashSet<GT_ItemStack>(), sHeatHazmatList = new GT_HashSet<GT_ItemStack>(), sRadioHazmatList = new GT_HashSet<GT_ItemStack>(), sElectroHazmatList = new GT_HashSet<GT_ItemStack>();
- /**
- * The List of Dimensions, which are Whitelisted for the Teleporter. This list should not contain other Planets.
- * Mystcraft Dimensions and other Dimensional Things should be allowed.
- * Mystcraft and Twilight Forest are automatically considered a Dimension, without being in this List.
- */
- public static final Collection<Integer> sDimensionalList = new HashSet<Integer>();
- /**
- * Lists of all the active World generation Features, these are getting Initialized in Postload!
- */
- public static final List<GT_Worldgen> sWorldgenList = new ArrayList<GT_Worldgen>();
- /**
- * A List containing all the Materials, which are somehow in use by GT and therefor receive a specific Set of Items.
- */
- public static final Materials[] sGeneratedMaterials = new Materials[1000];
- /**
- * This is the generic Cover behavior. Used for the default Covers, which have no Behavior.
- */
- public static final GT_CoverBehavior sDefaultBehavior = new GT_Cover_Default(), sNoBehavior = new GT_Cover_None();
- /**
- * For the API Version check
- */
- public static volatile int VERSION = 509;
- @Deprecated
- public static IGT_RecipeAdder sRecipeAdder;
- /**
- * Used to register Aspects to ThaumCraft, this Object might be null if ThaumCraft isn't installed
- */
- public static IThaumcraftCompat sThaumcraftCompat;
- /**
- * These Lists are getting executed at their respective timings. Useful if you have to do things right before/after I do them, without having to control the load order. Add your "Commands" in the Constructor or in a static Code Block of your Mods Main Class. These are not Threaded, I just use a native Java Interface for their execution. Implement just the Method run() and everything should work
- */
- public static List<Runnable> sBeforeGTPreload = new ArrayList<Runnable>(), sAfterGTPreload = new ArrayList<Runnable>(), sBeforeGTLoad = new ArrayList<Runnable>(), sAfterGTLoad = new ArrayList<Runnable>(), sBeforeGTPostload = new ArrayList<Runnable>(), sAfterGTPostload = new ArrayList<Runnable>(), sBeforeGTServerstart = new ArrayList<Runnable>(), sAfterGTServerstart = new ArrayList<Runnable>(), sBeforeGTServerstop = new ArrayList<Runnable>(), sAfterGTServerstop = new ArrayList<Runnable>(), sGTBlockIconload = new ArrayList<Runnable>(), sGTItemIconload = new ArrayList<Runnable>();
- /**
- * The Icon Registers from Blocks and Items. They will get set right before the corresponding Icon Load Phase as executed in the Runnable List above.
- */
- @SideOnly(Side.CLIENT)
- public static IIconRegister sBlockIcons, sItemIcons;
- /**
- * The Configuration Objects
- */
- public static GT_Config sRecipeFile = null, sMachineFile = null, sWorldgenFile = null, sModularArmor = null, sMaterialProperties = null, sMaterialComponents = null, sUnification = null, sSpecialFile = null, sClientDataFile, sOPStuff = null;
- public static int TICKS_FOR_LAG_AVERAGING = 25, MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING = 100;
- /**
- * Initialized by the Block creation.
- */
- public static Block sBlockMachines;
-
- public static Block sBlockOres1, sBlockOresUb1, sBlockOresUb2, sBlockOresUb3, /*sBlockGem,*/ sBlockMetal1, sBlockMetal2, sBlockMetal3, sBlockMetal4, sBlockMetal5, sBlockMetal6, sBlockMetal7, sBlockMetal8, sBlockGem1, sBlockGem2, sBlockGem3, sBlockReinforced;
- public static Block sBlockGranites, sBlockConcretes, sBlockStones;
- public static Block sBlockCasings1, sBlockCasings2, sBlockCasings3, sBlockCasings4, sBlockCasings5, sBlockCasings6, sBlockCasings8;
- /**
- * Getting assigned by the Config
- */
- public static boolean sTimber = true, sDrinksAlwaysDrinkable = false, sMultiThreadedSounds = false, sDoShowAllItemsInCreative = false, sColoredGUI = true, sConstantEnergy = true, sMachineExplosions = true, sMachineFlammable = true, sMachineNonWrenchExplosions = true, sMachineRainExplosions = true, sMachineThunderExplosions = true, sMachineFireExplosions = true, sMachineWireFire = true;
- public static boolean mOutputRF = false;
- public static boolean mInputRF = false;
- public static boolean meIOLoaded = false;
- public static int mEUtoRF = 360;
- public static int mRFtoEU = 20;
- public static boolean mRFExplosions = true;
- public static boolean mServerStarted = false;
- public static boolean mIC2Classic = false;
- public static boolean mMagneticraft = false;
- public static boolean mImmersiveEngineering = false;
- public static boolean mGTPlusPlus = false;
-
- public static boolean mUseOnlyGoodSolderingMaterials = false;
-
- private static final String aTextIC2Lower = MOD_ID_IC2.toLowerCase(Locale.ENGLISH);
- /**
- * Getting assigned by the Mod loading
- */
- public static boolean sUnificationEntriesRegistered = false, sPreloadStarted = false, sPreloadFinished = false, sLoadStarted = false, sLoadFinished = false, sPostloadStarted = false, sPostloadFinished = false;
- private static Class sBaseMetaTileEntityClass = null;
-
- /**
- * Adds Biomes to the Biome Lists for World Generation
- */
- static {
- sItemStackMappings.add(sCovers);
- sItemStackMappings.add(sCoverBehaviors);
-
- //sDimensionalList.add(56);
- //sDimensionalList.add(55);
-
- sSoundList.put(0, "random.break");
- sSoundList.put(1, "random.anvil_use");
- sSoundList.put(2, "random.anvil_break");
- sSoundList.put(3, "random.click");
- sSoundList.put(4, "random.fizz");
- sSoundList.put(5, "random.explode");
- sSoundList.put(6, "fire.ignite");
-
- sSoundList.put(100, aTextIC2Lower + ":" + "tools.Wrench");
- sSoundList.put(101, aTextIC2Lower + ":" + "tools.RubberTrampoline");
- sSoundList.put(102, aTextIC2Lower + ":" + "tools.Painter");
- sSoundList.put(103, aTextIC2Lower + ":" + "tools.BatteryUse");
- sSoundList.put(104, aTextIC2Lower + ":" + "tools.chainsaw.ChainsawUseOne");
- sSoundList.put(105, aTextIC2Lower + ":" + "tools.chainsaw.ChainsawUseTwo");
- sSoundList.put(106, aTextIC2Lower + ":" + "tools.drill.DrillSoft");
- sSoundList.put(107, aTextIC2Lower + ":" + "tools.drill.DrillHard");
- sSoundList.put(108, aTextIC2Lower + ":" + "tools.ODScanner");
-
- sSoundList.put(200, aTextIC2Lower + ":" + "machines.ExtractorOp");
- sSoundList.put(201, aTextIC2Lower + ":" + "machines.MaceratorOp");
- sSoundList.put(202, aTextIC2Lower + ":" + "machines.InductionLoop");
- sSoundList.put(203, aTextIC2Lower + ":" + "machines.CompressorOp");
- sSoundList.put(204, aTextIC2Lower + ":" + "machines.RecyclerOp");
- sSoundList.put(205, aTextIC2Lower + ":" + "machines.MinerOp");
- sSoundList.put(206, aTextIC2Lower + ":" + "machines.PumpOp");
- sSoundList.put(207, aTextIC2Lower + ":" + "machines.ElectroFurnaceLoop");
- sSoundList.put(208, aTextIC2Lower + ":" + "machines.InductionLoop");
- sSoundList.put(209, aTextIC2Lower + ":" + "machines.MachineOverload");
- sSoundList.put(210, aTextIC2Lower + ":" + "machines.InterruptOne");
- sSoundList.put(211, aTextIC2Lower + ":" + "machines.KaChing");
- sSoundList.put(212, aTextIC2Lower + ":" + "machines.MagnetizerLoop");
- }
-
- /**
- * You want OreDict-Unification for YOUR Mod/Addon, when GregTech is installed? This Function is especially for YOU.
- * Call this Function after the load-Phase, as I register the the most of the Unification at that Phase (Redpowers Storageblocks are registered at postload).
- * A recommended use of this Function is inside your Recipe-System itself (if you have one), as the unification then makes 100% sure, that every added non-unificated Output gets automatically unificated.
- * <p/>
- * I will personally make sure, that only common prefixes of Ores get registered at the Unificator, as of now there are:
- * pulp, dust, dustSmall, ingot, nugget, gem, ore and block
- * If another Mod-Author messes these up, then it's not my fault and it's especially not your fault. As these are commonly used prefixes.
- * <p/>
- * This Unificator-API-Function uses the same Functions I use, for unificating Items. So if there is something messed up (very unlikely), then everything is messed up.
- * <p/>
- * You shouldn't use this to unificate the Inputs of your Recipes, this is only meant for the Outputs.
- *
- * @param aOreStack the Stack you want to get unificated. It is stackSize Sensitive.
- * @return Either an unificated Stack or the stack you toss in, but it should never be null, unless you throw a Nullpointer into it.
- */
- public static ItemStack getUnificatedOreDictStack(ItemStack aOreStack) {
- if (!GregTech_API.sPreloadFinished)
- GT_Log.err.println("GregTech_API ERROR: " + aOreStack.getItem() + "." + aOreStack.getItemDamage() + " - OreDict Unification Entries are not registered now, please call it in the postload phase.");
- return GT_OreDictUnificator.get(true, aOreStack);
- }
-
- /**
- * Causes a Machineblock Update
- * This update will cause surrounding MultiBlock Machines to update their Configuration.
- * You should call this Function in @Block.breakBlock and in @Block.onBlockAdded of your Machine.
- *
- * @param aWorld is being the World
- * @param aX is the X-Coord of the update causing Block
- * @param aY is the Y-Coord of the update causing Block
- * @param aZ is the Z-Coord of the update causing Block
- */
- public static boolean causeMachineUpdate(World aWorld, int aX, int aY, int aZ) {
- if (!aWorld.isRemote)
- new Thread(new GT_Runnable_MachineBlockUpdate(aWorld, aX, aY, aZ), "Machine Block Updating").start();
- return true;
- }
-
- /**
- * Adds a Multi-Machine Block, like my Machine Casings for example.
- * You should call @causeMachineUpdate in @Block.breakBlock and in @Block.onBlockAdded of your registered Block.
- * You don't need to register TileEntities which implement @IMachineBlockUpdateable
- *
- * @param aBlock the Block
- * @param aMeta the Metadata of the Blocks as Bitmask! -1 or ~0 for all Metavalues
- */
- public static boolean registerMachineBlock(Block aBlock, int aMeta) {
- if (GT_Utility.isBlockInvalid(aBlock)) return false;
- if (GregTech_API.sThaumcraftCompat != null)
- GregTech_API.sThaumcraftCompat.registerPortholeBlacklistedBlock(aBlock);
- sMachineIDs.put(aBlock, aMeta);
- return true;
- }
-
- /**
- * Like above but with boolean Parameters instead of a BitMask
- */
- public static boolean registerMachineBlock(Block aBlock, boolean... aMeta) {
- if (GT_Utility.isBlockInvalid(aBlock) || aMeta == null || aMeta.length == 0) return false;
- if (GregTech_API.sThaumcraftCompat != null)
- GregTech_API.sThaumcraftCompat.registerPortholeBlacklistedBlock(aBlock);
- int rMeta = 0;
- for (byte i = 0; i < aMeta.length && i < 16; i++) if (aMeta[i]) rMeta |= B[i];
- sMachineIDs.put(aBlock, rMeta);
- return true;
- }
-
- /**
- * if this Block is a Machine Update Conducting Block
- */
- public static boolean isMachineBlock(Block aBlock, int aMeta) {
- if (GT_Utility.isBlockInvalid(aBlock)) return false;
- return (sMachineIDs.containsKey(aBlock) && (sMachineIDs.get(aBlock) & B[aMeta]) != 0);
- }
-
- /**
- * Creates a new Coolant Cell Item for your Nuclear Reactor
- */
- public static Item constructCoolantCellItem(String aUnlocalized, String aEnglish, int aMaxStore) {
- try {
- return new GT_CoolantCellIC_Item(aUnlocalized, aEnglish, aMaxStore);
-// return (Item)Class.forName("gregtech.api.items.GT_CoolantCellIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxStore);
- } catch (Throwable e) {/*Do nothing*/}
- try {
- return new GT_CoolantCell_Item(aUnlocalized, aEnglish, aMaxStore);
-// return (Item)Class.forName("gregtech.api.items.GT_CoolantCell_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxStore);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Generic_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", false);
- }
-
- /**
- * Creates a new Energy Armor Item
- */
- public static Item constructElectricArmorItem(String aUnlocalized, String aEnglish, int aCharge, int aTransfer, int aTier, int aDamageEnergyCost, int aSpecials, double aArmorAbsorbtionPercentage, boolean aChargeProvider, int aType, int aArmorIndex) {
- try {
- return (Item) Class.forName("gregtechmod.api.items.GT_EnergyArmorIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aDamageEnergyCost, aSpecials, aArmorAbsorbtionPercentage, aChargeProvider, aType, aArmorIndex);
- } catch (Throwable e) {/*Do nothing*/}
- try {
- return (Item) Class.forName("gregtechmod.api.items.GT_EnergyArmor_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aDamageEnergyCost, aSpecials, aArmorAbsorbtionPercentage, aChargeProvider, aType, aArmorIndex);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Generic_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", false);
- }
-
- /**
- * Creates a new Energy Battery Item
- */
- public static Item constructElectricEnergyStorageItem(String aUnlocalized, String aEnglish, int aCharge, int aTransfer, int aTier, int aEmptyID, int aFullID) {
- try {
- return (Item) Class.forName("gregtechmod.api.items.GT_EnergyStoreIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aEmptyID, aFullID);
- } catch (Throwable e) {/*Do nothing*/}
- try {
- return (Item) Class.forName("gregtechmod.api.items.GT_EnergyStore_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aEmptyID, aFullID);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Generic_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", false);
- }
-
- /**
- * Creates a new Hard Hammer Item
- */
- public static GT_Tool_Item constructHardHammerItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) {
- try {
- return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_HardHammer_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
- }
-
- /**
- * Creates a new Crowbar Item
- */
- public static GT_Tool_Item constructCrowbarItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) {
- try {
- return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_CrowbarRC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage);
- } catch (Throwable e) {/*Do nothing*/}
- try {
- return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_Crowbar_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
- }
-
- /**
- * Creates a new Wrench Item
- */
- public static GT_Tool_Item constructWrenchItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) {
- try {
- return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_Wrench_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
- }
-
- /**
- * Creates a new electric Screwdriver Item
- */
- public static GT_Tool_Item constructElectricScrewdriverItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) {
- try {
- return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_ScrewdriverIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
- }
-
- /**
- * Creates a new electric Wrench Item
- */
- public static GT_Tool_Item constructElectricWrenchItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) {
- try {
- return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_WrenchIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
- }
-
- /**
- * Creates a new electric Saw Item
- */
- public static GT_Tool_Item constructElectricSawItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aToolQuality, float aToolStrength, int aEnergyConsumptionPerBlockBreak, int aDisChargedGTID) {
- try {
- return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_SawIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aToolQuality, aToolStrength, aEnergyConsumptionPerBlockBreak, aDisChargedGTID);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
- }
-
- /**
- * Creates a new electric Drill Item
- */
- public static GT_Tool_Item constructElectricDrillItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aToolQuality, float aToolStrength, int aEnergyConsumptionPerBlockBreak, int aDisChargedGTID) {
- try {
- return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_DrillIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aToolQuality, aToolStrength, aEnergyConsumptionPerBlockBreak, aDisChargedGTID);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
- }
-
- /**
- * Creates a new electric Soldering Tool
- */
- public static GT_Tool_Item constructElectricSolderingToolItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) {
- try {
- return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_SolderingToolIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
- }
-
- /**
- * Creates a new empty electric Tool
- */
- public static GT_Tool_Item constructEmptyElectricToolItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aChargedGTID) {
- try {
- return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_EmptyToolIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aChargedGTID);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, 0, false);
- }
-
- /**
- * This gives you a new BaseMetaTileEntity. As some Interfaces are not always loaded (Buildcraft, Univeral Electricity) I have to use Invocation at the Constructor of the BaseMetaTileEntity
- */
- public static BaseMetaTileEntity constructBaseMetaTileEntity() {
- if (sBaseMetaTileEntityClass == null) {
- try {
- return (BaseMetaTileEntity) (sBaseMetaTileEntityClass = BaseMetaTileEntity.class).newInstance();
- } catch (Throwable e) {/*Do nothing*/}
- }
-
- try {
- return (BaseMetaTileEntity) (sBaseMetaTileEntityClass.newInstance());
- } catch (Throwable e) {
- GT_Log.err.println("GT_Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
- e.printStackTrace(GT_Log.err);
- throw new RuntimeException(e);
- }
- }
-
- public static void registerCover(ItemStack aStack, ITexture aCover, GT_CoverBehavior aBehavior) {
- if (!sCovers.containsKey(new GT_ItemStack(aStack)))
- sCovers.put(new GT_ItemStack(aStack), aCover == null || !aCover.isValidTexture() ? Textures.BlockIcons.ERROR_RENDERING[0] : aCover);
- if (aBehavior != null) sCoverBehaviors.put(new GT_ItemStack(aStack), aBehavior);
- }
-
- public static void registerCoverBehavior(ItemStack aStack, GT_CoverBehavior aBehavior) {
- sCoverBehaviors.put(new GT_ItemStack(aStack), aBehavior == null ? sDefaultBehavior : aBehavior);
- }
-
- /**
- * Registers multiple Cover Items. I use that for the OreDict Functionality.
- *
- * @param aBehavior can be null
- */
- public static void registerCover(Collection<ItemStack> aStackList, ITexture aCover, GT_CoverBehavior aBehavior) {
- if (aCover.isValidTexture()) for (ItemStack tStack : aStackList) registerCover(tStack, aCover, aBehavior);
- }
-
- /**
- * returns a Cover behavior, guaranteed to not return null after preload
- */
- public static GT_CoverBehavior getCoverBehavior(ItemStack aStack) {
- if (aStack == null || aStack.getItem() == null) return sNoBehavior;
- GT_CoverBehavior rCover = sCoverBehaviors.get(new GT_ItemStack(aStack));
- if (rCover == null) return sDefaultBehavior;
- return rCover;
- }
-
- /**
- * returns a Cover behavior, guaranteed to not return null
- */
- public static GT_CoverBehavior getCoverBehavior(int aStack) {
- if (aStack == 0) return sNoBehavior;
- return getCoverBehavior(GT_Utility.intToStack(aStack));
- }
-
- /**
- * Register a Wrench to be usable on GregTech Machines.
- * The Wrench MUST have some kind of Durability unlike certain Buildcraft Wrenches.
- * <p/>
- * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
- * <p/>
- * -----
- * <p/>
- * Returning true at isDamagable was a great Idea, KingLemming. Well played.
- * Since the OmniWrench is just a Single-Item-Mod, people can choose if they want your infinite durability or not. So that's not really a Problem.
- * I even have a new Config to autodisable most infinite BC Wrenches (but that one is turned off).
- * <p/>
- * One last Bug for you to fix:
- * My Autoregistration detects Railcrafts Crowbars, Buildcrafts Wrenches and alike, due to their Interfaces.
- * Guess what now became a Crowbar by accident. Try registering the Wrench at the load phase to prevent things like that from happening.
- * Yes, I know that "You need to register Tools in the Load Phase"-Part wasn't there before this. Sorry about that.
- */
- public static boolean registerWrench(ItemStack aTool) {
- return registerTool(aTool, sWrenchList);
- }
-
- /**
- * Register a Crowbar to extract Covers from Machines
- * Crowbars are NOT Wrenches btw.
- * <p/>
- * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
- */
- public static boolean registerCrowbar(ItemStack aTool) {
- return registerTool(aTool, sCrowbarList);
- }
-
- /**
- * Register a Screwdriver to interact directly with Machines and Covers
- * Did I mention, that it is intentionally not possible to make a Multitool, which doesn't switch ItemID (like a Mode) all the time?
- * <p/>
- * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
- */
- public static boolean registerScrewdriver(ItemStack aTool) {
- return registerTool(aTool, sScrewdriverList);
- }
-
- /**
- * Register a Soft Hammer to interact with Machines
- * <p/>
- * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
- */
- public static boolean registerSoftHammer(ItemStack aTool) {
- return registerTool(aTool, sSoftHammerList);
- }
-
- /**
- * Register a Hard Hammer to interact with Machines
- * <p/>
- * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
- */
- public static boolean registerHardHammer(ItemStack aTool) {
- return registerTool(aTool, sHardHammerList);
- }
-
- /**
- * Register a Soldering Tool to interact with Machines
- * <p/>
- * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
- */
- public static boolean registerSolderingTool(ItemStack aTool) {
- return registerTool(aTool, sSolderingToolList);
- }
-
- /**
- * Register a Soldering Tin to interact with Soldering Tools
- * <p/>
- * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
- */
- public static boolean registerSolderingMetal(ItemStack aTool) {
- return registerTool(aTool, sSolderingMetalList);
- }
-
- /**
- * Generic Function to add Tools to the Lists.
- * Contains all sanity Checks for Tools, like preventing one Tool from being registered for multiple purposes as controls would override each other.
- */
- public static boolean registerTool(ItemStack aTool, Collection<GT_ItemStack> aToolList) {
- if (aTool == null || GT_Utility.isStackInList(aTool, sToolList) || (!aTool.getItem().isDamageable() && !GT_ModHandler.isElectricItem(aTool) && !(aTool.getItem() instanceof IDamagableItem)))
- return false;
- aToolList.add(new GT_ItemStack(GT_Utility.copyAmount(1, aTool)));
- sToolList.add(new GT_ItemStack(GT_Utility.copyAmount(1, aTool)));
- return true;
- }
-}
+package gregtech.api;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.IDamagableItem;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.internal.IGT_RecipeAdder;
+import gregtech.api.interfaces.internal.IThaumcraftCompat;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.items.GT_CoolantCellIC_Item;
+import gregtech.api.items.GT_CoolantCell_Item;
+import gregtech.api.items.GT_Tool_Item;
+import gregtech.api.metatileentity.BaseMetaTileEntity;
+import gregtech.api.objects.GT_Cover_Default;
+import gregtech.api.objects.GT_Cover_None;
+import gregtech.api.objects.GT_HashSet;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.threads.GT_Runnable_MachineBlockUpdate;
+import gregtech.api.util.*;
+import gregtech.api.world.GT_Worldgen;
+import net.minecraft.block.Block;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+import net.minecraftforge.fluids.Fluid;
+
+import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+
+import static gregtech.api.enums.GT_Values.*;
+
+/**
+ * Please do not include this File in your Mod-download as it ruins compatiblity, like with the IC2-API
+ * You may just copy those Functions into your Code, or better call them via reflection.
+ * <p/>
+ * The whole API is the basic construct of my Mod. Everything is dependent on it.
+ * I change things quite often so please don't include any File inside your Mod, even if it is an Interface.
+ * Since some Authors were stupid enough to break this simple Rule, I added Version checks to enforce it.
+ * <p/>
+ * In these Folders are many useful Functions. You can use them via reflection if you want.
+ * I know not everything is compilable due to API's of other Mods, but these are easy to fix in your Setup.
+ * <p/>
+ * You can use this to learn about Modding, but I would recommend simpler Mods.
+ * You may even copypaste Code from these API-Files into your Mod, as I have nothing against that, but you should look exactly at what you are copying.
+ *
+ * @author Gregorius Techneticies
+ */
+public class GregTech_API {
+ @Deprecated
+ public static final long MATERIAL_UNIT = M, FLUID_MATERIAL_UNIT = L;
+ /**
+ * Fixes the HashMap Mappings for ItemStacks once the Server started
+ */
+ public static final Collection<Map<GT_ItemStack, ?>> sItemStackMappings = new ArrayList<Map<GT_ItemStack, ?>>();
+ public static final Collection<Map<Fluid, ?>> sFluidMappings = new ArrayList<Map<Fluid, ?>>();
+ /**
+ * The MetaTileEntity-ID-List-Length
+ */
+ public static final short MAXIMUM_METATILE_IDS = Short.MAX_VALUE - 1;
+ /**
+ * My Creative Tab
+ */
+ public static final CreativeTabs TAB_GREGTECH = new GT_CreativeTab("Main", "Main"), TAB_GREGTECH_MATERIALS = new GT_CreativeTab("Materials", "Materials"), TAB_GREGTECH_ORES = new GT_CreativeTab("Ores", "Ores");
+ /**
+ * A List of all registered MetaTileEntities
+ * <p/>
+ * 0 - 749 are used by GregTech.
+ * 750 - 999 are reserved for Alkalus.
+ * 1000 - 2047 are used by GregTech.
+ * 2048 - 2559 are reserved for OvermindDL.
+ * 2560 - 3071 are reserved for Immibis.
+ * 3072 - 3583 are reserved for LinusPhoenix.
+ * 3584 - 4095 are reserved for BloodyAsp.
+ * 4096 - 5095 are used for GregTech Frames.
+ * 5096 - 6099 are used for GregTech Pipes.
+ * 6100 - 8191 are used for GregTech Decoration Blocks.
+ * 8192 - 8703 are reserved for ZL123.
+ * 8704 - 9215 are reserved for Mr10Movie.
+ * 9216 - 9727 are used for GregTech Automation Machines.
+ * 9728 - 10239 are reserved for 28Smiles.
+ * 10240 - 10751 are reserved for VirMan.
+ * 10752 - 11263 are reserved for Briareos81.
+ * 11264 - 12000 are reserved for the next one who asks me.
+ * 9728 - 32766 are currently free.
+ * <p/>
+ * Contact me if you need a free ID-Range, which doesn't conflict with other Addons.
+ * You could make an ID-Config, but we all know, what "stupid" customers think about conflicting ID's
+ */
+ public static final IMetaTileEntity[] METATILEENTITIES = new IMetaTileEntity[MAXIMUM_METATILE_IDS];
+ /**
+ * The Icon List for Covers
+ */
+ public static final Map<GT_ItemStack, ITexture> sCovers = new ConcurrentHashMap<GT_ItemStack, ITexture>();
+ /**
+ * The List of Cover Behaviors for the Covers
+ */
+ public static final Map<GT_ItemStack, GT_CoverBehavior> sCoverBehaviors = new ConcurrentHashMap<GT_ItemStack, GT_CoverBehavior>();
+ /**
+ * The List of Circuit Behaviors for the Redstone Circuit Block
+ */
+ public static final Map<Integer, GT_CircuitryBehavior> sCircuitryBehaviors = new ConcurrentHashMap<Integer, GT_CircuitryBehavior>();
+ /**
+ * The List of Blocks, which can conduct Machine Block Updates
+ */
+ public static final Map<Block, Integer> sMachineIDs = new ConcurrentHashMap<Block, Integer>();
+ /**
+ * The Redstone Frequencies
+ */
+ public static final Map<Integer, Byte> sWirelessRedstone = new ConcurrentHashMap<Integer, Byte>();
+ /**
+ * The IDSU Frequencies
+ */
+ public static final Map<Integer, Integer> sIDSUList = new ConcurrentHashMap<Integer, Integer>();
+ /**
+ * A List of all Books, which were created using @GT_Utility.getWrittenBook the original Title is the Key Value
+ */
+ public static final Map<String, ItemStack> sBookList = new ConcurrentHashMap<String, ItemStack>();
+ /**
+ * The List of all Sounds used in GT, indices are in the static Block at the bottom
+ */
+ public static final Map<Integer, String> sSoundList = new ConcurrentHashMap<Integer, String>();
+ /**
+ * The List of Tools, which can be used. Accepts regular damageable Items and Electric Items
+ */
+ public static final GT_HashSet<GT_ItemStack> sToolList = new GT_HashSet<GT_ItemStack>(), sCrowbarList = new GT_HashSet<GT_ItemStack>(), sScrewdriverList = new GT_HashSet<GT_ItemStack>(), sWrenchList = new GT_HashSet<GT_ItemStack>(), sSoftHammerList = new GT_HashSet<GT_ItemStack>(), sHardHammerList = new GT_HashSet<GT_ItemStack>(), sWireCutterList = new GT_HashSet<GT_ItemStack>(), sSolderingToolList = new GT_HashSet<GT_ItemStack>(), sSolderingMetalList = new GT_HashSet<GT_ItemStack>();
+ /**
+ * The List of Hazmat Armors
+ */
+ public static final GT_HashSet<GT_ItemStack> sGasHazmatList = new GT_HashSet<GT_ItemStack>(), sBioHazmatList = new GT_HashSet<GT_ItemStack>(), sFrostHazmatList = new GT_HashSet<GT_ItemStack>(), sHeatHazmatList = new GT_HashSet<GT_ItemStack>(), sRadioHazmatList = new GT_HashSet<GT_ItemStack>(), sElectroHazmatList = new GT_HashSet<GT_ItemStack>();
+ /**
+ * The List of Dimensions, which are Whitelisted for the Teleporter. This list should not contain other Planets.
+ * Mystcraft Dimensions and other Dimensional Things should be allowed.
+ * Mystcraft and Twilight Forest are automatically considered a Dimension, without being in this List.
+ */
+ public static final Collection<Integer> sDimensionalList = new HashSet<Integer>();
+ /**
+ * Lists of all the active World generation Features, these are getting Initialized in Postload!
+ */
+ public static final List<GT_Worldgen> sWorldgenList = new ArrayList<GT_Worldgen>();
+ /**
+ * A List containing all the Materials, which are somehow in use by GT and therefor receive a specific Set of Items.
+ */
+ public static final Materials[] sGeneratedMaterials = new Materials[1000];
+ /**
+ * This is the generic Cover behavior. Used for the default Covers, which have no Behavior.
+ */
+ public static final GT_CoverBehavior sDefaultBehavior = new GT_Cover_Default(), sNoBehavior = new GT_Cover_None();
+ /**
+ * For the API Version check
+ */
+ public static volatile int VERSION = 509;
+ @Deprecated
+ public static IGT_RecipeAdder sRecipeAdder;
+ /**
+ * Used to register Aspects to ThaumCraft, this Object might be null if ThaumCraft isn't installed
+ */
+ public static IThaumcraftCompat sThaumcraftCompat;
+ /**
+ * These Lists are getting executed at their respective timings. Useful if you have to do things right before/after I do them, without having to control the load order. Add your "Commands" in the Constructor or in a static Code Block of your Mods Main Class. These are not Threaded, I just use a native Java Interface for their execution. Implement just the Method run() and everything should work
+ */
+ public static List<Runnable> sBeforeGTPreload = new ArrayList<Runnable>(), sAfterGTPreload = new ArrayList<Runnable>(), sBeforeGTLoad = new ArrayList<Runnable>(), sAfterGTLoad = new ArrayList<Runnable>(), sBeforeGTPostload = new ArrayList<Runnable>(), sAfterGTPostload = new ArrayList<Runnable>(), sBeforeGTServerstart = new ArrayList<Runnable>(), sAfterGTServerstart = new ArrayList<Runnable>(), sBeforeGTServerstop = new ArrayList<Runnable>(), sAfterGTServerstop = new ArrayList<Runnable>(), sGTBlockIconload = new ArrayList<Runnable>(), sGTItemIconload = new ArrayList<Runnable>();
+ /**
+ * The Icon Registers from Blocks and Items. They will get set right before the corresponding Icon Load Phase as executed in the Runnable List above.
+ */
+ @SideOnly(Side.CLIENT)
+ public static IIconRegister sBlockIcons, sItemIcons;
+ /**
+ * The Configuration Objects
+ */
+ public static GT_Config sRecipeFile = null, sMachineFile = null, sWorldgenFile = null, sModularArmor = null, sMaterialProperties = null, sMaterialComponents = null, sUnification = null, sSpecialFile = null, sClientDataFile, sOPStuff = null;
+ public static int TICKS_FOR_LAG_AVERAGING = 25, MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING = 100;
+ /**
+ * Initialized by the Block creation.
+ */
+ public static Block sBlockMachines;
+
+ public static Block sBlockOres1, sBlockOresUb1, sBlockOresUb2, sBlockOresUb3, /*sBlockGem,*/ sBlockMetal1, sBlockMetal2, sBlockMetal3, sBlockMetal4, sBlockMetal5, sBlockMetal6, sBlockMetal7, sBlockMetal8, sBlockGem1, sBlockGem2, sBlockGem3, sBlockReinforced;
+ public static Block sBlockGranites, sBlockConcretes, sBlockStones;
+ public static Block sBlockCasings1, sBlockCasings2, sBlockCasings3, sBlockCasings4, sBlockCasings5, sBlockCasings6, sBlockCasings8;
+ /**
+ * Getting assigned by the Config
+ */
+ public static boolean sTimber = true, sDrinksAlwaysDrinkable = false, sMultiThreadedSounds = false, sDoShowAllItemsInCreative = false, sColoredGUI = true, sConstantEnergy = true, sMachineExplosions = true, sMachineFlammable = true, sMachineNonWrenchExplosions = true, sMachineRainExplosions = true, sMachineThunderExplosions = true, sMachineFireExplosions = true, sMachineWireFire = true;
+ public static boolean mOutputRF = false;
+ public static boolean mInputRF = false;
+ public static boolean meIOLoaded = false;
+ public static int mEUtoRF = 360;
+ public static int mRFtoEU = 20;
+ public static boolean mRFExplosions = true;
+ public static boolean mServerStarted = false;
+ public static boolean mIC2Classic = false;
+ public static boolean mMagneticraft = false;
+ public static boolean mImmersiveEngineering = false;
+ public static boolean mGTPlusPlus = false;
+
+ public static boolean mUseOnlyGoodSolderingMaterials = false;
+
+ private static final String aTextIC2Lower = MOD_ID_IC2.toLowerCase(Locale.ENGLISH);
+ /**
+ * Getting assigned by the Mod loading
+ */
+ public static boolean sUnificationEntriesRegistered = false, sPreloadStarted = false, sPreloadFinished = false, sLoadStarted = false, sLoadFinished = false, sPostloadStarted = false, sPostloadFinished = false;
+ private static Class sBaseMetaTileEntityClass = null;
+
+ /**
+ * Adds Biomes to the Biome Lists for World Generation
+ */
+ static {
+ sItemStackMappings.add(sCovers);
+ sItemStackMappings.add(sCoverBehaviors);
+
+ //sDimensionalList.add(56);
+ //sDimensionalList.add(55);
+
+ sSoundList.put(0, "random.break");
+ sSoundList.put(1, "random.anvil_use");
+ sSoundList.put(2, "random.anvil_break");
+ sSoundList.put(3, "random.click");
+ sSoundList.put(4, "random.fizz");
+ sSoundList.put(5, "random.explode");
+ sSoundList.put(6, "fire.ignite");
+
+ sSoundList.put(100, aTextIC2Lower + ":" + "tools.Wrench");
+ sSoundList.put(101, aTextIC2Lower + ":" + "tools.RubberTrampoline");
+ sSoundList.put(102, aTextIC2Lower + ":" + "tools.Painter");
+ sSoundList.put(103, aTextIC2Lower + ":" + "tools.BatteryUse");
+ sSoundList.put(104, aTextIC2Lower + ":" + "tools.chainsaw.ChainsawUseOne");
+ sSoundList.put(105, aTextIC2Lower + ":" + "tools.chainsaw.ChainsawUseTwo");
+ sSoundList.put(106, aTextIC2Lower + ":" + "tools.drill.DrillSoft");
+ sSoundList.put(107, aTextIC2Lower + ":" + "tools.drill.DrillHard");
+ sSoundList.put(108, aTextIC2Lower + ":" + "tools.ODScanner");
+
+ sSoundList.put(200, aTextIC2Lower + ":" + "machines.ExtractorOp");
+ sSoundList.put(201, aTextIC2Lower + ":" + "machines.MaceratorOp");
+ sSoundList.put(202, aTextIC2Lower + ":" + "machines.InductionLoop");
+ sSoundList.put(203, aTextIC2Lower + ":" + "machines.CompressorOp");
+ sSoundList.put(204, aTextIC2Lower + ":" + "machines.RecyclerOp");
+ sSoundList.put(205, aTextIC2Lower + ":" + "machines.MinerOp");
+ sSoundList.put(206, aTextIC2Lower + ":" + "machines.PumpOp");
+ sSoundList.put(207, aTextIC2Lower + ":" + "machines.ElectroFurnaceLoop");
+ sSoundList.put(208, aTextIC2Lower + ":" + "machines.InductionLoop");
+ sSoundList.put(209, aTextIC2Lower + ":" + "machines.MachineOverload");
+ sSoundList.put(210, aTextIC2Lower + ":" + "machines.InterruptOne");
+ sSoundList.put(211, aTextIC2Lower + ":" + "machines.KaChing");
+ sSoundList.put(212, aTextIC2Lower + ":" + "machines.MagnetizerLoop");
+ }
+
+ /**
+ * You want OreDict-Unification for YOUR Mod/Addon, when GregTech is installed? This Function is especially for YOU.
+ * Call this Function after the load-Phase, as I register the the most of the Unification at that Phase (Redpowers Storageblocks are registered at postload).
+ * A recommended use of this Function is inside your Recipe-System itself (if you have one), as the unification then makes 100% sure, that every added non-unificated Output gets automatically unificated.
+ * <p/>
+ * I will personally make sure, that only common prefixes of Ores get registered at the Unificator, as of now there are:
+ * pulp, dust, dustSmall, ingot, nugget, gem, ore and block
+ * If another Mod-Author messes these up, then it's not my fault and it's especially not your fault. As these are commonly used prefixes.
+ * <p/>
+ * This Unificator-API-Function uses the same Functions I use, for unificating Items. So if there is something messed up (very unlikely), then everything is messed up.
+ * <p/>
+ * You shouldn't use this to unificate the Inputs of your Recipes, this is only meant for the Outputs.
+ *
+ * @param aOreStack the Stack you want to get unificated. It is stackSize Sensitive.
+ * @return Either an unificated Stack or the stack you toss in, but it should never be null, unless you throw a Nullpointer into it.
+ */
+ public static ItemStack getUnificatedOreDictStack(ItemStack aOreStack) {
+ if (!GregTech_API.sPreloadFinished)
+ GT_Log.err.println("GregTech_API ERROR: " + aOreStack.getItem() + "." + aOreStack.getItemDamage() + " - OreDict Unification Entries are not registered now, please call it in the postload phase.");
+ return GT_OreDictUnificator.get(true, aOreStack);
+ }
+
+ /**
+ * Causes a Machineblock Update
+ * This update will cause surrounding MultiBlock Machines to update their Configuration.
+ * You should call this Function in @Block.breakBlock and in @Block.onBlockAdded of your Machine.
+ *
+ * @param aWorld is being the World
+ * @param aX is the X-Coord of the update causing Block
+ * @param aY is the Y-Coord of the update causing Block
+ * @param aZ is the Z-Coord of the update causing Block
+ */
+ public static boolean causeMachineUpdate(World aWorld, int aX, int aY, int aZ) {
+ if (!aWorld.isRemote)
+ new Thread(new GT_Runnable_MachineBlockUpdate(aWorld, aX, aY, aZ), "Machine Block Updating").start();
+ return true;
+ }
+
+ /**
+ * Adds a Multi-Machine Block, like my Machine Casings for example.
+ * You should call @causeMachineUpdate in @Block.breakBlock and in @Block.onBlockAdded of your registered Block.
+ * You don't need to register TileEntities which implement @IMachineBlockUpdateable
+ *
+ * @param aBlock the Block
+ * @param aMeta the Metadata of the Blocks as Bitmask! -1 or ~0 for all Metavalues
+ */
+ public static boolean registerMachineBlock(Block aBlock, int aMeta) {
+ if (GT_Utility.isBlockInvalid(aBlock)) return false;
+ if (GregTech_API.sThaumcraftCompat != null)
+ GregTech_API.sThaumcraftCompat.registerPortholeBlacklistedBlock(aBlock);
+ sMachineIDs.put(aBlock, aMeta);
+ return true;
+ }
+
+ /**
+ * Like above but with boolean Parameters instead of a BitMask
+ */
+ public static boolean registerMachineBlock(Block aBlock, boolean... aMeta) {
+ if (GT_Utility.isBlockInvalid(aBlock) || aMeta == null || aMeta.length == 0) return false;
+ if (GregTech_API.sThaumcraftCompat != null)
+ GregTech_API.sThaumcraftCompat.registerPortholeBlacklistedBlock(aBlock);
+ int rMeta = 0;
+ for (byte i = 0; i < aMeta.length && i < 16; i++) if (aMeta[i]) rMeta |= B[i];
+ sMachineIDs.put(aBlock, rMeta);
+ return true;
+ }
+
+ /**
+ * if this Block is a Machine Update Conducting Block
+ */
+ public static boolean isMachineBlock(Block aBlock, int aMeta) {
+ if (GT_Utility.isBlockInvalid(aBlock)) return false;
+ return (sMachineIDs.containsKey(aBlock) && (sMachineIDs.get(aBlock) & B[aMeta]) != 0);
+ }
+
+ /**
+ * Creates a new Coolant Cell Item for your Nuclear Reactor
+ */
+ public static Item constructCoolantCellItem(String aUnlocalized, String aEnglish, int aMaxStore) {
+ try {
+ return new GT_CoolantCellIC_Item(aUnlocalized, aEnglish, aMaxStore);
+// return (Item)Class.forName("gregtech.api.items.GT_CoolantCellIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxStore);
+ } catch (Throwable e) {/*Do nothing*/}
+ try {
+ return new GT_CoolantCell_Item(aUnlocalized, aEnglish, aMaxStore);
+// return (Item)Class.forName("gregtech.api.items.GT_CoolantCell_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxStore);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Generic_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", false);
+ }
+
+ /**
+ * Creates a new Energy Armor Item
+ */
+ public static Item constructElectricArmorItem(String aUnlocalized, String aEnglish, int aCharge, int aTransfer, int aTier, int aDamageEnergyCost, int aSpecials, double aArmorAbsorbtionPercentage, boolean aChargeProvider, int aType, int aArmorIndex) {
+ try {
+ return (Item) Class.forName("gregtechmod.api.items.GT_EnergyArmorIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aDamageEnergyCost, aSpecials, aArmorAbsorbtionPercentage, aChargeProvider, aType, aArmorIndex);
+ } catch (Throwable e) {/*Do nothing*/}
+ try {
+ return (Item) Class.forName("gregtechmod.api.items.GT_EnergyArmor_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aDamageEnergyCost, aSpecials, aArmorAbsorbtionPercentage, aChargeProvider, aType, aArmorIndex);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Generic_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", false);
+ }
+
+ /**
+ * Creates a new Energy Battery Item
+ */
+ public static Item constructElectricEnergyStorageItem(String aUnlocalized, String aEnglish, int aCharge, int aTransfer, int aTier, int aEmptyID, int aFullID) {
+ try {
+ return (Item) Class.forName("gregtechmod.api.items.GT_EnergyStoreIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aEmptyID, aFullID);
+ } catch (Throwable e) {/*Do nothing*/}
+ try {
+ return (Item) Class.forName("gregtechmod.api.items.GT_EnergyStore_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aEmptyID, aFullID);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Generic_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", false);
+ }
+
+ /**
+ * Creates a new Hard Hammer Item
+ */
+ public static GT_Tool_Item constructHardHammerItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) {
+ try {
+ return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_HardHammer_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
+ }
+
+ /**
+ * Creates a new Crowbar Item
+ */
+ public static GT_Tool_Item constructCrowbarItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) {
+ try {
+ return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_CrowbarRC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage);
+ } catch (Throwable e) {/*Do nothing*/}
+ try {
+ return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_Crowbar_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
+ }
+
+ /**
+ * Creates a new Wrench Item
+ */
+ public static GT_Tool_Item constructWrenchItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) {
+ try {
+ return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_Wrench_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
+ }
+
+ /**
+ * Creates a new electric Screwdriver Item
+ */
+ public static GT_Tool_Item constructElectricScrewdriverItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) {
+ try {
+ return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_ScrewdriverIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
+ }
+
+ /**
+ * Creates a new electric Wrench Item
+ */
+ public static GT_Tool_Item constructElectricWrenchItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) {
+ try {
+ return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_WrenchIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
+ }
+
+ /**
+ * Creates a new electric Saw Item
+ */
+ public static GT_Tool_Item constructElectricSawItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aToolQuality, float aToolStrength, int aEnergyConsumptionPerBlockBreak, int aDisChargedGTID) {
+ try {
+ return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_SawIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aToolQuality, aToolStrength, aEnergyConsumptionPerBlockBreak, aDisChargedGTID);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
+ }
+
+ /**
+ * Creates a new electric Drill Item
+ */
+ public static GT_Tool_Item constructElectricDrillItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aToolQuality, float aToolStrength, int aEnergyConsumptionPerBlockBreak, int aDisChargedGTID) {
+ try {
+ return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_DrillIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aToolQuality, aToolStrength, aEnergyConsumptionPerBlockBreak, aDisChargedGTID);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
+ }
+
+ /**
+ * Creates a new electric Soldering Tool
+ */
+ public static GT_Tool_Item constructElectricSolderingToolItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) {
+ try {
+ return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_SolderingToolIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
+ }
+
+ /**
+ * Creates a new empty electric Tool
+ */
+ public static GT_Tool_Item constructEmptyElectricToolItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aChargedGTID) {
+ try {
+ return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_EmptyToolIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aChargedGTID);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, 0, false);
+ }
+
+ /**
+ * This gives you a new BaseMetaTileEntity. As some Interfaces are not always loaded (Buildcraft, Univeral Electricity) I have to use Invocation at the Constructor of the BaseMetaTileEntity
+ */
+ public static BaseMetaTileEntity constructBaseMetaTileEntity() {
+ if (sBaseMetaTileEntityClass == null) {
+ try {
+ return (BaseMetaTileEntity) (sBaseMetaTileEntityClass = BaseMetaTileEntity.class).newInstance();
+ } catch (Throwable e) {/*Do nothing*/}
+ }
+
+ try {
+ return (BaseMetaTileEntity) (sBaseMetaTileEntityClass.newInstance());
+ } catch (Throwable e) {
+ GT_Log.err.println("GT_Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
+ e.printStackTrace(GT_Log.err);
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static void registerCover(ItemStack aStack, ITexture aCover, GT_CoverBehavior aBehavior) {
+ if (!sCovers.containsKey(new GT_ItemStack(aStack)))
+ sCovers.put(new GT_ItemStack(aStack), aCover == null || !aCover.isValidTexture() ? Textures.BlockIcons.ERROR_RENDERING[0] : aCover);
+ if (aBehavior != null) sCoverBehaviors.put(new GT_ItemStack(aStack), aBehavior);
+ }
+
+ public static void registerCoverBehavior(ItemStack aStack, GT_CoverBehavior aBehavior) {
+ sCoverBehaviors.put(new GT_ItemStack(aStack), aBehavior == null ? sDefaultBehavior : aBehavior);
+ }
+
+ /**
+ * Registers multiple Cover Items. I use that for the OreDict Functionality.
+ *
+ * @param aBehavior can be null
+ */
+ public static void registerCover(Collection<ItemStack> aStackList, ITexture aCover, GT_CoverBehavior aBehavior) {
+ if (aCover.isValidTexture()) for (ItemStack tStack : aStackList) registerCover(tStack, aCover, aBehavior);
+ }
+
+ /**
+ * returns a Cover behavior, guaranteed to not return null after preload
+ */
+ public static GT_CoverBehavior getCoverBehavior(ItemStack aStack) {
+ if (aStack == null || aStack.getItem() == null) return sNoBehavior;
+ GT_CoverBehavior rCover = sCoverBehaviors.get(new GT_ItemStack(aStack));
+ if (rCover == null) return sDefaultBehavior;
+ return rCover;
+ }
+
+ /**
+ * returns a Cover behavior, guaranteed to not return null
+ */
+ public static GT_CoverBehavior getCoverBehavior(int aStack) {
+ if (aStack == 0) return sNoBehavior;
+ return getCoverBehavior(GT_Utility.intToStack(aStack));
+ }
+
+ /**
+ * Register a Wrench to be usable on GregTech Machines.
+ * The Wrench MUST have some kind of Durability unlike certain Buildcraft Wrenches.
+ * <p/>
+ * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
+ * <p/>
+ * -----
+ * <p/>
+ * Returning true at isDamagable was a great Idea, KingLemming. Well played.
+ * Since the OmniWrench is just a Single-Item-Mod, people can choose if they want your infinite durability or not. So that's not really a Problem.
+ * I even have a new Config to autodisable most infinite BC Wrenches (but that one is turned off).
+ * <p/>
+ * One last Bug for you to fix:
+ * My Autoregistration detects Railcrafts Crowbars, Buildcrafts Wrenches and alike, due to their Interfaces.
+ * Guess what now became a Crowbar by accident. Try registering the Wrench at the load phase to prevent things like that from happening.
+ * Yes, I know that "You need to register Tools in the Load Phase"-Part wasn't there before this. Sorry about that.
+ */
+ public static boolean registerWrench(ItemStack aTool) {
+ return registerTool(aTool, sWrenchList);
+ }
+
+ /**
+ * Register a Crowbar to extract Covers from Machines
+ * Crowbars are NOT Wrenches btw.
+ * <p/>
+ * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
+ */
+ public static boolean registerCrowbar(ItemStack aTool) {
+ return registerTool(aTool, sCrowbarList);
+ }
+
+ /**
+ * Register a Screwdriver to interact directly with Machines and Covers
+ * Did I mention, that it is intentionally not possible to make a Multitool, which doesn't switch ItemID (like a Mode) all the time?
+ * <p/>
+ * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
+ */
+ public static boolean registerScrewdriver(ItemStack aTool) {
+ return registerTool(aTool, sScrewdriverList);
+ }
+
+ /**
+ * Register a Soft Hammer to interact with Machines
+ * <p/>
+ * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
+ */
+ public static boolean registerSoftHammer(ItemStack aTool) {
+ return registerTool(aTool, sSoftHammerList);
+ }
+
+ /**
+ * Register a Hard Hammer to interact with Machines
+ * <p/>
+ * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
+ */
+ public static boolean registerHardHammer(ItemStack aTool) {
+ return registerTool(aTool, sHardHammerList);
+ }
+
+ /**
+ * Register a Wire Cutter to interact with Machines
+ * <p/>
+ * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
+ */
+ public static boolean registerWireCutter(ItemStack aTool) {
+ return registerTool(aTool, sWireCutterList);
+ }
+
+ /**
+ * Register a Soldering Tool to interact with Machines
+ * <p/>
+ * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
+ */
+ public static boolean registerSolderingTool(ItemStack aTool) {
+ return registerTool(aTool, sSolderingToolList);
+ }
+
+ /**
+ * Register a Soldering Tin to interact with Soldering Tools
+ * <p/>
+ * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
+ */
+ public static boolean registerSolderingMetal(ItemStack aTool) {
+ return registerTool(aTool, sSolderingMetalList);
+ }
+
+ /**
+ * Generic Function to add Tools to the Lists.
+ * Contains all sanity Checks for Tools, like preventing one Tool from being registered for multiple purposes as controls would override each other.
+ */
+ public static boolean registerTool(ItemStack aTool, Collection<GT_ItemStack> aToolList) {
+ if (aTool == null || GT_Utility.isStackInList(aTool, sToolList) || (!aTool.getItem().isDamageable() && !GT_ModHandler.isElectricItem(aTool) && !(aTool.getItem() instanceof IDamagableItem)))
+ return false;
+ aToolList.add(new GT_ItemStack(GT_Utility.copyAmount(1, aTool)));
+ sToolList.add(new GT_ItemStack(GT_Utility.copyAmount(1, aTool)));
+ return true;
+ }
+}
diff --git a/src/main/java/gregtech/api/enums/OrePrefixes.java b/src/main/java/gregtech/api/enums/OrePrefixes.java
index 6b887937bc..5f8ea2f655 100644
--- a/src/main/java/gregtech/api/enums/OrePrefixes.java
+++ b/src/main/java/gregtech/api/enums/OrePrefixes.java
@@ -188,6 +188,8 @@ public enum OrePrefixes {
pipeMedium("Medium Pipes", "Medium ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 3, 64, 80),
pipeLarge("Large pipes", "Large ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 6, 64, 81),
pipeHuge("Huge Pipes", "Huge ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 12, 64, 82),
+ pipeQuadruple("Quadruple Pipes", "Quadruple ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M *12, 64, 84),
+ pipeNonuple("Nonuple Pipes", "Nonuple ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 9, 64, 85),
pipeRestrictiveTiny("Tiny Restrictive Pipes", "Tiny Restrictive ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M / 2, 64, 78),
pipeRestrictiveSmall("Small Restrictive Pipes", "Small Restrictive ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 1, 64, 79),
pipeRestrictiveMedium("Medium Restrictive Pipes", "Medium Restrictive ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 3, 64, 80),
diff --git a/src/main/java/gregtech/api/enums/TextureSet.java b/src/main/java/gregtech/api/enums/TextureSet.java
index 891a808553..32260ecea1 100644
--- a/src/main/java/gregtech/api/enums/TextureSet.java
+++ b/src/main/java/gregtech/api/enums/TextureSet.java
@@ -1,151 +1,151 @@
-package gregtech.api.enums;
-
-import gregtech.api.interfaces.IIconContainer;
-
-public class TextureSet {
- public static final TextureSet
- SET_NONE = new TextureSet("NONE"), SET_DULL = new TextureSet("DULL"), SET_RUBY = new TextureSet("RUBY"), SET_OPAL = new TextureSet("OPAL"), SET_LEAF = new TextureSet("LEAF"), SET_WOOD = new TextureSet("WOOD"), SET_SAND = new TextureSet("SAND"), SET_FINE = new TextureSet("FINE"), SET_FIERY = new TextureSet("FIERY"), SET_FLUID = new TextureSet("FLUID"), SET_ROUGH = new TextureSet("ROUGH"), SET_PAPER = new TextureSet("PAPER"), SET_GLASS = new TextureSet("GLASS"), SET_FLINT = new TextureSet("FLINT"), SET_LAPIS = new TextureSet("LAPIS"), SET_SHINY = new TextureSet("SHINY"), SET_SHARDS = new TextureSet("SHARDS"), SET_POWDER = new TextureSet("POWDER"), SET_QUARTZ = new TextureSet("QUARTZ"), SET_EMERALD = new TextureSet("EMERALD"), SET_DIAMOND = new TextureSet("DIAMOND"), SET_LIGNITE = new TextureSet("LIGNITE"), SET_MAGNETIC = new TextureSet("MAGNETIC"), SET_METALLIC = new TextureSet("METALLIC"), SET_NETHERSTAR = new TextureSet("NETHERSTAR"), SET_GEM_VERTICAL = new TextureSet("GEM_VERTICAL"), SET_GEM_HORIZONTAL = new TextureSet("GEM_HORIZONTAL");
-
- /**
- * For the Indices of OrePrefixes you need to look into the OrePrefix Enum.
- */
- public static final short
- INDEX_wire = 69, INDEX_foil = 70, INDEX_block1 = 71, INDEX_block2 = 72, INDEX_block3 = 73, INDEX_block4 = 74, INDEX_block5 = 75, INDEX_block6 = 76;
-
- public final IIconContainer[] mTextures = new IIconContainer[128];
- public final String mSetName;
- private final static String aTextMatIconDir = "materialicons/";
- private final static String aTextVoidDir = "/void";
-
- public TextureSet(String aSetName) {
- mSetName = aSetName;
- mTextures[0] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/dustTiny");
- mTextures[1] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/dustSmall");
- mTextures[2] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/dust");
- mTextures[3] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/dustImpure");
- mTextures[4] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/dustPure");
- mTextures[5] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crushed");
- mTextures[6] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crushedPurified");
- mTextures[7] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crushedCentrifuged");
- mTextures[8] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gem");
- mTextures[9] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/nugget");
- mTextures[10] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[11] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingot");
- mTextures[12] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingotHot");
- mTextures[13] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingotDouble");
- mTextures[14] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingotTriple");
- mTextures[15] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingotQuadruple");
- mTextures[16] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingotQuintuple");
- mTextures[17] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plate");
- mTextures[18] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plateDouble");
- mTextures[19] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plateTriple");
- mTextures[20] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plateQuadruple");
- mTextures[21] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plateQuintuple");
- mTextures[22] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plateDense");
- mTextures[23] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/stick");
- mTextures[24] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/lens");
- mTextures[25] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/round");
- mTextures[26] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/bolt");
- mTextures[27] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/screw");
- mTextures[28] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ring");
- mTextures[29] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/foil");
- mTextures[30] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/cell");
- mTextures[31] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/cellPlasma");
- mTextures[32] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadSword");
- mTextures[33] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadPickaxe");
- mTextures[34] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadShovel");
- mTextures[35] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadAxe");
- mTextures[36] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadHoe");
- mTextures[37] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadHammer");
- mTextures[38] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadFile");
- mTextures[39] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadSaw");
- mTextures[40] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadDrill");
- mTextures[41] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadChainsaw");
- mTextures[42] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadWrench");
- mTextures[43] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadUniversalSpade");
- mTextures[44] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadSense");
- mTextures[45] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadPlow");
- mTextures[46] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadArrow");
- mTextures[47] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadScrewdriver");
- mTextures[48] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadBuzzSaw");
- mTextures[49] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadSoldering");
- mTextures[50] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[51] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/wireFine");
- mTextures[52] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gearGtSmall");
- mTextures[53] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/rotor");
- mTextures[54] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/stickLong");
- mTextures[55] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/springSmall");
- mTextures[56] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/spring");
- mTextures[57] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/arrowGtWood");
- mTextures[58] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/arrowGtPlastic");
- mTextures[59] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gemChipped");
- mTextures[60] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gemFlawed");
- mTextures[61] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gemFlawless");
- mTextures[62] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gemExquisite");
- mTextures[63] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gearGt");
- mTextures[64] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[65] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[66] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[67] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/oreSmall");
- mTextures[68] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/ore");
- mTextures[69] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/wire");
- mTextures[70] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/foil");
- mTextures[71] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block1");
- mTextures[72] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block2");
- mTextures[73] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block3");
- mTextures[74] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block4");
- mTextures[75] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block5");
- mTextures[76] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block6");
- mTextures[77] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeSide");
- mTextures[78] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeTiny");
- mTextures[79] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeSmall");
- mTextures[80] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeMedium");
- mTextures[81] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeLarge");
- mTextures[82] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeHuge");
- mTextures[83] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/frameGt");
- mTextures[84] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[85] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[86] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[87] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[88] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[89] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[90] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[91] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[92] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[93] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[94] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[95] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[96] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crateGtDust");
- mTextures[97] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crateGtIngot");
- mTextures[98] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crateGtGem");
- mTextures[99] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crateGtPlate");
- mTextures[100] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/turbineBlade");
- mTextures[101] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[102] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[103] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[104] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[105] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[106] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[107] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[108] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[109] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[110] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[111] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[112] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[113] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[114] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[115] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[116] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[117] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[118] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[119] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[120] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[121] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[122] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[123] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[124] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[125] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[126] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/handleMallet");
- mTextures[127] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadMallet");
- }
+package gregtech.api.enums;
+
+import gregtech.api.interfaces.IIconContainer;
+
+public class TextureSet {
+ public static final TextureSet
+ SET_NONE = new TextureSet("NONE"), SET_DULL = new TextureSet("DULL"), SET_RUBY = new TextureSet("RUBY"), SET_OPAL = new TextureSet("OPAL"), SET_LEAF = new TextureSet("LEAF"), SET_WOOD = new TextureSet("WOOD"), SET_SAND = new TextureSet("SAND"), SET_FINE = new TextureSet("FINE"), SET_FIERY = new TextureSet("FIERY"), SET_FLUID = new TextureSet("FLUID"), SET_ROUGH = new TextureSet("ROUGH"), SET_PAPER = new TextureSet("PAPER"), SET_GLASS = new TextureSet("GLASS"), SET_FLINT = new TextureSet("FLINT"), SET_LAPIS = new TextureSet("LAPIS"), SET_SHINY = new TextureSet("SHINY"), SET_SHARDS = new TextureSet("SHARDS"), SET_POWDER = new TextureSet("POWDER"), SET_QUARTZ = new TextureSet("QUARTZ"), SET_EMERALD = new TextureSet("EMERALD"), SET_DIAMOND = new TextureSet("DIAMOND"), SET_LIGNITE = new TextureSet("LIGNITE"), SET_MAGNETIC = new TextureSet("MAGNETIC"), SET_METALLIC = new TextureSet("METALLIC"), SET_NETHERSTAR = new TextureSet("NETHERSTAR"), SET_GEM_VERTICAL = new TextureSet("GEM_VERTICAL"), SET_GEM_HORIZONTAL = new TextureSet("GEM_HORIZONTAL");
+
+ /**
+ * For the Indices of OrePrefixes you need to look into the OrePrefix Enum.
+ */
+ public static final short
+ INDEX_wire = 69, INDEX_foil = 70, INDEX_block1 = 71, INDEX_block2 = 72, INDEX_block3 = 73, INDEX_block4 = 74, INDEX_block5 = 75, INDEX_block6 = 76;
+
+ public final IIconContainer[] mTextures = new IIconContainer[128];
+ public final String mSetName;
+ private final static String aTextMatIconDir = "materialicons/";
+ private final static String aTextVoidDir = "/void";
+
+ public TextureSet(String aSetName) {
+ mSetName = aSetName;
+ mTextures[0] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/dustTiny");
+ mTextures[1] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/dustSmall");
+ mTextures[2] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/dust");
+ mTextures[3] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/dustImpure");
+ mTextures[4] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/dustPure");
+ mTextures[5] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crushed");
+ mTextures[6] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crushedPurified");
+ mTextures[7] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crushedCentrifuged");
+ mTextures[8] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gem");
+ mTextures[9] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/nugget");
+ mTextures[10] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[11] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingot");
+ mTextures[12] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingotHot");
+ mTextures[13] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingotDouble");
+ mTextures[14] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingotTriple");
+ mTextures[15] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingotQuadruple");
+ mTextures[16] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingotQuintuple");
+ mTextures[17] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plate");
+ mTextures[18] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plateDouble");
+ mTextures[19] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plateTriple");
+ mTextures[20] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plateQuadruple");
+ mTextures[21] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plateQuintuple");
+ mTextures[22] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plateDense");
+ mTextures[23] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/stick");
+ mTextures[24] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/lens");
+ mTextures[25] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/round");
+ mTextures[26] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/bolt");
+ mTextures[27] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/screw");
+ mTextures[28] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ring");
+ mTextures[29] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/foil");
+ mTextures[30] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/cell");
+ mTextures[31] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/cellPlasma");
+ mTextures[32] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadSword");
+ mTextures[33] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadPickaxe");
+ mTextures[34] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadShovel");
+ mTextures[35] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadAxe");
+ mTextures[36] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadHoe");
+ mTextures[37] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadHammer");
+ mTextures[38] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadFile");
+ mTextures[39] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadSaw");
+ mTextures[40] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadDrill");
+ mTextures[41] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadChainsaw");
+ mTextures[42] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadWrench");
+ mTextures[43] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadUniversalSpade");
+ mTextures[44] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadSense");
+ mTextures[45] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadPlow");
+ mTextures[46] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadArrow");
+ mTextures[47] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadScrewdriver");
+ mTextures[48] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadBuzzSaw");
+ mTextures[49] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadSoldering");
+ mTextures[50] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[51] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/wireFine");
+ mTextures[52] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gearGtSmall");
+ mTextures[53] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/rotor");
+ mTextures[54] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/stickLong");
+ mTextures[55] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/springSmall");
+ mTextures[56] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/spring");
+ mTextures[57] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/arrowGtWood");
+ mTextures[58] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/arrowGtPlastic");
+ mTextures[59] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gemChipped");
+ mTextures[60] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gemFlawed");
+ mTextures[61] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gemFlawless");
+ mTextures[62] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gemExquisite");
+ mTextures[63] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gearGt");
+ mTextures[64] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[65] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[66] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[67] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/oreSmall");
+ mTextures[68] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/ore");
+ mTextures[69] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/wire");
+ mTextures[70] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/foil");
+ mTextures[71] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block1");
+ mTextures[72] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block2");
+ mTextures[73] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block3");
+ mTextures[74] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block4");
+ mTextures[75] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block5");
+ mTextures[76] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block6");
+ mTextures[77] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeSide");
+ mTextures[78] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeTiny");
+ mTextures[79] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeSmall");
+ mTextures[80] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeMedium");
+ mTextures[81] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeLarge");
+ mTextures[82] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeHuge");
+ mTextures[83] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/frameGt");
+ mTextures[84] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeQuadruple");
+ mTextures[85] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeNonuple");
+ mTextures[86] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[87] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[88] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[89] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[90] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[91] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[92] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[93] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[94] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[95] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[96] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crateGtDust");
+ mTextures[97] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crateGtIngot");
+ mTextures[98] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crateGtGem");
+ mTextures[99] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crateGtPlate");
+ mTextures[100] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/turbineBlade");
+ mTextures[101] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[102] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[103] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[104] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[105] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[106] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[107] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[108] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[109] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[110] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[111] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[112] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[113] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[114] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[115] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[116] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[117] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[118] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[119] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[120] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[121] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[122] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[123] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[124] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[125] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[126] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/handleMallet");
+ mTextures[127] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadMallet");
+ }
} \ No newline at end of file
diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java
index 00d6e6401c..9bd00b2836 100644
--- a/src/main/java/gregtech/api/enums/Textures.java
+++ b/src/main/java/gregtech/api/enums/Textures.java
@@ -1,855 +1,857 @@
-package gregtech.api.enums;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.interfaces.IIconContainer;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.objects.GT_SidedTexture;
-import net.minecraft.client.renderer.texture.TextureMap;
-import net.minecraft.util.IIcon;
-import net.minecraft.util.ResourceLocation;
-
-import static gregtech.api.enums.GT_Values.RES_PATH_BLOCK;
-import static gregtech.api.enums.GT_Values.RES_PATH_ITEM;
-
-public class Textures {
- public enum BlockIcons implements IIconContainer, Runnable {
- //ADDED
- MACHINE_UEV_SIDE, MACHINE_UIV_SIDE,
- MACHINE_UMV_SIDE, MACHINE_UXV_SIDE,
- MACHINE_OPV_SIDE, MACHINE_MAXV_SIDE,
- MACHINE_UEV_TOP, MACHINE_UIV_TOP,
- MACHINE_UMV_TOP, MACHINE_UXV_TOP,
- MACHINE_OPV_TOP, MACHINE_MAXV_TOP,
- MACHINE_UEV_BOTTOM, MACHINE_UIV_BOTTOM,
- MACHINE_UMV_BOTTOM, MACHINE_UXV_BOTTOM,
- MACHINE_OPV_BOTTOM, MACHINE_MAXV_BOTTOM,
- OVERLAY_SCHEST, OVERLAY_STANK,
- MACHINE_CASING_TANK_1, MACHINE_CASING_TANK_2, MACHINE_CASING_TANK_3, MACHINE_CASING_TANK_4,
- MACHINE_CASING_TANK_5, MACHINE_CASING_TANK_6, MACHINE_CASING_TANK_7, MACHINE_CASING_TANK_8,
- MACHINE_CASING_TANK_9, MACHINE_CASING_TANK_10,MACHINE_CASING_TANK_11,MACHINE_CASING_TANK_12,
- MACHINE_CASING_TANK_13,MACHINE_CASING_TANK_14,MACHINE_CASING_TANK_15,MACHINE_CASING_TANK_0,
- BLOCK_STEELEAF, BLOCK_ICHORIUM,
- OVERLAY_ENERGY_IN_POWER,OVERLAY_ENERGY_OUT_POWER,OVERLAY_AUTOMAINTENANCE,OVERLAY_AUTOMAINTENANCE_IDLE,OVERLAY_TELEPORTER_SIDES,
- //
- VOID // The Empty Texture
- , RENDERING_ERROR, PIPE_RESTRICTOR, INSULATION_FULL, INSULATION_TINY, INSULATION_SMALL, INSULATION_MEDIUM, INSULATION_MEDIUM_PLUS, INSULATION_LARGE, INSULATION_HUGE, CFOAM_FRESH,
- CFOAM_HARDENED, SOLARPANEL, SOLARPANEL_8V, SOLARPANEL_LV, SOLARPANEL_MV, SOLARPANEL_HV, SOLARPANEL_EV, SOLARPANEL_IV, SOLARPANEL_LuV, SOLARPANEL_ZPM,
- SOLARPANEL_UV, VENT_NORMAL, VENT_ADVANCED, COVER_WOOD_PLATE, ARROW_UP, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, AUTOMATION_FILTER, AUTOMATION_TYPEFILTER,
- AUTOMATION_CHESTBUFFER, AUTOMATION_SUPERBUFFER, AUTOMATION_REGULATOR, AUTOMATION_ITEMDISTRIBUTOR, CONCRETE_LIGHT_STONE, CONCRETE_LIGHT_COBBLE, CONCRETE_LIGHT_COBBLE_MOSSY,
- CONCRETE_LIGHT_BRICKS, CONCRETE_LIGHT_BRICKS_CRACKED, CONCRETE_LIGHT_BRICKS_MOSSY, CONCRETE_LIGHT_BRICKS_CHISELED, CONCRETE_LIGHT_SMOOTH, CONCRETE_DARK_STONE,
- CONCRETE_DARK_COBBLE, CONCRETE_DARK_COBBLE_MOSSY, CONCRETE_DARK_BRICKS, CONCRETE_DARK_BRICKS_CRACKED, CONCRETE_DARK_BRICKS_MOSSY, CONCRETE_DARK_BRICKS_CHISELED,
- CONCRETE_DARK_SMOOTH, GRANITE_BLACK_STONE, GRANITE_BLACK_COBBLE, GRANITE_BLACK_COBBLE_MOSSY, GRANITE_BLACK_BRICKS, GRANITE_BLACK_BRICKS_CRACKED, GRANITE_BLACK_BRICKS_MOSSY,
- GRANITE_BLACK_BRICKS_CHISELED, GRANITE_BLACK_SMOOTH, GRANITE_RED_STONE, GRANITE_RED_COBBLE, GRANITE_RED_COBBLE_MOSSY, GRANITE_RED_BRICKS, GRANITE_RED_BRICKS_CRACKED,
- GRANITE_RED_BRICKS_MOSSY, GRANITE_RED_BRICKS_CHISELED, GRANITE_RED_SMOOTH, MACHINE_BRONZEBRICKS_TOP, MACHINE_BRONZEBRICKS_SIDE, MACHINE_BRONZEBRICKS_BOTTOM,
- MACHINE_STEELBRICKS_TOP, MACHINE_STEELBRICKS_SIDE, MACHINE_STEELBRICKS_BOTTOM, MACHINE_BRONZE_TOP, MACHINE_BRONZE_SIDE, MACHINE_BRONZE_BOTTOM, MACHINE_STEEL_TOP,
- MACHINE_STEEL_SIDE, MACHINE_STEEL_BOTTOM, MACHINE_8V_TOP, MACHINE_8V_SIDE, MACHINE_8V_BOTTOM, MACHINE_LV_TOP, MACHINE_LV_SIDE, MACHINE_LV_BOTTOM, MACHINE_MV_TOP,
- MACHINE_MV_SIDE, MACHINE_MV_BOTTOM, MACHINE_HV_TOP, MACHINE_HV_SIDE, MACHINE_HV_BOTTOM, MACHINE_EV_TOP, MACHINE_EV_SIDE, MACHINE_EV_BOTTOM, MACHINE_IV_TOP,
- MACHINE_IV_SIDE, MACHINE_IV_BOTTOM, MACHINE_LuV_TOP, MACHINE_LuV_SIDE, MACHINE_LuV_BOTTOM, MACHINE_ZPM_TOP, MACHINE_ZPM_SIDE, MACHINE_ZPM_BOTTOM, MACHINE_UV_TOP,
- MACHINE_UV_SIDE, MACHINE_UV_BOTTOM, MACHINE_MAX_TOP, MACHINE_MAX_SIDE, MACHINE_MAX_BOTTOM, MACHINE_BRONZEPLATEDBRICKS, MACHINE_HEATPROOFCASING, MACHINE_COIL_SUPERCONDUCTOR,
- MACHINE_BRONZEBLASTFURNACE, MACHINE_BRONZEBLASTFURNACE_ACTIVE, MACHINE_CASING_ROBUST_TUNGSTENSTEEL, MACHINE_CASING_CLEAN_STAINLESSSTEEL, MACHINE_CASING_STABLE_TITANIUM, MACHINE_CASING_MINING_OSMIRIDIUM,
- MACHINE_CASING_FIREBOX_TITANIUM, MACHINE_CASING_FUSION_COIL, MACHINE_CASING_FUSION, MACHINE_CASING_FUSION_GLASS, MACHINE_CASING_FUSION_GLASS_YELLOW, MACHINE_CASING_FUSION_2,
- MACHINE_CASING_MAGIC, MACHINE_CASING_MAGIC_ACTIVE, MACHINE_CASING_MAGIC_FRONT, MACHINE_CASING_MAGIC_FRONT_ACTIVE, MACHINE_CASING_DRAGONEGG, MACHINE_CASING_SOLID_STEEL,
- MACHINE_CASING_FROST_PROOF, MACHINE_CASING_PUMP, MACHINE_CASING_MOTOR, MACHINE_CASING_PIPE_BRONZE, MACHINE_CASING_PIPE_STEEL, MACHINE_CASING_PIPE_TITANIUM, MACHINE_CASING_PIPE_TUNGSTENSTEEL, MACHINE_CASING_PIPE_POLYTETRAFLUOROETHYLENE,
- MACHINE_CASING_GEARBOX_BRONZE, MACHINE_CASING_GEARBOX_STEEL, MACHINE_CASING_GEARBOX_TITANIUM, MACHINE_CASING_GEARBOX_TUNGSTENSTEEL, MACHINE_CASING_DATA_DRIVE, MACHINE_CASING_CONTAINMENT_FIELD,
- MACHINE_CASING_ASSEMBLER, MACHINE_CASING_PROCESSOR, MACHINE_CASING_STRIPES_A, MACHINE_CASING_STRIPES_B, MACHINE_CASING_RADIOACTIVEHAZARD, MACHINE_CASING_BIOHAZARD, MACHINE_CASING_EXPLOSIONHAZARD,
- MACHINE_CASING_FIREHAZARD, MACHINE_CASING_ACIDHAZARD, MACHINE_CASING_MAGICHAZARD, MACHINE_CASING_FROSTHAZARD, MACHINE_CASING_NOISEHAZARD, MACHINE_CASING_GRATE, MACHINE_CASING_VENT,
- MACHINE_CASING_RADIATIONPROOF, MACHINE_CASING_FIREBOX_BRONZE, MACHINE_CASING_FIREBOX_STEEL, MACHINE_CASING_FIREBOX_TUNGSTENSTEEL, MACHINE_CASING_ENGINE_INTAKE, MACHINE_CASING_CHEMICALLY_INERT, MACHINE_COIL_CUPRONICKEL,
- MACHINE_CASING_DENSEBRICKS, MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE, MACHINE_CASING_BRICKEDBLASTFURNACE_INACTIVE,
- MACHINE_COIL_KANTHAL, MACHINE_COIL_NICHROME, MACHINE_COIL_TUNGSTENSTEEL, MACHINE_COIL_HSSG, MACHINE_COIL_NAQUADAH, MACHINE_COIL_NAQUADAHALLOY, BOILER_SOLAR, BOILER_FRONT,
- BOILER_FRONT_ACTIVE, BOILER_LAVA_FRONT, BOILER_LAVA_FRONT_ACTIVE, NAQUADAH_REACTOR_SOLID_BACK, NAQUADAH_REACTOR_SOLID_FRONT, NAQUADAH_REACTOR_SOLID_SIDE, NAQUADAH_REACTOR_SOLID_BOTTOM,
- NAQUADAH_REACTOR_SOLID_TOP, NAQUADAH_REACTOR_SOLID_BACK_ACTIVE, NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE, NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE, NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE,
- NAQUADAH_REACTOR_SOLID_TOP_ACTIVE, NAQUADAH_REACTOR_FLUID_BACK, NAQUADAH_REACTOR_FLUID_FRONT, NAQUADAH_REACTOR_FLUID_SIDE, NAQUADAH_REACTOR_FLUID_BOTTOM, NAQUADAH_REACTOR_FLUID_TOP,
- NAQUADAH_REACTOR_FLUID_BACK_ACTIVE, NAQUADAH_REACTOR_FLUID_FRONT_ACTIVE, NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE, NAQUADAH_REACTOR_FLUID_BOTTOM_ACTIVE, NAQUADAH_REACTOR_FLUID_TOP_ACTIVE,
- DIESEL_GENERATOR_BACK, DIESEL_GENERATOR_FRONT, DIESEL_GENERATOR_SIDE, DIESEL_GENERATOR_BOTTOM, DIESEL_GENERATOR_TOP, DIESEL_GENERATOR_BACK_ACTIVE, DIESEL_GENERATOR_FRONT_ACTIVE,
- DIESEL_GENERATOR_SIDE_ACTIVE, DIESEL_GENERATOR_BOTTOM_ACTIVE, DIESEL_GENERATOR_TOP_ACTIVE, GAS_TURBINE_BACK, GAS_TURBINE_FRONT, GAS_TURBINE_SIDE, GAS_TURBINE_BOTTOM,
- GAS_TURBINE_TOP, GAS_TURBINE_BACK_ACTIVE, GAS_TURBINE_FRONT_ACTIVE, GAS_TURBINE_SIDE_ACTIVE, GAS_TURBINE_BOTTOM_ACTIVE, GAS_TURBINE_TOP_ACTIVE, STEAM_TURBINE_BACK,
- STEAM_TURBINE_FRONT, STEAM_TURBINE_SIDE, STEAM_TURBINE_BOTTOM, STEAM_TURBINE_TOP, STEAM_TURBINE_BACK_ACTIVE, STEAM_TURBINE_FRONT_ACTIVE, STEAM_TURBINE_SIDE_ACTIVE,
- STEAM_TURBINE_BOTTOM_ACTIVE, STEAM_TURBINE_TOP_ACTIVE, BLOCK_BRONZEPREIN, BLOCK_IRREIN, BLOCK_PLASCRETE, BLOCK_TSREIN, OVERLAY_LOCKER, OVERLAY_LOCKER_000, OVERLAY_LOCKER_001,
- OVERLAY_LOCKER_002, OVERLAY_LOCKER_003, OVERLAY_LOCKER_004, OVERLAY_LOCKER_005, OVERLAY_LOCKER_006, OVERLAY_LOCKER_007, OVERLAY_LOCKER_008, OVERLAY_LOCKER_009, OVERLAY_LOCKER_010,
- OVERLAY_LOCKER_011, OVERLAY_LOCKER_012, OVERLAY_LOCKER_013, OVERLAY_LENS, OVERLAY_PIPE, OVERLAY_PIPE_IN, OVERLAY_PIPE_OUT, OVERLAY_MUFFLER, OVERLAY_CONTROLLER, OVERLAY_ACTIVITYDETECTOR,
- OVERLAY_ENERGYDETECTOR, OVERLAY_FLUIDDETECTOR, OVERLAY_ITEMDETECTOR, OVERLAY_FUSION1, OVERLAY_FUSION2, OVERLAY_FUSION3, OVERLAY_SCREEN, OVERLAY_QTANK, OVERLAY_QCHEST, OVERLAY_SHUTTER,
- OVERLAY_CLOSET, OVERLAY_DUCTTAPE, OVERLAY_MAINTENANCE, OVERLAY_DATA_ACCESS, OVERLAY_CONVEYOR, OVERLAY_PUMP, OVERLAY_ARM, OVERLAY_DRAIN, OVERLAY_CRAFTING, OVERLAY_ENERGY_IN, OVERLAY_ENERGY_OUT,
- OVERLAY_ENERGY_IN_MULTI, OVERLAY_ENERGY_OUT_MULTI, OVERLAY_FRONT_LARGE_BOILER, OVERLAY_FRONT_LARGE_BOILER_ACTIVE, OVERLAY_FRONT_VACUUM_FREEZER, OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE,
- OVERLAY_FRONT_MULTI_SMELTER, OVERLAY_FRONT_MULTI_SMELTER_ACTIVE, OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE, OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE, OVERLAY_FRONT_IMPLOSION_COMPRESSOR,
- OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE, OVERLAY_TOP_POTIONBREWER, OVERLAY_TOP_REPLICATOR, OVERLAY_TOP_MASSFAB, OVERLAY_TOP_STEAM_HAMMER, OVERLAY_TOP_STEAM_FURNACE, OVERLAY_TOP_STEAM_ALLOY_SMELTER,
- OVERLAY_TOP_STEAM_MACERATOR, OVERLAY_TOP_STEAM_COMPRESSOR, OVERLAY_TOP_STEAM_EXTRACTOR, OVERLAY_TOP_DISASSEMBLER, OVERLAY_TOP_BOXINATOR, OVERLAY_TOP_ROCK_BREAKER, OVERLAY_TOP_SCANNER,
- OVERLAY_FRONT_POTIONBREWER, OVERLAY_FRONT_REPLICATOR, OVERLAY_FRONT_MASSFAB, OVERLAY_FRONT_STEAM_HAMMER, OVERLAY_FRONT_STEAM_FURNACE, OVERLAY_FRONT_STEAM_ALLOY_SMELTER,
- OVERLAY_FRONT_STEAM_MACERATOR, OVERLAY_FRONT_STEAM_COMPRESSOR, OVERLAY_FRONT_STEAM_EXTRACTOR, OVERLAY_FRONT_DISASSEMBLER, OVERLAY_FRONT_BOXINATOR, OVERLAY_FRONT_ROCK_BREAKER,
- OVERLAY_FRONT_SCANNER, OVERLAY_BOTTOM_POTIONBREWER, OVERLAY_BOTTOM_REPLICATOR, OVERLAY_BOTTOM_MASSFAB, OVERLAY_BOTTOM_STEAM_HAMMER, OVERLAY_BOTTOM_STEAM_FURNACE,
- OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER, OVERLAY_BOTTOM_STEAM_MACERATOR, OVERLAY_BOTTOM_STEAM_COMPRESSOR, OVERLAY_BOTTOM_STEAM_EXTRACTOR, OVERLAY_BOTTOM_DISASSEMBLER,
- OVERLAY_BOTTOM_BOXINATOR, OVERLAY_BOTTOM_ROCK_BREAKER, OVERLAY_BOTTOM_SCANNER, OVERLAY_SIDE_POTIONBREWER, OVERLAY_SIDE_REPLICATOR, OVERLAY_SIDE_MASSFAB, OVERLAY_SIDE_STEAM_HAMMER,
- OVERLAY_SIDE_STEAM_FURNACE, OVERLAY_SIDE_STEAM_ALLOY_SMELTER, OVERLAY_SIDE_STEAM_MACERATOR, OVERLAY_SIDE_STEAM_COMPRESSOR, OVERLAY_SIDE_STEAM_EXTRACTOR, OVERLAY_SIDE_DISASSEMBLER,
- OVERLAY_SIDE_BOXINATOR, OVERLAY_SIDE_ROCK_BREAKER, OVERLAY_SIDE_SCANNER, OVERLAY_TOP_POTIONBREWER_ACTIVE, OVERLAY_TOP_REPLICATOR_ACTIVE, OVERLAY_TOP_MASSFAB_ACTIVE,
- OVERLAY_TOP_STEAM_HAMMER_ACTIVE, OVERLAY_TOP_STEAM_FURNACE_ACTIVE, OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE, OVERLAY_TOP_STEAM_MACERATOR_ACTIVE, OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE,
- OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE, OVERLAY_TOP_DISASSEMBLER_ACTIVE, OVERLAY_TOP_BOXINATOR_ACTIVE, OVERLAY_TOP_ROCK_BREAKER_ACTIVE, OVERLAY_TOP_SCANNER_ACTIVE, OVERLAY_FRONT_POTIONBREWER_ACTIVE,
- OVERLAY_FRONT_REPLICATOR_ACTIVE, OVERLAY_FRONT_MASSFAB_ACTIVE, OVERLAY_FRONT_STEAM_HAMMER_ACTIVE, OVERLAY_FRONT_STEAM_FURNACE_ACTIVE, OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE,
- OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE, OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE, OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE, OVERLAY_FRONT_DISASSEMBLER_ACTIVE, OVERLAY_FRONT_BOXINATOR_ACTIVE,
- OVERLAY_FRONT_ROCK_BREAKER_ACTIVE, OVERLAY_FRONT_SCANNER_ACTIVE, OVERLAY_BOTTOM_POTIONBREWER_ACTIVE, OVERLAY_BOTTOM_REPLICATOR_ACTIVE, OVERLAY_BOTTOM_MASSFAB_ACTIVE,
- OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE, OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE, OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE, OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE, OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE,
- OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE, OVERLAY_BOTTOM_DISASSEMBLER_ACTIVE, OVERLAY_BOTTOM_BOXINATOR_ACTIVE, OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE, OVERLAY_BOTTOM_SCANNER_ACTIVE,
- OVERLAY_SIDE_POTIONBREWER_ACTIVE, OVERLAY_SIDE_REPLICATOR_ACTIVE, OVERLAY_SIDE_MASSFAB_ACTIVE, OVERLAY_SIDE_STEAM_HAMMER_ACTIVE, OVERLAY_SIDE_STEAM_FURNACE_ACTIVE, OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE,
- OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE, OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE, OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE, OVERLAY_SIDE_DISASSEMBLER_ACTIVE, OVERLAY_SIDE_BOXINATOR_ACTIVE,
- OVERLAY_SIDE_ROCK_BREAKER_ACTIVE, OVERLAY_SIDE_SCANNER_ACTIVE, OVERLAY_ADV_PUMP, OVERLAY_TELEPORTER, OVERLAY_TELEPORTER_ACTIVE, FUSIONI_1, FUSIONI_2, FUSIONI_3, FUSIONI_4, FUSIONI_5,
- FUSIONI_6, FUSIONI_7, FUSIONI_8, FUSIONI_9, FUSIONI_10, FUSIONI_11, FUSIONI_12, FUSIONII_1, FUSIONII_2, FUSIONII_3, FUSIONII_4, FUSIONII_5, FUSIONII_6, FUSIONII_7, FUSIONII_8, FUSIONII_9,
- FUSIONII_10, FUSIONII_11, FUSIONII_12, LARGETURBINE_ST1, LARGETURBINE_ST2, LARGETURBINE_ST3, LARGETURBINE_ST4, LARGETURBINE_ST5, LARGETURBINE_ST6, LARGETURBINE_ST7, LARGETURBINE_ST8,
- LARGETURBINE_ST9, LARGETURBINE_ST_ACTIVE1, LARGETURBINE_ST_ACTIVE2, LARGETURBINE_ST_ACTIVE3, LARGETURBINE_ST_ACTIVE4, LARGETURBINE_ST_ACTIVE5, LARGETURBINE_ST_ACTIVE6, LARGETURBINE_ST_ACTIVE7,
- LARGETURBINE_ST_ACTIVE8, LARGETURBINE_ST_ACTIVE9, LARGETURBINE_SS1, LARGETURBINE_SS2, LARGETURBINE_SS3, LARGETURBINE_SS4, LARGETURBINE_SS5, LARGETURBINE_SS6, LARGETURBINE_SS7, LARGETURBINE_SS8,
- LARGETURBINE_SS9, LARGETURBINE_SS_ACTIVE1, LARGETURBINE_SS_ACTIVE2, LARGETURBINE_SS_ACTIVE3, LARGETURBINE_SS_ACTIVE4, LARGETURBINE_SS_ACTIVE5, LARGETURBINE_SS_ACTIVE6, LARGETURBINE_SS_ACTIVE7,
- LARGETURBINE_SS_ACTIVE8, LARGETURBINE_SS_ACTIVE9, LARGETURBINE_TI1, LARGETURBINE_TI2, LARGETURBINE_TI3, LARGETURBINE_TI4, LARGETURBINE_TI5, LARGETURBINE_TI6, LARGETURBINE_TI7,
- LARGETURBINE_TI8, LARGETURBINE_TI9, LARGETURBINE_TI_ACTIVE1, LARGETURBINE_TI_ACTIVE2, LARGETURBINE_TI_ACTIVE3, LARGETURBINE_TI_ACTIVE4, LARGETURBINE_TI_ACTIVE5, LARGETURBINE_TI_ACTIVE6,
- LARGETURBINE_TI_ACTIVE7, LARGETURBINE_TI_ACTIVE8, LARGETURBINE_TI_ACTIVE9, LARGETURBINE_TU1, LARGETURBINE_TU2, LARGETURBINE_TU3, LARGETURBINE_TU4, LARGETURBINE_TU5, LARGETURBINE_TU6,
- LARGETURBINE_TU7, LARGETURBINE_TU8, LARGETURBINE_TU9, LARGETURBINE_TU_ACTIVE1, LARGETURBINE_TU_ACTIVE2, LARGETURBINE_TU_ACTIVE3, LARGETURBINE_TU_ACTIVE4, LARGETURBINE_TU_ACTIVE5,
- LARGETURBINE_TU_ACTIVE6, LARGETURBINE_TU_ACTIVE7, LARGETURBINE_TU_ACTIVE8, LARGETURBINE_TU_ACTIVE9, MACHINE_CASING_TURBINE, BLOCK_ADAMANTIUM, BLOCK_ALUMINIUM, BLOCK_AMERICIUM,
- BLOCK_ANNEALEDCOPPER, BLOCK_ANTIMONY, BLOCK_ARSENIC, BLOCK_ASTRALSILVER, BLOCK_BATTERYALLOY, BLOCK_BERYLLIUM, BLOCK_BISMUTH, BLOCK_BISMUTHBRONZE, BLOCK_BLACKBRONZE, BLOCK_BLACKSTEEL,
- BLOCK_BLUEALLOY, BLOCK_BLUESTEEL, BLOCK_BRASS, BLOCK_BRONZE, BLOCK_CAESIUM, BLOCK_CERIUM, BLOCK_CHROME, BLOCK_CHROMIUMDIOXIDE, BLOCK_COBALT, BLOCK_COBALTBRASS, BLOCK_COPPER,
- BLOCK_CUPRONICKEL, BLOCK_DAMASCUSSTEEL, BLOCK_DARKIRON, BLOCK_DEEPIRON, BLOCK_DESH, BLOCK_DURANIUM, BLOCK_DYSPROSIUM, BLOCK_ELECTRUM, BLOCK_ELECTRUMFLUX, BLOCK_ENDERIUM,
- BLOCK_ERBIUM, BLOCK_EUROPIUM, BLOCK_FIERYSTEEL, BLOCK_GADOLINIUM, BLOCK_GALLIUM, BLOCK_HOLMIUM, BLOCK_HSLA, BLOCK_INDIUM, BLOCK_INFUSEDGOLD, BLOCK_INVAR, BLOCK_IRIDIUM,
- BLOCK_IRONMAGNETIC, BLOCK_IRONWOOD, BLOCK_KANTHAL, BLOCK_KNIGHTMETAL, BLOCK_LANTHANUM, BLOCK_LEAD, BLOCK_LUTETIUM, BLOCK_MAGNALIUM, BLOCK_MAGNESIUM, BLOCK_MANGANESE, BLOCK_METEORICIRON,
- BLOCK_METEORICSTEEL, BLOCK_MIDASIUM, BLOCK_TRINIUM,BLOCK_MITHRIL, BLOCK_MOLYBDENUM, BLOCK_NAQUADAH, BLOCK_NAQUADAHALLOY, BLOCK_NAQUADAHENRICHED, BLOCK_NAQUADRIA, BLOCK_NEODYMIUM, BLOCK_NEODYMIUMMAGNETIC,
- BLOCK_NEUTRONIUM, BLOCK_NICHROME, BLOCK_NICKEL, BLOCK_NIOBIUM, BLOCK_NIOBIUMNITRIDE, BLOCK_NIOBIUMTITANIUM, BLOCK_OSMIRIDIUM, BLOCK_OSMIUM, BLOCK_PALLADIUM, BLOCK_PIGIRON, BLOCK_PLATINUM,
- BLOCK_PLUTONIUM, BLOCK_PLUTONIUM241, BLOCK_PRASEODYMIUM, BLOCK_PROMETHIUM, BLOCK_REDALLOY, BLOCK_REDSTEEL, BLOCK_ROSEGOLD, BLOCK_RUBIDIUM, BLOCK_SAMARIUM, BLOCK_SCANDIUM, BLOCK_SHADOWIRON,
- BLOCK_SHADOWSTEEL, BLOCK_SILICON, BLOCK_SILVER, BLOCK_SOLDERINGALLOY, BLOCK_STAINLESSSTEEL, BLOCK_STEEL, BLOCK_STEELMAGNETIC, BLOCK_STERLINGSILVER, BLOCK_SUNNARIUM, BLOCK_TANTALUM,
- BLOCK_TELLURIUM, BLOCK_TERBIUM, BLOCK_THAUMIUM, BLOCK_THORIUM, BLOCK_THULIUM, BLOCK_TIN, BLOCK_TINALLOY, BLOCK_TITANIUM, BLOCK_TRITANIUM, BLOCK_TUNGSTEN, BLOCK_TUNGSTENSTEEL, BLOCK_ULTIMET,
- BLOCK_URANIUM, BLOCK_URANIUM235, BLOCK_VANADIUM, BLOCK_VANADIUMGALLIUM, BLOCK_WROUGHTIRON, BLOCK_YTTRBIUM, BLOCK_YTTRIUM, BLOCK_YTTRIUMBARIUMCUPRATE, BLOCK_ZINC, BLOCK_TUNGSTENCARBIDE,
- BLOCK_VANADIUMSTEEL, BLOCK_HSSG, BLOCK_HSSE, BLOCK_HSSS, BLOCK_AERCRYSTAL, BLOCK_AMBER, BLOCK_AMETHYST, BLOCK_AQUACRYSTAL, BLOCK_BLUETOPAZ, BLOCK_CERTUSQUARTZ, BLOCK_DILITHIUM,
- BLOCK_ENDEREYE, BLOCK_ENDERPEARL, BLOCK_FOOLSRUBY, BLOCK_FORCE, BLOCK_FORCICIUM, BLOCK_FORCILLIUM, BLOCK_GREENSAPPHIRE, BLOCK_IGNISCRYSTAL, BLOCK_JASPER, BLOCK_LAZURITE,
- BLOCK_LIGNITE, BLOCK_MONAZITE, BLOCK_NITER, BLOCK_OLIVINE, BLOCK_OPAL, BLOCK_ORDOCRYSTAL, BLOCK_PERDITIOCRYSTAL, BLOCK_PHOSPHORUS, BLOCK_QUARTZITE, BLOCK_REDGARNET, BLOCK_RUBY,
- BLOCK_SAPPHIRE, BLOCK_SODALITE, BLOCK_TANZANITE, BLOCK_TERRACRYSTAL, BLOCK_TOPAZ, BLOCK_VINTEUM, BLOCK_YELLOWGARNET, BLOCK_NETHERSTAR, BLOCK_CHARCOAL, BLOCK_BLAZE, MARBLE_STONE, MARBLE_COBBLE,
- MARBLE_COBBLE_MOSSY, MARBLE_BRICKS, MARBLE_BRICKS_CRACKED, MARBLE_BRICKS_MOSSY, MARBLE_BRICKS_CHISELED, MARBLE_SMOOTH, BASALT_STONE, BASALT_COBBLE, BASALT_COBBLE_MOSSY, BASALT_BRICKS,
- BASALT_BRICKS_CRACKED, BASALT_BRICKS_MOSSY, BASALT_BRICKS_CHISELED, BASALT_SMOOTH, OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE, OVERLAY_FRONT_HEAT_EXCHANGER, OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE,
- OVERLAY_FRONT_PROCESSING_ARRAY, OVERLAY_FRONT_OIL_DRILL_ACTIVE, OVERLAY_FRONT_OIL_DRILL, OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE, OVERLAY_FRONT_DIESEL_ENGINE, OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE,
- OVERLAY_FRONT_PYROLYSE_OVEN, OVERLAY_FRONT_OIL_CRACKER_ACTIVE, OVERLAY_FRONT_OIL_CRACKER, OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE, OVERLAY_FRONT_DISTILLATION_TOWER,
- OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE, OVERLAY_FRONT_ASSEMBLY_LINE, OVERLAY_FRONT_ORE_DRILL_ACTIVE, OVERLAY_FRONT_ORE_DRILL, OVERLAY_TOP_CLEANROOM_ACTIVE, OVERLAY_TOP_CLEANROOM,
- OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR, OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE;
-
- /**
- * Icon for Fresh CFoam
- */
- public static final ITexture[] FRESHFOAM = new ITexture[]{new GT_RenderedTexture(CFOAM_FRESH)};
- /**
- * Icons for Hardened CFoam
- * 0 = No Color
- * 1 - 16 = Colors
- */
- public static final ITexture[][] HARDENEDFOAMS = new ITexture[][]{
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.CONSTRUCTION_FOAM.mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[0].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[1].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[2].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[3].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[4].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[5].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[6].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[7].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[8].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[9].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[10].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[11].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[12].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[13].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[14].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[15].mRGBa)}
- };
- /**
- * Machine Casings by Tier
- * 0 = 8V, 1 = LV, 2 = MV, 3 = HV, 4 = EV, 5 = IV, 6 = IV, 7 = IV, 8 = IV, 9 = IV
- */
- public static final IIconContainer[]
- MACHINECASINGS_SIDE = new IIconContainer[]{
- MACHINE_8V_SIDE,
- MACHINE_LV_SIDE,
- MACHINE_MV_SIDE,
- MACHINE_HV_SIDE,
- MACHINE_EV_SIDE,
- MACHINE_IV_SIDE,
- MACHINE_LuV_SIDE,
- MACHINE_ZPM_SIDE,
- MACHINE_UV_SIDE,
- MACHINE_MAX_SIDE,
- MACHINE_UEV_SIDE,
- MACHINE_UIV_SIDE,
- MACHINE_UMV_SIDE,
- MACHINE_UXV_SIDE,
- MACHINE_OPV_SIDE,
- MACHINE_MAXV_SIDE,
- },
- MACHINECASINGS_TOP = new IIconContainer[]{
- MACHINE_8V_TOP,
- MACHINE_LV_TOP,
- MACHINE_MV_TOP,
- MACHINE_HV_TOP,
- MACHINE_EV_TOP,
- MACHINE_IV_TOP,
- MACHINE_LuV_TOP,
- MACHINE_ZPM_TOP,
- MACHINE_UV_TOP,
- MACHINE_MAX_TOP,
- MACHINE_UEV_TOP,
- MACHINE_UIV_TOP,
- MACHINE_UMV_TOP,
- MACHINE_UXV_TOP,
- MACHINE_OPV_TOP,
- MACHINE_MAXV_TOP,
- },
- MACHINECASINGS_BOTTOM = new IIconContainer[]{
- MACHINE_8V_BOTTOM,
- MACHINE_LV_BOTTOM,
- MACHINE_MV_BOTTOM,
- MACHINE_HV_BOTTOM,
- MACHINE_EV_BOTTOM,
- MACHINE_IV_BOTTOM,
- MACHINE_LuV_BOTTOM,
- MACHINE_ZPM_BOTTOM,
- MACHINE_UV_BOTTOM,
- MACHINE_MAX_BOTTOM,
- MACHINE_UEV_BOTTOM,
- MACHINE_UIV_BOTTOM,
- MACHINE_UMV_BOTTOM,
- MACHINE_UXV_BOTTOM,
- MACHINE_OPV_BOTTOM,
- MACHINE_MAXV_BOTTOM,
- },
- GRANITES = new IIconContainer[]{
- GRANITE_BLACK_STONE,
- GRANITE_BLACK_COBBLE,
- GRANITE_BLACK_COBBLE_MOSSY,
- GRANITE_BLACK_BRICKS,
- GRANITE_BLACK_BRICKS_CRACKED,
- GRANITE_BLACK_BRICKS_MOSSY,
- GRANITE_BLACK_BRICKS_CHISELED,
- GRANITE_BLACK_SMOOTH,
- GRANITE_RED_STONE,
- GRANITE_RED_COBBLE,
- GRANITE_RED_COBBLE_MOSSY,
- GRANITE_RED_BRICKS,
- GRANITE_RED_BRICKS_CRACKED,
- GRANITE_RED_BRICKS_MOSSY,
- GRANITE_RED_BRICKS_CHISELED,
- GRANITE_RED_SMOOTH,
- },
- CONCRETES = new IIconContainer[]{
- CONCRETE_DARK_STONE,
- CONCRETE_DARK_COBBLE,
- CONCRETE_DARK_COBBLE_MOSSY,
- CONCRETE_DARK_BRICKS,
- CONCRETE_DARK_BRICKS_CRACKED,
- CONCRETE_DARK_BRICKS_MOSSY,
- CONCRETE_DARK_BRICKS_CHISELED,
- CONCRETE_DARK_SMOOTH,
- CONCRETE_LIGHT_STONE,
- CONCRETE_LIGHT_COBBLE,
- CONCRETE_LIGHT_COBBLE_MOSSY,
- CONCRETE_LIGHT_BRICKS,
- CONCRETE_LIGHT_BRICKS_CRACKED,
- CONCRETE_LIGHT_BRICKS_MOSSY,
- CONCRETE_LIGHT_BRICKS_CHISELED,
- CONCRETE_LIGHT_SMOOTH,
- },
- STONES = new IIconContainer[]{
- MARBLE_STONE,
- MARBLE_COBBLE,
- MARBLE_COBBLE_MOSSY,
- MARBLE_BRICKS,
- MARBLE_BRICKS_CRACKED,
- MARBLE_BRICKS_MOSSY,
- MARBLE_BRICKS_CHISELED,
- MARBLE_SMOOTH,
- BASALT_STONE,
- BASALT_COBBLE,
- BASALT_COBBLE_MOSSY,
- BASALT_BRICKS,
- BASALT_BRICKS_CRACKED,
- BASALT_BRICKS_MOSSY,
- BASALT_BRICKS_CHISELED,
- BASALT_SMOOTH,
- },
- TURBINE = new IIconContainer[]{
- LARGETURBINE_ST1,
- LARGETURBINE_ST2,
- LARGETURBINE_ST3,
- LARGETURBINE_ST4,
- LARGETURBINE_ST5,
- LARGETURBINE_ST6,
- LARGETURBINE_ST7,
- LARGETURBINE_ST8,
- LARGETURBINE_ST9
- },
- TURBINE_ACTIVE = new IIconContainer[]{
- LARGETURBINE_ST_ACTIVE1,
- LARGETURBINE_ST_ACTIVE2,
- LARGETURBINE_ST_ACTIVE3,
- LARGETURBINE_ST_ACTIVE4,
- LARGETURBINE_ST_ACTIVE5,
- LARGETURBINE_ST_ACTIVE6,
- LARGETURBINE_ST_ACTIVE7,
- LARGETURBINE_ST_ACTIVE8,
- LARGETURBINE_ST_ACTIVE9
- },
- TURBINE1 = new IIconContainer[]{
- LARGETURBINE_SS1,
- LARGETURBINE_SS2,
- LARGETURBINE_SS3,
- LARGETURBINE_SS4,
- LARGETURBINE_SS5,
- LARGETURBINE_SS6,
- LARGETURBINE_SS7,
- LARGETURBINE_SS8,
- LARGETURBINE_SS9
- },
- TURBINE_ACTIVE1 = new IIconContainer[]{
- LARGETURBINE_SS_ACTIVE1,
- LARGETURBINE_SS_ACTIVE2,
- LARGETURBINE_SS_ACTIVE3,
- LARGETURBINE_SS_ACTIVE4,
- LARGETURBINE_SS_ACTIVE5,
- LARGETURBINE_SS_ACTIVE6,
- LARGETURBINE_SS_ACTIVE7,
- LARGETURBINE_SS_ACTIVE8,
- LARGETURBINE_SS_ACTIVE9
- },
- TURBINE2 = new IIconContainer[]{
- LARGETURBINE_TI1,
- LARGETURBINE_TI2,
- LARGETURBINE_TI3,
- LARGETURBINE_TI4,
- LARGETURBINE_TI5,
- LARGETURBINE_TI6,
- LARGETURBINE_TI7,
- LARGETURBINE_TI8,
- LARGETURBINE_TI9
- },
- TURBINE_ACTIVE2 = new IIconContainer[]{
- LARGETURBINE_TI_ACTIVE1,
- LARGETURBINE_TI_ACTIVE2,
- LARGETURBINE_TI_ACTIVE3,
- LARGETURBINE_TI_ACTIVE4,
- LARGETURBINE_TI_ACTIVE5,
- LARGETURBINE_TI_ACTIVE6,
- LARGETURBINE_TI_ACTIVE7,
- LARGETURBINE_TI_ACTIVE8,
- LARGETURBINE_TI_ACTIVE9
- },
- TURBINE3 = new IIconContainer[]{
- LARGETURBINE_TU1,
- LARGETURBINE_TU2,
- LARGETURBINE_TU3,
- LARGETURBINE_TU4,
- LARGETURBINE_TU5,
- LARGETURBINE_TU6,
- LARGETURBINE_TU7,
- LARGETURBINE_TU8,
- LARGETURBINE_TU9
- },
- TURBINE_ACTIVE3 = new IIconContainer[]{
- LARGETURBINE_TU_ACTIVE1,
- LARGETURBINE_TU_ACTIVE2,
- LARGETURBINE_TU_ACTIVE3,
- LARGETURBINE_TU_ACTIVE4,
- LARGETURBINE_TU_ACTIVE5,
- LARGETURBINE_TU_ACTIVE6,
- LARGETURBINE_TU_ACTIVE7,
- LARGETURBINE_TU_ACTIVE8,
- LARGETURBINE_TU_ACTIVE9
- },
- CONNECTED_HULLS = new IIconContainer[]{
- CONCRETE_DARK_STONE,
- FUSIONI_1,
- FUSIONI_2,
- FUSIONI_3,
- FUSIONI_4,
- FUSIONI_5,
- FUSIONI_6,
- FUSIONI_7,
- FUSIONI_8,
- FUSIONI_9,
- FUSIONI_10,
- FUSIONI_11,
- FUSIONI_12,
- FUSIONII_1,
- FUSIONII_2,
- FUSIONII_3,
- FUSIONII_4,
- FUSIONII_5,
- FUSIONII_6,
- FUSIONII_7,
- FUSIONII_8,
- FUSIONII_9,
- FUSIONII_10,
- FUSIONII_11,
- FUSIONII_12,
- },
- STORAGE_BLOCKS1 = new IIconContainer[]{
- BLOCK_ADAMANTIUM,
- BLOCK_ALUMINIUM,
- BLOCK_AMERICIUM,
- BLOCK_ANNEALEDCOPPER,
- BLOCK_ANTIMONY,
- BLOCK_ARSENIC,
- BLOCK_ASTRALSILVER,
- BLOCK_BATTERYALLOY,
- BLOCK_BERYLLIUM,
- BLOCK_BISMUTH,
- BLOCK_BISMUTHBRONZE,
- BLOCK_BLACKBRONZE,
- BLOCK_BLACKSTEEL,
- BLOCK_BLUEALLOY,
- BLOCK_BLUESTEEL,
- BLOCK_BRASS
- },
- STORAGE_BLOCKS2 = new IIconContainer[]{
- BLOCK_BRONZE,
- BLOCK_CAESIUM,
- BLOCK_CERIUM,
- BLOCK_CHROME,
- BLOCK_CHROMIUMDIOXIDE,
- BLOCK_COBALT,
- BLOCK_COBALTBRASS,
- BLOCK_COPPER,
- BLOCK_CUPRONICKEL,
- BLOCK_DAMASCUSSTEEL,
- BLOCK_DARKIRON,
- BLOCK_DEEPIRON,
- BLOCK_DESH,
- BLOCK_DURANIUM,
- BLOCK_DYSPROSIUM,
- BLOCK_ELECTRUM
- },
- STORAGE_BLOCKS3 = new IIconContainer[]{
- BLOCK_ELECTRUMFLUX,
- BLOCK_ENDERIUM,
- BLOCK_ERBIUM,
- BLOCK_EUROPIUM,
- BLOCK_FIERYSTEEL,
- BLOCK_GADOLINIUM,
- BLOCK_GALLIUM,
- BLOCK_HOLMIUM,
- BLOCK_HSLA,
- BLOCK_INDIUM,
- BLOCK_INFUSEDGOLD,
- BLOCK_INVAR,
- BLOCK_IRIDIUM,
- BLOCK_IRONMAGNETIC,
- BLOCK_IRONWOOD,
- BLOCK_KANTHAL
- },
- STORAGE_BLOCKS4 = new IIconContainer[]{
- BLOCK_KNIGHTMETAL,
- BLOCK_LANTHANUM,
- BLOCK_LEAD,
- BLOCK_LUTETIUM,
- BLOCK_MAGNALIUM,
- BLOCK_MAGNESIUM,
- BLOCK_MANGANESE,
- BLOCK_METEORICIRON,
- BLOCK_METEORICSTEEL,
- BLOCK_TRINIUM,
- BLOCK_MITHRIL,
- BLOCK_MOLYBDENUM,
- BLOCK_NAQUADAH,
- BLOCK_NAQUADAHALLOY,
- BLOCK_NAQUADAHENRICHED,
- BLOCK_NAQUADRIA
- },
- STORAGE_BLOCKS5 = new IIconContainer[]{
- BLOCK_NEODYMIUM,
- BLOCK_NEODYMIUMMAGNETIC,
- BLOCK_NEUTRONIUM,
- BLOCK_NICHROME,
- BLOCK_NICKEL,
- BLOCK_NIOBIUM,
- BLOCK_NIOBIUMNITRIDE,
- BLOCK_NIOBIUMTITANIUM,
- BLOCK_OSMIRIDIUM,
- BLOCK_OSMIUM,
- BLOCK_PALLADIUM,
- BLOCK_PIGIRON,
- BLOCK_PLATINUM,
- BLOCK_PLUTONIUM,
- BLOCK_PLUTONIUM241,
- BLOCK_PRASEODYMIUM
- },
- STORAGE_BLOCKS6 = new IIconContainer[]{
- BLOCK_PROMETHIUM,
- BLOCK_REDALLOY,
- BLOCK_REDSTEEL,
- BLOCK_ROSEGOLD,
- BLOCK_RUBIDIUM,
- BLOCK_SAMARIUM,
- BLOCK_SCANDIUM,
- BLOCK_SHADOWIRON,
- BLOCK_SHADOWSTEEL,
- BLOCK_SILICON,
- BLOCK_SILVER,
- BLOCK_SOLDERINGALLOY,
- BLOCK_STAINLESSSTEEL,
- BLOCK_STEEL,
- BLOCK_STEELMAGNETIC,
- BLOCK_STERLINGSILVER
- },
- STORAGE_BLOCKS7 = new IIconContainer[]{
- BLOCK_SUNNARIUM,
- BLOCK_TANTALUM,
- BLOCK_TELLURIUM,
- BLOCK_TERBIUM,
- BLOCK_THAUMIUM,
- BLOCK_THORIUM,
- BLOCK_THULIUM,
- BLOCK_TIN,
- BLOCK_TINALLOY,
- BLOCK_TITANIUM,
- BLOCK_TRITANIUM,
- BLOCK_TUNGSTEN,
- BLOCK_TUNGSTENSTEEL,
- BLOCK_ULTIMET,
- BLOCK_URANIUM,
- BLOCK_URANIUM235
- },
- STORAGE_BLOCKS8 = new IIconContainer[]{
- BLOCK_VANADIUM,
- BLOCK_VANADIUMGALLIUM,
- BLOCK_WROUGHTIRON,
- BLOCK_YTTRBIUM,
- BLOCK_YTTRIUM,
- BLOCK_YTTRIUMBARIUMCUPRATE,
- BLOCK_ZINC,
- BLOCK_TUNGSTENCARBIDE,
- BLOCK_VANADIUMSTEEL,
- BLOCK_HSSG,
- BLOCK_HSSE,
- BLOCK_HSSS,
- BLOCK_STEELEAF,
- BLOCK_ICHORIUM
- },
- STORAGE_BLOCKS9 = new IIconContainer[]{
- BLOCK_AERCRYSTAL,
- BLOCK_AMBER,
- BLOCK_AMETHYST,
- BLOCK_AQUACRYSTAL,
- BLOCK_BLUETOPAZ,
- BLOCK_CERTUSQUARTZ,
- BLOCK_DILITHIUM,
- BLOCK_ENDEREYE,
- BLOCK_ENDERPEARL,
- BLOCK_FOOLSRUBY,
- BLOCK_FORCE,
- BLOCK_FORCICIUM,
- BLOCK_FORCILLIUM,
- BLOCK_GREENSAPPHIRE,
- BLOCK_IGNISCRYSTAL,
- BLOCK_JASPER
- },
- STORAGE_BLOCKS10 = new IIconContainer[]{
- BLOCK_LAZURITE,
- BLOCK_LIGNITE,
- BLOCK_MONAZITE,
- BLOCK_NITER,
- BLOCK_OLIVINE,
- BLOCK_OPAL,
- BLOCK_ORDOCRYSTAL,
- BLOCK_PERDITIOCRYSTAL,
- BLOCK_PHOSPHORUS,
- BLOCK_QUARTZITE,
- BLOCK_REDGARNET,
- BLOCK_RUBY,
- BLOCK_SAPPHIRE,
- BLOCK_SODALITE,
- BLOCK_TANZANITE,
- BLOCK_TERRACRYSTAL
- },
- STORAGE_BLOCKS11 = new IIconContainer[]{
- BLOCK_TOPAZ,
- BLOCK_VINTEUM,
- BLOCK_YELLOWGARNET,
- BLOCK_NETHERSTAR,
- BLOCK_CHARCOAL,
- BLOCK_BLAZE
- };
- public static ITexture[]
- ERROR_RENDERING = new ITexture[]{
- new GT_RenderedTexture(RENDERING_ERROR)
- },
- OVERLAYS_ENERGY_IN = new ITexture[]{
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{40, 40, 245, 0}),
- },
- OVERLAYS_ENERGY_OUT = new ITexture[]{
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{40, 40, 245, 0}),
- },
- OVERLAYS_ENERGY_IN_MULTI = new ITexture[]{
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{40, 40, 245, 0}),
- },
- OVERLAYS_ENERGY_OUT_MULTI = new ITexture[]{
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{40, 40, 245, 0}),
- },
- OVERLAYS_ENERGY_IN_POWER = new ITexture[]{
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{40, 40, 245, 0}),
- },
- OVERLAYS_ENERGY_OUT_POWER = new ITexture[]{
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{40, 40, 245, 0}),
- },
- LOCKERS = new ITexture[]{
- new GT_RenderedTexture(OVERLAY_LOCKER_000),
- new GT_RenderedTexture(OVERLAY_LOCKER_001),
- new GT_RenderedTexture(OVERLAY_LOCKER_002),
- new GT_RenderedTexture(OVERLAY_LOCKER_003),
- new GT_RenderedTexture(OVERLAY_LOCKER_004),
- new GT_RenderedTexture(OVERLAY_LOCKER_005),
- new GT_RenderedTexture(OVERLAY_LOCKER_006),
- new GT_RenderedTexture(OVERLAY_LOCKER_007),
- new GT_RenderedTexture(OVERLAY_LOCKER_008),
- new GT_RenderedTexture(OVERLAY_LOCKER_009),
- new GT_RenderedTexture(OVERLAY_LOCKER_010),
- new GT_RenderedTexture(OVERLAY_LOCKER_011),
- new GT_RenderedTexture(OVERLAY_LOCKER_012),
- new GT_RenderedTexture(OVERLAY_LOCKER_013),
- },
- CASING_BLOCKS = new ITexture[128],//original variable still limited to 128
- MACHINE_CASINGS[] = new ITexture[16][17];
-
- public static ITexture[][] casingTexturePages = new ITexture[128][];//page holder so we don't make an short long array
-
- static {
- for (byte i = 0; i < MACHINE_CASINGS.length; i++)
- for (byte j = 0; j < MACHINE_CASINGS[i].length; j++)
- MACHINE_CASINGS[i][j] = new GT_SidedTexture(MACHINECASINGS_BOTTOM[i], MACHINECASINGS_TOP[i], MACHINECASINGS_SIDE[i], Dyes.getModulation(j - 1, Dyes.MACHINE_METAL.mRGBa));
- casingTexturePages[0]=CASING_BLOCKS;
- if(casingTexturePages[8]==null)
- casingTexturePages[8]=new ITexture[128];
- }
-
- protected IIcon mIcon;
-
- private BlockIcons() {
- GregTech_API.sGTBlockIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return null;
- }
-
- @Override
- public void run() {
- mIcon = GregTech_API.sBlockIcons.registerIcon(RES_PATH_BLOCK + "iconsets/" + this);
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationBlocksTexture;
- }
-
- public static class CustomIcon implements IIconContainer, Runnable {
- protected IIcon mIcon;
- protected String mIconName;
-
- public CustomIcon(String aIconName) {
- mIconName = aIconName;
- GregTech_API.sGTBlockIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return null;
- }
-
- @Override
- public void run() {
- mIcon = GregTech_API.sBlockIcons.registerIcon(RES_PATH_BLOCK + mIconName);
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationBlocksTexture;
- }
- }
- }
-
- public enum ItemIcons implements IIconContainer, Runnable {
- VOID // The Empty Texture
- , RENDERING_ERROR, WRENCH, MORTAR, CROWBAR, JACKHAMMER, WIRE_CUTTER, KNIFE, BUTCHERYKNIFE, SICKLE, SCOOP, GRAFTER, PLUNGER, ROLLING_PIN, HANDLE_SWORD, HANDLE_FILE, HANDLE_SAW, HANDLE_SCREWDRIVER, HANDLE_BUZZSAW, HANDLE_ELECTRIC_SCREWDRIVER, HANDLE_SOLDERING, POWER_UNIT_LV, POWER_UNIT_MV, POWER_UNIT_HV, DURABILITY_BAR_0, DURABILITY_BAR_1, DURABILITY_BAR_2, DURABILITY_BAR_3, DURABILITY_BAR_4, DURABILITY_BAR_5, DURABILITY_BAR_6, DURABILITY_BAR_7, DURABILITY_BAR_8, ENERGY_BAR_0, ENERGY_BAR_1, ENERGY_BAR_2, ENERGY_BAR_3, ENERGY_BAR_4, ENERGY_BAR_5, ENERGY_BAR_6, ENERGY_BAR_7, ENERGY_BAR_8, TURBINE, TURBINE_SMALL, TURBINE_LARGE, TURBINE_HUGE;
-
- public static final IIconContainer[]
- DURABILITY_BAR = new IIconContainer[]{
- DURABILITY_BAR_0,
- DURABILITY_BAR_1,
- DURABILITY_BAR_2,
- DURABILITY_BAR_3,
- DURABILITY_BAR_4,
- DURABILITY_BAR_5,
- DURABILITY_BAR_6,
- DURABILITY_BAR_7,
- DURABILITY_BAR_8,
- },
- ENERGY_BAR = new IIconContainer[]{
- ENERGY_BAR_0,
- ENERGY_BAR_1,
- ENERGY_BAR_2,
- ENERGY_BAR_3,
- ENERGY_BAR_4,
- ENERGY_BAR_5,
- ENERGY_BAR_6,
- ENERGY_BAR_7,
- ENERGY_BAR_8,
- };
-
- public static final ITexture[] ERROR_RENDERING = new ITexture[]{new GT_RenderedTexture(RENDERING_ERROR)};
-
- protected IIcon mIcon, mOverlay;
-
- private ItemIcons() {
- GregTech_API.sGTItemIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return mOverlay;
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationItemsTexture;
- }
-
- @Override
- public void run() {
- mIcon = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + "iconsets/" + this);
- mOverlay = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + "iconsets/" + this + "_OVERLAY");
- }
-
- public static class CustomIcon implements IIconContainer, Runnable {
- protected IIcon mIcon, mOverlay;
- protected String mIconName;
-
- public CustomIcon(String aIconName) {
- mIconName = aIconName;
- GregTech_API.sGTItemIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return mOverlay;
- }
-
- @Override
- public void run() {
- mIcon = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + mIconName);
- mOverlay = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + mIconName + "_OVERLAY");
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationItemsTexture;
- }
- }
- }
-}
+package gregtech.api.enums;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.objects.GT_SidedTexture;
+import net.minecraft.client.renderer.texture.TextureMap;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.ResourceLocation;
+
+import static gregtech.api.enums.GT_Values.RES_PATH_BLOCK;
+import static gregtech.api.enums.GT_Values.RES_PATH_ITEM;
+
+public class Textures {
+ public enum BlockIcons implements IIconContainer, Runnable {
+ //ADDED
+ MACHINE_UEV_SIDE, MACHINE_UIV_SIDE,
+ MACHINE_UMV_SIDE, MACHINE_UXV_SIDE,
+ MACHINE_OPV_SIDE, MACHINE_MAXV_SIDE,
+ MACHINE_UEV_TOP, MACHINE_UIV_TOP,
+ MACHINE_UMV_TOP, MACHINE_UXV_TOP,
+ MACHINE_OPV_TOP, MACHINE_MAXV_TOP,
+ MACHINE_UEV_BOTTOM, MACHINE_UIV_BOTTOM,
+ MACHINE_UMV_BOTTOM, MACHINE_UXV_BOTTOM,
+ MACHINE_OPV_BOTTOM, MACHINE_MAXV_BOTTOM,
+ OVERLAY_SCHEST, OVERLAY_STANK,
+ MACHINE_CASING_TANK_1, MACHINE_CASING_TANK_2, MACHINE_CASING_TANK_3, MACHINE_CASING_TANK_4,
+ MACHINE_CASING_TANK_5, MACHINE_CASING_TANK_6, MACHINE_CASING_TANK_7, MACHINE_CASING_TANK_8,
+ MACHINE_CASING_TANK_9, MACHINE_CASING_TANK_10,MACHINE_CASING_TANK_11,MACHINE_CASING_TANK_12,
+ MACHINE_CASING_TANK_13,MACHINE_CASING_TANK_14,MACHINE_CASING_TANK_15,MACHINE_CASING_TANK_0,
+ BLOCK_STEELEAF, BLOCK_ICHORIUM,
+ OVERLAY_ENERGY_IN_POWER,OVERLAY_ENERGY_OUT_POWER,OVERLAY_AUTOMAINTENANCE,OVERLAY_AUTOMAINTENANCE_IDLE,OVERLAY_TELEPORTER_SIDES,
+ //
+ VOID // The Empty Texture
+ , RENDERING_ERROR, PIPE_RESTRICTOR, INSULATION_FULL, INSULATION_TINY, INSULATION_SMALL, INSULATION_MEDIUM, INSULATION_MEDIUM_PLUS, INSULATION_LARGE, INSULATION_HUGE, CFOAM_FRESH,
+ CFOAM_HARDENED, SOLARPANEL, SOLARPANEL_8V, SOLARPANEL_LV, SOLARPANEL_MV, SOLARPANEL_HV, SOLARPANEL_EV, SOLARPANEL_IV, SOLARPANEL_LuV, SOLARPANEL_ZPM,
+ SOLARPANEL_UV, VENT_NORMAL, VENT_ADVANCED, COVER_WOOD_PLATE, ARROW_UP, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, AUTOMATION_FILTER, AUTOMATION_TYPEFILTER,
+ AUTOMATION_CHESTBUFFER, AUTOMATION_SUPERBUFFER, AUTOMATION_REGULATOR, AUTOMATION_ITEMDISTRIBUTOR, CONCRETE_LIGHT_STONE, CONCRETE_LIGHT_COBBLE, CONCRETE_LIGHT_COBBLE_MOSSY,
+ CONCRETE_LIGHT_BRICKS, CONCRETE_LIGHT_BRICKS_CRACKED, CONCRETE_LIGHT_BRICKS_MOSSY, CONCRETE_LIGHT_BRICKS_CHISELED, CONCRETE_LIGHT_SMOOTH, CONCRETE_DARK_STONE,
+ CONCRETE_DARK_COBBLE, CONCRETE_DARK_COBBLE_MOSSY, CONCRETE_DARK_BRICKS, CONCRETE_DARK_BRICKS_CRACKED, CONCRETE_DARK_BRICKS_MOSSY, CONCRETE_DARK_BRICKS_CHISELED,
+ CONCRETE_DARK_SMOOTH, GRANITE_BLACK_STONE, GRANITE_BLACK_COBBLE, GRANITE_BLACK_COBBLE_MOSSY, GRANITE_BLACK_BRICKS, GRANITE_BLACK_BRICKS_CRACKED, GRANITE_BLACK_BRICKS_MOSSY,
+ GRANITE_BLACK_BRICKS_CHISELED, GRANITE_BLACK_SMOOTH, GRANITE_RED_STONE, GRANITE_RED_COBBLE, GRANITE_RED_COBBLE_MOSSY, GRANITE_RED_BRICKS, GRANITE_RED_BRICKS_CRACKED,
+ GRANITE_RED_BRICKS_MOSSY, GRANITE_RED_BRICKS_CHISELED, GRANITE_RED_SMOOTH, MACHINE_BRONZEBRICKS_TOP, MACHINE_BRONZEBRICKS_SIDE, MACHINE_BRONZEBRICKS_BOTTOM,
+ MACHINE_STEELBRICKS_TOP, MACHINE_STEELBRICKS_SIDE, MACHINE_STEELBRICKS_BOTTOM, MACHINE_BRONZE_TOP, MACHINE_BRONZE_SIDE, MACHINE_BRONZE_BOTTOM, MACHINE_STEEL_TOP,
+ MACHINE_STEEL_SIDE, MACHINE_STEEL_BOTTOM, MACHINE_8V_TOP, MACHINE_8V_SIDE, MACHINE_8V_BOTTOM, MACHINE_LV_TOP, MACHINE_LV_SIDE, MACHINE_LV_BOTTOM, MACHINE_MV_TOP,
+ MACHINE_MV_SIDE, MACHINE_MV_BOTTOM, MACHINE_HV_TOP, MACHINE_HV_SIDE, MACHINE_HV_BOTTOM, MACHINE_EV_TOP, MACHINE_EV_SIDE, MACHINE_EV_BOTTOM, MACHINE_IV_TOP,
+ MACHINE_IV_SIDE, MACHINE_IV_BOTTOM, MACHINE_LuV_TOP, MACHINE_LuV_SIDE, MACHINE_LuV_BOTTOM, MACHINE_ZPM_TOP, MACHINE_ZPM_SIDE, MACHINE_ZPM_BOTTOM, MACHINE_UV_TOP,
+ MACHINE_UV_SIDE, MACHINE_UV_BOTTOM, MACHINE_MAX_TOP, MACHINE_MAX_SIDE, MACHINE_MAX_BOTTOM, MACHINE_BRONZEPLATEDBRICKS, MACHINE_HEATPROOFCASING, MACHINE_COIL_SUPERCONDUCTOR,
+ MACHINE_BRONZEBLASTFURNACE, MACHINE_BRONZEBLASTFURNACE_ACTIVE, MACHINE_CASING_ROBUST_TUNGSTENSTEEL, MACHINE_CASING_CLEAN_STAINLESSSTEEL, MACHINE_CASING_STABLE_TITANIUM, MACHINE_CASING_MINING_OSMIRIDIUM,
+ MACHINE_CASING_FIREBOX_TITANIUM, MACHINE_CASING_FUSION_COIL, MACHINE_CASING_FUSION, MACHINE_CASING_FUSION_GLASS, MACHINE_CASING_FUSION_GLASS_YELLOW, MACHINE_CASING_FUSION_2,
+ MACHINE_CASING_MAGIC, MACHINE_CASING_MAGIC_ACTIVE, MACHINE_CASING_MAGIC_FRONT, MACHINE_CASING_MAGIC_FRONT_ACTIVE, MACHINE_CASING_DRAGONEGG, MACHINE_CASING_SOLID_STEEL,
+ MACHINE_CASING_FROST_PROOF, MACHINE_CASING_PUMP, MACHINE_CASING_MOTOR, MACHINE_CASING_PIPE_BRONZE, MACHINE_CASING_PIPE_STEEL, MACHINE_CASING_PIPE_TITANIUM, MACHINE_CASING_PIPE_TUNGSTENSTEEL, MACHINE_CASING_PIPE_POLYTETRAFLUOROETHYLENE,
+ MACHINE_CASING_GEARBOX_BRONZE, MACHINE_CASING_GEARBOX_STEEL, MACHINE_CASING_GEARBOX_TITANIUM, MACHINE_CASING_GEARBOX_TUNGSTENSTEEL, MACHINE_CASING_DATA_DRIVE, MACHINE_CASING_CONTAINMENT_FIELD,
+ MACHINE_CASING_ASSEMBLER, MACHINE_CASING_PROCESSOR, MACHINE_CASING_STRIPES_A, MACHINE_CASING_STRIPES_B, MACHINE_CASING_RADIOACTIVEHAZARD, MACHINE_CASING_BIOHAZARD, MACHINE_CASING_EXPLOSIONHAZARD,
+ MACHINE_CASING_FIREHAZARD, MACHINE_CASING_ACIDHAZARD, MACHINE_CASING_MAGICHAZARD, MACHINE_CASING_FROSTHAZARD, MACHINE_CASING_NOISEHAZARD, MACHINE_CASING_GRATE, MACHINE_CASING_VENT,
+ MACHINE_CASING_RADIATIONPROOF, MACHINE_CASING_FIREBOX_BRONZE, MACHINE_CASING_FIREBOX_STEEL, MACHINE_CASING_FIREBOX_TUNGSTENSTEEL, MACHINE_CASING_ENGINE_INTAKE, MACHINE_CASING_CHEMICALLY_INERT, MACHINE_COIL_CUPRONICKEL,
+ MACHINE_CASING_DENSEBRICKS, MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE, MACHINE_CASING_BRICKEDBLASTFURNACE_INACTIVE,
+ MACHINE_COIL_KANTHAL, MACHINE_COIL_NICHROME, MACHINE_COIL_TUNGSTENSTEEL, MACHINE_COIL_HSSG, MACHINE_COIL_NAQUADAH, MACHINE_COIL_NAQUADAHALLOY, BOILER_SOLAR, BOILER_FRONT,
+ BOILER_FRONT_ACTIVE, BOILER_LAVA_FRONT, BOILER_LAVA_FRONT_ACTIVE, NAQUADAH_REACTOR_SOLID_BACK, NAQUADAH_REACTOR_SOLID_FRONT, NAQUADAH_REACTOR_SOLID_SIDE, NAQUADAH_REACTOR_SOLID_BOTTOM,
+ NAQUADAH_REACTOR_SOLID_TOP, NAQUADAH_REACTOR_SOLID_BACK_ACTIVE, NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE, NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE, NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE,
+ NAQUADAH_REACTOR_SOLID_TOP_ACTIVE, NAQUADAH_REACTOR_FLUID_BACK, NAQUADAH_REACTOR_FLUID_FRONT, NAQUADAH_REACTOR_FLUID_SIDE, NAQUADAH_REACTOR_FLUID_BOTTOM, NAQUADAH_REACTOR_FLUID_TOP,
+ NAQUADAH_REACTOR_FLUID_BACK_ACTIVE, NAQUADAH_REACTOR_FLUID_FRONT_ACTIVE, NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE, NAQUADAH_REACTOR_FLUID_BOTTOM_ACTIVE, NAQUADAH_REACTOR_FLUID_TOP_ACTIVE,
+ DIESEL_GENERATOR_BACK, DIESEL_GENERATOR_FRONT, DIESEL_GENERATOR_SIDE, DIESEL_GENERATOR_BOTTOM, DIESEL_GENERATOR_TOP, DIESEL_GENERATOR_BACK_ACTIVE, DIESEL_GENERATOR_FRONT_ACTIVE,
+ DIESEL_GENERATOR_SIDE_ACTIVE, DIESEL_GENERATOR_BOTTOM_ACTIVE, DIESEL_GENERATOR_TOP_ACTIVE, GAS_TURBINE_BACK, GAS_TURBINE_FRONT, GAS_TURBINE_SIDE, GAS_TURBINE_BOTTOM,
+ GAS_TURBINE_TOP, GAS_TURBINE_BACK_ACTIVE, GAS_TURBINE_FRONT_ACTIVE, GAS_TURBINE_SIDE_ACTIVE, GAS_TURBINE_BOTTOM_ACTIVE, GAS_TURBINE_TOP_ACTIVE, STEAM_TURBINE_BACK,
+ STEAM_TURBINE_FRONT, STEAM_TURBINE_SIDE, STEAM_TURBINE_BOTTOM, STEAM_TURBINE_TOP, STEAM_TURBINE_BACK_ACTIVE, STEAM_TURBINE_FRONT_ACTIVE, STEAM_TURBINE_SIDE_ACTIVE,
+ STEAM_TURBINE_BOTTOM_ACTIVE, STEAM_TURBINE_TOP_ACTIVE, BLOCK_BRONZEPREIN, BLOCK_IRREIN, BLOCK_PLASCRETE, BLOCK_TSREIN, OVERLAY_LOCKER, OVERLAY_LOCKER_000, OVERLAY_LOCKER_001,
+ OVERLAY_LOCKER_002, OVERLAY_LOCKER_003, OVERLAY_LOCKER_004, OVERLAY_LOCKER_005, OVERLAY_LOCKER_006, OVERLAY_LOCKER_007, OVERLAY_LOCKER_008, OVERLAY_LOCKER_009, OVERLAY_LOCKER_010,
+ OVERLAY_LOCKER_011, OVERLAY_LOCKER_012, OVERLAY_LOCKER_013, OVERLAY_LENS, OVERLAY_PIPE, OVERLAY_PIPE_IN, OVERLAY_PIPE_OUT, OVERLAY_MUFFLER, OVERLAY_CONTROLLER, OVERLAY_ACTIVITYDETECTOR,
+ OVERLAY_ENERGYDETECTOR, OVERLAY_FLUIDDETECTOR, OVERLAY_ITEMDETECTOR, OVERLAY_FUSION1, OVERLAY_FUSION2, OVERLAY_FUSION3, OVERLAY_SCREEN, OVERLAY_QTANK, OVERLAY_QCHEST, OVERLAY_SHUTTER,
+ OVERLAY_CLOSET, OVERLAY_DUCTTAPE, OVERLAY_MAINTENANCE, OVERLAY_DATA_ACCESS, OVERLAY_CONVEYOR, OVERLAY_PUMP, OVERLAY_ARM, OVERLAY_DRAIN, OVERLAY_CRAFTING, OVERLAY_ENERGY_IN, OVERLAY_ENERGY_OUT,
+ OVERLAY_ENERGY_IN_MULTI, OVERLAY_ENERGY_OUT_MULTI, OVERLAY_FRONT_LARGE_BOILER, OVERLAY_FRONT_LARGE_BOILER_ACTIVE, OVERLAY_FRONT_VACUUM_FREEZER, OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE,
+ OVERLAY_FRONT_MULTI_SMELTER, OVERLAY_FRONT_MULTI_SMELTER_ACTIVE, OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE, OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE, OVERLAY_FRONT_IMPLOSION_COMPRESSOR,
+ OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE, OVERLAY_TOP_POTIONBREWER, OVERLAY_TOP_REPLICATOR, OVERLAY_TOP_MASSFAB, OVERLAY_TOP_STEAM_HAMMER, OVERLAY_TOP_STEAM_FURNACE, OVERLAY_TOP_STEAM_ALLOY_SMELTER,
+ OVERLAY_TOP_STEAM_MACERATOR, OVERLAY_TOP_STEAM_COMPRESSOR, OVERLAY_TOP_STEAM_EXTRACTOR, OVERLAY_TOP_DISASSEMBLER, OVERLAY_TOP_BOXINATOR, OVERLAY_TOP_ROCK_BREAKER, OVERLAY_TOP_SCANNER,
+ OVERLAY_FRONT_POTIONBREWER, OVERLAY_FRONT_REPLICATOR, OVERLAY_FRONT_MASSFAB, OVERLAY_FRONT_STEAM_HAMMER, OVERLAY_FRONT_STEAM_FURNACE, OVERLAY_FRONT_STEAM_ALLOY_SMELTER,
+ OVERLAY_FRONT_STEAM_MACERATOR, OVERLAY_FRONT_STEAM_COMPRESSOR, OVERLAY_FRONT_STEAM_EXTRACTOR, OVERLAY_FRONT_DISASSEMBLER, OVERLAY_FRONT_BOXINATOR, OVERLAY_FRONT_ROCK_BREAKER,
+ OVERLAY_FRONT_SCANNER, OVERLAY_BOTTOM_POTIONBREWER, OVERLAY_BOTTOM_REPLICATOR, OVERLAY_BOTTOM_MASSFAB, OVERLAY_BOTTOM_STEAM_HAMMER, OVERLAY_BOTTOM_STEAM_FURNACE,
+ OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER, OVERLAY_BOTTOM_STEAM_MACERATOR, OVERLAY_BOTTOM_STEAM_COMPRESSOR, OVERLAY_BOTTOM_STEAM_EXTRACTOR, OVERLAY_BOTTOM_DISASSEMBLER,
+ OVERLAY_BOTTOM_BOXINATOR, OVERLAY_BOTTOM_ROCK_BREAKER, OVERLAY_BOTTOM_SCANNER, OVERLAY_SIDE_POTIONBREWER, OVERLAY_SIDE_REPLICATOR, OVERLAY_SIDE_MASSFAB, OVERLAY_SIDE_STEAM_HAMMER,
+ OVERLAY_SIDE_STEAM_FURNACE, OVERLAY_SIDE_STEAM_ALLOY_SMELTER, OVERLAY_SIDE_STEAM_MACERATOR, OVERLAY_SIDE_STEAM_COMPRESSOR, OVERLAY_SIDE_STEAM_EXTRACTOR, OVERLAY_SIDE_DISASSEMBLER,
+ OVERLAY_SIDE_BOXINATOR, OVERLAY_SIDE_ROCK_BREAKER, OVERLAY_SIDE_SCANNER, OVERLAY_TOP_POTIONBREWER_ACTIVE, OVERLAY_TOP_REPLICATOR_ACTIVE, OVERLAY_TOP_MASSFAB_ACTIVE,
+ OVERLAY_TOP_STEAM_HAMMER_ACTIVE, OVERLAY_TOP_STEAM_FURNACE_ACTIVE, OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE, OVERLAY_TOP_STEAM_MACERATOR_ACTIVE, OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE,
+ OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE, OVERLAY_TOP_DISASSEMBLER_ACTIVE, OVERLAY_TOP_BOXINATOR_ACTIVE, OVERLAY_TOP_ROCK_BREAKER_ACTIVE, OVERLAY_TOP_SCANNER_ACTIVE, OVERLAY_FRONT_POTIONBREWER_ACTIVE,
+ OVERLAY_FRONT_REPLICATOR_ACTIVE, OVERLAY_FRONT_MASSFAB_ACTIVE, OVERLAY_FRONT_STEAM_HAMMER_ACTIVE, OVERLAY_FRONT_STEAM_FURNACE_ACTIVE, OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE,
+ OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE, OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE, OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE, OVERLAY_FRONT_DISASSEMBLER_ACTIVE, OVERLAY_FRONT_BOXINATOR_ACTIVE,
+ OVERLAY_FRONT_ROCK_BREAKER_ACTIVE, OVERLAY_FRONT_SCANNER_ACTIVE, OVERLAY_BOTTOM_POTIONBREWER_ACTIVE, OVERLAY_BOTTOM_REPLICATOR_ACTIVE, OVERLAY_BOTTOM_MASSFAB_ACTIVE,
+ OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE, OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE, OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE, OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE, OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE,
+ OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE, OVERLAY_BOTTOM_DISASSEMBLER_ACTIVE, OVERLAY_BOTTOM_BOXINATOR_ACTIVE, OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE, OVERLAY_BOTTOM_SCANNER_ACTIVE,
+ OVERLAY_SIDE_POTIONBREWER_ACTIVE, OVERLAY_SIDE_REPLICATOR_ACTIVE, OVERLAY_SIDE_MASSFAB_ACTIVE, OVERLAY_SIDE_STEAM_HAMMER_ACTIVE, OVERLAY_SIDE_STEAM_FURNACE_ACTIVE, OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE,
+ OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE, OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE, OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE, OVERLAY_SIDE_DISASSEMBLER_ACTIVE, OVERLAY_SIDE_BOXINATOR_ACTIVE,
+ OVERLAY_SIDE_ROCK_BREAKER_ACTIVE, OVERLAY_SIDE_SCANNER_ACTIVE, OVERLAY_ADV_PUMP, OVERLAY_TELEPORTER, OVERLAY_TELEPORTER_ACTIVE, FUSIONI_1, FUSIONI_2, FUSIONI_3, FUSIONI_4, FUSIONI_5,
+ FUSIONI_6, FUSIONI_7, FUSIONI_8, FUSIONI_9, FUSIONI_10, FUSIONI_11, FUSIONI_12, FUSIONII_1, FUSIONII_2, FUSIONII_3, FUSIONII_4, FUSIONII_5, FUSIONII_6, FUSIONII_7, FUSIONII_8, FUSIONII_9,
+ FUSIONII_10, FUSIONII_11, FUSIONII_12, LARGETURBINE_ST1, LARGETURBINE_ST2, LARGETURBINE_ST3, LARGETURBINE_ST4, LARGETURBINE_ST5, LARGETURBINE_ST6, LARGETURBINE_ST7, LARGETURBINE_ST8,
+ LARGETURBINE_ST9, LARGETURBINE_ST_ACTIVE1, LARGETURBINE_ST_ACTIVE2, LARGETURBINE_ST_ACTIVE3, LARGETURBINE_ST_ACTIVE4, LARGETURBINE_ST_ACTIVE5, LARGETURBINE_ST_ACTIVE6, LARGETURBINE_ST_ACTIVE7,
+ LARGETURBINE_ST_ACTIVE8, LARGETURBINE_ST_ACTIVE9, LARGETURBINE_SS1, LARGETURBINE_SS2, LARGETURBINE_SS3, LARGETURBINE_SS4, LARGETURBINE_SS5, LARGETURBINE_SS6, LARGETURBINE_SS7, LARGETURBINE_SS8,
+ LARGETURBINE_SS9, LARGETURBINE_SS_ACTIVE1, LARGETURBINE_SS_ACTIVE2, LARGETURBINE_SS_ACTIVE3, LARGETURBINE_SS_ACTIVE4, LARGETURBINE_SS_ACTIVE5, LARGETURBINE_SS_ACTIVE6, LARGETURBINE_SS_ACTIVE7,
+ LARGETURBINE_SS_ACTIVE8, LARGETURBINE_SS_ACTIVE9, LARGETURBINE_TI1, LARGETURBINE_TI2, LARGETURBINE_TI3, LARGETURBINE_TI4, LARGETURBINE_TI5, LARGETURBINE_TI6, LARGETURBINE_TI7,
+ LARGETURBINE_TI8, LARGETURBINE_TI9, LARGETURBINE_TI_ACTIVE1, LARGETURBINE_TI_ACTIVE2, LARGETURBINE_TI_ACTIVE3, LARGETURBINE_TI_ACTIVE4, LARGETURBINE_TI_ACTIVE5, LARGETURBINE_TI_ACTIVE6,
+ LARGETURBINE_TI_ACTIVE7, LARGETURBINE_TI_ACTIVE8, LARGETURBINE_TI_ACTIVE9, LARGETURBINE_TU1, LARGETURBINE_TU2, LARGETURBINE_TU3, LARGETURBINE_TU4, LARGETURBINE_TU5, LARGETURBINE_TU6,
+ LARGETURBINE_TU7, LARGETURBINE_TU8, LARGETURBINE_TU9, LARGETURBINE_TU_ACTIVE1, LARGETURBINE_TU_ACTIVE2, LARGETURBINE_TU_ACTIVE3, LARGETURBINE_TU_ACTIVE4, LARGETURBINE_TU_ACTIVE5,
+ LARGETURBINE_TU_ACTIVE6, LARGETURBINE_TU_ACTIVE7, LARGETURBINE_TU_ACTIVE8, LARGETURBINE_TU_ACTIVE9, MACHINE_CASING_TURBINE, BLOCK_ADAMANTIUM, BLOCK_ALUMINIUM, BLOCK_AMERICIUM,
+ BLOCK_ANNEALEDCOPPER, BLOCK_ANTIMONY, BLOCK_ARSENIC, BLOCK_ASTRALSILVER, BLOCK_BATTERYALLOY, BLOCK_BERYLLIUM, BLOCK_BISMUTH, BLOCK_BISMUTHBRONZE, BLOCK_BLACKBRONZE, BLOCK_BLACKSTEEL,
+ BLOCK_BLUEALLOY, BLOCK_BLUESTEEL, BLOCK_BRASS, BLOCK_BRONZE, BLOCK_CAESIUM, BLOCK_CERIUM, BLOCK_CHROME, BLOCK_CHROMIUMDIOXIDE, BLOCK_COBALT, BLOCK_COBALTBRASS, BLOCK_COPPER,
+ BLOCK_CUPRONICKEL, BLOCK_DAMASCUSSTEEL, BLOCK_DARKIRON, BLOCK_DEEPIRON, BLOCK_DESH, BLOCK_DURANIUM, BLOCK_DYSPROSIUM, BLOCK_ELECTRUM, BLOCK_ELECTRUMFLUX, BLOCK_ENDERIUM,
+ BLOCK_ERBIUM, BLOCK_EUROPIUM, BLOCK_FIERYSTEEL, BLOCK_GADOLINIUM, BLOCK_GALLIUM, BLOCK_HOLMIUM, BLOCK_HSLA, BLOCK_INDIUM, BLOCK_INFUSEDGOLD, BLOCK_INVAR, BLOCK_IRIDIUM,
+ BLOCK_IRONMAGNETIC, BLOCK_IRONWOOD, BLOCK_KANTHAL, BLOCK_KNIGHTMETAL, BLOCK_LANTHANUM, BLOCK_LEAD, BLOCK_LUTETIUM, BLOCK_MAGNALIUM, BLOCK_MAGNESIUM, BLOCK_MANGANESE, BLOCK_METEORICIRON,
+ BLOCK_METEORICSTEEL, BLOCK_MIDASIUM, BLOCK_TRINIUM,BLOCK_MITHRIL, BLOCK_MOLYBDENUM, BLOCK_NAQUADAH, BLOCK_NAQUADAHALLOY, BLOCK_NAQUADAHENRICHED, BLOCK_NAQUADRIA, BLOCK_NEODYMIUM, BLOCK_NEODYMIUMMAGNETIC,
+ BLOCK_NEUTRONIUM, BLOCK_NICHROME, BLOCK_NICKEL, BLOCK_NIOBIUM, BLOCK_NIOBIUMNITRIDE, BLOCK_NIOBIUMTITANIUM, BLOCK_OSMIRIDIUM, BLOCK_OSMIUM, BLOCK_PALLADIUM, BLOCK_PIGIRON, BLOCK_PLATINUM,
+ BLOCK_PLUTONIUM, BLOCK_PLUTONIUM241, BLOCK_PRASEODYMIUM, BLOCK_PROMETHIUM, BLOCK_REDALLOY, BLOCK_REDSTEEL, BLOCK_ROSEGOLD, BLOCK_RUBIDIUM, BLOCK_SAMARIUM, BLOCK_SCANDIUM, BLOCK_SHADOWIRON,
+ BLOCK_SHADOWSTEEL, BLOCK_SILICON, BLOCK_SILVER, BLOCK_SOLDERINGALLOY, BLOCK_STAINLESSSTEEL, BLOCK_STEEL, BLOCK_STEELMAGNETIC, BLOCK_STERLINGSILVER, BLOCK_SUNNARIUM, BLOCK_TANTALUM,
+ BLOCK_TELLURIUM, BLOCK_TERBIUM, BLOCK_THAUMIUM, BLOCK_THORIUM, BLOCK_THULIUM, BLOCK_TIN, BLOCK_TINALLOY, BLOCK_TITANIUM, BLOCK_TRITANIUM, BLOCK_TUNGSTEN, BLOCK_TUNGSTENSTEEL, BLOCK_ULTIMET,
+ BLOCK_URANIUM, BLOCK_URANIUM235, BLOCK_VANADIUM, BLOCK_VANADIUMGALLIUM, BLOCK_WROUGHTIRON, BLOCK_YTTRBIUM, BLOCK_YTTRIUM, BLOCK_YTTRIUMBARIUMCUPRATE, BLOCK_ZINC, BLOCK_TUNGSTENCARBIDE,
+ BLOCK_VANADIUMSTEEL, BLOCK_HSSG, BLOCK_HSSE, BLOCK_HSSS, BLOCK_AERCRYSTAL, BLOCK_AMBER, BLOCK_AMETHYST, BLOCK_AQUACRYSTAL, BLOCK_BLUETOPAZ, BLOCK_CERTUSQUARTZ, BLOCK_DILITHIUM,
+ BLOCK_ENDEREYE, BLOCK_ENDERPEARL, BLOCK_FOOLSRUBY, BLOCK_FORCE, BLOCK_FORCICIUM, BLOCK_FORCILLIUM, BLOCK_GREENSAPPHIRE, BLOCK_IGNISCRYSTAL, BLOCK_JASPER, BLOCK_LAZURITE,
+ BLOCK_LIGNITE, BLOCK_MONAZITE, BLOCK_NITER, BLOCK_OLIVINE, BLOCK_OPAL, BLOCK_ORDOCRYSTAL, BLOCK_PERDITIOCRYSTAL, BLOCK_PHOSPHORUS, BLOCK_QUARTZITE, BLOCK_REDGARNET, BLOCK_RUBY,
+ BLOCK_SAPPHIRE, BLOCK_SODALITE, BLOCK_TANZANITE, BLOCK_TERRACRYSTAL, BLOCK_TOPAZ, BLOCK_VINTEUM, BLOCK_YELLOWGARNET, BLOCK_NETHERSTAR, BLOCK_CHARCOAL, BLOCK_BLAZE, MARBLE_STONE, MARBLE_COBBLE,
+ MARBLE_COBBLE_MOSSY, MARBLE_BRICKS, MARBLE_BRICKS_CRACKED, MARBLE_BRICKS_MOSSY, MARBLE_BRICKS_CHISELED, MARBLE_SMOOTH, BASALT_STONE, BASALT_COBBLE, BASALT_COBBLE_MOSSY, BASALT_BRICKS,
+ BASALT_BRICKS_CRACKED, BASALT_BRICKS_MOSSY, BASALT_BRICKS_CHISELED, BASALT_SMOOTH, OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE, OVERLAY_FRONT_HEAT_EXCHANGER, OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE,
+ OVERLAY_FRONT_PROCESSING_ARRAY, OVERLAY_FRONT_OIL_DRILL_ACTIVE, OVERLAY_FRONT_OIL_DRILL, OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE, OVERLAY_FRONT_DIESEL_ENGINE, OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE,
+ OVERLAY_FRONT_PYROLYSE_OVEN, OVERLAY_FRONT_OIL_CRACKER_ACTIVE, OVERLAY_FRONT_OIL_CRACKER, OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE, OVERLAY_FRONT_DISTILLATION_TOWER,
+ OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE, OVERLAY_FRONT_ASSEMBLY_LINE, OVERLAY_FRONT_ORE_DRILL_ACTIVE, OVERLAY_FRONT_ORE_DRILL, OVERLAY_TOP_CLEANROOM_ACTIVE, OVERLAY_TOP_CLEANROOM,
+ OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR, OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE,
+ PIPE_RESTRICTOR_UP, PIPE_RESTRICTOR_DOWN, PIPE_RESTRICTOR_LEFT, PIPE_RESTRICTOR_RIGHT, PIPE_RESTRICTOR_NU, PIPE_RESTRICTOR_ND, PIPE_RESTRICTOR_NL, PIPE_RESTRICTOR_NR,
+ PIPE_RESTRICTOR_UD, PIPE_RESTRICTOR_UL, PIPE_RESTRICTOR_UR, PIPE_RESTRICTOR_DL, PIPE_RESTRICTOR_DR, PIPE_RESTRICTOR_LR;
+
+ /**
+ * Icon for Fresh CFoam
+ */
+ public static final ITexture[] FRESHFOAM = new ITexture[]{new GT_RenderedTexture(CFOAM_FRESH)};
+ /**
+ * Icons for Hardened CFoam
+ * 0 = No Color
+ * 1 - 16 = Colors
+ */
+ public static final ITexture[][] HARDENEDFOAMS = new ITexture[][]{
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.CONSTRUCTION_FOAM.mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[0].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[1].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[2].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[3].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[4].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[5].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[6].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[7].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[8].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[9].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[10].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[11].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[12].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[13].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[14].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[15].mRGBa)}
+ };
+ /**
+ * Machine Casings by Tier
+ * 0 = 8V, 1 = LV, 2 = MV, 3 = HV, 4 = EV, 5 = IV, 6 = IV, 7 = IV, 8 = IV, 9 = IV
+ */
+ public static final IIconContainer[]
+ MACHINECASINGS_SIDE = new IIconContainer[]{
+ MACHINE_8V_SIDE,
+ MACHINE_LV_SIDE,
+ MACHINE_MV_SIDE,
+ MACHINE_HV_SIDE,
+ MACHINE_EV_SIDE,
+ MACHINE_IV_SIDE,
+ MACHINE_LuV_SIDE,
+ MACHINE_ZPM_SIDE,
+ MACHINE_UV_SIDE,
+ MACHINE_MAX_SIDE,
+ MACHINE_UEV_SIDE,
+ MACHINE_UIV_SIDE,
+ MACHINE_UMV_SIDE,
+ MACHINE_UXV_SIDE,
+ MACHINE_OPV_SIDE,
+ MACHINE_MAXV_SIDE,
+ },
+ MACHINECASINGS_TOP = new IIconContainer[]{
+ MACHINE_8V_TOP,
+ MACHINE_LV_TOP,
+ MACHINE_MV_TOP,
+ MACHINE_HV_TOP,
+ MACHINE_EV_TOP,
+ MACHINE_IV_TOP,
+ MACHINE_LuV_TOP,
+ MACHINE_ZPM_TOP,
+ MACHINE_UV_TOP,
+ MACHINE_MAX_TOP,
+ MACHINE_UEV_TOP,
+ MACHINE_UIV_TOP,
+ MACHINE_UMV_TOP,
+ MACHINE_UXV_TOP,
+ MACHINE_OPV_TOP,
+ MACHINE_MAXV_TOP,
+ },
+ MACHINECASINGS_BOTTOM = new IIconContainer[]{
+ MACHINE_8V_BOTTOM,
+ MACHINE_LV_BOTTOM,
+ MACHINE_MV_BOTTOM,
+ MACHINE_HV_BOTTOM,
+ MACHINE_EV_BOTTOM,
+ MACHINE_IV_BOTTOM,
+ MACHINE_LuV_BOTTOM,
+ MACHINE_ZPM_BOTTOM,
+ MACHINE_UV_BOTTOM,
+ MACHINE_MAX_BOTTOM,
+ MACHINE_UEV_BOTTOM,
+ MACHINE_UIV_BOTTOM,
+ MACHINE_UMV_BOTTOM,
+ MACHINE_UXV_BOTTOM,
+ MACHINE_OPV_BOTTOM,
+ MACHINE_MAXV_BOTTOM,
+ },
+ GRANITES = new IIconContainer[]{
+ GRANITE_BLACK_STONE,
+ GRANITE_BLACK_COBBLE,
+ GRANITE_BLACK_COBBLE_MOSSY,
+ GRANITE_BLACK_BRICKS,
+ GRANITE_BLACK_BRICKS_CRACKED,
+ GRANITE_BLACK_BRICKS_MOSSY,
+ GRANITE_BLACK_BRICKS_CHISELED,
+ GRANITE_BLACK_SMOOTH,
+ GRANITE_RED_STONE,
+ GRANITE_RED_COBBLE,
+ GRANITE_RED_COBBLE_MOSSY,
+ GRANITE_RED_BRICKS,
+ GRANITE_RED_BRICKS_CRACKED,
+ GRANITE_RED_BRICKS_MOSSY,
+ GRANITE_RED_BRICKS_CHISELED,
+ GRANITE_RED_SMOOTH,
+ },
+ CONCRETES = new IIconContainer[]{
+ CONCRETE_DARK_STONE,
+ CONCRETE_DARK_COBBLE,
+ CONCRETE_DARK_COBBLE_MOSSY,
+ CONCRETE_DARK_BRICKS,
+ CONCRETE_DARK_BRICKS_CRACKED,
+ CONCRETE_DARK_BRICKS_MOSSY,
+ CONCRETE_DARK_BRICKS_CHISELED,
+ CONCRETE_DARK_SMOOTH,
+ CONCRETE_LIGHT_STONE,
+ CONCRETE_LIGHT_COBBLE,
+ CONCRETE_LIGHT_COBBLE_MOSSY,
+ CONCRETE_LIGHT_BRICKS,
+ CONCRETE_LIGHT_BRICKS_CRACKED,
+ CONCRETE_LIGHT_BRICKS_MOSSY,
+ CONCRETE_LIGHT_BRICKS_CHISELED,
+ CONCRETE_LIGHT_SMOOTH,
+ },
+ STONES = new IIconContainer[]{
+ MARBLE_STONE,
+ MARBLE_COBBLE,
+ MARBLE_COBBLE_MOSSY,
+ MARBLE_BRICKS,
+ MARBLE_BRICKS_CRACKED,
+ MARBLE_BRICKS_MOSSY,
+ MARBLE_BRICKS_CHISELED,
+ MARBLE_SMOOTH,
+ BASALT_STONE,
+ BASALT_COBBLE,
+ BASALT_COBBLE_MOSSY,
+ BASALT_BRICKS,
+ BASALT_BRICKS_CRACKED,
+ BASALT_BRICKS_MOSSY,
+ BASALT_BRICKS_CHISELED,
+ BASALT_SMOOTH,
+ },
+ TURBINE = new IIconContainer[]{
+ LARGETURBINE_ST1,
+ LARGETURBINE_ST2,
+ LARGETURBINE_ST3,
+ LARGETURBINE_ST4,
+ LARGETURBINE_ST5,
+ LARGETURBINE_ST6,
+ LARGETURBINE_ST7,
+ LARGETURBINE_ST8,
+ LARGETURBINE_ST9
+ },
+ TURBINE_ACTIVE = new IIconContainer[]{
+ LARGETURBINE_ST_ACTIVE1,
+ LARGETURBINE_ST_ACTIVE2,
+ LARGETURBINE_ST_ACTIVE3,
+ LARGETURBINE_ST_ACTIVE4,
+ LARGETURBINE_ST_ACTIVE5,
+ LARGETURBINE_ST_ACTIVE6,
+ LARGETURBINE_ST_ACTIVE7,
+ LARGETURBINE_ST_ACTIVE8,
+ LARGETURBINE_ST_ACTIVE9
+ },
+ TURBINE1 = new IIconContainer[]{
+ LARGETURBINE_SS1,
+ LARGETURBINE_SS2,
+ LARGETURBINE_SS3,
+ LARGETURBINE_SS4,
+ LARGETURBINE_SS5,
+ LARGETURBINE_SS6,
+ LARGETURBINE_SS7,
+ LARGETURBINE_SS8,
+ LARGETURBINE_SS9
+ },
+ TURBINE_ACTIVE1 = new IIconContainer[]{
+ LARGETURBINE_SS_ACTIVE1,
+ LARGETURBINE_SS_ACTIVE2,
+ LARGETURBINE_SS_ACTIVE3,
+ LARGETURBINE_SS_ACTIVE4,
+ LARGETURBINE_SS_ACTIVE5,
+ LARGETURBINE_SS_ACTIVE6,
+ LARGETURBINE_SS_ACTIVE7,
+ LARGETURBINE_SS_ACTIVE8,
+ LARGETURBINE_SS_ACTIVE9
+ },
+ TURBINE2 = new IIconContainer[]{
+ LARGETURBINE_TI1,
+ LARGETURBINE_TI2,
+ LARGETURBINE_TI3,
+ LARGETURBINE_TI4,
+ LARGETURBINE_TI5,
+ LARGETURBINE_TI6,
+ LARGETURBINE_TI7,
+ LARGETURBINE_TI8,
+ LARGETURBINE_TI9
+ },
+ TURBINE_ACTIVE2 = new IIconContainer[]{
+ LARGETURBINE_TI_ACTIVE1,
+ LARGETURBINE_TI_ACTIVE2,
+ LARGETURBINE_TI_ACTIVE3,
+ LARGETURBINE_TI_ACTIVE4,
+ LARGETURBINE_TI_ACTIVE5,
+ LARGETURBINE_TI_ACTIVE6,
+ LARGETURBINE_TI_ACTIVE7,
+ LARGETURBINE_TI_ACTIVE8,
+ LARGETURBINE_TI_ACTIVE9
+ },
+ TURBINE3 = new IIconContainer[]{
+ LARGETURBINE_TU1,
+ LARGETURBINE_TU2,
+ LARGETURBINE_TU3,
+ LARGETURBINE_TU4,
+ LARGETURBINE_TU5,
+ LARGETURBINE_TU6,
+ LARGETURBINE_TU7,
+ LARGETURBINE_TU8,
+ LARGETURBINE_TU9
+ },
+ TURBINE_ACTIVE3 = new IIconContainer[]{
+ LARGETURBINE_TU_ACTIVE1,
+ LARGETURBINE_TU_ACTIVE2,
+ LARGETURBINE_TU_ACTIVE3,
+ LARGETURBINE_TU_ACTIVE4,
+ LARGETURBINE_TU_ACTIVE5,
+ LARGETURBINE_TU_ACTIVE6,
+ LARGETURBINE_TU_ACTIVE7,
+ LARGETURBINE_TU_ACTIVE8,
+ LARGETURBINE_TU_ACTIVE9
+ },
+ CONNECTED_HULLS = new IIconContainer[]{
+ CONCRETE_DARK_STONE,
+ FUSIONI_1,
+ FUSIONI_2,
+ FUSIONI_3,
+ FUSIONI_4,
+ FUSIONI_5,
+ FUSIONI_6,
+ FUSIONI_7,
+ FUSIONI_8,
+ FUSIONI_9,
+ FUSIONI_10,
+ FUSIONI_11,
+ FUSIONI_12,
+ FUSIONII_1,
+ FUSIONII_2,
+ FUSIONII_3,
+ FUSIONII_4,
+ FUSIONII_5,
+ FUSIONII_6,
+ FUSIONII_7,
+ FUSIONII_8,
+ FUSIONII_9,
+ FUSIONII_10,
+ FUSIONII_11,
+ FUSIONII_12,
+ },
+ STORAGE_BLOCKS1 = new IIconContainer[]{
+ BLOCK_ADAMANTIUM,
+ BLOCK_ALUMINIUM,
+ BLOCK_AMERICIUM,
+ BLOCK_ANNEALEDCOPPER,
+ BLOCK_ANTIMONY,
+ BLOCK_ARSENIC,
+ BLOCK_ASTRALSILVER,
+ BLOCK_BATTERYALLOY,
+ BLOCK_BERYLLIUM,
+ BLOCK_BISMUTH,
+ BLOCK_BISMUTHBRONZE,
+ BLOCK_BLACKBRONZE,
+ BLOCK_BLACKSTEEL,
+ BLOCK_BLUEALLOY,
+ BLOCK_BLUESTEEL,
+ BLOCK_BRASS
+ },
+ STORAGE_BLOCKS2 = new IIconContainer[]{
+ BLOCK_BRONZE,
+ BLOCK_CAESIUM,
+ BLOCK_CERIUM,
+ BLOCK_CHROME,
+ BLOCK_CHROMIUMDIOXIDE,
+ BLOCK_COBALT,
+ BLOCK_COBALTBRASS,
+ BLOCK_COPPER,
+ BLOCK_CUPRONICKEL,
+ BLOCK_DAMASCUSSTEEL,
+ BLOCK_DARKIRON,
+ BLOCK_DEEPIRON,
+ BLOCK_DESH,
+ BLOCK_DURANIUM,
+ BLOCK_DYSPROSIUM,
+ BLOCK_ELECTRUM
+ },
+ STORAGE_BLOCKS3 = new IIconContainer[]{
+ BLOCK_ELECTRUMFLUX,
+ BLOCK_ENDERIUM,
+ BLOCK_ERBIUM,
+ BLOCK_EUROPIUM,
+ BLOCK_FIERYSTEEL,
+ BLOCK_GADOLINIUM,
+ BLOCK_GALLIUM,
+ BLOCK_HOLMIUM,
+ BLOCK_HSLA,
+ BLOCK_INDIUM,
+ BLOCK_INFUSEDGOLD,
+ BLOCK_INVAR,
+ BLOCK_IRIDIUM,
+ BLOCK_IRONMAGNETIC,
+ BLOCK_IRONWOOD,
+ BLOCK_KANTHAL
+ },
+ STORAGE_BLOCKS4 = new IIconContainer[]{
+ BLOCK_KNIGHTMETAL,
+ BLOCK_LANTHANUM,
+ BLOCK_LEAD,
+ BLOCK_LUTETIUM,
+ BLOCK_MAGNALIUM,
+ BLOCK_MAGNESIUM,
+ BLOCK_MANGANESE,
+ BLOCK_METEORICIRON,
+ BLOCK_METEORICSTEEL,
+ BLOCK_TRINIUM,
+ BLOCK_MITHRIL,
+ BLOCK_MOLYBDENUM,
+ BLOCK_NAQUADAH,
+ BLOCK_NAQUADAHALLOY,
+ BLOCK_NAQUADAHENRICHED,
+ BLOCK_NAQUADRIA
+ },
+ STORAGE_BLOCKS5 = new IIconContainer[]{
+ BLOCK_NEODYMIUM,
+ BLOCK_NEODYMIUMMAGNETIC,
+ BLOCK_NEUTRONIUM,
+ BLOCK_NICHROME,
+ BLOCK_NICKEL,
+ BLOCK_NIOBIUM,
+ BLOCK_NIOBIUMNITRIDE,
+ BLOCK_NIOBIUMTITANIUM,
+ BLOCK_OSMIRIDIUM,
+ BLOCK_OSMIUM,
+ BLOCK_PALLADIUM,
+ BLOCK_PIGIRON,
+ BLOCK_PLATINUM,
+ BLOCK_PLUTONIUM,
+ BLOCK_PLUTONIUM241,
+ BLOCK_PRASEODYMIUM
+ },
+ STORAGE_BLOCKS6 = new IIconContainer[]{
+ BLOCK_PROMETHIUM,
+ BLOCK_REDALLOY,
+ BLOCK_REDSTEEL,
+ BLOCK_ROSEGOLD,
+ BLOCK_RUBIDIUM,
+ BLOCK_SAMARIUM,
+ BLOCK_SCANDIUM,
+ BLOCK_SHADOWIRON,
+ BLOCK_SHADOWSTEEL,
+ BLOCK_SILICON,
+ BLOCK_SILVER,
+ BLOCK_SOLDERINGALLOY,
+ BLOCK_STAINLESSSTEEL,
+ BLOCK_STEEL,
+ BLOCK_STEELMAGNETIC,
+ BLOCK_STERLINGSILVER
+ },
+ STORAGE_BLOCKS7 = new IIconContainer[]{
+ BLOCK_SUNNARIUM,
+ BLOCK_TANTALUM,
+ BLOCK_TELLURIUM,
+ BLOCK_TERBIUM,
+ BLOCK_THAUMIUM,
+ BLOCK_THORIUM,
+ BLOCK_THULIUM,
+ BLOCK_TIN,
+ BLOCK_TINALLOY,
+ BLOCK_TITANIUM,
+ BLOCK_TRITANIUM,
+ BLOCK_TUNGSTEN,
+ BLOCK_TUNGSTENSTEEL,
+ BLOCK_ULTIMET,
+ BLOCK_URANIUM,
+ BLOCK_URANIUM235
+ },
+ STORAGE_BLOCKS8 = new IIconContainer[]{
+ BLOCK_VANADIUM,
+ BLOCK_VANADIUMGALLIUM,
+ BLOCK_WROUGHTIRON,
+ BLOCK_YTTRBIUM,
+ BLOCK_YTTRIUM,
+ BLOCK_YTTRIUMBARIUMCUPRATE,
+ BLOCK_ZINC,
+ BLOCK_TUNGSTENCARBIDE,
+ BLOCK_VANADIUMSTEEL,
+ BLOCK_HSSG,
+ BLOCK_HSSE,
+ BLOCK_HSSS,
+ BLOCK_STEELEAF,
+ BLOCK_ICHORIUM
+ },
+ STORAGE_BLOCKS9 = new IIconContainer[]{
+ BLOCK_AERCRYSTAL,
+ BLOCK_AMBER,
+ BLOCK_AMETHYST,
+ BLOCK_AQUACRYSTAL,
+ BLOCK_BLUETOPAZ,
+ BLOCK_CERTUSQUARTZ,
+ BLOCK_DILITHIUM,
+ BLOCK_ENDEREYE,
+ BLOCK_ENDERPEARL,
+ BLOCK_FOOLSRUBY,
+ BLOCK_FORCE,
+ BLOCK_FORCICIUM,
+ BLOCK_FORCILLIUM,
+ BLOCK_GREENSAPPHIRE,
+ BLOCK_IGNISCRYSTAL,
+ BLOCK_JASPER
+ },
+ STORAGE_BLOCKS10 = new IIconContainer[]{
+ BLOCK_LAZURITE,
+ BLOCK_LIGNITE,
+ BLOCK_MONAZITE,
+ BLOCK_NITER,
+ BLOCK_OLIVINE,
+ BLOCK_OPAL,
+ BLOCK_ORDOCRYSTAL,
+ BLOCK_PERDITIOCRYSTAL,
+ BLOCK_PHOSPHORUS,
+ BLOCK_QUARTZITE,
+ BLOCK_REDGARNET,
+ BLOCK_RUBY,
+ BLOCK_SAPPHIRE,
+ BLOCK_SODALITE,
+ BLOCK_TANZANITE,
+ BLOCK_TERRACRYSTAL
+ },
+ STORAGE_BLOCKS11 = new IIconContainer[]{
+ BLOCK_TOPAZ,
+ BLOCK_VINTEUM,
+ BLOCK_YELLOWGARNET,
+ BLOCK_NETHERSTAR,
+ BLOCK_CHARCOAL,
+ BLOCK_BLAZE
+ };
+ public static ITexture[]
+ ERROR_RENDERING = new ITexture[]{
+ new GT_RenderedTexture(RENDERING_ERROR)
+ },
+ OVERLAYS_ENERGY_IN = new ITexture[]{
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{180, 180, 180, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{220, 220, 220, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{255, 100, 0, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{255, 255, 30, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{128, 128, 128, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{240, 240, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{220, 220, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{200, 200, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{180, 180, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{160, 160, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{140, 140, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{120, 120, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{100, 100, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{80, 80, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{60, 60, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{40, 40, 245, 0}),
+ },
+ OVERLAYS_ENERGY_OUT = new ITexture[]{
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{180, 180, 180, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{220, 220, 220, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{255, 100, 0, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{255, 255, 30, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{128, 128, 128, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{240, 240, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{220, 220, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{200, 200, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{180, 180, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{160, 160, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{140, 140, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{120, 120, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{100, 100, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{80, 80, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{60, 60, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{40, 40, 245, 0}),
+ },
+ OVERLAYS_ENERGY_IN_MULTI = new ITexture[]{
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{180, 180, 180, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{220, 220, 220, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{255, 100, 0, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{255, 255, 30, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{128, 128, 128, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{240, 240, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{220, 220, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{200, 200, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{180, 180, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{160, 160, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{140, 140, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{120, 120, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{100, 100, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{80, 80, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{60, 60, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{40, 40, 245, 0}),
+ },
+ OVERLAYS_ENERGY_OUT_MULTI = new ITexture[]{
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{180, 180, 180, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{220, 220, 220, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{255, 100, 0, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{255, 255, 30, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{128, 128, 128, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{240, 240, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{220, 220, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{200, 200, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{180, 180, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{160, 160, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{140, 140, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{120, 120, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{100, 100, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{80, 80, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{60, 60, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{40, 40, 245, 0}),
+ },
+ OVERLAYS_ENERGY_IN_POWER = new ITexture[]{
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{180, 180, 180, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{220, 220, 220, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{255, 100, 0, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{255, 255, 30, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{128, 128, 128, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{240, 240, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{220, 220, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{200, 200, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{180, 180, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{160, 160, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{140, 140, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{120, 120, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{100, 100, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{80, 80, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{60, 60, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{40, 40, 245, 0}),
+ },
+ OVERLAYS_ENERGY_OUT_POWER = new ITexture[]{
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{180, 180, 180, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{220, 220, 220, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{255, 100, 0, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{255, 255, 30, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{128, 128, 128, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{240, 240, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{220, 220, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{200, 200, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{180, 180, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{160, 160, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{140, 140, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{120, 120, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{100, 100, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{80, 80, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{60, 60, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{40, 40, 245, 0}),
+ },
+ LOCKERS = new ITexture[]{
+ new GT_RenderedTexture(OVERLAY_LOCKER_000),
+ new GT_RenderedTexture(OVERLAY_LOCKER_001),
+ new GT_RenderedTexture(OVERLAY_LOCKER_002),
+ new GT_RenderedTexture(OVERLAY_LOCKER_003),
+ new GT_RenderedTexture(OVERLAY_LOCKER_004),
+ new GT_RenderedTexture(OVERLAY_LOCKER_005),
+ new GT_RenderedTexture(OVERLAY_LOCKER_006),
+ new GT_RenderedTexture(OVERLAY_LOCKER_007),
+ new GT_RenderedTexture(OVERLAY_LOCKER_008),
+ new GT_RenderedTexture(OVERLAY_LOCKER_009),
+ new GT_RenderedTexture(OVERLAY_LOCKER_010),
+ new GT_RenderedTexture(OVERLAY_LOCKER_011),
+ new GT_RenderedTexture(OVERLAY_LOCKER_012),
+ new GT_RenderedTexture(OVERLAY_LOCKER_013),
+ },
+ CASING_BLOCKS = new ITexture[128],//original variable still limited to 128
+ MACHINE_CASINGS[] = new ITexture[16][17];
+
+ public static ITexture[][] casingTexturePages = new ITexture[128][];//page holder so we don't make an short long array
+
+ static {
+ for (byte i = 0; i < MACHINE_CASINGS.length; i++)
+ for (byte j = 0; j < MACHINE_CASINGS[i].length; j++)
+ MACHINE_CASINGS[i][j] = new GT_SidedTexture(MACHINECASINGS_BOTTOM[i], MACHINECASINGS_TOP[i], MACHINECASINGS_SIDE[i], Dyes.getModulation(j - 1, Dyes.MACHINE_METAL.mRGBa));
+ casingTexturePages[0]=CASING_BLOCKS;
+ if(casingTexturePages[8]==null)
+ casingTexturePages[8]=new ITexture[128];
+ }
+
+ protected IIcon mIcon;
+
+ private BlockIcons() {
+ GregTech_API.sGTBlockIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return null;
+ }
+
+ @Override
+ public void run() {
+ mIcon = GregTech_API.sBlockIcons.registerIcon(RES_PATH_BLOCK + "iconsets/" + this);
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationBlocksTexture;
+ }
+
+ public static class CustomIcon implements IIconContainer, Runnable {
+ protected IIcon mIcon;
+ protected String mIconName;
+
+ public CustomIcon(String aIconName) {
+ mIconName = aIconName;
+ GregTech_API.sGTBlockIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return null;
+ }
+
+ @Override
+ public void run() {
+ mIcon = GregTech_API.sBlockIcons.registerIcon(RES_PATH_BLOCK + mIconName);
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationBlocksTexture;
+ }
+ }
+ }
+
+ public enum ItemIcons implements IIconContainer, Runnable {
+ VOID // The Empty Texture
+ , RENDERING_ERROR, WRENCH, MORTAR, CROWBAR, JACKHAMMER, WIRE_CUTTER, KNIFE, BUTCHERYKNIFE, SICKLE, SCOOP, GRAFTER, PLUNGER, ROLLING_PIN, HANDLE_SWORD, HANDLE_FILE, HANDLE_SAW, HANDLE_SCREWDRIVER, HANDLE_BUZZSAW, HANDLE_ELECTRIC_SCREWDRIVER, HANDLE_SOLDERING, POWER_UNIT_LV, POWER_UNIT_MV, POWER_UNIT_HV, DURABILITY_BAR_0, DURABILITY_BAR_1, DURABILITY_BAR_2, DURABILITY_BAR_3, DURABILITY_BAR_4, DURABILITY_BAR_5, DURABILITY_BAR_6, DURABILITY_BAR_7, DURABILITY_BAR_8, ENERGY_BAR_0, ENERGY_BAR_1, ENERGY_BAR_2, ENERGY_BAR_3, ENERGY_BAR_4, ENERGY_BAR_5, ENERGY_BAR_6, ENERGY_BAR_7, ENERGY_BAR_8, TURBINE, TURBINE_SMALL, TURBINE_LARGE, TURBINE_HUGE;
+
+ public static final IIconContainer[]
+ DURABILITY_BAR = new IIconContainer[]{
+ DURABILITY_BAR_0,
+ DURABILITY_BAR_1,
+ DURABILITY_BAR_2,
+ DURABILITY_BAR_3,
+ DURABILITY_BAR_4,
+ DURABILITY_BAR_5,
+ DURABILITY_BAR_6,
+ DURABILITY_BAR_7,
+ DURABILITY_BAR_8,
+ },
+ ENERGY_BAR = new IIconContainer[]{
+ ENERGY_BAR_0,
+ ENERGY_BAR_1,
+ ENERGY_BAR_2,
+ ENERGY_BAR_3,
+ ENERGY_BAR_4,
+ ENERGY_BAR_5,
+ ENERGY_BAR_6,
+ ENERGY_BAR_7,
+ ENERGY_BAR_8,
+ };
+
+ public static final ITexture[] ERROR_RENDERING = new ITexture[]{new GT_RenderedTexture(RENDERING_ERROR)};
+
+ protected IIcon mIcon, mOverlay;
+
+ private ItemIcons() {
+ GregTech_API.sGTItemIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return mOverlay;
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationItemsTexture;
+ }
+
+ @Override
+ public void run() {
+ mIcon = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + "iconsets/" + this);
+ mOverlay = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + "iconsets/" + this + "_OVERLAY");
+ }
+
+ public static class CustomIcon implements IIconContainer, Runnable {
+ protected IIcon mIcon, mOverlay;
+ protected String mIconName;
+
+ public CustomIcon(String aIconName) {
+ mIconName = aIconName;
+ GregTech_API.sGTItemIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return mOverlay;
+ }
+
+ @Override
+ public void run() {
+ mIcon = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + mIconName);
+ mOverlay = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + mIconName + "_OVERLAY");
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationItemsTexture;
+ }
+ }
+ }
+}
diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IConnectable.java b/src/main/java/gregtech/api/interfaces/metatileentity/IConnectable.java
new file mode 100644
index 0000000000..c1391371b9
--- /dev/null
+++ b/src/main/java/gregtech/api/interfaces/metatileentity/IConnectable.java
@@ -0,0 +1,16 @@
+package gregtech.api.interfaces.metatileentity;
+
+/**
+ * For pipes, wires, and other MetaTiles which need to be decided whether they should connect to the block at each side.
+ */
+public interface IConnectable {
+ /**
+ * Try to connect to the Block at the specified side
+ * returns the connection state. Non-positive values for failed, others for succeeded.
+ */
+ public int connect(byte aSide);
+ /**
+ * Try to disconnect to the Block at the specified side
+ */
+ public void disconnect(byte aSide);
+}
diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java
index 5a3f8c2227..f8498fe1e4 100644
--- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java
@@ -1,1316 +1,1327 @@
-package gregtech.api.metatileentity;
-
-import cpw.mods.fml.common.FMLLog;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.interfaces.tileentity.IPipeRenderedTileEntity;
-import gregtech.api.net.GT_Packet_TileEntity;
-import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.util.*;
-import net.minecraft.block.Block;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-import net.minecraft.network.Packet;
-import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.FluidTankInfo;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import static gregtech.api.enums.GT_Values.NW;
-
-/**
- * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
- * <p/>
- * This is the main TileEntity for EVERYTHING.
- */
-public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileEntity, IPipeRenderedTileEntity {
- private final GT_CoverBehavior[] mCoverBehaviors = new GT_CoverBehavior[]{GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior};
- public byte mConnections = 0;
- protected MetaPipeEntity mMetaTileEntity;
- private byte[] mSidedRedstone = new byte[]{0, 0, 0, 0, 0, 0};
- private int[] mCoverSides = new int[]{0, 0, 0, 0, 0, 0}, mCoverData = new int[]{0, 0, 0, 0, 0, 0}, mTimeStatistics = new int[GregTech_API.TICKS_FOR_LAG_AVERAGING];
- private boolean mInventoryChanged = false, mWorkUpdate = false, mWorks = true, mNeedsUpdate = true, mNeedsBlockUpdate = true, mSendClientData = false;
- private byte mColor = 0, oColor = 0, mStrongRedstone = 0, oRedstoneData = 63, oTextureData = 0, oUpdateData = 0, mLagWarningCount = 0;
- private int oX = 0, oY = 0, oZ = 0, mTimeStatisticsIndex = 0;
- private short mID = 0;
- private long mTickTimer = 0;
-
- public BaseMetaPipeEntity() {
- }
-
- @Override
- public void writeToNBT(NBTTagCompound aNBT) {
- try {
- super.writeToNBT(aNBT);
- } catch (Throwable e) {
- GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- try {
- aNBT.setInteger("mID", mID);
- aNBT.setIntArray("mCoverData", mCoverData);
- aNBT.setIntArray("mCoverSides", mCoverSides);
- aNBT.setByteArray("mRedstoneSided", mSidedRedstone);
- aNBT.setByte("mConnections", mConnections);
- aNBT.setByte("mColor", mColor);
- aNBT.setByte("mStrongRedstone", mStrongRedstone);
- aNBT.setBoolean("mWorks", !mWorks);
- } catch (Throwable e) {
- GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- try {
- if (hasValidMetaTileEntity()) {
- NBTTagList tItemList = new NBTTagList();
- for (int i = 0; i < mMetaTileEntity.getRealInventory().length; i++) {
- ItemStack tStack = mMetaTileEntity.getRealInventory()[i];
- if (tStack != null) {
- NBTTagCompound tTag = new NBTTagCompound();
- tTag.setInteger("IntSlot", i);
- tStack.writeToNBT(tTag);
- tItemList.appendTag(tTag);
- }
- }
- aNBT.setTag("Inventory", tItemList);
-
- try {
- mMetaTileEntity.saveNBTData(aNBT);
- } catch (Throwable e) {
- GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- }
- } catch (Throwable e) {
- GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- }
-
- @Override
- public void readFromNBT(NBTTagCompound aNBT) {
- super.readFromNBT(aNBT);
- setInitialValuesAsNBT(aNBT, (short) 0);
- }
-
- @Override
- public void setInitialValuesAsNBT(NBTTagCompound aNBT, short aID) {
- if (aNBT == null) {
- if (aID > 0) mID = aID;
- else mID = mID > 0 ? mID : 0;
- if (mID != 0) createNewMetatileEntity(mID);
- } else {
- if (aID <= 0) mID = (short) aNBT.getInteger("mID");
- else mID = aID;
- mCoverSides = aNBT.getIntArray("mCoverSides");
- mCoverData = aNBT.getIntArray("mCoverData");
- mSidedRedstone = aNBT.getByteArray("mRedstoneSided");
- mConnections = aNBT.getByte("mConnections");
- mColor = aNBT.getByte("mColor");
- mStrongRedstone = aNBT.getByte("mStrongRedstone");
- mWorks = !aNBT.getBoolean("mWorks");
-
- if (mCoverData.length != 6) mCoverData = new int[]{0, 0, 0, 0, 0, 0};
- if (mCoverSides.length != 6) mCoverSides = new int[]{0, 0, 0, 0, 0, 0};
- if (mSidedRedstone.length != 6) mSidedRedstone = new byte[]{0, 0, 0, 0, 0, 0};
-
- for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
-
- if (mID != 0 && createNewMetatileEntity(mID)) {
- NBTTagList tItemList = aNBT.getTagList("Inventory", 10);
- for (int i = 0; i < tItemList.tagCount(); i++) {
- NBTTagCompound tTag = tItemList.getCompoundTagAt(i);
- int tSlot = tTag.getInteger("IntSlot");
- if (tSlot >= 0 && tSlot < mMetaTileEntity.getRealInventory().length) {
- mMetaTileEntity.getRealInventory()[tSlot] = GT_Utility.loadItem(tTag);
- }
- }
-
- try {
- mMetaTileEntity.loadNBTData(aNBT);
- } catch (Throwable e) {
- GT_Log.err.println("Encountered Exception while loading MetaTileEntity, the Server should've crashed now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- }
- }
-
- if (mCoverData.length != 6) mCoverData = new int[]{0, 0, 0, 0, 0, 0};
- if (mCoverSides.length != 6) mCoverSides = new int[]{0, 0, 0, 0, 0, 0};
- if (mSidedRedstone.length != 6) mSidedRedstone = new byte[]{0, 0, 0, 0, 0, 0};
-
- for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
- }
-
- private boolean createNewMetatileEntity(short aID) {
- if (aID <= 0 || aID >= GregTech_API.METATILEENTITIES.length || GregTech_API.METATILEENTITIES[aID] == null) {
- GT_Log.err.println("MetaID " + aID + " not loadable => locking TileEntity!");
- } else {
- if (hasValidMetaTileEntity()) mMetaTileEntity.setBaseMetaTileEntity(null);
- GregTech_API.METATILEENTITIES[aID].newMetaEntity(this).setBaseMetaTileEntity(this);
- mTickTimer = 0;
- mID = aID;
- return true;
- }
- return false;
- }
-
- @Override
- public void updateEntity() {
- super.updateEntity();
-
- if (!hasValidMetaTileEntity()) {
- if (mMetaTileEntity == null) return;
- mMetaTileEntity.setBaseMetaTileEntity(this);
- }
-
- long tTime = System.currentTimeMillis();
- int tCode = 0;
-
- try { for (tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) {
- switch (tCode) {
- case 0:
- tCode++;
- if (mTickTimer++ == 0) {
- oX = xCoord;
- oY = yCoord;
- oZ = zCoord;
- if (isServerSide()) for (byte i = 0; i < 6; i++)
- if (getCoverIDAtSide(i) != 0)
- if (!mMetaTileEntity.allowCoverOnSide(i, new GT_ItemStack(getCoverIDAtSide(i))))
- dropCover(i, i, true);
- worldObj.markTileEntityChunkModified(xCoord, yCoord, zCoord, this);
- mMetaTileEntity.onFirstTick(this);
- if (!hasValidMetaTileEntity()) return;
- }
- case 1:
- tCode++;
- if (isClientSide()) {
- if (mColor != oColor) {
- mMetaTileEntity.onColorChangeClient(oColor = mColor);
- issueTextureUpdate();
- }
-
- if (mNeedsUpdate) {
- worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
- //worldObj.func_147479_m(xCoord, yCoord, zCoord);
- mNeedsUpdate = false;
- }
- }
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- if (isServerSide() && mTickTimer > 10) {
- for (byte i = (byte) (tCode - 2); i < 6; i++)
- if (getCoverIDAtSide(i) != 0) {
- tCode++;
- GT_CoverBehavior tCover = getCoverBehaviorAtSide(i);
- int tCoverTickRate = tCover.getTickRate(i, getCoverIDAtSide(i), mCoverData[i], this);
- if (tCoverTickRate > 0 && mTickTimer % tCoverTickRate == 0) {
- mCoverData[i] = tCover.doCoverThings(i, getInputRedstoneSignal(i), getCoverIDAtSide(i), mCoverData[i], this, mTickTimer);
- if (!hasValidMetaTileEntity()) return;
- }
- }
- mConnections = (byte) (mMetaTileEntity.mConnections | (mConnections & ~63));
- if ((mConnections & -64) == 64 && getRandomNumber(1000) == 0) {
- mConnections = (byte) ((mConnections & ~64) | -128);
- }
- }
- case 8:
- tCode = 9;
- mMetaTileEntity.onPreTick(this, mTickTimer);
- if (!hasValidMetaTileEntity()) return;
- case 9:
- tCode++;
- if (isServerSide()) {
- if (mTickTimer == 10) {
- for (byte i = 0; i < 6; i++)
- mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
- issueBlockUpdate();
- }
-
- if (xCoord != oX || yCoord != oY || zCoord != oZ) {
- oX = xCoord;
- oY = yCoord;
- oZ = zCoord;
- issueClientUpdate();
- clearTileEntityBuffer();
- }
- }
- case 10:
- tCode++;
- mMetaTileEntity.onPostTick(this, mTickTimer);
- if (!hasValidMetaTileEntity()) return;
- case 11:
- tCode++;
- if (isServerSide()) {
- if (mTickTimer % 10 == 0) {
- if (mSendClientData) {
- NW.sendPacketToAllPlayersInRange(worldObj, new GT_Packet_TileEntity(xCoord, (short) yCoord, zCoord, mID, mCoverSides[0], mCoverSides[1], mCoverSides[2], mCoverSides[3], mCoverSides[4], mCoverSides[5], oTextureData = mConnections, oUpdateData = hasValidMetaTileEntity() ? mMetaTileEntity.getUpdateData() : 0, oRedstoneData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) | ((mSidedRedstone[2] > 0) ? 4 : 0) | ((mSidedRedstone[3] > 0) ? 8 : 0) | ((mSidedRedstone[4] > 0) ? 16 : 0) | ((mSidedRedstone[5] > 0) ? 32 : 0)), oColor = mColor), xCoord, zCoord);
- mSendClientData = false;
- }
- }
-
- if (mTickTimer > 10) {
- if (mConnections != oTextureData) sendBlockEvent((byte) 0, oTextureData = mConnections);
- byte tData = mMetaTileEntity.getUpdateData();
- if (tData != oUpdateData) sendBlockEvent((byte) 1, oUpdateData = tData);
- if (mColor != oColor) sendBlockEvent((byte) 2, oColor = mColor);
- tData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) | ((mSidedRedstone[2] > 0) ? 4 : 0) | ((mSidedRedstone[3] > 0) ? 8 : 0) | ((mSidedRedstone[4] > 0) ? 16 : 0) | ((mSidedRedstone[5] > 0) ? 32 : 0));
- if (tData != oRedstoneData) sendBlockEvent((byte) 3, oRedstoneData = tData);
- }
-
- if (mNeedsBlockUpdate) {
- worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockOffset(0, 0, 0));
- mNeedsBlockUpdate = false;
- }
- }
- default:
- tCode = -1;
- break;
- }
- }
- } catch (Throwable e) {
- //GT_Log.err.println("Encountered Exception while ticking MetaTileEntity in Step " + (tCode - 1) + ". The Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
-
- if (isServerSide() && hasValidMetaTileEntity()) {
- tTime = System.currentTimeMillis() - tTime;
- if (mTimeStatistics.length > 0)
- mTimeStatistics[mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) % mTimeStatistics.length] = (int) tTime;
- if (tTime > 0 && tTime > GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING && mTickTimer > 1000 && getMetaTileEntity().doTickProfilingMessageDuringThisTick() && mLagWarningCount++ < 10)
- FMLLog.warning("WARNING: Possible Lag Source at [%s,%s,%s] in Dimension %s with %s ms caused by an instance of %s", xCoord, yCoord, zCoord, worldObj.provider.dimensionId, tTime, getMetaTileEntity().getClass());
- }
-
- mWorkUpdate = mInventoryChanged = false;
- }
-
- @Override
- public Packet getDescriptionPacket() {
- issueClientUpdate();
- return null;
- }
-
- public final void receiveMetaTileEntityData(short aID, int aCover0, int aCover1, int aCover2, int aCover3, int aCover4, int aCover5, byte aTextureData, byte aUpdateData, byte aRedstoneData, byte aColorData) {
- issueTextureUpdate();
- if (aID > 0 && mID != aID) {
- mID = aID;
- createNewMetatileEntity(mID);
- }
-
- mCoverSides[0] = aCover0;
- mCoverSides[1] = aCover1;
- mCoverSides[2] = aCover2;
- mCoverSides[3] = aCover3;
- mCoverSides[4] = aCover4;
- mCoverSides[5] = aCover5;
-
- for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
-
- receiveClientEvent(0, aTextureData);
- receiveClientEvent(1, aUpdateData);
- receiveClientEvent(2, aColorData);
- receiveClientEvent(3, aRedstoneData);
- }
-
- @Override
- public boolean receiveClientEvent(int aEventID, int aValue) {
- super.receiveClientEvent(aEventID, aValue);
-
- if (hasValidMetaTileEntity()) {
- try {
- mMetaTileEntity.receiveClientEvent((byte) aEventID, (byte) aValue);
- } catch (Throwable e) {
- GT_Log.err.println("Encountered Exception while receiving Data from the Server, the Client should've been crashed by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- }
-
- if (isClientSide()) {
- issueTextureUpdate();
- switch (aEventID) {
- case 0:
- mConnections = (byte) aValue;
- break;
- case 1:
- if (hasValidMetaTileEntity()) mMetaTileEntity.onValueUpdate((byte) aValue);
- break;
- case 2:
- if (aValue > 16 || aValue < 0) aValue = 0;
- mColor = (byte) aValue;
- break;
- case 3:
- mSidedRedstone[0] = (byte) ((aValue & 1) == 1 ? 15 : 0);
- mSidedRedstone[1] = (byte) ((aValue & 2) == 2 ? 15 : 0);
- mSidedRedstone[2] = (byte) ((aValue & 4) == 4 ? 15 : 0);
- mSidedRedstone[3] = (byte) ((aValue & 8) == 8 ? 15 : 0);
- mSidedRedstone[4] = (byte) ((aValue & 16) == 16 ? 15 : 0);
- mSidedRedstone[5] = (byte) ((aValue & 32) == 32 ? 15 : 0);
- break;
- case 4:
- if (hasValidMetaTileEntity() && mTickTimer > 20)
- mMetaTileEntity.doSound((byte) aValue, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
- break;
- case 5:
- if (hasValidMetaTileEntity() && mTickTimer > 20)
- mMetaTileEntity.startSoundLoop((byte) aValue, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
- break;
- case 6:
- if (hasValidMetaTileEntity() && mTickTimer > 20)
- mMetaTileEntity.stopSoundLoop((byte) aValue, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
- break;
- }
- }
- return true;
- }
-
- public ArrayList<String> getDebugInfo(EntityPlayer aPlayer, int aLogLevel) {
- ArrayList<String> tList = new ArrayList<String>();
- if (aLogLevel > 2) {
- tList.add("Meta-ID: " + EnumChatFormatting.BLUE+ mID +EnumChatFormatting.RESET + (hasValidMetaTileEntity() ? EnumChatFormatting.GREEN+" valid"+EnumChatFormatting.RESET : EnumChatFormatting.RED+" invalid"+EnumChatFormatting.RESET) + (mMetaTileEntity == null ? EnumChatFormatting.RED+" MetaTileEntity == null!"+EnumChatFormatting.RESET : " "));
- }
- if (aLogLevel > 1) {
- if (mTimeStatistics.length > 0) {
- double tAverageTime = 0;
- for (int tTime : mTimeStatistics) tAverageTime += tTime;
- tList.add("Average CPU-load of ~" + (tAverageTime / mTimeStatistics.length) + "ms since " + mTimeStatistics.length + " ticks.");
- }
- if (mLagWarningCount > 0) {
- tList.add("Caused " + (mLagWarningCount >= 10 ? "more than 10" : mLagWarningCount) + " Lag Spike Warnings (anything taking longer than " + GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING + "ms) on the Server.");
- }
- tList.add("Is" + (mMetaTileEntity.isAccessAllowed(aPlayer) ? " " : EnumChatFormatting.RED+" not "+EnumChatFormatting.RESET) + "accessible for you");
- }
- return mMetaTileEntity.getSpecialDebugInfo(this, aPlayer, aLogLevel, tList);
- }
-
- @Override
- public void issueTextureUpdate() {
- mNeedsUpdate = true;
- }
-
- @Override
- public void issueBlockUpdate() {
- mNeedsBlockUpdate = true;
- }
-
- @Override
- public void issueClientUpdate() {
- mSendClientData = true;
- }
-
- @Override
- public void issueCoverUpdate(byte aSide) {
- issueClientUpdate();
- }
-
- @Override
- public byte getStrongestRedstone() {
- return (byte) Math.max(getInternalInputRedstoneSignal((byte) 0), Math.max(getInternalInputRedstoneSignal((byte) 1), Math.max(getInternalInputRedstoneSignal((byte) 2), Math.max(getInternalInputRedstoneSignal((byte) 3), Math.max(getInternalInputRedstoneSignal((byte) 4), getInternalInputRedstoneSignal((byte) 5))))));
- }
-
- @Override
- public boolean getRedstone() {
- return getRedstone((byte) 0) || getRedstone((byte) 1) || getRedstone((byte) 2) || getRedstone((byte) 3) || getRedstone((byte) 4) || getRedstone((byte) 5);
- }
-
- @Override
- public boolean getRedstone(byte aSide) {
- return getInternalInputRedstoneSignal(aSide) > 0;
- }
-
- public ITexture getCoverTexture(byte aSide) {
- return GregTech_API.sCovers.get(new GT_ItemStack(getCoverIDAtSide(aSide)));
- }
-
- @Override
- public boolean isGivingInformation() {
- if (canAccessData()) return mMetaTileEntity.isGivingInformation();
- return false;
- }
-
- @Override
- public boolean isValidFacing(byte aSide) {
- if (canAccessData()) return mMetaTileEntity.isFacingValid(aSide);
- return false;
- }
-
- @Override
- public byte getBackFacing() {
- return GT_Utility.getOppositeSide(getFrontFacing());
- }
-
- @Override
- public byte getFrontFacing() {
- return 6;
- }
-
- @Override
- public void setFrontFacing(byte aFacing) {/*Do nothing*/}
-
- @Override
- public int getSizeInventory() {
- if (canAccessData()) return mMetaTileEntity.getSizeInventory();
- return 0;
- }
-
- @Override
- public ItemStack getStackInSlot(int aIndex) {
- if (canAccessData()) return mMetaTileEntity.getStackInSlot(aIndex);
- return null;
- }
-
- @Override
- public void setInventorySlotContents(int aIndex, ItemStack aStack) {
- mInventoryChanged = true;
- if (canAccessData())
- mMetaTileEntity.setInventorySlotContents(aIndex, worldObj.isRemote ? aStack : GT_OreDictUnificator.setStack(true, aStack));
- }
-
- @Override
- public String getInventoryName() {
- if (canAccessData()) return mMetaTileEntity.getInventoryName();
- if (GregTech_API.METATILEENTITIES[mID] != null) return GregTech_API.METATILEENTITIES[mID].getInventoryName();
- return "";
- }
-
- @Override
- public int getInventoryStackLimit() {
- if (canAccessData()) return mMetaTileEntity.getInventoryStackLimit();
- return 64;
- }
-
- @Override
- public void openInventory() {/*Do nothing*/}
-
- @Override
- public void closeInventory() {/*Do nothing*/}
-
- @Override
- public boolean isUseableByPlayer(EntityPlayer aPlayer) {
- return hasValidMetaTileEntity() && mTickTimer > 40 && getTileEntityOffset(0, 0, 0) == this && aPlayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64 && mMetaTileEntity.isAccessAllowed(aPlayer);
- }
-
- @Override
- public void validate() {
- super.validate();
- mTickTimer = 0;
- }
-
- @Override
- public void invalidate() {
- tileEntityInvalid = false;
- if (hasValidMetaTileEntity()) {
- mMetaTileEntity.onRemoval();
- mMetaTileEntity.setBaseMetaTileEntity(null);
- }
- super.invalidate();
- }
-
- @Override
- public void onChunkUnload() {
- super.onChunkUnload();
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return false;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(int slot) {
- ItemStack stack = getStackInSlot(slot);
- if (stack != null) setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void onMachineBlockUpdate() {
- if (canAccessData()) mMetaTileEntity.onMachineBlockUpdate();
- }
-
- @Override
- public int getProgress() {
- return canAccessData() ? mMetaTileEntity.getProgresstime() : 0;
- }
-
- @Override
- public int getMaxProgress() {
- return canAccessData() ? mMetaTileEntity.maxProgresstime() : 0;
- }
-
- @Override
- public boolean increaseProgress(int aProgressAmountInTicks) {
- return canAccessData() ? mMetaTileEntity.increaseProgress(aProgressAmountInTicks) != aProgressAmountInTicks : false;
- }
-
- @Override
- public boolean hasThingsToDo() {
- return getMaxProgress() > 0;
- }
-
- @Override
- public void enableWorking() {
- if (!mWorks) mWorkUpdate = true;
- mWorks = true;
- }
-
- @Override
- public void disableWorking() {
- mWorks = false;
- }
-
- @Override
- public boolean isAllowedToWork() {
- return mWorks;
- }
-
- @Override
- public boolean hasWorkJustBeenEnabled() {
- return mWorkUpdate;
- }
-
- @Override
- public byte getWorkDataValue() {
- return 0;
- }
-
- @Override
- public void setWorkDataValue(byte aValue) {/*Do nothing*/}
-
- @Override
- public int getMetaTileID() {
- return mID;
- }
-
- @Override
- public int setMetaTileID(short aID) {
- return mID = aID;
- }
-
- @Override
- public boolean isActive() {
- return false;
- }
-
- @Override
- public void setActive(boolean aActive) {/*Do nothing*/}
-
- @Override
- public long getTimer() {
- return mTickTimer;
- }
-
- @Override
- public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) {
- return false;
- }
-
- @Override
- public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy) {
- return false;
- }
-
- @Override
- public boolean inputEnergyFrom(byte aSide) {
- return false;
- }
-
- @Override
- public boolean outputsEnergyTo(byte aSide) {
- return false;
- }
-
- @Override
- public long getOutputAmperage() {
- return 0;
- }
-
- @Override
- public long getOutputVoltage() {
- return 0;
- }
-
- @Override
- public long getInputAmperage() {
- return 0;
- }
-
- @Override
- public long getInputVoltage() {
- return 0;
- }
-
- @Override
- public boolean increaseStoredSteam(long aEnergy, boolean aIgnoreTooMuchEnergy) {
- return false;
- }
-
- @Override
- public String[] getDescription() {
- if (canAccessData()) return mMetaTileEntity.getDescription();
- return new String[0];
- }
-
- @Override
- public boolean isValidSlot(int aIndex) {
- if (canAccessData()) return mMetaTileEntity.isValidSlot(aIndex);
- return false;
- }
-
- @Override
- public long getUniversalEnergyStored() {
- return Math.max(getStoredEU(), getStoredSteam());
- }
-
- @Override
- public long getUniversalEnergyCapacity() {
- return Math.max(getEUCapacity(), getSteamCapacity());
- }
-
- @Override
- public long getStoredEU() {
- return 0;
- }
-
- @Override
- public long getEUCapacity() {
- return 0;
- }
-
- @Override
- public long getStoredSteam() {
- return 0;
- }
-
- @Override
- public long getSteamCapacity() {
- return 0;
- }
-
- @Override
- public ITexture[] getTexture(Block aBlock, byte aSide) {
- ITexture rIcon = getCoverTexture(aSide);
- if (rIcon != null) return new ITexture[]{rIcon};
- return getTextureUncovered(aSide);
- }
-
- @Override
- public ITexture[] getTextureUncovered(byte aSide) {
- if ((mConnections & 64) != 0) return Textures.BlockIcons.FRESHFOAM;
- if ((mConnections & -128) != 0) return Textures.BlockIcons.HARDENEDFOAMS[mColor];
- if ((mConnections & -64) != 0) return Textures.BlockIcons.ERROR_RENDERING;
- byte tConnections = mConnections;
- if (tConnections == 1 || tConnections == 2) tConnections = 3;
- else if (tConnections == 4 || tConnections == 8) tConnections = 12;
- else if (tConnections == 16 || tConnections == 32) tConnections = 48;
- if (hasValidMetaTileEntity())
- return mMetaTileEntity.getTexture(this, aSide, tConnections, (byte) (mColor - 1), tConnections == 0 || (tConnections & (1 << aSide)) != 0, getOutputRedstoneSignal(aSide) > 0);
- return Textures.BlockIcons.ERROR_RENDERING;
- }
-
- protected boolean hasValidMetaTileEntity() {
- return mMetaTileEntity != null && mMetaTileEntity.getBaseMetaTileEntity() == this;
- }
-
- protected boolean canAccessData() {
- return hasValidMetaTileEntity() && !isDead;
- }
-
- @Override
- public void doExplosion(long aAmount) {
- if (canAccessData()) {
- mMetaTileEntity.onExplosion();
- mMetaTileEntity.doExplosion(aAmount);
- }
- }
-
- @Override
- public ArrayList<ItemStack> getDrops() {
- ItemStack rStack = new ItemStack(GregTech_API.sBlockMachines, 1, mID);
- NBTTagCompound tNBT = new NBTTagCompound();
- if (mStrongRedstone > 0) tNBT.setByte("mStrongRedstone", mStrongRedstone);
- for (byte i = 0; i < mCoverSides.length; i++) {
- if (mCoverSides[i] != 0) {
- tNBT.setIntArray("mCoverData", mCoverData);
- tNBT.setIntArray("mCoverSides", mCoverSides);
- break;
- }
- }
- if (hasValidMetaTileEntity()) mMetaTileEntity.setItemNBT(tNBT);
- if (!tNBT.hasNoTags()) rStack.setTagCompound(tNBT);
- return new ArrayList<ItemStack>(Arrays.asList(rStack));
- }
-
- @Override
- public boolean onRightclick(EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
- if (isClientSide()) {
- if (getCoverBehaviorAtSide(aSide).onCoverRightclickClient(aSide, this, aPlayer, aX, aY, aZ)) return true;
- }
- if (isServerSide()) {
- ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
- if (tCurrentItem != null) {
- if (getColorization() >= 0 && GT_Utility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) {
- tCurrentItem.func_150996_a(Items.bucket);
- setColorization((byte) -1);
- return true;
- }
- byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList)) {
- if (mMetaTileEntity.onWrenchRightClick(aSide, tSide, aPlayer, aX, aY, aZ)) {
- GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer);
- GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
- }
- return true;
- }
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList)) {
- if (getCoverIDAtSide(aSide) == 0 && getCoverIDAtSide(tSide) != 0) {
- if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) {
- setCoverDataAtSide(tSide, getCoverBehaviorAtSide(tSide).onCoverScrewdriverclick(tSide, getCoverIDAtSide(tSide), getCoverDataAtSide(tSide), this, aPlayer, 0.5F, 0.5F, 0.5F));
- mMetaTileEntity.onScrewdriverRightClick(tSide, aPlayer, aX, aY, aZ);
- GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
- }
- } else {
- if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
- setCoverDataAtSide(aSide, getCoverBehaviorAtSide(aSide).onCoverScrewdriverclick(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this, aPlayer, aX, aY, aZ));
- mMetaTileEntity.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
- GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
- }
- }
- return true;
- }
-
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sHardHammerList)) {
- //if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
- // GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(1), 1.0F, -1, xCoord, yCoord, zCoord);
- //}
- return true;
- }
-
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList)) {
- if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
- if (mWorks) disableWorking();
- else enableWorking();
- GT_Utility.sendChatToPlayer(aPlayer, trans("090","Machine Processing: ") + (isAllowedToWork() ? trans("088","Enabled") : trans("087","Disabled")));
- GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(101), 1.0F, -1, xCoord, yCoord, zCoord);
- }
- return true;
- }
-
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)) {
- if (GT_ModHandler.useSolderingIron(tCurrentItem, aPlayer)) {
- mStrongRedstone ^= (1 << tSide);
- GT_Utility.sendChatToPlayer(aPlayer, trans("091","Redstone Output at Side ") + tSide + trans("092"," set to: ") + ((mStrongRedstone & (1 << tSide)) != 0 ? trans("093","Strong") : trans("094","Weak")));
- GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(103), 3.0F, -1, xCoord, yCoord, zCoord);
- }
- return true;
- }
-
- byte cSide = tSide;
- if (getCoverIDAtSide(aSide) != 0) cSide = aSide;
-
- if (getCoverIDAtSide(cSide) == 0) {
- if (GregTech_API.sCovers.containsKey(new GT_ItemStack(tCurrentItem))) {
- if (GregTech_API.getCoverBehavior(tCurrentItem).isCoverPlaceable(cSide, new GT_ItemStack(tCurrentItem), this) && mMetaTileEntity.allowCoverOnSide(cSide, new GT_ItemStack(tCurrentItem))) {
- setCoverItemAtSide(cSide, tCurrentItem);
- if (!aPlayer.capabilities.isCreativeMode) tCurrentItem.stackSize--;
- GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
- }
- return true;
- }
- } else {
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCrowbarList)) {
- if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
- GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(0), 1.0F, -1, xCoord, yCoord, zCoord);
- dropCover(cSide, aSide, false);
- }
- return true;
- }
- }
- }
-
- if (getCoverBehaviorAtSide(aSide).onCoverRightclick(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this, aPlayer, aX, aY, aZ))
- return true;
- }
-
- if (!getCoverBehaviorAtSide(aSide).isGUIClickable(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this))
- return false;
-
- try {
- if (hasValidMetaTileEntity()) return mMetaTileEntity.onRightclick(this, aPlayer, aSide, aX, aY, aZ);
- } catch (Throwable e) {
- GT_Log.err.println("Encountered Exception while rightclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
-
- return false;
- }
-
- @Override
- public void onLeftclick(EntityPlayer aPlayer) {
- try {
- if (aPlayer != null && hasValidMetaTileEntity()) mMetaTileEntity.onLeftclick(this, aPlayer);
- } catch (Throwable e) {
- GT_Log.err.println("Encountered Exception while leftclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- }
-
- @Override
- public boolean isDigitalChest() {
- return false;
- }
-
- @Override
- public ItemStack[] getStoredItemData() {
- return null;
- }
-
- @Override
- public void setItemCount(int aCount) {
- //
- }
-
- @Override
- public int getMaxItemCount() {
- return 0;
- }
-
- /**
- * Can put aStack into Slot
- */
- @Override
- public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
- return canAccessData() && mMetaTileEntity.isItemValidForSlot(aIndex, aStack);
- }
-
- /**
- * returns all valid Inventory Slots, no matter which Side (Unless it's covered).
- * The Side Stuff is done in the following two Functions.
- */
- @Override
- public int[] getAccessibleSlotsFromSide(int aSide) {
- if (canAccessData() && (getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, getCoverIDAtSide((byte) aSide), getCoverDataAtSide((byte) aSide), -1, this) || getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, getCoverIDAtSide((byte) aSide), getCoverDataAtSide((byte) aSide), -1, this)))
- return mMetaTileEntity.getAccessibleSlotsFromSide(aSide);
- return new int[0];
- }
-
- /**
- * Can put aStack into Slot at Side
- */
- @Override
- public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
- return canAccessData() && getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, getCoverIDAtSide((byte) aSide), getCoverDataAtSide((byte) aSide), aIndex, this) && mMetaTileEntity.canInsertItem(aIndex, aStack, aSide);
- }
-
- /**
- * Can pull aStack out of Slot from Side
- */
- @Override
- public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) {
- return canAccessData() && getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, getCoverIDAtSide((byte) aSide), getCoverDataAtSide((byte) aSide), aIndex, this) && mMetaTileEntity.canExtractItem(aIndex, aStack, aSide);
- }
-
- @Override
- public boolean isUpgradable() {
- return false;
- }
-
- @Override
- public byte getInternalInputRedstoneSignal(byte aSide) {
- return (byte) (getCoverBehaviorAtSide(aSide).getRedstoneInput(aSide, getInputRedstoneSignal(aSide), getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) & 15);
- }
-
- @Override
- public byte getInputRedstoneSignal(byte aSide) {
- return (byte) (worldObj.getIndirectPowerLevelTo(getOffsetX(aSide, 1), getOffsetY(aSide, 1), getOffsetZ(aSide, 1), aSide) & 15);
- }
-
- @Override
- public byte getOutputRedstoneSignal(byte aSide) {
- return (byte) (getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) || (getCoverBehaviorAtSide(aSide).letsRedstoneGoOut(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this)) ? mSidedRedstone[aSide] & 15 : 0);
- }
-
- @Override
- public void setInternalOutputRedstoneSignal(byte aSide, byte aStrength) {
- if (!getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this))
- setOutputRedstoneSignal(aSide, aStrength);
- }
-
- @Override
- public void setOutputRedstoneSignal(byte aSide, byte aStrength) {
- aStrength = (byte) Math.min(Math.max(0, aStrength), 15);
- if (aSide >= 0 && aSide < 6 && mSidedRedstone[aSide] != aStrength) {
- mSidedRedstone[aSide] = aStrength;
- issueBlockUpdate();
- }
- }
-
- @Override
- public boolean isSteamEngineUpgradable() {
- return isUpgradable() && !hasSteamEngineUpgrade() && getSteamCapacity() > 0;
- }
-
- @Override
- public boolean addSteamEngineUpgrade() {
- if (isSteamEngineUpgradable()) {
- issueBlockUpdate();
- return true;
- }
- return false;
- }
-
- @Override
- public boolean hasSteamEngineUpgrade() {
- return false;
- }
-
- @Override
- public boolean hasInventoryBeenModified() {
- return mInventoryChanged;
- }
-
- @Override
- public void setGenericRedstoneOutput(boolean aOnOff) {
- //
- }
-
- @Override
- public int getErrorDisplayID() {
- return 0;
- }
-
- @Override
- public void setErrorDisplayID(int aErrorID) {
- //
- }
-
- @Override
- public IMetaTileEntity getMetaTileEntity() {
- return hasValidMetaTileEntity() ? mMetaTileEntity : null;
- }
-
- @Override
- public void setMetaTileEntity(IMetaTileEntity aMetaTileEntity) {
- mMetaTileEntity = (MetaPipeEntity) aMetaTileEntity;
- }
-
- @Override
- public GT_CoverBehavior getCoverBehaviorAtSide(byte aSide) {
- return aSide >= 0 && aSide < mCoverBehaviors.length ? mCoverBehaviors[aSide] : GregTech_API.sNoBehavior;
- }
-
- @Override
- public void setCoverIDAtSide(byte aSide, int aID) {
- if (aSide >= 0 && aSide < 6) {
- mCoverSides[aSide] = aID;
- mCoverData[aSide] = 0;
- mCoverBehaviors[aSide] = GregTech_API.getCoverBehavior(aID);
- issueCoverUpdate(aSide);
- issueBlockUpdate();
- }
- }
-
- @Override
- public void setCoverItemAtSide(byte aSide, ItemStack aCover) {
- GregTech_API.getCoverBehavior(aCover).placeCover(aSide, aCover, this);
- }
-
- @Override
- public int getCoverIDAtSide(byte aSide) {
- if (aSide >= 0 && aSide < 6) return mCoverSides[aSide];
- return 0;
- }
-
- @Override
- public ItemStack getCoverItemAtSide(byte aSide) {
- return GT_Utility.intToStack(getCoverIDAtSide(aSide));
- }
-
- @Override
- public boolean canPlaceCoverIDAtSide(byte aSide, int aID) {
- return getCoverIDAtSide(aSide) == 0;
- }
-
- @Override
- public boolean canPlaceCoverItemAtSide(byte aSide, ItemStack aCover) {
- return getCoverIDAtSide(aSide) == 0;
- }
-
- @Override
- public void setCoverDataAtSide(byte aSide, int aData) {
- if (aSide >= 0 && aSide < 6) mCoverData[aSide] = aData;
- }
-
- @Override
- public int getCoverDataAtSide(byte aSide) {
- if (aSide >= 0 && aSide < 6) return mCoverData[aSide];
- return 0;
- }
-
- @Override
- public void setLightValue(byte aLightValue) {
- //
- }
-
- @Override
- public long getAverageElectricInput() {
- return 0;
- }
-
- @Override
- public long getAverageElectricOutput() {
- return 0;
- }
-
- @Override
- public boolean dropCover(byte aSide, byte aDroppedSide, boolean aForced) {
- if (getCoverBehaviorAtSide(aSide).onCoverRemoval(aSide, getCoverIDAtSide(aSide), mCoverData[aSide], this, aForced) || aForced) {
- ItemStack tStack = getCoverBehaviorAtSide(aSide).getDrop(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this);
- if (tStack != null) {
- tStack.setTagCompound(null);
- EntityItem tEntity = new EntityItem(worldObj, getOffsetX(aDroppedSide, 1) + 0.5, getOffsetY(aDroppedSide, 1) + 0.5, getOffsetZ(aDroppedSide, 1) + 0.5, tStack);
- tEntity.motionX = 0;
- tEntity.motionY = 0;
- tEntity.motionZ = 0;
- worldObj.spawnEntityInWorld(tEntity);
- }
-
- setCoverIDAtSide(aSide, 0);
- setOutputRedstoneSignal(aSide, (byte) 0);
- return true;
- }
- return false;
- }
-
- @Override
- public String getOwnerName() {
- return "Player";
- }
-
- @Override
- public String setOwnerName(String aName) {
- return "Player";
- }
-
- @Override
- public byte getComparatorValue(byte aSide) {
- return canAccessData() ? mMetaTileEntity.getComparatorValue(aSide) : 0;
- }
-
- @Override
- public byte getStrongOutputRedstoneSignal(byte aSide) {
- return aSide >= 0 && aSide < 6 && (mStrongRedstone & (1 << aSide)) != 0 ? (byte) (mSidedRedstone[aSide] & 15) : 0;
- }
-
- @Override
- public void setStrongOutputRedstoneSignal(byte aSide, byte aStrength) {
- mStrongRedstone |= (1 << aSide);
- setOutputRedstoneSignal(aSide, aStrength);
- }
-
- @Override
- public ItemStack decrStackSize(int aIndex, int aAmount) {
- if (canAccessData()) {
- mInventoryChanged = true;
- return mMetaTileEntity.decrStackSize(aIndex, aAmount);
- }
- return null;
- }
-
- @Override
- public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
- if (canAccessData()) return mMetaTileEntity.injectEnergyUnits(aSide, aVoltage, aAmperage);
- return 0;
- }
-
- @Override
- public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
- return false;
- }
-
- @Override
- public boolean acceptsRotationalEnergy(byte aSide) {
- if (!canAccessData() || getCoverIDAtSide(aSide) != 0) return false;
- return mMetaTileEntity.acceptsRotationalEnergy(aSide);
- }
-
- @Override
- public boolean injectRotationalEnergy(byte aSide, long aSpeed, long aEnergy) {
- if (!canAccessData() || getCoverIDAtSide(aSide) != 0) return false;
- return mMetaTileEntity.injectRotationalEnergy(aSide, aSpeed, aEnergy);
- }
-
- @Override
- public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
- if (mTickTimer > 5 && canAccessData() && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidIn((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), aFluid == null ? null : aFluid.getFluid(), this))))
- return mMetaTileEntity.fill(aSide, aFluid, doFill);
- return 0;
- }
-
- @Override
- public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) {
- if (mTickTimer > 5 && canAccessData() && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), mMetaTileEntity.getFluid() == null ? null : mMetaTileEntity.getFluid().getFluid(), this))))
- return mMetaTileEntity.drain(aSide, maxDrain, doDrain);
- return null;
- }
-
- @Override
- public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) {
- if (mTickTimer > 5 && canAccessData() && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), aFluid == null ? null : aFluid.getFluid(), this))))
- return mMetaTileEntity.drain(aSide, aFluid, doDrain);
- return null;
- }
-
- @Override
- public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
- if (mTickTimer > 5 && canAccessData() && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidIn((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), aFluid, this))))
- return mMetaTileEntity.canFill(aSide, aFluid);
- return false;
- }
-
- @Override
- public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
- if (mTickTimer > 5 && canAccessData() && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), aFluid, this))))
- return mMetaTileEntity.canDrain(aSide, aFluid);
- return false;
- }
-
- @Override
- public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
- if (canAccessData() && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidIn((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), null, this)) || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), null, this))))
- return mMetaTileEntity.getTankInfo(aSide);
- return new FluidTankInfo[]{};
- }
-
- @Override
- public boolean isInvalidTileEntity() {
- return isInvalid();
- }
-
- @Override
- public boolean addStackToSlot(int aIndex, ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack)) return true;
- if (aIndex < 0 || aIndex >= getSizeInventory()) return false;
- ItemStack tStack = getStackInSlot(aIndex);
- if (GT_Utility.isStackInvalid(tStack)) {
- setInventorySlotContents(aIndex, aStack);
- return true;
- }
- aStack = GT_OreDictUnificator.get(aStack);
- if (GT_Utility.areStacksEqual(tStack, aStack) && tStack.stackSize + aStack.stackSize <= Math.min(aStack.getMaxStackSize(), getInventoryStackLimit())) {
- tStack.stackSize += aStack.stackSize;
- return true;
- }
- return false;
- }
-
- @Override
- public boolean addStackToSlot(int aIndex, ItemStack aStack, int aAmount) {
- return addStackToSlot(aIndex, GT_Utility.copyAmount(aAmount, aStack));
- }
-
- @Override
- public byte getColorization() {
- return (byte) (mColor - 1);
- }
-
- @Override
- public byte setColorization(byte aColor) {
- if (aColor > 15 || aColor < -1) aColor = -1;
- if (canAccessData()) mMetaTileEntity.onColorChangeServer(aColor);
- return mColor = (byte) (aColor + 1);
- }
-
- @Override
- public float getThickNess() {
- if (canAccessData()) return mMetaTileEntity.getThickNess();
- return 1.0F;
- }
-
- public boolean renderInside(byte aSide) {
- if (canAccessData()) return mMetaTileEntity.renderInside(aSide);
- return false;
- }
-
- @Override
- public float getBlastResistance(byte aSide) {
- return (mConnections & 192) != 0 ? 50.0F : 5.0F;
- }
-
- @Override
- public boolean isMufflerUpgradable() {
- return false;
- }
-
- @Override
- public boolean addMufflerUpgrade() {
- return false;
- }
-
- @Override
- public boolean hasMufflerUpgrade() {
- return false;
- }
-
- @Override
- public boolean isUniversalEnergyStored(long aEnergyAmount) {
- return getUniversalEnergyStored() >= aEnergyAmount;
- }
-
- @Override
- public String[] getInfoData() {
- {
- if (canAccessData()) return getMetaTileEntity().getInfoData();
- return new String[]{};
- }
- }
-
- @Override
- public byte getConnections() {
- return mConnections;
- }
-
- @Override
- public void markDirty() {
- super.markDirty();
- mInventoryChanged = true;
- }
-
- @Override
- public int getLightOpacity() {
- return mMetaTileEntity == null ? 0 : mMetaTileEntity.getLightOpacity();
- }
-
- @Override
- public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) {
- mMetaTileEntity.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
- }
-
- @Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- return mMetaTileEntity.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- }
-
- @Override
- public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) {
- mMetaTileEntity.onEntityCollidedWithBlock(aWorld, aX, aY, aZ, collider);
- }
-}
+package gregtech.api.metatileentity;
+
+import cpw.mods.fml.common.FMLLog;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.interfaces.tileentity.IPipeRenderedTileEntity;
+import gregtech.api.net.GT_Packet_TileEntity;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.util.*;
+import net.minecraft.block.Block;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import net.minecraft.network.Packet;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import static gregtech.api.enums.GT_Values.NW;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <p/>
+ * This is the main TileEntity for EVERYTHING.
+ */
+public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileEntity, IPipeRenderedTileEntity {
+ private final GT_CoverBehavior[] mCoverBehaviors = new GT_CoverBehavior[]{GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior};
+ public byte mConnections = 0;
+ protected MetaPipeEntity mMetaTileEntity;
+ private byte[] mSidedRedstone = new byte[]{0, 0, 0, 0, 0, 0};
+ private int[] mCoverSides = new int[]{0, 0, 0, 0, 0, 0}, mCoverData = new int[]{0, 0, 0, 0, 0, 0}, mTimeStatistics = new int[GregTech_API.TICKS_FOR_LAG_AVERAGING];
+ private boolean mInventoryChanged = false, mWorkUpdate = false, mWorks = true, mNeedsUpdate = true, mNeedsBlockUpdate = true, mSendClientData = false;
+ private byte mColor = 0, oColor = 0, mStrongRedstone = 0, oRedstoneData = 63, oTextureData = 0, oUpdateData = 0, mLagWarningCount = 0;
+ private int oX = 0, oY = 0, oZ = 0, mTimeStatisticsIndex = 0;
+ private short mID = 0;
+ private long mTickTimer = 0;
+
+ public BaseMetaPipeEntity() {
+ }
+
+ @Override
+ public void writeToNBT(NBTTagCompound aNBT) {
+ try {
+ super.writeToNBT(aNBT);
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ try {
+ aNBT.setInteger("mID", mID);
+ aNBT.setIntArray("mCoverData", mCoverData);
+ aNBT.setIntArray("mCoverSides", mCoverSides);
+ aNBT.setByteArray("mRedstoneSided", mSidedRedstone);
+ aNBT.setByte("mConnections", mConnections);
+ aNBT.setByte("mColor", mColor);
+ aNBT.setByte("mStrongRedstone", mStrongRedstone);
+ aNBT.setBoolean("mWorks", !mWorks);
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ try {
+ if (hasValidMetaTileEntity()) {
+ NBTTagList tItemList = new NBTTagList();
+ for (int i = 0; i < mMetaTileEntity.getRealInventory().length; i++) {
+ ItemStack tStack = mMetaTileEntity.getRealInventory()[i];
+ if (tStack != null) {
+ NBTTagCompound tTag = new NBTTagCompound();
+ tTag.setInteger("IntSlot", i);
+ tStack.writeToNBT(tTag);
+ tItemList.appendTag(tTag);
+ }
+ }
+ aNBT.setTag("Inventory", tItemList);
+
+ try {
+ mMetaTileEntity.saveNBTData(aNBT);
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+
+ @Override
+ public void readFromNBT(NBTTagCompound aNBT) {
+ super.readFromNBT(aNBT);
+ setInitialValuesAsNBT(aNBT, (short) 0);
+ }
+
+ @Override
+ public void setInitialValuesAsNBT(NBTTagCompound aNBT, short aID) {
+ if (aNBT == null) {
+ if (aID > 0) mID = aID;
+ else mID = mID > 0 ? mID : 0;
+ if (mID != 0) createNewMetatileEntity(mID);
+ } else {
+ if (aID <= 0) mID = (short) aNBT.getInteger("mID");
+ else mID = aID;
+ mCoverSides = aNBT.getIntArray("mCoverSides");
+ mCoverData = aNBT.getIntArray("mCoverData");
+ mSidedRedstone = aNBT.getByteArray("mRedstoneSided");
+ mConnections = aNBT.getByte("mConnections");
+ mColor = aNBT.getByte("mColor");
+ mStrongRedstone = aNBT.getByte("mStrongRedstone");
+ mWorks = !aNBT.getBoolean("mWorks");
+
+ if (mCoverData.length != 6) mCoverData = new int[]{0, 0, 0, 0, 0, 0};
+ if (mCoverSides.length != 6) mCoverSides = new int[]{0, 0, 0, 0, 0, 0};
+ if (mSidedRedstone.length != 6) mSidedRedstone = new byte[]{0, 0, 0, 0, 0, 0};
+
+ for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
+
+ if (mID != 0 && createNewMetatileEntity(mID)) {
+ NBTTagList tItemList = aNBT.getTagList("Inventory", 10);
+ for (int i = 0; i < tItemList.tagCount(); i++) {
+ NBTTagCompound tTag = tItemList.getCompoundTagAt(i);
+ int tSlot = tTag.getInteger("IntSlot");
+ if (tSlot >= 0 && tSlot < mMetaTileEntity.getRealInventory().length) {
+ mMetaTileEntity.getRealInventory()[tSlot] = GT_Utility.loadItem(tTag);
+ }
+ }
+
+ try {
+ mMetaTileEntity.loadNBTData(aNBT);
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered Exception while loading MetaTileEntity, the Server should've crashed now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+ }
+
+ if (mCoverData.length != 6) mCoverData = new int[]{0, 0, 0, 0, 0, 0};
+ if (mCoverSides.length != 6) mCoverSides = new int[]{0, 0, 0, 0, 0, 0};
+ if (mSidedRedstone.length != 6) mSidedRedstone = new byte[]{0, 0, 0, 0, 0, 0};
+
+ for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
+ }
+
+ private boolean createNewMetatileEntity(short aID) {
+ if (aID <= 0 || aID >= GregTech_API.METATILEENTITIES.length || GregTech_API.METATILEENTITIES[aID] == null) {
+ GT_Log.err.println("MetaID " + aID + " not loadable => locking TileEntity!");
+ } else {
+ if (hasValidMetaTileEntity()) mMetaTileEntity.setBaseMetaTileEntity(null);
+ GregTech_API.METATILEENTITIES[aID].newMetaEntity(this).setBaseMetaTileEntity(this);
+ mTickTimer = 0;
+ mID = aID;
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public void updateEntity() {
+ super.updateEntity();
+
+ if (!hasValidMetaTileEntity()) {
+ if (mMetaTileEntity == null) return;
+ mMetaTileEntity.setBaseMetaTileEntity(this);
+ }
+
+ long tTime = System.currentTimeMillis();
+ int tCode = 0;
+
+ try { for (tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) {
+ switch (tCode) {
+ case 0:
+ tCode++;
+ if (mTickTimer++ == 0) {
+ oX = xCoord;
+ oY = yCoord;
+ oZ = zCoord;
+ if (isServerSide()) for (byte i = 0; i < 6; i++)
+ if (getCoverIDAtSide(i) != 0)
+ if (!mMetaTileEntity.allowCoverOnSide(i, new GT_ItemStack(getCoverIDAtSide(i))))
+ dropCover(i, i, true);
+ worldObj.markTileEntityChunkModified(xCoord, yCoord, zCoord, this);
+ mMetaTileEntity.onFirstTick(this);
+ if (!hasValidMetaTileEntity()) return;
+ }
+ case 1:
+ tCode++;
+ if (isClientSide()) {
+ if (mColor != oColor) {
+ mMetaTileEntity.onColorChangeClient(oColor = mColor);
+ issueTextureUpdate();
+ }
+
+ if (mNeedsUpdate) {
+ worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ //worldObj.func_147479_m(xCoord, yCoord, zCoord);
+ mNeedsUpdate = false;
+ }
+ }
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ if (isServerSide() && mTickTimer > 10) {
+ for (byte i = (byte) (tCode - 2); i < 6; i++)
+ if (getCoverIDAtSide(i) != 0) {
+ tCode++;
+ GT_CoverBehavior tCover = getCoverBehaviorAtSide(i);
+ int tCoverTickRate = tCover.getTickRate(i, getCoverIDAtSide(i), mCoverData[i], this);
+ if (tCoverTickRate > 0 && mTickTimer % tCoverTickRate == 0) {
+ mCoverData[i] = tCover.doCoverThings(i, getInputRedstoneSignal(i), getCoverIDAtSide(i), mCoverData[i], this, mTickTimer);
+ if (!hasValidMetaTileEntity()) return;
+ }
+ }
+ mConnections = (byte) (mMetaTileEntity.mConnections | (mConnections & ~63));
+ if ((mConnections & -64) == 64 && getRandomNumber(1000) == 0) {
+ mConnections = (byte) ((mConnections & ~64) | -128);
+ }
+ }
+ case 8:
+ tCode = 9;
+ mMetaTileEntity.onPreTick(this, mTickTimer);
+ if (!hasValidMetaTileEntity()) return;
+ case 9:
+ tCode++;
+ if (isServerSide()) {
+ if (mTickTimer == 10) {
+ for (byte i = 0; i < 6; i++)
+ mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
+ issueBlockUpdate();
+ }
+
+ if (xCoord != oX || yCoord != oY || zCoord != oZ) {
+ oX = xCoord;
+ oY = yCoord;
+ oZ = zCoord;
+ issueClientUpdate();
+ clearTileEntityBuffer();
+ }
+ }
+ case 10:
+ tCode++;
+ mMetaTileEntity.onPostTick(this, mTickTimer);
+ if (!hasValidMetaTileEntity()) return;
+ case 11:
+ tCode++;
+ if (isServerSide()) {
+ if (mTickTimer % 10 == 0) {
+ if (mSendClientData) {
+ NW.sendPacketToAllPlayersInRange(worldObj, new GT_Packet_TileEntity(xCoord, (short) yCoord, zCoord, mID, mCoverSides[0], mCoverSides[1], mCoverSides[2], mCoverSides[3], mCoverSides[4], mCoverSides[5], oTextureData = mConnections, oUpdateData = hasValidMetaTileEntity() ? mMetaTileEntity.getUpdateData() : 0, oRedstoneData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) | ((mSidedRedstone[2] > 0) ? 4 : 0) | ((mSidedRedstone[3] > 0) ? 8 : 0) | ((mSidedRedstone[4] > 0) ? 16 : 0) | ((mSidedRedstone[5] > 0) ? 32 : 0)), oColor = mColor), xCoord, zCoord);
+ mSendClientData = false;
+ }
+ }
+
+ if (mTickTimer > 10) {
+ if (mConnections != oTextureData) sendBlockEvent((byte) 0, oTextureData = mConnections);
+ byte tData = mMetaTileEntity.getUpdateData();
+ if (tData != oUpdateData) sendBlockEvent((byte) 1, oUpdateData = tData);
+ if (mColor != oColor) sendBlockEvent((byte) 2, oColor = mColor);
+ tData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) | ((mSidedRedstone[2] > 0) ? 4 : 0) | ((mSidedRedstone[3] > 0) ? 8 : 0) | ((mSidedRedstone[4] > 0) ? 16 : 0) | ((mSidedRedstone[5] > 0) ? 32 : 0));
+ if (tData != oRedstoneData) sendBlockEvent((byte) 3, oRedstoneData = tData);
+ }
+
+ if (mNeedsBlockUpdate) {
+ worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockOffset(0, 0, 0));
+ mNeedsBlockUpdate = false;
+ }
+ }
+ default:
+ tCode = -1;
+ break;
+ }
+ }
+ } catch (Throwable e) {
+ //GT_Log.err.println("Encountered Exception while ticking MetaTileEntity in Step " + (tCode - 1) + ". The Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+
+ if (isServerSide() && hasValidMetaTileEntity()) {
+ tTime = System.currentTimeMillis() - tTime;
+ if (mTimeStatistics.length > 0)
+ mTimeStatistics[mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) % mTimeStatistics.length] = (int) tTime;
+ if (tTime > 0 && tTime > GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING && mTickTimer > 1000 && getMetaTileEntity().doTickProfilingMessageDuringThisTick() && mLagWarningCount++ < 10)
+ FMLLog.warning("WARNING: Possible Lag Source at [%s,%s,%s] in Dimension %s with %s ms caused by an instance of %s", xCoord, yCoord, zCoord, worldObj.provider.dimensionId, tTime, getMetaTileEntity().getClass());
+ }
+
+ mWorkUpdate = mInventoryChanged = false;
+ }
+
+ @Override
+ public Packet getDescriptionPacket() {
+ issueClientUpdate();
+ return null;
+ }
+
+ public final void receiveMetaTileEntityData(short aID, int aCover0, int aCover1, int aCover2, int aCover3, int aCover4, int aCover5, byte aTextureData, byte aUpdateData, byte aRedstoneData, byte aColorData) {
+ issueTextureUpdate();
+ if (aID > 0 && mID != aID) {
+ mID = aID;
+ createNewMetatileEntity(mID);
+ }
+
+ mCoverSides[0] = aCover0;
+ mCoverSides[1] = aCover1;
+ mCoverSides[2] = aCover2;
+ mCoverSides[3] = aCover3;
+ mCoverSides[4] = aCover4;
+ mCoverSides[5] = aCover5;
+
+ for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
+
+ receiveClientEvent(0, aTextureData);
+ receiveClientEvent(1, aUpdateData);
+ receiveClientEvent(2, aColorData);
+ receiveClientEvent(3, aRedstoneData);
+ }
+
+ @Override
+ public boolean receiveClientEvent(int aEventID, int aValue) {
+ super.receiveClientEvent(aEventID, aValue);
+
+ if (hasValidMetaTileEntity()) {
+ try {
+ mMetaTileEntity.receiveClientEvent((byte) aEventID, (byte) aValue);
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered Exception while receiving Data from the Server, the Client should've been crashed by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+
+ if (isClientSide()) {
+ issueTextureUpdate();
+ switch (aEventID) {
+ case 0:
+ mConnections = (byte) aValue;
+ break;
+ case 1:
+ if (hasValidMetaTileEntity()) mMetaTileEntity.onValueUpdate((byte) aValue);
+ break;
+ case 2:
+ if (aValue > 16 || aValue < 0) aValue = 0;
+ mColor = (byte) aValue;
+ break;
+ case 3:
+ mSidedRedstone[0] = (byte) ((aValue & 1) == 1 ? 15 : 0);
+ mSidedRedstone[1] = (byte) ((aValue & 2) == 2 ? 15 : 0);
+ mSidedRedstone[2] = (byte) ((aValue & 4) == 4 ? 15 : 0);
+ mSidedRedstone[3] = (byte) ((aValue & 8) == 8 ? 15 : 0);
+ mSidedRedstone[4] = (byte) ((aValue & 16) == 16 ? 15 : 0);
+ mSidedRedstone[5] = (byte) ((aValue & 32) == 32 ? 15 : 0);
+ break;
+ case 4:
+ if (hasValidMetaTileEntity() && mTickTimer > 20)
+ mMetaTileEntity.doSound((byte) aValue, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
+ break;
+ case 5:
+ if (hasValidMetaTileEntity() && mTickTimer > 20)
+ mMetaTileEntity.startSoundLoop((byte) aValue, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
+ break;
+ case 6:
+ if (hasValidMetaTileEntity() && mTickTimer > 20)
+ mMetaTileEntity.stopSoundLoop((byte) aValue, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
+ break;
+ }
+ }
+ return true;
+ }
+
+ public ArrayList<String> getDebugInfo(EntityPlayer aPlayer, int aLogLevel) {
+ ArrayList<String> tList = new ArrayList<String>();
+ if (aLogLevel > 2) {
+ tList.add("Meta-ID: " + EnumChatFormatting.BLUE+ mID +EnumChatFormatting.RESET + (hasValidMetaTileEntity() ? EnumChatFormatting.GREEN+" valid"+EnumChatFormatting.RESET : EnumChatFormatting.RED+" invalid"+EnumChatFormatting.RESET) + (mMetaTileEntity == null ? EnumChatFormatting.RED+" MetaTileEntity == null!"+EnumChatFormatting.RESET : " "));
+ }
+ if (aLogLevel > 1) {
+ if (mTimeStatistics.length > 0) {
+ double tAverageTime = 0;
+ for (int tTime : mTimeStatistics) tAverageTime += tTime;
+ tList.add("Average CPU-load of ~" + (tAverageTime / mTimeStatistics.length) + "ms since " + mTimeStatistics.length + " ticks.");
+ }
+ if (mLagWarningCount > 0) {
+ tList.add("Caused " + (mLagWarningCount >= 10 ? "more than 10" : mLagWarningCount) + " Lag Spike Warnings (anything taking longer than " + GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING + "ms) on the Server.");
+ }
+ tList.add("Is" + (mMetaTileEntity.isAccessAllowed(aPlayer) ? " " : EnumChatFormatting.RED+" not "+EnumChatFormatting.RESET) + "accessible for you");
+ }
+ return mMetaTileEntity.getSpecialDebugInfo(this, aPlayer, aLogLevel, tList);
+ }
+
+ @Override
+ public void issueTextureUpdate() {
+ mNeedsUpdate = true;
+ }
+
+ @Override
+ public void issueBlockUpdate() {
+ mNeedsBlockUpdate = true;
+ }
+
+ @Override
+ public void issueClientUpdate() {
+ mSendClientData = true;
+ }
+
+ @Override
+ public void issueCoverUpdate(byte aSide) {
+ issueClientUpdate();
+ }
+
+ @Override
+ public byte getStrongestRedstone() {
+ return (byte) Math.max(getInternalInputRedstoneSignal((byte) 0), Math.max(getInternalInputRedstoneSignal((byte) 1), Math.max(getInternalInputRedstoneSignal((byte) 2), Math.max(getInternalInputRedstoneSignal((byte) 3), Math.max(getInternalInputRedstoneSignal((byte) 4), getInternalInputRedstoneSignal((byte) 5))))));
+ }
+
+ @Override
+ public boolean getRedstone() {
+ return getRedstone((byte) 0) || getRedstone((byte) 1) || getRedstone((byte) 2) || getRedstone((byte) 3) || getRedstone((byte) 4) || getRedstone((byte) 5);
+ }
+
+ @Override
+ public boolean getRedstone(byte aSide) {
+ return getInternalInputRedstoneSignal(aSide) > 0;
+ }
+
+ public ITexture getCoverTexture(byte aSide) {
+ return GregTech_API.sCovers.get(new GT_ItemStack(getCoverIDAtSide(aSide)));
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ if (canAccessData()) return mMetaTileEntity.isGivingInformation();
+ return false;
+ }
+
+ @Override
+ public boolean isValidFacing(byte aSide) {
+ if (canAccessData()) return mMetaTileEntity.isFacingValid(aSide);
+ return false;
+ }
+
+ @Override
+ public byte getBackFacing() {
+ return GT_Utility.getOppositeSide(getFrontFacing());
+ }
+
+ @Override
+ public byte getFrontFacing() {
+ return 6;
+ }
+
+ @Override
+ public void setFrontFacing(byte aFacing) {/*Do nothing*/}
+
+ @Override
+ public int getSizeInventory() {
+ if (canAccessData()) return mMetaTileEntity.getSizeInventory();
+ return 0;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(int aIndex) {
+ if (canAccessData()) return mMetaTileEntity.getStackInSlot(aIndex);
+ return null;
+ }
+
+ @Override
+ public void setInventorySlotContents(int aIndex, ItemStack aStack) {
+ mInventoryChanged = true;
+ if (canAccessData())
+ mMetaTileEntity.setInventorySlotContents(aIndex, worldObj.isRemote ? aStack : GT_OreDictUnificator.setStack(true, aStack));
+ }
+
+ @Override
+ public String getInventoryName() {
+ if (canAccessData()) return mMetaTileEntity.getInventoryName();
+ if (GregTech_API.METATILEENTITIES[mID] != null) return GregTech_API.METATILEENTITIES[mID].getInventoryName();
+ return "";
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ if (canAccessData()) return mMetaTileEntity.getInventoryStackLimit();
+ return 64;
+ }
+
+ @Override
+ public void openInventory() {/*Do nothing*/}
+
+ @Override
+ public void closeInventory() {/*Do nothing*/}
+
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer aPlayer) {
+ return hasValidMetaTileEntity() && mTickTimer > 40 && getTileEntityOffset(0, 0, 0) == this && aPlayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64 && mMetaTileEntity.isAccessAllowed(aPlayer);
+ }
+
+ @Override
+ public void validate() {
+ super.validate();
+ mTickTimer = 0;
+ }
+
+ @Override
+ public void invalidate() {
+ tileEntityInvalid = false;
+ if (hasValidMetaTileEntity()) {
+ mMetaTileEntity.onRemoval();
+ mMetaTileEntity.setBaseMetaTileEntity(null);
+ }
+ super.invalidate();
+ }
+
+ @Override
+ public void onChunkUnload() {
+ super.onChunkUnload();
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return false;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(int slot) {
+ ItemStack stack = getStackInSlot(slot);
+ if (stack != null) setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void onMachineBlockUpdate() {
+ if (canAccessData()) mMetaTileEntity.onMachineBlockUpdate();
+ }
+
+ @Override
+ public int getProgress() {
+ return canAccessData() ? mMetaTileEntity.getProgresstime() : 0;
+ }
+
+ @Override
+ public int getMaxProgress() {
+ return canAccessData() ? mMetaTileEntity.maxProgresstime() : 0;
+ }
+
+ @Override
+ public boolean increaseProgress(int aProgressAmountInTicks) {
+ return canAccessData() ? mMetaTileEntity.increaseProgress(aProgressAmountInTicks) != aProgressAmountInTicks : false;
+ }
+
+ @Override
+ public boolean hasThingsToDo() {
+ return getMaxProgress() > 0;
+ }
+
+ @Override
+ public void enableWorking() {
+ if (!mWorks) mWorkUpdate = true;
+ mWorks = true;
+ }
+
+ @Override
+ public void disableWorking() {
+ mWorks = false;
+ }
+
+ @Override
+ public boolean isAllowedToWork() {
+ return mWorks;
+ }
+
+ @Override
+ public boolean hasWorkJustBeenEnabled() {
+ return mWorkUpdate;
+ }
+
+ @Override
+ public byte getWorkDataValue() {
+ return 0;
+ }
+
+ @Override
+ public void setWorkDataValue(byte aValue) {/*Do nothing*/}
+
+ @Override
+ public int getMetaTileID() {
+ return mID;
+ }
+
+ @Override
+ public int setMetaTileID(short aID) {
+ return mID = aID;
+ }
+
+ @Override
+ public boolean isActive() {
+ return false;
+ }
+
+ @Override
+ public void setActive(boolean aActive) {/*Do nothing*/}
+
+ @Override
+ public long getTimer() {
+ return mTickTimer;
+ }
+
+ @Override
+ public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) {
+ return false;
+ }
+
+ @Override
+ public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy) {
+ return false;
+ }
+
+ @Override
+ public boolean inputEnergyFrom(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public boolean outputsEnergyTo(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public long getOutputAmperage() {
+ return 0;
+ }
+
+ @Override
+ public long getOutputVoltage() {
+ return 0;
+ }
+
+ @Override
+ public long getInputAmperage() {
+ return 0;
+ }
+
+ @Override
+ public long getInputVoltage() {
+ return 0;
+ }
+
+ @Override
+ public boolean increaseStoredSteam(long aEnergy, boolean aIgnoreTooMuchEnergy) {
+ return false;
+ }
+
+ @Override
+ public String[] getDescription() {
+ if (canAccessData()) return mMetaTileEntity.getDescription();
+ return new String[0];
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ if (canAccessData()) return mMetaTileEntity.isValidSlot(aIndex);
+ return false;
+ }
+
+ @Override
+ public long getUniversalEnergyStored() {
+ return Math.max(getStoredEU(), getStoredSteam());
+ }
+
+ @Override
+ public long getUniversalEnergyCapacity() {
+ return Math.max(getEUCapacity(), getSteamCapacity());
+ }
+
+ @Override
+ public long getStoredEU() {
+ return 0;
+ }
+
+ @Override
+ public long getEUCapacity() {
+ return 0;
+ }
+
+ @Override
+ public long getStoredSteam() {
+ return 0;
+ }
+
+ @Override
+ public long getSteamCapacity() {
+ return 0;
+ }
+
+ @Override
+ public ITexture[] getTexture(Block aBlock, byte aSide) {
+ ITexture rIcon = getCoverTexture(aSide);
+ if (rIcon != null) return new ITexture[]{rIcon};
+ return getTextureUncovered(aSide);
+ }
+
+ @Override
+ public ITexture[] getTextureUncovered(byte aSide) {
+ if ((mConnections & 64) != 0) return Textures.BlockIcons.FRESHFOAM;
+ if ((mConnections & -128) != 0) return Textures.BlockIcons.HARDENEDFOAMS[mColor];
+ if ((mConnections & -64) != 0) return Textures.BlockIcons.ERROR_RENDERING;
+ byte tConnections = mConnections;
+ if (tConnections == 1 || tConnections == 2) tConnections = 3;
+ else if (tConnections == 4 || tConnections == 8) tConnections = 12;
+ else if (tConnections == 16 || tConnections == 32) tConnections = 48;
+ if (hasValidMetaTileEntity())
+ return mMetaTileEntity.getTexture(this, aSide, tConnections, (byte) (mColor - 1), tConnections == 0 || (tConnections & (1 << aSide)) != 0, getOutputRedstoneSignal(aSide) > 0);
+ return Textures.BlockIcons.ERROR_RENDERING;
+ }
+
+ protected boolean hasValidMetaTileEntity() {
+ return mMetaTileEntity != null && mMetaTileEntity.getBaseMetaTileEntity() == this;
+ }
+
+ protected boolean canAccessData() {
+ return hasValidMetaTileEntity() && !isDead;
+ }
+
+ @Override
+ public void doExplosion(long aAmount) {
+ if (canAccessData()) {
+ mMetaTileEntity.onExplosion();
+ mMetaTileEntity.doExplosion(aAmount);
+ }
+ }
+
+ @Override
+ public ArrayList<ItemStack> getDrops() {
+ ItemStack rStack = new ItemStack(GregTech_API.sBlockMachines, 1, mID);
+ NBTTagCompound tNBT = new NBTTagCompound();
+ if (mStrongRedstone > 0) tNBT.setByte("mStrongRedstone", mStrongRedstone);
+ for (byte i = 0; i < mCoverSides.length; i++) {
+ if (mCoverSides[i] != 0) {
+ tNBT.setIntArray("mCoverData", mCoverData);
+ tNBT.setIntArray("mCoverSides", mCoverSides);
+ break;
+ }
+ }
+ if (hasValidMetaTileEntity()) mMetaTileEntity.setItemNBT(tNBT);
+ if (!tNBT.hasNoTags()) rStack.setTagCompound(tNBT);
+ return new ArrayList<ItemStack>(Arrays.asList(rStack));
+ }
+
+ @Override
+ public boolean onRightclick(EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
+ if (isClientSide()) {
+ if (getCoverBehaviorAtSide(aSide).onCoverRightclickClient(aSide, this, aPlayer, aX, aY, aZ)) return true;
+ }
+ if (isServerSide()) {
+ ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
+ if (tCurrentItem != null) {
+ if (getColorization() >= 0 && GT_Utility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) {
+ tCurrentItem.func_150996_a(Items.bucket);
+ setColorization((byte) -1);
+ return true;
+ }
+ byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
+ if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList)) {
+ if (mMetaTileEntity.onWrenchRightClick(aSide, tSide, aPlayer, aX, aY, aZ)) {
+ GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer);
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
+ }
+ return true;
+ }
+ if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList)) {
+ if (getCoverIDAtSide(aSide) == 0 && getCoverIDAtSide(tSide) != 0) {
+ if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) {
+ setCoverDataAtSide(tSide, getCoverBehaviorAtSide(tSide).onCoverScrewdriverclick(tSide, getCoverIDAtSide(tSide), getCoverDataAtSide(tSide), this, aPlayer, 0.5F, 0.5F, 0.5F));
+ mMetaTileEntity.onScrewdriverRightClick(tSide, aPlayer, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
+ }
+ } else {
+ if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
+ setCoverDataAtSide(aSide, getCoverBehaviorAtSide(aSide).onCoverScrewdriverclick(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this, aPlayer, aX, aY, aZ));
+ mMetaTileEntity.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
+ }
+ }
+ return true;
+ }
+
+ if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sHardHammerList)) {
+ //if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
+ // GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(1), 1.0F, -1, xCoord, yCoord, zCoord);
+ //}
+ return true;
+ }
+
+ if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList)) {
+ if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
+ if (mWorks) disableWorking();
+ else enableWorking();
+ GT_Utility.sendChatToPlayer(aPlayer, trans("090","Machine Processing: ") + (isAllowedToWork() ? trans("088","Enabled") : trans("087","Disabled")));
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(101), 1.0F, -1, xCoord, yCoord, zCoord);
+ }
+ return true;
+ }
+
+ if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWireCutterList)) {
+ if (mMetaTileEntity.onWireCutterRightClick(aSide, tSide, aPlayer, aX, aY, aZ)) {
+ GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer);
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
+ }
+ return true;
+ }
+
+ if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)) {
+ if (mMetaTileEntity.onSolderingToolRightClick(aSide, tSide, aPlayer, aX, aY, aZ)) {
+ GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 500, aPlayer);
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
+ } else if (GT_ModHandler.useSolderingIron(tCurrentItem, aPlayer)) {
+ mStrongRedstone ^= (1 << tSide);
+ GT_Utility.sendChatToPlayer(aPlayer, trans("091","Redstone Output at Side ") + tSide + trans("092"," set to: ") + ((mStrongRedstone & (1 << tSide)) != 0 ? trans("093","Strong") : trans("094","Weak")));
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(103), 3.0F, -1, xCoord, yCoord, zCoord);
+ }
+ return true;
+ }
+
+ byte cSide = tSide;
+ if (getCoverIDAtSide(aSide) != 0) cSide = aSide;
+
+ if (getCoverIDAtSide(cSide) == 0) {
+ if (GregTech_API.sCovers.containsKey(new GT_ItemStack(tCurrentItem))) {
+ if (GregTech_API.getCoverBehavior(tCurrentItem).isCoverPlaceable(cSide, new GT_ItemStack(tCurrentItem), this) && mMetaTileEntity.allowCoverOnSide(cSide, new GT_ItemStack(tCurrentItem))) {
+ setCoverItemAtSide(cSide, tCurrentItem);
+ if (!aPlayer.capabilities.isCreativeMode) tCurrentItem.stackSize--;
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
+ }
+ return true;
+ }
+ } else {
+ if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCrowbarList)) {
+ if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(0), 1.0F, -1, xCoord, yCoord, zCoord);
+ dropCover(cSide, aSide, false);
+ }
+ return true;
+ }
+ }
+ }
+
+ if (getCoverBehaviorAtSide(aSide).onCoverRightclick(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this, aPlayer, aX, aY, aZ))
+ return true;
+ }
+
+ if (!getCoverBehaviorAtSide(aSide).isGUIClickable(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this))
+ return false;
+
+ try {
+ if (hasValidMetaTileEntity()) return mMetaTileEntity.onRightclick(this, aPlayer, aSide, aX, aY, aZ);
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered Exception while rightclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+
+ return false;
+ }
+
+ @Override
+ public void onLeftclick(EntityPlayer aPlayer) {
+ try {
+ if (aPlayer != null && hasValidMetaTileEntity()) mMetaTileEntity.onLeftclick(this, aPlayer);
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered Exception while leftclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+
+ @Override
+ public boolean isDigitalChest() {
+ return false;
+ }
+
+ @Override
+ public ItemStack[] getStoredItemData() {
+ return null;
+ }
+
+ @Override
+ public void setItemCount(int aCount) {
+ //
+ }
+
+ @Override
+ public int getMaxItemCount() {
+ return 0;
+ }
+
+ /**
+ * Can put aStack into Slot
+ */
+ @Override
+ public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
+ return canAccessData() && mMetaTileEntity.isItemValidForSlot(aIndex, aStack);
+ }
+
+ /**
+ * returns all valid Inventory Slots, no matter which Side (Unless it's covered).
+ * The Side Stuff is done in the following two Functions.
+ */
+ @Override
+ public int[] getAccessibleSlotsFromSide(int aSide) {
+ if (canAccessData() && (getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, getCoverIDAtSide((byte) aSide), getCoverDataAtSide((byte) aSide), -1, this) || getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, getCoverIDAtSide((byte) aSide), getCoverDataAtSide((byte) aSide), -1, this)))
+ return mMetaTileEntity.getAccessibleSlotsFromSide(aSide);
+ return new int[0];
+ }
+
+ /**
+ * Can put aStack into Slot at Side
+ */
+ @Override
+ public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
+ return canAccessData() && getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, getCoverIDAtSide((byte) aSide), getCoverDataAtSide((byte) aSide), aIndex, this) && mMetaTileEntity.canInsertItem(aIndex, aStack, aSide);
+ }
+
+ /**
+ * Can pull aStack out of Slot from Side
+ */
+ @Override
+ public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) {
+ return canAccessData() && getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, getCoverIDAtSide((byte) aSide), getCoverDataAtSide((byte) aSide), aIndex, this) && mMetaTileEntity.canExtractItem(aIndex, aStack, aSide);
+ }
+
+ @Override
+ public boolean isUpgradable() {
+ return false;
+ }
+
+ @Override
+ public byte getInternalInputRedstoneSignal(byte aSide) {
+ return (byte) (getCoverBehaviorAtSide(aSide).getRedstoneInput(aSide, getInputRedstoneSignal(aSide), getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) & 15);
+ }
+
+ @Override
+ public byte getInputRedstoneSignal(byte aSide) {
+ return (byte) (worldObj.getIndirectPowerLevelTo(getOffsetX(aSide, 1), getOffsetY(aSide, 1), getOffsetZ(aSide, 1), aSide) & 15);
+ }
+
+ @Override
+ public byte getOutputRedstoneSignal(byte aSide) {
+ return (byte) (getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) || (getCoverBehaviorAtSide(aSide).letsRedstoneGoOut(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this)) ? mSidedRedstone[aSide] & 15 : 0);
+ }
+
+ @Override
+ public void setInternalOutputRedstoneSignal(byte aSide, byte aStrength) {
+ if (!getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this))
+ setOutputRedstoneSignal(aSide, aStrength);
+ }
+
+ @Override
+ public void setOutputRedstoneSignal(byte aSide, byte aStrength) {
+ aStrength = (byte) Math.min(Math.max(0, aStrength), 15);
+ if (aSide >= 0 && aSide < 6 && mSidedRedstone[aSide] != aStrength) {
+ mSidedRedstone[aSide] = aStrength;
+ issueBlockUpdate();
+ }
+ }
+
+ @Override
+ public boolean isSteamEngineUpgradable() {
+ return isUpgradable() && !hasSteamEngineUpgrade() && getSteamCapacity() > 0;
+ }
+
+ @Override
+ public boolean addSteamEngineUpgrade() {
+ if (isSteamEngineUpgradable()) {
+ issueBlockUpdate();
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean hasSteamEngineUpgrade() {
+ return false;
+ }
+
+ @Override
+ public boolean hasInventoryBeenModified() {
+ return mInventoryChanged;
+ }
+
+ @Override
+ public void setGenericRedstoneOutput(boolean aOnOff) {
+ //
+ }
+
+ @Override
+ public int getErrorDisplayID() {
+ return 0;
+ }
+
+ @Override
+ public void setErrorDisplayID(int aErrorID) {
+ //
+ }
+
+ @Override
+ public IMetaTileEntity getMetaTileEntity() {
+ return hasValidMetaTileEntity() ? mMetaTileEntity : null;
+ }
+
+ @Override
+ public void setMetaTileEntity(IMetaTileEntity aMetaTileEntity) {
+ mMetaTileEntity = (MetaPipeEntity) aMetaTileEntity;
+ }
+
+ @Override
+ public GT_CoverBehavior getCoverBehaviorAtSide(byte aSide) {
+ return aSide >= 0 && aSide < mCoverBehaviors.length ? mCoverBehaviors[aSide] : GregTech_API.sNoBehavior;
+ }
+
+ @Override
+ public void setCoverIDAtSide(byte aSide, int aID) {
+ if (aSide >= 0 && aSide < 6) {
+ mCoverSides[aSide] = aID;
+ mCoverData[aSide] = 0;
+ mCoverBehaviors[aSide] = GregTech_API.getCoverBehavior(aID);
+ issueCoverUpdate(aSide);
+ issueBlockUpdate();
+ }
+ }
+
+ @Override
+ public void setCoverItemAtSide(byte aSide, ItemStack aCover) {
+ GregTech_API.getCoverBehavior(aCover).placeCover(aSide, aCover, this);
+ }
+
+ @Override
+ public int getCoverIDAtSide(byte aSide) {
+ if (aSide >= 0 && aSide < 6) return mCoverSides[aSide];
+ return 0;
+ }
+
+ @Override
+ public ItemStack getCoverItemAtSide(byte aSide) {
+ return GT_Utility.intToStack(getCoverIDAtSide(aSide));
+ }
+
+ @Override
+ public boolean canPlaceCoverIDAtSide(byte aSide, int aID) {
+ return getCoverIDAtSide(aSide) == 0;
+ }
+
+ @Override
+ public boolean canPlaceCoverItemAtSide(byte aSide, ItemStack aCover) {
+ return getCoverIDAtSide(aSide) == 0;
+ }
+
+ @Override
+ public void setCoverDataAtSide(byte aSide, int aData) {
+ if (aSide >= 0 && aSide < 6) mCoverData[aSide] = aData;
+ }
+
+ @Override
+ public int getCoverDataAtSide(byte aSide) {
+ if (aSide >= 0 && aSide < 6) return mCoverData[aSide];
+ return 0;
+ }
+
+ @Override
+ public void setLightValue(byte aLightValue) {
+ //
+ }
+
+ @Override
+ public long getAverageElectricInput() {
+ return 0;
+ }
+
+ @Override
+ public long getAverageElectricOutput() {
+ return 0;
+ }
+
+ @Override
+ public boolean dropCover(byte aSide, byte aDroppedSide, boolean aForced) {
+ if (getCoverBehaviorAtSide(aSide).onCoverRemoval(aSide, getCoverIDAtSide(aSide), mCoverData[aSide], this, aForced) || aForced) {
+ ItemStack tStack = getCoverBehaviorAtSide(aSide).getDrop(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this);
+ if (tStack != null) {
+ tStack.setTagCompound(null);
+ EntityItem tEntity = new EntityItem(worldObj, getOffsetX(aDroppedSide, 1) + 0.5, getOffsetY(aDroppedSide, 1) + 0.5, getOffsetZ(aDroppedSide, 1) + 0.5, tStack);
+ tEntity.motionX = 0;
+ tEntity.motionY = 0;
+ tEntity.motionZ = 0;
+ worldObj.spawnEntityInWorld(tEntity);
+ }
+
+ setCoverIDAtSide(aSide, 0);
+ setOutputRedstoneSignal(aSide, (byte) 0);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public String getOwnerName() {
+ return "Player";
+ }
+
+ @Override
+ public String setOwnerName(String aName) {
+ return "Player";
+ }
+
+ @Override
+ public byte getComparatorValue(byte aSide) {
+ return canAccessData() ? mMetaTileEntity.getComparatorValue(aSide) : 0;
+ }
+
+ @Override
+ public byte getStrongOutputRedstoneSignal(byte aSide) {
+ return aSide >= 0 && aSide < 6 && (mStrongRedstone & (1 << aSide)) != 0 ? (byte) (mSidedRedstone[aSide] & 15) : 0;
+ }
+
+ @Override
+ public void setStrongOutputRedstoneSignal(byte aSide, byte aStrength) {
+ mStrongRedstone |= (1 << aSide);
+ setOutputRedstoneSignal(aSide, aStrength);
+ }
+
+ @Override
+ public ItemStack decrStackSize(int aIndex, int aAmount) {
+ if (canAccessData()) {
+ mInventoryChanged = true;
+ return mMetaTileEntity.decrStackSize(aIndex, aAmount);
+ }
+ return null;
+ }
+
+ @Override
+ public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
+ if (canAccessData()) return mMetaTileEntity.injectEnergyUnits(aSide, aVoltage, aAmperage);
+ return 0;
+ }
+
+ @Override
+ public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
+ return false;
+ }
+
+ @Override
+ public boolean acceptsRotationalEnergy(byte aSide) {
+ if (!canAccessData() || getCoverIDAtSide(aSide) != 0) return false;
+ return mMetaTileEntity.acceptsRotationalEnergy(aSide);
+ }
+
+ @Override
+ public boolean injectRotationalEnergy(byte aSide, long aSpeed, long aEnergy) {
+ if (!canAccessData() || getCoverIDAtSide(aSide) != 0) return false;
+ return mMetaTileEntity.injectRotationalEnergy(aSide, aSpeed, aEnergy);
+ }
+
+ @Override
+ public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ if (mTickTimer > 5 && canAccessData() && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidIn((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), aFluid == null ? null : aFluid.getFluid(), this))))
+ return mMetaTileEntity.fill(aSide, aFluid, doFill);
+ return 0;
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) {
+ if (mTickTimer > 5 && canAccessData() && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), mMetaTileEntity.getFluid() == null ? null : mMetaTileEntity.getFluid().getFluid(), this))))
+ return mMetaTileEntity.drain(aSide, maxDrain, doDrain);
+ return null;
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) {
+ if (mTickTimer > 5 && canAccessData() && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), aFluid == null ? null : aFluid.getFluid(), this))))
+ return mMetaTileEntity.drain(aSide, aFluid, doDrain);
+ return null;
+ }
+
+ @Override
+ public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
+ if (mTickTimer > 5 && canAccessData() && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidIn((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), aFluid, this))))
+ return mMetaTileEntity.canFill(aSide, aFluid);
+ return false;
+ }
+
+ @Override
+ public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
+ if (mTickTimer > 5 && canAccessData() && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), aFluid, this))))
+ return mMetaTileEntity.canDrain(aSide, aFluid);
+ return false;
+ }
+
+ @Override
+ public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
+ if (canAccessData() && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidIn((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), null, this)) || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), null, this))))
+ return mMetaTileEntity.getTankInfo(aSide);
+ return new FluidTankInfo[]{};
+ }
+
+ @Override
+ public boolean isInvalidTileEntity() {
+ return isInvalid();
+ }
+
+ @Override
+ public boolean addStackToSlot(int aIndex, ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack)) return true;
+ if (aIndex < 0 || aIndex >= getSizeInventory()) return false;
+ ItemStack tStack = getStackInSlot(aIndex);
+ if (GT_Utility.isStackInvalid(tStack)) {
+ setInventorySlotContents(aIndex, aStack);
+ return true;
+ }
+ aStack = GT_OreDictUnificator.get(aStack);
+ if (GT_Utility.areStacksEqual(tStack, aStack) && tStack.stackSize + aStack.stackSize <= Math.min(aStack.getMaxStackSize(), getInventoryStackLimit())) {
+ tStack.stackSize += aStack.stackSize;
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean addStackToSlot(int aIndex, ItemStack aStack, int aAmount) {
+ return addStackToSlot(aIndex, GT_Utility.copyAmount(aAmount, aStack));
+ }
+
+ @Override
+ public byte getColorization() {
+ return (byte) (mColor - 1);
+ }
+
+ @Override
+ public byte setColorization(byte aColor) {
+ if (aColor > 15 || aColor < -1) aColor = -1;
+ if (canAccessData()) mMetaTileEntity.onColorChangeServer(aColor);
+ return mColor = (byte) (aColor + 1);
+ }
+
+ @Override
+ public float getThickNess() {
+ if (canAccessData()) return mMetaTileEntity.getThickNess();
+ return 1.0F;
+ }
+
+ public boolean renderInside(byte aSide) {
+ if (canAccessData()) return mMetaTileEntity.renderInside(aSide);
+ return false;
+ }
+
+ @Override
+ public float getBlastResistance(byte aSide) {
+ return (mConnections & 192) != 0 ? 50.0F : 5.0F;
+ }
+
+ @Override
+ public boolean isMufflerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public boolean addMufflerUpgrade() {
+ return false;
+ }
+
+ @Override
+ public boolean hasMufflerUpgrade() {
+ return false;
+ }
+
+ @Override
+ public boolean isUniversalEnergyStored(long aEnergyAmount) {
+ return getUniversalEnergyStored() >= aEnergyAmount;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ {
+ if (canAccessData()) return getMetaTileEntity().getInfoData();
+ return new String[]{};
+ }
+ }
+
+ @Override
+ public byte getConnections() {
+ return mConnections;
+ }
+
+ @Override
+ public void markDirty() {
+ super.markDirty();
+ mInventoryChanged = true;
+ }
+
+ @Override
+ public int getLightOpacity() {
+ return mMetaTileEntity == null ? 0 : mMetaTileEntity.getLightOpacity();
+ }
+
+ @Override
+ public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) {
+ mMetaTileEntity.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
+ }
+
+ @Override
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ return mMetaTileEntity.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ }
+
+ @Override
+ public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) {
+ mMetaTileEntity.onEntityCollidedWithBlock(aWorld, aX, aY, aZ, collider);
+ }
+}
diff --git a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java
index 362e13d171..332470cf75 100644
--- a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java
@@ -1,710 +1,747 @@
-package gregtech.api.metatileentity;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.GregTech_API;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.util.GT_Config;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.block.Block;
-import net.minecraft.client.renderer.RenderBlocks;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.FluidTankInfo;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import static gregtech.api.enums.GT_Values.GT;
-import static gregtech.api.enums.GT_Values.V;
-
-/**
- * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
- * <p/>
- * Extend this Class to add a new MetaPipe
- * Call the Constructor with the desired ID at the load-phase (not preload and also not postload!)
- * Implement the newMetaEntity-Method to return a new ready instance of your MetaTileEntity
- * <p/>
- * Call the Constructor like the following example inside the Load Phase, to register it.
- * "new GT_MetaTileEntity_E_Furnace(54, "GT_E_Furnace", "Automatic E-Furnace");"
- */
-public abstract class MetaPipeEntity implements IMetaTileEntity {
- /**
- * The Inventory of the MetaTileEntity. Amount of Slots can be larger than 256. HAYO!
- */
- public final ItemStack[] mInventory;
- /**
- * This variable tells, which directions the Block is connected to. It is a Bitmask.
- */
- public byte mConnections = 0;
- /**
- * Only assigned for the MetaTileEntity in the List! Also only used to get the localized Name for the ItemStack and for getInvName.
- */
- public String mName;
- public boolean doTickProfilingInThisTick = true;
- /**
- * accessibility to this Field is no longer given, see below
- */
- private IGregTechTileEntity mBaseMetaTileEntity;
-
- /**
- * This registers your Machine at the List.
- * Use only ID's larger than 2048, because i reserved these ones.
- * See also the List in the API, as it has a Description containing all the reservations.
- *
- * @param aID the ID
- * @example for Constructor overload.
- * <p/>
- * public GT_MetaTileEntity_EBench(int aID, String mName, String mNameRegional) {
- * super(aID, mName, mNameRegional);
- * }
- */
- public MetaPipeEntity(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) {
- if (GregTech_API.sPostloadStarted || !GregTech_API.sPreloadStarted)
- throw new IllegalAccessError("This Constructor has to be called in the load Phase");
- if (GregTech_API.METATILEENTITIES[aID] == null) {
- GregTech_API.METATILEENTITIES[aID] = this;
- } else {
- throw new IllegalArgumentException("MetaMachine-Slot Nr. " + aID + " is already occupied!");
- }
- mName = aBasicName.replaceAll(" ", "_").toLowerCase(Locale.ENGLISH);
- setBaseMetaTileEntity(new BaseMetaPipeEntity());
- getBaseMetaTileEntity().setMetaTileID((short) aID);
- GT_LanguageManager.addStringLocalization("gt.blockmachines." + mName + ".name", aRegionalName);
- mInventory = new ItemStack[aInvSlotCount];
-
- if (GT.isClientSide()) {
- ItemStack tStack = new ItemStack(GregTech_API.sBlockMachines, 1, aID);
- tStack.getItem().addInformation(tStack, null, new ArrayList<String>(), true);
- }
- }
-
- /**
- * This is the normal Constructor.
- */
- public MetaPipeEntity(String aName, int aInvSlotCount) {
- mInventory = new ItemStack[aInvSlotCount];
- mName = aName;
- }
-
- /**
- * For Pipe Rendering
- */
- public abstract float getThickNess();
-
- /**
- * For Pipe Rendering
- */
- public abstract boolean renderInside(byte aSide);
-
- @Override
- public IGregTechTileEntity getBaseMetaTileEntity() {
- return mBaseMetaTileEntity;
- }
-
- @Override
- public void setBaseMetaTileEntity(IGregTechTileEntity aBaseMetaTileEntity) {
- if (mBaseMetaTileEntity != null && aBaseMetaTileEntity == null) {
- mBaseMetaTileEntity.getMetaTileEntity().inValidate();
- mBaseMetaTileEntity.setMetaTileEntity(null);
- }
- mBaseMetaTileEntity = aBaseMetaTileEntity;
- if (mBaseMetaTileEntity != null) {
- mBaseMetaTileEntity.setMetaTileEntity(this);
- }
- }
-
- @Override
- public ItemStack getStackForm(long aAmount) {
- return new ItemStack(GregTech_API.sBlockMachines, (int) aAmount, getBaseMetaTileEntity().getMetaTileID());
- }
-
- public boolean isCoverOnSide(BaseMetaPipeEntity aPipe, EntityLivingBase aEntity) {
- byte aSide = 6;
- double difference = aEntity.posY - (double) aPipe.yCoord;
- if (difference > 0.6 && difference < 0.99) {
- aSide = 1;
- }
- if (difference < -1.5 && difference > -1.99) {
- aSide = 0;
- }
- difference = aEntity.posZ - (double) aPipe.zCoord;
- if (difference < -0.05 && difference > -0.4) {
- aSide = 2;
- }
- if (difference > 1.05 && difference < 1.4) {
- aSide = 3;
- }
- difference = aEntity.posX - (double) aPipe.xCoord;
- if (difference < -0.05 && difference > -0.4) {
- aSide = 4;
- }
- if (difference > 1.05 && difference < 1.4) {
- aSide = 5;
- }
- boolean tCovered = false;
- if (aSide < 6 && mBaseMetaTileEntity.getCoverIDAtSide(aSide) > 0) {
- tCovered = true;
- }
- if((mConnections & (byte)(Math.pow(2, aSide))) != 0){
- tCovered = true;
- }
- //System.out.println("Cover: "+mBaseMetaTileEntity.getCoverIDAtSide(aSide));
- //toDo: filter cover ids that actually protect against temperature (rubber/plastic maybe?, more like asbestos)
- return tCovered;
- }
-
- @Override
- public void onServerStart() {/*Do nothing*/}
-
- @Override
- public void onWorldSave(File aSaveDirectory) {/*Do nothing*/}
-
- @Override
- public void onWorldLoad(File aSaveDirectory) {/*Do nothing*/}
-
- @Override
- public void onConfigLoad(GT_Config aConfig) {/*Do nothing*/}
-
- @Override
- public void setItemNBT(NBTTagCompound aNBT) {/*Do nothing*/}
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister aBlockIconRegister) {/*Do nothing*/}
-
- @Override
- public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) {
- return true;
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {/*Do nothing*/}
-
- @Override
- public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- return false;
- }
-
- @Override
- public void onExplosion() {/*Do nothing*/}
-
- @Override
- public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {/*Do nothing*/}
-
- @Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {/*Do nothing*/}
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {/*Do nothing*/}
-
- @Override
- public void inValidate() {/*Do nothing*/}
-
- @Override
- public void onRemoval() {/*Do nothing*/}
-
- @Override
- public void initDefaultModes(NBTTagCompound aNBT) {/*Do nothing*/}
-
- /**
- * When a GUI is opened
- */
- public void onOpenGUI() {/*Do nothing*/}
-
- /**
- * When a GUI is closed
- */
- public void onCloseGUI() {/*Do nothing*/}
-
- /**
- * a Player rightclicks the Machine
- * Sneaky rightclicks are not getting passed to this!
- */
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
- return false;
- }
-
- @Override
- public void onLeftclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {/*Do nothing*/}
-
- @Override
- public void onValueUpdate(byte aValue) {/*Do nothing*/}
-
- @Override
- public byte getUpdateData() {
- return 0;
- }
-
- @Override
- public void doSound(byte aIndex, double aX, double aY, double aZ) {/*Do nothing*/}
-
- @Override
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {/*Do nothing*/}
-
- @Override
- public void stopSoundLoop(byte aValue, double aX, double aY, double aZ) {/*Do nothing*/}
-
- @Override
- public final void sendSound(byte aIndex) {
- if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte) 4, aIndex);
- }
-
- @Override
- public final void sendLoopStart(byte aIndex) {
- if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte) 5, aIndex);
- }
-
- @Override
- public final void sendLoopEnd(byte aIndex) {
- if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte) 6, aIndex);
- }
-
- @Override
- public boolean isFacingValid(byte aFacing) {
- return false;
- }
-
- @Override
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public boolean isValidSlot(int aIndex) {
- return true;
- }
-
- @Override
- public boolean setStackToZeroInsteadOfNull(int aIndex) {
- return false;
- }
-
- @Override
- public ArrayList<String> getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, ArrayList<String> aList) {
- return aList;
- }
-
- @Override
- public boolean isLiquidInput(byte aSide) {
- return true;
- }
-
- @Override
- public boolean isLiquidOutput(byte aSide) {
- return true;
- }
-
- /**
- * gets the contained Liquid
- */
- @Override
- public FluidStack getFluid() {
- return null;
- }
-
- /**
- * tries to fill this Tank
- */
- @Override
- public int fill(FluidStack resource, boolean doFill) {
- return 0;
- }
-
- /**
- * tries to empty this Tank
- */
- @Override
- public FluidStack drain(int maxDrain, boolean doDrain) {
- return null;
- }
-
- /**
- * Tank pressure
- */
- public int getTankPressure() {
- return 0;
- }
-
- /**
- * Liquid Capacity
- */
- @Override
- public int getCapacity() {
- return 0;
- }
-
- /**
- * Progress this machine has already made
- */
- public int getProgresstime() {
- return 0;
- }
-
- /**
- * Progress this Machine has to do to produce something
- */
- public int maxProgresstime() {
- return 0;
- }
-
- /**
- * Increases the Progress, returns the overflown Progress.
- */
- public int increaseProgress(int aProgress) {
- return 0;
- }
-
- @Override
- public void onMachineBlockUpdate() {/*Do nothing*/}
-
- @Override
- public void receiveClientEvent(byte aEventID, byte aValue) {/*Do nothing*/}
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public byte getComparatorValue(byte aSide) {
- return 0;
- }
-
- @Override
- public boolean acceptsRotationalEnergy(byte aSide) {
- return false;
- }
-
- @Override
- public boolean injectRotationalEnergy(byte aSide, long aSpeed, long aEnergy) {
- return false;
- }
-
- @Override
- public String getSpecialVoltageToolTip() {
- return null;
- }
-
- @Override
- public boolean isGivingInformation() {
- return false;
- }
-
- @Override
- public String[] getInfoData() {
- return new String[]{};
- }
-
- public boolean isDigitalChest() {
- return false;
- }
-
- public ItemStack[] getStoredItemData() {
- return null;
- }
-
- public void setItemCount(int aCount) {/*Do nothing*/}
-
- public int getMaxItemCount() {
- return 0;
- }
-
- @Override
- public int getSizeInventory() {
- return mInventory.length;
- }
-
- @Override
- public ItemStack getStackInSlot(int aIndex) {
- if (aIndex >= 0 && aIndex < mInventory.length) return mInventory[aIndex];
- return null;
- }
-
- @Override
- public void setInventorySlotContents(int aIndex, ItemStack aStack) {
- if (aIndex >= 0 && aIndex < mInventory.length) mInventory[aIndex] = aStack;
- }
-
- @Override
- public String getInventoryName() {
- if (GregTech_API.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()] != null)
- return GregTech_API.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()].getMetaName();
- return "";
- }
-
- @Override
- public int getInventoryStackLimit() {
- return 64;
- }
-
- @Override
- public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
- return getBaseMetaTileEntity().isValidSlot(aIndex);
- }
-
- @Override
- public ItemStack decrStackSize(int aIndex, int aAmount) {
- ItemStack tStack = getStackInSlot(aIndex), rStack = GT_Utility.copy(tStack);
- if (tStack != null) {
- if (tStack.stackSize <= aAmount) {
- if (setStackToZeroInsteadOfNull(aIndex)) tStack.stackSize = 0;
- else setInventorySlotContents(aIndex, null);
- } else {
- rStack = tStack.splitStack(aAmount);
- if (tStack.stackSize == 0 && !setStackToZeroInsteadOfNull(aIndex))
- setInventorySlotContents(aIndex, null);
- }
- }
- return rStack;
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(int aSide) {
- ArrayList<Integer> tList = new ArrayList<Integer>();
- IGregTechTileEntity tTileEntity = getBaseMetaTileEntity();
- boolean tSkip = tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), -2, tTileEntity) || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), -2, tTileEntity);
- for (int i = 0; i < getSizeInventory(); i++)
- if (isValidSlot(i) && (tSkip || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), i, tTileEntity) || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), i, tTileEntity)))
- tList.add(i);
- int[] rArray = new int[tList.size()];
- for (int i = 0; i < rArray.length; i++) rArray[i] = tList.get(i);
- return rArray;
- }
-
- @Override
- public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
- return isValidSlot(aIndex) && aStack != null && aIndex < mInventory.length && (mInventory[aIndex] == null || GT_Utility.areStacksEqual(aStack, mInventory[aIndex])) && allowPutStack(getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack);
- }
-
- @Override
- public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) {
- return isValidSlot(aIndex) && aStack != null && aIndex < mInventory.length && allowPullStack(getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack);
- }
-
- @Override
- public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
- return fill(aSide, new FluidStack(aFluid, 1), false) == 1;
- }
-
- @Override
- public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
- return drain(aSide, new FluidStack(aFluid, 1), false) != null;
- }
-
- @Override
- public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
- if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[]{};
- return new FluidTankInfo[]{getInfo()};
- }
-
- public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
- return fill(aFluid, doFill);
- }
-
- @Override
- public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
- return fill_default(aSide, aFluid, doFill);
- }
-
- @Override
- public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) {
- if (getFluid() != null && aFluid != null && getFluid().isFluidEqual(aFluid))
- return drain(aFluid.amount, doDrain);
- return null;
- }
-
- @Override
- public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) {
- return drain(maxDrain, doDrain);
- }
-
- @Override
- public int getFluidAmount() {
- return 0;
- }
-
- @Override
- public FluidTankInfo getInfo() {
- return new FluidTankInfo(this);
- }
-
- @Override
- public String getMetaName() {
- return mName;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(int i) {
- return null;
- }
-
- @Override
- public boolean doTickProfilingMessageDuringThisTick() {
- return doTickProfilingInThisTick;
- }
-
- @Override
- public boolean isUseableByPlayer(EntityPlayer entityplayer) {
- return false;
- }
-
- @Override
- public boolean connectsToItemPipe(byte aSide) {
- return false;
- }
-
- @Override
- public void openInventory() {
- //
- }
-
- @Override
- public void closeInventory() {
- //
- }
-
- @Override
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return null;
- }
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return null;
- }
-
- @Override
- public float getExplosionResistance(byte aSide) {
- return 10.0F;
- }
-
- @Override
- public ItemStack[] getRealInventory() {
- return mInventory;
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return false;
- }
-
- @Override
- public void markDirty() {
- //
- }
-
- @Override
- public void onColorChangeServer(byte aColor) {
- //
- }
-
- @Override
- public void onColorChangeClient(byte aColor) {
- //
- }
-
- public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
- return 0;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean renderInInventory(Block aBlock, int aMeta, RenderBlocks aRenderer) {
- return false;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean renderInWorld(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) {
- return false;
- }
-
- @Override
- public void doExplosion(long aExplosionPower) {
- float tStrength =
- aExplosionPower < V[0] ? 1.0F :
- aExplosionPower < V[1] ? 2.0F :
- aExplosionPower < V[2] ? 3.0F :
- aExplosionPower < V[3] ? 4.0F :
- aExplosionPower < V[4] ? 5.0F :
- aExplosionPower < V[4] * 2 ? 6.0F :
- aExplosionPower < V[5] ? 7.0F :
- aExplosionPower < V[6] ? 8.0F :
- aExplosionPower < V[7] ? 9.0F :
- aExplosionPower < V[8] ? 10.0F :
- aExplosionPower < V[8] * 2 ? 11.0F :
- aExplosionPower < V[9] ? 12.0F :
- aExplosionPower < V[10] ? 13.0F :
- aExplosionPower < V[11] ? 14.0F :
- aExplosionPower < V[12] ? 15.0F :
- aExplosionPower < V[12] * 2 ? 16.0F :
- aExplosionPower < V[13] ? 17.0F :
- aExplosionPower < V[14] ? 18.0F :
- aExplosionPower < V[15] ? 19.0F : 20.0F;
- int tX = getBaseMetaTileEntity().getXCoord(), tY = getBaseMetaTileEntity().getYCoord(), tZ = getBaseMetaTileEntity().getZCoord();
- World tWorld = getBaseMetaTileEntity().getWorld();
- tWorld.setBlock(tX, tY, tZ, Blocks.air);
- if (GregTech_API.sMachineExplosions)
- tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true);
- }
-
- @Override
- public int getLightOpacity() {
- return 0;
- }
-
- @Override
- public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) {
- AxisAlignedBB axisalignedbb1 = getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- if (axisalignedbb1 != null && inputAABB.intersectsWith(axisalignedbb1)) outputAABB.add(axisalignedbb1);
- }
-
- @Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
- }
-
- @Override
- public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) {
- //
- }
-
- @Override
- public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
- //
- }
-
- @Override
- public boolean allowGeneralRedstoneOutput(){
- return false;
- }
-
- @Override
- public boolean hasAlternativeModeText() {
- return false;
- }
-
- @Override
- public String getAlternativeModeText() {
- return "";
- }
-}
+package gregtech.api.metatileentity;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.GT_Mod;
+import gregtech.api.GregTech_API;
+import gregtech.api.interfaces.metatileentity.IConnectable;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.util.GT_Config;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.block.Block;
+import net.minecraft.client.renderer.RenderBlocks;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import static gregtech.api.enums.GT_Values.GT;
+import static gregtech.api.enums.GT_Values.V;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <p/>
+ * Extend this Class to add a new MetaPipe
+ * Call the Constructor with the desired ID at the load-phase (not preload and also not postload!)
+ * Implement the newMetaEntity-Method to return a new ready instance of your MetaTileEntity
+ * <p/>
+ * Call the Constructor like the following example inside the Load Phase, to register it.
+ * "new GT_MetaTileEntity_E_Furnace(54, "GT_E_Furnace", "Automatic E-Furnace");"
+ */
+public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
+ /**
+ * The Inventory of the MetaTileEntity. Amount of Slots can be larger than 256. HAYO!
+ */
+ public final ItemStack[] mInventory;
+ /**
+ * This variable tells, which directions the Block is connected to. It is a Bitmask.
+ */
+ public byte mConnections = 0;
+ /**
+ * Only assigned for the MetaTileEntity in the List! Also only used to get the localized Name for the ItemStack and for getInvName.
+ */
+ public String mName;
+ public boolean doTickProfilingInThisTick = true;
+ /**
+ * accessibility to this Field is no longer given, see below
+ */
+ private IGregTechTileEntity mBaseMetaTileEntity;
+
+ /**
+ * This registers your Machine at the List.
+ * Use only ID's larger than 2048, because i reserved these ones.
+ * See also the List in the API, as it has a Description containing all the reservations.
+ *
+ * @param aID the ID
+ * @example for Constructor overload.
+ * <p/>
+ * public GT_MetaTileEntity_EBench(int aID, String mName, String mNameRegional) {
+ * super(aID, mName, mNameRegional);
+ * }
+ */
+ public MetaPipeEntity(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) {
+ if (GregTech_API.sPostloadStarted || !GregTech_API.sPreloadStarted)
+ throw new IllegalAccessError("This Constructor has to be called in the load Phase");
+ if (GregTech_API.METATILEENTITIES[aID] == null) {
+ GregTech_API.METATILEENTITIES[aID] = this;
+ } else {
+ throw new IllegalArgumentException("MetaMachine-Slot Nr. " + aID + " is already occupied!");
+ }
+ mName = aBasicName.replaceAll(" ", "_").toLowerCase(Locale.ENGLISH);
+ setBaseMetaTileEntity(new BaseMetaPipeEntity());
+ getBaseMetaTileEntity().setMetaTileID((short) aID);
+ GT_LanguageManager.addStringLocalization("gt.blockmachines." + mName + ".name", aRegionalName);
+ mInventory = new ItemStack[aInvSlotCount];
+
+ if (GT.isClientSide()) {
+ ItemStack tStack = new ItemStack(GregTech_API.sBlockMachines, 1, aID);
+ tStack.getItem().addInformation(tStack, null, new ArrayList<String>(), true);
+ }
+ }
+
+ /**
+ * This is the normal Constructor.
+ */
+ public MetaPipeEntity(String aName, int aInvSlotCount) {
+ mInventory = new ItemStack[aInvSlotCount];
+ mName = aName;
+ }
+
+ /**
+ * For Pipe Rendering
+ */
+ public abstract float getThickNess();
+
+ /**
+ * For Pipe Rendering
+ */
+ public abstract boolean renderInside(byte aSide);
+
+ @Override
+ public IGregTechTileEntity getBaseMetaTileEntity() {
+ return mBaseMetaTileEntity;
+ }
+
+ @Override
+ public void setBaseMetaTileEntity(IGregTechTileEntity aBaseMetaTileEntity) {
+ if (mBaseMetaTileEntity != null && aBaseMetaTileEntity == null) {
+ mBaseMetaTileEntity.getMetaTileEntity().inValidate();
+ mBaseMetaTileEntity.setMetaTileEntity(null);
+ }
+ mBaseMetaTileEntity = aBaseMetaTileEntity;
+ if (mBaseMetaTileEntity != null) {
+ mBaseMetaTileEntity.setMetaTileEntity(this);
+ }
+ }
+
+ @Override
+ public ItemStack getStackForm(long aAmount) {
+ return new ItemStack(GregTech_API.sBlockMachines, (int) aAmount, getBaseMetaTileEntity().getMetaTileID());
+ }
+
+ public boolean isCoverOnSide(BaseMetaPipeEntity aPipe, EntityLivingBase aEntity) {
+ byte aSide = 6;
+ double difference = aEntity.posY - (double) aPipe.yCoord;
+ if (difference > 0.6 && difference < 0.99) {
+ aSide = 1;
+ }
+ if (difference < -1.5 && difference > -1.99) {
+ aSide = 0;
+ }
+ difference = aEntity.posZ - (double) aPipe.zCoord;
+ if (difference < -0.05 && difference > -0.4) {
+ aSide = 2;
+ }
+ if (difference > 1.05 && difference < 1.4) {
+ aSide = 3;
+ }
+ difference = aEntity.posX - (double) aPipe.xCoord;
+ if (difference < -0.05 && difference > -0.4) {
+ aSide = 4;
+ }
+ if (difference > 1.05 && difference < 1.4) {
+ aSide = 5;
+ }
+ boolean tCovered = false;
+ if (aSide < 6 && mBaseMetaTileEntity.getCoverIDAtSide(aSide) > 0) {
+ tCovered = true;
+ }
+ if((mConnections & (byte)(Math.pow(2, aSide))) != 0){
+ tCovered = true;
+ }
+ //System.out.println("Cover: "+mBaseMetaTileEntity.getCoverIDAtSide(aSide));
+ //toDo: filter cover ids that actually protect against temperature (rubber/plastic maybe?, more like asbestos)
+ return tCovered;
+ }
+
+ @Override
+ public void onServerStart() {/*Do nothing*/}
+
+ @Override
+ public void onWorldSave(File aSaveDirectory) {/*Do nothing*/}
+
+ @Override
+ public void onWorldLoad(File aSaveDirectory) {/*Do nothing*/}
+
+ @Override
+ public void onConfigLoad(GT_Config aConfig) {/*Do nothing*/}
+
+ @Override
+ public void setItemNBT(NBTTagCompound aNBT) {/*Do nothing*/}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister aBlockIconRegister) {/*Do nothing*/}
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) {
+ return true;
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {/*Do nothing*/}
+
+ @Override
+ public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ return false;
+ }
+
+ public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ return false;
+ }
+
+ public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ return false;
+ }
+
+ @Override
+ public void onExplosion() {/*Do nothing*/}
+
+ @Override
+ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {/*Do nothing*/}
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {/*Do nothing*/}
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {/*Do nothing*/}
+
+ @Override
+ public void inValidate() {/*Do nothing*/}
+
+ @Override
+ public void onRemoval() {/*Do nothing*/}
+
+ @Override
+ public void initDefaultModes(NBTTagCompound aNBT) {/*Do nothing*/}
+
+ /**
+ * When a GUI is opened
+ */
+ public void onOpenGUI() {/*Do nothing*/}
+
+ /**
+ * When a GUI is closed
+ */
+ public void onCloseGUI() {/*Do nothing*/}
+
+ /**
+ * a Player rightclicks the Machine
+ * Sneaky rightclicks are not getting passed to this!
+ */
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
+ return false;
+ }
+
+ @Override
+ public void onLeftclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {/*Do nothing*/}
+
+ @Override
+ public void onValueUpdate(byte aValue) {/*Do nothing*/}
+
+ @Override
+ public byte getUpdateData() {
+ return 0;
+ }
+
+ @Override
+ public void doSound(byte aIndex, double aX, double aY, double aZ) {/*Do nothing*/}
+
+ @Override
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {/*Do nothing*/}
+
+ @Override
+ public void stopSoundLoop(byte aValue, double aX, double aY, double aZ) {/*Do nothing*/}
+
+ @Override
+ public final void sendSound(byte aIndex) {
+ if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte) 4, aIndex);
+ }
+
+ @Override
+ public final void sendLoopStart(byte aIndex) {
+ if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte) 5, aIndex);
+ }
+
+ @Override
+ public final void sendLoopEnd(byte aIndex) {
+ if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte) 6, aIndex);
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return false;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return true;
+ }
+
+ @Override
+ public boolean setStackToZeroInsteadOfNull(int aIndex) {
+ return false;
+ }
+
+ @Override
+ public ArrayList<String> getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, ArrayList<String> aList) {
+ return aList;
+ }
+
+ @Override
+ public boolean isLiquidInput(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public boolean isLiquidOutput(byte aSide) {
+ return false;
+ }
+
+ /**
+ * gets the contained Liquid
+ */
+ @Override
+ public FluidStack getFluid() {
+ return null;
+ }
+
+ /**
+ * tries to fill this Tank
+ */
+ @Override
+ public int fill(FluidStack resource, boolean doFill) {
+ return 0;
+ }
+
+ /**
+ * tries to empty this Tank
+ */
+ @Override
+ public FluidStack drain(int maxDrain, boolean doDrain) {
+ return null;
+ }
+
+ /**
+ * Tank pressure
+ */
+ public int getTankPressure() {
+ return 0;
+ }
+
+ /**
+ * Liquid Capacity
+ */
+ @Override
+ public int getCapacity() {
+ return 0;
+ }
+
+ /**
+ * Progress this machine has already made
+ */
+ public int getProgresstime() {
+ return 0;
+ }
+
+ /**
+ * Progress this Machine has to do to produce something
+ */
+ public int maxProgresstime() {
+ return 0;
+ }
+
+ /**
+ * Increases the Progress, returns the overflown Progress.
+ */
+ public int increaseProgress(int aProgress) {
+ return 0;
+ }
+
+ @Override
+ public void onMachineBlockUpdate() {/*Do nothing*/}
+
+ @Override
+ public void receiveClientEvent(byte aEventID, byte aValue) {/*Do nothing*/}
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public byte getComparatorValue(byte aSide) {
+ return 0;
+ }
+
+ @Override
+ public boolean acceptsRotationalEnergy(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public boolean injectRotationalEnergy(byte aSide, long aSpeed, long aEnergy) {
+ return false;
+ }
+
+ @Override
+ public String getSpecialVoltageToolTip() {
+ return null;
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return false;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return new String[]{};
+ }
+
+ public boolean isDigitalChest() {
+ return false;
+ }
+
+ public ItemStack[] getStoredItemData() {
+ return null;
+ }
+
+ public void setItemCount(int aCount) {/*Do nothing*/}
+
+ public int getMaxItemCount() {
+ return 0;
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return mInventory.length;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(int aIndex) {
+ if (aIndex >= 0 && aIndex < mInventory.length) return mInventory[aIndex];
+ return null;
+ }
+
+ @Override
+ public void setInventorySlotContents(int aIndex, ItemStack aStack) {
+ if (aIndex >= 0 && aIndex < mInventory.length) mInventory[aIndex] = aStack;
+ }
+
+ @Override
+ public String getInventoryName() {
+ if (GregTech_API.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()] != null)
+ return GregTech_API.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()].getMetaName();
+ return "";
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ @Override
+ public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
+ return getBaseMetaTileEntity().isValidSlot(aIndex);
+ }
+
+ @Override
+ public ItemStack decrStackSize(int aIndex, int aAmount) {
+ ItemStack tStack = getStackInSlot(aIndex), rStack = GT_Utility.copy(tStack);
+ if (tStack != null) {
+ if (tStack.stackSize <= aAmount) {
+ if (setStackToZeroInsteadOfNull(aIndex)) tStack.stackSize = 0;
+ else setInventorySlotContents(aIndex, null);
+ } else {
+ rStack = tStack.splitStack(aAmount);
+ if (tStack.stackSize == 0 && !setStackToZeroInsteadOfNull(aIndex))
+ setInventorySlotContents(aIndex, null);
+ }
+ }
+ return rStack;
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(int aSide) {
+ ArrayList<Integer> tList = new ArrayList<Integer>();
+ IGregTechTileEntity tTileEntity = getBaseMetaTileEntity();
+ boolean tSkip = tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), -2, tTileEntity) || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), -2, tTileEntity);
+ for (int i = 0; i < getSizeInventory(); i++)
+ if (isValidSlot(i) && (tSkip || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), i, tTileEntity) || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), i, tTileEntity)))
+ tList.add(i);
+ int[] rArray = new int[tList.size()];
+ for (int i = 0; i < rArray.length; i++) rArray[i] = tList.get(i);
+ return rArray;
+ }
+
+ @Override
+ public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
+ return isValidSlot(aIndex) && aStack != null && aIndex < mInventory.length && (mInventory[aIndex] == null || GT_Utility.areStacksEqual(aStack, mInventory[aIndex])) && allowPutStack(getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack);
+ }
+
+ @Override
+ public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) {
+ return isValidSlot(aIndex) && aStack != null && aIndex < mInventory.length && allowPullStack(getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack);
+ }
+
+ @Override
+ public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
+ return fill(aSide, new FluidStack(aFluid, 1), false) == 1;
+ }
+
+ @Override
+ public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
+ return drain(aSide, new FluidStack(aFluid, 1), false) != null;
+ }
+
+ @Override
+ public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
+ if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[]{};
+ return new FluidTankInfo[]{getInfo()};
+ }
+
+ public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ return fill(aFluid, doFill);
+ }
+
+ @Override
+ public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ return fill_default(aSide, aFluid, doFill);
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) {
+ if (getFluid() != null && aFluid != null && getFluid().isFluidEqual(aFluid))
+ return drain(aFluid.amount, doDrain);
+ return null;
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) {
+ return drain(maxDrain, doDrain);
+ }
+
+ @Override
+ public int getFluidAmount() {
+ return 0;
+ }
+
+ @Override
+ public FluidTankInfo getInfo() {
+ return new FluidTankInfo(this);
+ }
+
+ @Override
+ public String getMetaName() {
+ return mName;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(int i) {
+ return null;
+ }
+
+ @Override
+ public boolean doTickProfilingMessageDuringThisTick() {
+ return doTickProfilingInThisTick;
+ }
+
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer entityplayer) {
+ return false;
+ }
+
+ @Override
+ public boolean connectsToItemPipe(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public void openInventory() {
+ //
+ }
+
+ @Override
+ public void closeInventory() {
+ //
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ @Override
+ public float getExplosionResistance(byte aSide) {
+ return 10.0F;
+ }
+
+ @Override
+ public ItemStack[] getRealInventory() {
+ return mInventory;
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return false;
+ }
+
+ @Override
+ public void markDirty() {
+ //
+ }
+
+ @Override
+ public void onColorChangeServer(byte aColor) {
+ //
+ }
+
+ @Override
+ public void onColorChangeClient(byte aColor) {
+ //
+ }
+
+ public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
+ return 0;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean renderInInventory(Block aBlock, int aMeta, RenderBlocks aRenderer) {
+ return false;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean renderInWorld(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) {
+ return false;
+ }
+
+ @Override
+ public void doExplosion(long aExplosionPower) {
+ float tStrength =
+ aExplosionPower < V[0] ? 1.0F :
+ aExplosionPower < V[1] ? 2.0F :
+ aExplosionPower < V[2] ? 3.0F :
+ aExplosionPower < V[3] ? 4.0F :
+ aExplosionPower < V[4] ? 5.0F :
+ aExplosionPower < V[4] * 2 ? 6.0F :
+ aExplosionPower < V[5] ? 7.0F :
+ aExplosionPower < V[6] ? 8.0F :
+ aExplosionPower < V[7] ? 9.0F :
+ aExplosionPower < V[8] ? 10.0F :
+ aExplosionPower < V[8] * 2 ? 11.0F :
+ aExplosionPower < V[9] ? 12.0F :
+ aExplosionPower < V[10] ? 13.0F :
+ aExplosionPower < V[11] ? 14.0F :
+ aExplosionPower < V[12] ? 15.0F :
+ aExplosionPower < V[12] * 2 ? 16.0F :
+ aExplosionPower < V[13] ? 17.0F :
+ aExplosionPower < V[14] ? 18.0F :
+ aExplosionPower < V[15] ? 19.0F : 20.0F;
+ int tX = getBaseMetaTileEntity().getXCoord(), tY = getBaseMetaTileEntity().getYCoord(), tZ = getBaseMetaTileEntity().getZCoord();
+ World tWorld = getBaseMetaTileEntity().getWorld();
+ tWorld.setBlock(tX, tY, tZ, Blocks.air);
+ if (GregTech_API.sMachineExplosions)
+ tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true);
+ }
+
+ @Override
+ public int getLightOpacity() {
+ return 0;
+ }
+
+ @Override
+ public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) {
+ AxisAlignedBB axisalignedbb1 = getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ if (axisalignedbb1 != null && inputAABB.intersectsWith(axisalignedbb1)) outputAABB.add(axisalignedbb1);
+ }
+
+ @Override
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
+ }
+
+ @Override
+ public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) {
+ //
+ }
+
+ @Override
+ public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ //
+ }
+
+ @Override
+ public boolean allowGeneralRedstoneOutput(){
+ return false;
+ }
+
+ @Override
+ public boolean hasAlternativeModeText() {
+ return false;
+ }
+
+ @Override
+ public String getAlternativeModeText() {
+ return "";
+ }
+
+ public String trans(String aKey, String aEnglish){
+ return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_"+aKey, aEnglish, false);
+ }
+
+ @Override
+ public int connect(byte aSide) {
+ if (aSide >= 6) return 0;
+ mConnections |= (1 << aSide);
+ byte tSide = GT_Utility.getOppositeSide(aSide);
+ IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSide(aSide);
+ IMetaTileEntity tPipe = tTileEntity instanceof IGregTechTileEntity ? ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() : null;
+ if (this.getClass().isInstance(tPipe) && (((MetaPipeEntity) tPipe).mConnections & (1 << tSide)) == 0)
+ ((MetaPipeEntity) tPipe).connect(tSide);
+ return 1;
+ }
+
+ @Override
+ public void disconnect(byte aSide) {
+ if (aSide >= 6) return;
+ mConnections &= ~(1 << aSide);
+ byte tSide = GT_Utility.getOppositeSide(aSide);
+ IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSide(aSide);
+ IMetaTileEntity tPipe = tTileEntity == null ? null : tTileEntity.getMetaTileEntity();
+ if (this.getClass().isInstance(tPipe) && (((MetaPipeEntity) tPipe).mConnections & (1 << tSide)) != 0)
+ ((MetaPipeEntity) tPipe).disconnect(tSide);
+ }
+}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java
index 2c141728a1..ad51707340 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java
@@ -1,412 +1,466 @@
-package gregtech.api.metatileentity.implementations;
-
-import cofh.api.energy.IEnergyReceiver;
-import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Dyes;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.TextureSet;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntityCable;
-import gregtech.api.interfaces.tileentity.IColoredTileEntity;
-import gregtech.api.interfaces.tileentity.IEnergyConnected;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.BaseMetaPipeEntity;
-import gregtech.api.metatileentity.MetaPipeEntity;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.GT_Client;
-import ic2.api.energy.tile.IEnergySink;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import static gregtech.api.enums.GT_Values.VN;
-
-public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTileEntityCable {
- public final float mThickNess;
- public final Materials mMaterial;
- public final long mCableLossPerMeter, mAmperage, mVoltage;
- public final boolean mInsulated, mCanShock;
- public int mTransferredAmperage = 0, mTransferredAmperageLast20 = 0,mTransferredAmperageLast20OK=0,mTransferredAmperageOK=0;
- public long mTransferredVoltageLast20 = 0, mTransferredVoltage = 0,mTransferredVoltageLast20OK=0,mTransferredVoltageOK=0;
- public long mRestRF;
- public int mOverheat;
- public static short mMaxOverheat=(short) (GT_Mod.gregtechproxy.mWireHeatingTicks * 100);
-
- private int[] lastAmperage;
- private long lastWorldTick;
-
- public GT_MetaPipeEntity_Cable(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
- super(aID, aName, aNameRegional, 0);
- mThickNess = aThickNess;
- mMaterial = aMaterial;
- mAmperage = aAmperage;
- mVoltage = aVoltage;
- mInsulated = aInsulated;
- mCanShock = aCanShock;
- mCableLossPerMeter = aCableLossPerMeter;
- }
-
- public GT_MetaPipeEntity_Cable(String aName, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
- super(aName, 0);
- mThickNess = aThickNess;
- mMaterial = aMaterial;
- mAmperage = aAmperage;
- mVoltage = aVoltage;
- mInsulated = aInsulated;
- mCanShock = aCanShock;
- mCableLossPerMeter = aCableLossPerMeter;
- }
-
- @Override
- public byte getTileEntityBaseType() {
- return (byte) (mInsulated ? 9 : 8);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaPipeEntity_Cable(mName, mThickNess, mMaterial, mCableLossPerMeter, mAmperage, mVoltage, mInsulated, mCanShock);
- }
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
- if (!mInsulated)
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], Dyes.getModulation(aColorIndex, mMaterial.mRGBa) )};
- if (aConnected) {
- float tThickNess = getThickNess();
- if (tThickNess < 0.124F)
- return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- if (tThickNess < 0.374F)//0.375 x1
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_TINY, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- if (tThickNess < 0.499F)//0.500 x2
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_SMALL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- if (tThickNess < 0.624F)//0.625 x4
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- if (tThickNess < 0.749F)//0.750 x8
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM_PLUS, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- if (tThickNess < 0.874F)//0.825 x12
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_LARGE, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_HUGE, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- }
- return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- }
-
- @Override
- public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) {
- if (mCanShock && (((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity))
- GT_Utility.applyElectricityDamage((EntityLivingBase) aEntity, mTransferredVoltageLast20, mTransferredAmperageLast20);
- }
-
- @Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- float tSpace = (1f - mThickNess)/2;
- float tSide0 = tSpace;
- float tSide1 = 1f - tSpace;
- float tSide2 = tSpace;
- float tSide3 = 1f - tSpace;
- float tSide4 = tSpace;
- float tSide5 = 1f - tSpace;
-
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;}
-
- byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections;
- if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f;
- if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f;
- if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f;
- if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f;
- if((tConn & (1 << ForgeDirection.WEST.ordinal()) ) != 0) tSide4 = 0f;
- if((tConn & (1 << ForgeDirection.EAST.ordinal()) ) != 0) tSide5 = 1f;
-
- return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3);
- }
-
- @Override
- public boolean isSimpleMachine() {
- return true;
- }
-
- @Override
- public boolean isFacingValid(byte aFacing) {
- return false;
- }
-
- @Override
- public boolean isValidSlot(int aIndex) {
- return true;
- }
-
- @Override
- public final boolean renderInside(byte aSide) {
- return false;
- }
-
- @Override
- public int getProgresstime() {
- return (int) mTransferredAmperage * 64;
- }
-
- @Override
- public int maxProgresstime() {
- return (int) mAmperage * 64;
- }
-
- @Override
- public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
- if (!getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsEnergyIn(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), getBaseMetaTileEntity()))
- return 0;
- return transferElectricity(aSide, aVoltage, aAmperage, new ArrayList<TileEntity>(Arrays.asList((TileEntity) getBaseMetaTileEntity())));
- }
-
- @Override
- public long transferElectricity(byte aSide, long aVoltage, long aAmperage, ArrayList<TileEntity> aAlreadyPassedTileEntityList) {
- long rUsedAmperes = 0;
- aVoltage -= mCableLossPerMeter;
- if (aVoltage > 0) for (byte i = 0; i < 6 && aAmperage > rUsedAmperes; i++)
- if (i != aSide && (mConnections & (1 << i)) != 0 && getBaseMetaTileEntity().getCoverBehaviorAtSide(i).letsEnergyOut(i, getBaseMetaTileEntity().getCoverIDAtSide(i), getBaseMetaTileEntity().getCoverDataAtSide(i), getBaseMetaTileEntity())) {
- TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(i);
- if (!aAlreadyPassedTileEntityList.contains(tTileEntity)) {
- aAlreadyPassedTileEntityList.add(tTileEntity);
- if (tTileEntity instanceof IEnergyConnected) {
- if (getBaseMetaTileEntity().getColorization() >= 0) {
- byte tColor = ((IEnergyConnected) tTileEntity).getColorization();
- if (tColor >= 0 && tColor != getBaseMetaTileEntity().getColorization()) continue;
- }
- if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() instanceof IMetaTileEntityCable && ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(GT_Utility.getOppositeSide(i)).letsEnergyIn(GT_Utility.getOppositeSide(i), ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(GT_Utility.getOppositeSide(i)), ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(GT_Utility.getOppositeSide(i)), ((IGregTechTileEntity) tTileEntity))) {
- if (((IGregTechTileEntity) tTileEntity).getTimer() > 50)
- rUsedAmperes += ((IMetaTileEntityCable) ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()).transferElectricity(GT_Utility.getOppositeSide(i), aVoltage, aAmperage - rUsedAmperes, aAlreadyPassedTileEntityList);
- } else {
- rUsedAmperes += ((IEnergyConnected) tTileEntity).injectEnergyUnits(GT_Utility.getOppositeSide(i), aVoltage, aAmperage - rUsedAmperes);
- }
-// } else if (tTileEntity instanceof IEnergySink) {
-// ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
-// if (((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)getBaseMetaTileEntity(), tDirection)) {
-// if (((IEnergySink)tTileEntity).demandedEnergyUnits() > 0 && ((IEnergySink)tTileEntity).injectEnergyUnits(tDirection, aVoltage) < aVoltage) rUsedAmperes++;
-// }
- } else if (tTileEntity instanceof IEnergySink) {
- ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
- if (((IEnergySink) tTileEntity).acceptsEnergyFrom((TileEntity) getBaseMetaTileEntity(), tDirection)) {
- if (((IEnergySink) tTileEntity).getDemandedEnergy() > 0 && ((IEnergySink) tTileEntity).injectEnergy(tDirection, aVoltage, aVoltage) < aVoltage)
- rUsedAmperes++;
- }
- } else if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver) {
- ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
- long rfOUT = aVoltage * GregTech_API.mEUtoRF / 100;
- int rfOut = rfOUT>Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)rfOUT;
- if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) == rfOut) {
- ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, false);
- rUsedAmperes++;
- } else if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) > 0) {
- if (mRestRF == 0) {
- int RFtrans = ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, (int) rfOut, false);
- rUsedAmperes++;
- mRestRF = rfOut - RFtrans;
- } else {
- int RFtrans = ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, (int) mRestRF, false);
- mRestRF = mRestRF - RFtrans;
- }
- }
- if (GregTech_API.mRFExplosions && ((IEnergyReceiver) tTileEntity).getMaxEnergyStored(tDirection) < rfOut * 600) {
- if (rfOut > 32 * GregTech_API.mEUtoRF / 100) this.doExplosion(rfOut);
- }
- }
- }
- }
- mTransferredVoltage=Math.max(mTransferredVoltage,aVoltage);
- mTransferredAmperage += rUsedAmperes;
- mTransferredVoltageLast20 = Math.max(mTransferredVoltageLast20, aVoltage);
- mTransferredAmperageLast20 = Math.max(mTransferredAmperageLast20, mTransferredAmperage);
- if (aVoltage > mVoltage){
- mOverheat+=Math.max(100,100*GT_Utility.getTier(aVoltage)-GT_Utility.getTier(mVoltage));
- }
- if (mTransferredAmperage > mAmperage) return aAmperage;
- return rUsedAmperes;
- //Always return amount of used amperes, used all on overheat
- }
-
- @Override
- public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
- if(aBaseMetaTileEntity.isServerSide()) {
- lastAmperage = new int[16];
- lastWorldTick = aBaseMetaTileEntity.getWorld().getTotalWorldTime() - 1;//sets initial value -1 since it is in the same tick as first on post tick
- }
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (aBaseMetaTileEntity.isServerSide()) {
- {//amp handler
- long worldTick = aBaseMetaTileEntity.getWorld().getTotalWorldTime();
- int tickDiff = (int) (worldTick - lastWorldTick);
- lastWorldTick = worldTick;
-
- if (tickDiff >= 16) for (int i = 0; i <= 14; i++) lastAmperage[i] = 0;
- else {
- System.arraycopy(lastAmperage, tickDiff, lastAmperage, 0, 16 - tickDiff);
- for (int i = 14; i >= 0; i--) {
- if (--tickDiff > 0) lastAmperage[i] = 0;
- else break;
- }
- }
-
- lastAmperage[15] = mTransferredAmperage;
-
- if (lastAmperage[15] > mAmperage) {
- int i = 0;
- for (; i <= 14; i++) {
- if (lastAmperage[i] < mAmperage) {
- lastAmperage[15] -= (int) mAmperage - lastAmperage[i];
- lastAmperage[i] = (int)mAmperage;
- if (lastAmperage[15] <= mAmperage) break;
- }
- }
- if (lastAmperage[15] > mAmperage) {
- mOverheat += 100 * (lastAmperage[15] - mAmperage);
- lastAmperage[15] = (int) mAmperage;
- } else if (lastAmperage[15] < mAmperage) {
- lastAmperage[i] = lastAmperage[15];
- lastAmperage[15] = (int) mAmperage;
- }
- }
- }
-
- if(mOverheat>=mMaxOverheat) {
- //todo someday
- //int newMeta=aBaseMetaTileEntity.getMetaTileID()-6;
- //if(mInsulated &&
- // GregTech_API.METATILEENTITIES[newMeta] instanceof GT_MetaPipeEntity_Cable &&
- // ((GT_MetaPipeEntity_Cable)GregTech_API.METATILEENTITIES[newMeta]).mMaterial==mMaterial &&
- // ((GT_MetaPipeEntity_Cable)GregTech_API.METATILEENTITIES[newMeta]).mAmperage<=mAmperage){
- // aBaseMetaTileEntity.setOnFire();
- // aBaseMetaTileEntity.setMetaTileEntity(GregTech_API.METATILEENTITIES[newMeta]);
- // return;
- //}else{
- aBaseMetaTileEntity.setToFire();
- //}
- }else if (mOverheat>0) mOverheat--;
-
- mTransferredVoltageOK=mTransferredVoltage;
- mTransferredVoltage=0;
- mTransferredAmperageOK=mTransferredAmperage;
- mTransferredAmperage = 0;
-
- if (aTick % 20 == 0) {
- mTransferredVoltageLast20OK=mTransferredVoltageLast20;
- mTransferredVoltageLast20 = 0;
- mTransferredAmperageLast20OK=mTransferredAmperageLast20;
- mTransferredAmperageLast20 = 0;
- mConnections = 0;
- for (byte i = 0, j = 0; i < 6; i++) {
- j = GT_Utility.getOppositeSide(i);
- if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).alwaysLookConnected(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity) || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyIn(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity) || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyOut(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity)) {
- TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i);
- if (tTileEntity instanceof IColoredTileEntity) {
- if (aBaseMetaTileEntity.getColorization() >= 0) {
- byte tColor = ((IColoredTileEntity) tTileEntity).getColorization();
- if (tColor >= 0 && tColor != aBaseMetaTileEntity.getColorization()) continue;
- }
- }
- if (tTileEntity instanceof IEnergyConnected && (((IEnergyConnected) tTileEntity).inputEnergyFrom(j) || ((IEnergyConnected) tTileEntity).outputsEnergyTo(j))) {
- mConnections |= (1 << i);
- continue;
- }
- if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() instanceof IMetaTileEntityCable) {
- if (((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).alwaysLookConnected(j, ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j), ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j), ((IGregTechTileEntity) tTileEntity)) || ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).letsEnergyIn(j, ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j), ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j), ((IGregTechTileEntity) tTileEntity)) || ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).letsEnergyOut(j, ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j), ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j), ((IGregTechTileEntity) tTileEntity))) {
- mConnections |= (1 << i);
- continue;
- }
- }
- if (tTileEntity instanceof IEnergySink && ((IEnergySink) tTileEntity).acceptsEnergyFrom((TileEntity) aBaseMetaTileEntity, ForgeDirection.getOrientation(j))) {
- mConnections |= (1 << i);
- continue;
- }
- if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver && ((IEnergyReceiver) tTileEntity).canConnectEnergy(ForgeDirection.getOrientation(j))) {
- mConnections |= (1 << i);
- continue;
- }
- /*
- if (tTileEntity instanceof IEnergyEmitter && ((IEnergyEmitter)tTileEntity).emitsEnergyTo((TileEntity)aBaseMetaTileEntity, ForgeDirection.getOrientation(j))) {
- mConnections |= (1<<i);
- continue;
- }*/
- }
- }
- }
- }else if(aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected==4) aBaseMetaTileEntity.issueTextureUpdate();
- }
-
- @Override
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return false;
- }
-
- @Override
- public String[] getDescription() {
- return new String[]{
- "Max Voltage: %%%" + EnumChatFormatting.GREEN + mVoltage + " (" + VN[GT_Utility.getTier(mVoltage)] + ")" + EnumChatFormatting.GRAY,
- "Max Amperage: %%%" + EnumChatFormatting.YELLOW + mAmperage + EnumChatFormatting.GRAY,
- "Loss/Meter/Ampere: %%%" + EnumChatFormatting.RED + mCableLossPerMeter + EnumChatFormatting.GRAY + "%%% EU-Volt"
- };
- }
-
- @Override
- public float getThickNess() {
- if(GT_Mod.instance.isClientSide() && GT_Client.hideValue==1) return 0.0625F;
- return mThickNess;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- //
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- //
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public String[] getInfoData() {
- return new String[]{
- //EnumChatFormatting.BLUE + mName + EnumChatFormatting.RESET,
- "Heat: "+
- EnumChatFormatting.RED+ mOverheat +EnumChatFormatting.RESET+" / "+EnumChatFormatting.YELLOW+ mMaxOverheat + EnumChatFormatting.RESET,
- "Max Load (1t):",
- EnumChatFormatting.GREEN + Integer.toString(mTransferredAmperageOK) + EnumChatFormatting.RESET +" A / "+
- EnumChatFormatting.YELLOW + Long.toString(mAmperage) + EnumChatFormatting.RESET +" A",
- "Max EU/p (1t):",
- EnumChatFormatting.GREEN + Long.toString(mTransferredVoltageOK) + EnumChatFormatting.RESET +" EU / "+
- EnumChatFormatting.YELLOW + Long.toString(mVoltage) + EnumChatFormatting.RESET +" EU",
- "Max Load (20t): "+
- EnumChatFormatting.GREEN + Integer.toString(mTransferredAmperageLast20OK) + EnumChatFormatting.RESET +" A",
- "Max EU/p (20t): "+
- EnumChatFormatting.GREEN + Long.toString(mTransferredVoltageLast20OK) + EnumChatFormatting.RESET +" EU"
- };
- }
-}
+package gregtech.api.metatileentity.implementations;
+
+import cofh.api.energy.IEnergyReceiver;
+import gregtech.GT_Mod;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.TextureSet;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntityCable;
+import gregtech.api.interfaces.tileentity.IColoredTileEntity;
+import gregtech.api.interfaces.tileentity.IEnergyConnected;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.BaseMetaPipeEntity;
+import gregtech.api.metatileentity.MetaPipeEntity;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.GT_Client;
+import ic2.api.energy.tile.IEnergySink;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import static gregtech.api.enums.GT_Values.VN;
+
+public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTileEntityCable {
+ public final float mThickNess;
+ public final Materials mMaterial;
+ public final long mCableLossPerMeter, mAmperage, mVoltage;
+ public final boolean mInsulated, mCanShock;
+ public int mTransferredAmperage = 0, mTransferredAmperageLast20 = 0,mTransferredAmperageLast20OK=0,mTransferredAmperageOK=0;
+ public long mTransferredVoltageLast20 = 0, mTransferredVoltage = 0,mTransferredVoltageLast20OK=0,mTransferredVoltageOK=0;
+ public long mRestRF;
+ public int mOverheat;
+ public static short mMaxOverheat=(short) (GT_Mod.gregtechproxy.mWireHeatingTicks * 100);
+ private boolean mCheckConnections = !GT_Mod.gregtechproxy.gt6Cable;
+
+ private int[] lastAmperage;
+ private long lastWorldTick;
+
+ public GT_MetaPipeEntity_Cable(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
+ super(aID, aName, aNameRegional, 0);
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mAmperage = aAmperage;
+ mVoltage = aVoltage;
+ mInsulated = aInsulated;
+ mCanShock = aCanShock;
+ mCableLossPerMeter = aCableLossPerMeter;
+ }
+
+ public GT_MetaPipeEntity_Cable(String aName, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
+ super(aName, 0);
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mAmperage = aAmperage;
+ mVoltage = aVoltage;
+ mInsulated = aInsulated;
+ mCanShock = aCanShock;
+ mCableLossPerMeter = aCableLossPerMeter;
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return (byte) (mInsulated ? 9 : 8);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaPipeEntity_Cable(mName, mThickNess, mMaterial, mCableLossPerMeter, mAmperage, mVoltage, mInsulated, mCanShock);
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
+ if (!mInsulated)
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], Dyes.getModulation(aColorIndex, mMaterial.mRGBa) )};
+ if (aConnected) {
+ float tThickNess = getThickNess();
+ if (tThickNess < 0.124F)
+ return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.374F)//0.375 x1
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_TINY, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.499F)//0.500 x2
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_SMALL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.624F)//0.625 x4
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.749F)//0.750 x8
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM_PLUS, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.874F)//0.825 x12
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_LARGE, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_HUGE, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ }
+ return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ }
+
+ @Override
+ public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) {
+ if (mCanShock && (((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity))
+ GT_Utility.applyElectricityDamage((EntityLivingBase) aEntity, mTransferredVoltageLast20, mTransferredAmperageLast20);
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return true;
+ }
+
+ @Override
+ public final boolean renderInside(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return (int) mTransferredAmperage * 64;
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return (int) mAmperage * 64;
+ }
+
+ @Override
+ public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
+ if (!getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsEnergyIn(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), getBaseMetaTileEntity()))
+ return 0;
+ return transferElectricity(aSide, aVoltage, aAmperage, new ArrayList<TileEntity>(Arrays.asList((TileEntity) getBaseMetaTileEntity())));
+ }
+
+ @Override
+ public long transferElectricity(byte aSide, long aVoltage, long aAmperage, ArrayList<TileEntity> aAlreadyPassedTileEntityList) {
+ long rUsedAmperes = 0;
+ aVoltage -= mCableLossPerMeter;
+ if (aVoltage > 0) for (byte i = 0; i < 6 && aAmperage > rUsedAmperes; i++)
+ if (i != aSide && (mConnections & (1 << i)) != 0 && getBaseMetaTileEntity().getCoverBehaviorAtSide(i).letsEnergyOut(i, getBaseMetaTileEntity().getCoverIDAtSide(i), getBaseMetaTileEntity().getCoverDataAtSide(i), getBaseMetaTileEntity())) {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(i);
+ if (!aAlreadyPassedTileEntityList.contains(tTileEntity)) {
+ aAlreadyPassedTileEntityList.add(tTileEntity);
+ if (tTileEntity instanceof IEnergyConnected) {
+ if (getBaseMetaTileEntity().getColorization() >= 0) {
+ byte tColor = ((IEnergyConnected) tTileEntity).getColorization();
+ if (tColor >= 0 && tColor != getBaseMetaTileEntity().getColorization()) continue;
+ }
+ if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() instanceof IMetaTileEntityCable && ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(GT_Utility.getOppositeSide(i)).letsEnergyIn(GT_Utility.getOppositeSide(i), ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(GT_Utility.getOppositeSide(i)), ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(GT_Utility.getOppositeSide(i)), ((IGregTechTileEntity) tTileEntity))) {
+ if (((IGregTechTileEntity) tTileEntity).getTimer() > 50)
+ rUsedAmperes += ((IMetaTileEntityCable) ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()).transferElectricity(GT_Utility.getOppositeSide(i), aVoltage, aAmperage - rUsedAmperes, aAlreadyPassedTileEntityList);
+ } else {
+ rUsedAmperes += ((IEnergyConnected) tTileEntity).injectEnergyUnits(GT_Utility.getOppositeSide(i), aVoltage, aAmperage - rUsedAmperes);
+ }
+// } else if (tTileEntity instanceof IEnergySink) {
+// ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
+// if (((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)getBaseMetaTileEntity(), tDirection)) {
+// if (((IEnergySink)tTileEntity).demandedEnergyUnits() > 0 && ((IEnergySink)tTileEntity).injectEnergyUnits(tDirection, aVoltage) < aVoltage) rUsedAmperes++;
+// }
+ } else if (tTileEntity instanceof IEnergySink) {
+ ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
+ if (((IEnergySink) tTileEntity).acceptsEnergyFrom((TileEntity) getBaseMetaTileEntity(), tDirection)) {
+ if (((IEnergySink) tTileEntity).getDemandedEnergy() > 0 && ((IEnergySink) tTileEntity).injectEnergy(tDirection, aVoltage, aVoltage) < aVoltage)
+ rUsedAmperes++;
+ }
+ } else if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver) {
+ ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
+ long rfOUT = aVoltage * GregTech_API.mEUtoRF / 100;
+ int rfOut = rfOUT>Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)rfOUT;
+ if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) == rfOut) {
+ ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, false);
+ rUsedAmperes++;
+ } else if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) > 0) {
+ if (mRestRF == 0) {
+ int RFtrans = ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, (int) rfOut, false);
+ rUsedAmperes++;
+ mRestRF = rfOut - RFtrans;
+ } else {
+ int RFtrans = ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, (int) mRestRF, false);
+ mRestRF = mRestRF - RFtrans;
+ }
+ }
+ if (GregTech_API.mRFExplosions && ((IEnergyReceiver) tTileEntity).getMaxEnergyStored(tDirection) < rfOut * 600) {
+ if (rfOut > 32 * GregTech_API.mEUtoRF / 100) this.doExplosion(rfOut);
+ }
+ }
+ }
+ }
+ mTransferredVoltage=Math.max(mTransferredVoltage,aVoltage);
+ mTransferredAmperage += rUsedAmperes;
+ mTransferredVoltageLast20 = Math.max(mTransferredVoltageLast20, aVoltage);
+ mTransferredAmperageLast20 = Math.max(mTransferredAmperageLast20, mTransferredAmperage);
+ if (aVoltage > mVoltage){
+ mOverheat+=Math.max(100,100*GT_Utility.getTier(aVoltage)-GT_Utility.getTier(mVoltage));
+ }
+ if (mTransferredAmperage > mAmperage) return aAmperage;
+ return rUsedAmperes;
+ //Always return amount of used amperes, used all on overheat
+ }
+
+ @Override
+ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
+ if(aBaseMetaTileEntity.isServerSide()) {
+ lastAmperage = new int[16];
+ lastWorldTick = aBaseMetaTileEntity.getWorld().getTotalWorldTime() - 1;//sets initial value -1 since it is in the same tick as first on post tick
+ }
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ {//amp handler
+ long worldTick = aBaseMetaTileEntity.getWorld().getTotalWorldTime();
+ int tickDiff = (int) (worldTick - lastWorldTick);
+ lastWorldTick = worldTick;
+
+ if (tickDiff >= 16) for (int i = 0; i <= 14; i++) lastAmperage[i] = 0;
+ else {
+ System.arraycopy(lastAmperage, tickDiff, lastAmperage, 0, 16 - tickDiff);
+ for (int i = 14; i >= 0; i--) {
+ if (--tickDiff > 0) lastAmperage[i] = 0;
+ else break;
+ }
+ }
+
+ lastAmperage[15] = mTransferredAmperage;
+
+ if (lastAmperage[15] > mAmperage) {
+ int i = 0;
+ for (; i <= 14; i++) {
+ if (lastAmperage[i] < mAmperage) {
+ lastAmperage[15] -= (int) mAmperage - lastAmperage[i];
+ lastAmperage[i] = (int)mAmperage;
+ if (lastAmperage[15] <= mAmperage) break;
+ }
+ }
+ if (lastAmperage[15] > mAmperage) {
+ mOverheat += 100 * (lastAmperage[15] - mAmperage);
+ lastAmperage[15] = (int) mAmperage;
+ } else if (lastAmperage[15] < mAmperage) {
+ lastAmperage[i] = lastAmperage[15];
+ lastAmperage[15] = (int) mAmperage;
+ }
+ }
+ }
+
+ if(mOverheat>=mMaxOverheat) {
+ //TODO someday
+ //int newMeta=aBaseMetaTileEntity.getMetaTileID()-6;
+ //if(mInsulated &&
+ // GregTech_API.METATILEENTITIES[newMeta] instanceof GT_MetaPipeEntity_Cable &&
+ // ((GT_MetaPipeEntity_Cable)GregTech_API.METATILEENTITIES[newMeta]).mMaterial==mMaterial &&
+ // ((GT_MetaPipeEntity_Cable)GregTech_API.METATILEENTITIES[newMeta]).mAmperage<=mAmperage){
+ // aBaseMetaTileEntity.setOnFire();
+ // aBaseMetaTileEntity.setMetaTileEntity(GregTech_API.METATILEENTITIES[newMeta]);
+ // return;
+ //}else{
+ aBaseMetaTileEntity.setToFire();
+ //}
+ }else if (mOverheat>0) mOverheat--;
+
+ mTransferredVoltageOK=mTransferredVoltage;
+ mTransferredVoltage=0;
+ mTransferredAmperageOK=mTransferredAmperage;
+ mTransferredAmperage = 0;
+
+ if (aTick % 20 == 0) {
+ mTransferredVoltageLast20OK=mTransferredVoltageLast20;
+ mTransferredVoltageLast20 = 0;
+ mTransferredAmperageLast20OK=mTransferredAmperageLast20;
+ mTransferredAmperageLast20 = 0;
+ for (byte i = 0, j = 0; i < 6; i++) {
+ if ((mCheckConnections || (mConnections & (1 << i)) == 0) && connect(i) == 0) disconnect(i);
+ }
+ if (GT_Mod.gregtechproxy.gt6Pipe) mCheckConnections = false;
+ }
+ }else if(aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected==4) aBaseMetaTileEntity.issueTextureUpdate();
+ }
+
+ @Override
+ public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ return onConnectionToolRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ);
+ }
+
+ @Override
+ public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ return onConnectionToolRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ);
+ }
+
+ private boolean onConnectionToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (GT_Mod.gregtechproxy.gt6Cable) {
+ byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
+ if ((mConnections & (1 << tSide)) == 0) {
+ if (GT_Mod.gregtechproxy.costlyCableConnection && !GT_ModHandler.consumeSolderingMaterial(aPlayer)) return false;
+ if (connect(tSide) > 0)
+ GT_Utility.sendChatToPlayer(aPlayer, trans("214", "Connected"));
+ }
+ else {
+ disconnect(tSide);
+ GT_Utility.sendChatToPlayer(aPlayer, trans("215", "Disconnected"));
+ }
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int connect(byte aSide) {
+ int rConnect = 0;
+ if (aSide >= 6) return rConnect;
+ byte tSide = GT_Utility.getOppositeSide(aSide);
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(aSide);
+ if (tTileEntity != null) {
+ if (getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).alwaysLookConnected(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), getBaseMetaTileEntity()) || getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsEnergyIn(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), getBaseMetaTileEntity()) || getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsEnergyOut(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), getBaseMetaTileEntity())) {
+ if (tTileEntity instanceof IColoredTileEntity) {
+ if (getBaseMetaTileEntity().getColorization() >= 0) {
+ byte tColor = ((IColoredTileEntity) tTileEntity).getColorization();
+ if (tColor >= 0 && tColor != getBaseMetaTileEntity().getColorization())
+ return rConnect;
+ }
+ }
+ if ((tTileEntity instanceof IEnergyConnected && (((IEnergyConnected) tTileEntity).inputEnergyFrom(tSide) || ((IEnergyConnected) tTileEntity).outputsEnergyTo(tSide)))
+ || (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() instanceof IMetaTileEntityCable
+ && (((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(tSide).alwaysLookConnected(tSide, ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(tSide), ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(tSide), ((IGregTechTileEntity) tTileEntity)) || ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(tSide).letsEnergyIn(tSide, ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(tSide), ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(tSide), ((IGregTechTileEntity) tTileEntity)) || ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(tSide).letsEnergyOut(tSide, ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(tSide), ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(tSide), ((IGregTechTileEntity) tTileEntity))))
+ || (tTileEntity instanceof IEnergySink && ((IEnergySink) tTileEntity).acceptsEnergyFrom((TileEntity) getBaseMetaTileEntity(), ForgeDirection.getOrientation(tSide)))
+ || (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver && ((IEnergyReceiver) tTileEntity).canConnectEnergy(ForgeDirection.getOrientation(tSide)))
+ /*|| (tTileEntity instanceof IEnergyEmitter && ((IEnergyEmitter)tTileEntity).emitsEnergyTo((TileEntity)getBaseMetaTileEntity(), ForgeDirection.getOrientation(tSide)))*/) {
+ rConnect = 1;
+ }
+ }
+ } else if (getBaseMetaTileEntity().getOffsetX(aSide, 1) >> 4 != getBaseMetaTileEntity().getXCoord() >> 4
+ || getBaseMetaTileEntity().getOffsetZ(aSide, 1) >> 4 != getBaseMetaTileEntity().getZCoord() >> 4) { // if chunk unloaded
+ rConnect = -1;
+ }
+ if (rConnect > 0) {
+ super.connect(aSide);
+ }
+ return rConnect;
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{
+ "Max Voltage: %%%" + EnumChatFormatting.GREEN + mVoltage + " (" + VN[GT_Utility.getTier(mVoltage)] + ")" + EnumChatFormatting.GRAY,
+ "Max Amperage: %%%" + EnumChatFormatting.YELLOW + mAmperage + EnumChatFormatting.GRAY,
+ "Loss/Meter/Ampere: %%%" + EnumChatFormatting.RED + mCableLossPerMeter + EnumChatFormatting.GRAY + "%%% EU-Volt"
+ };
+ }
+
+ @Override
+ public float getThickNess() {
+ if(GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x1) != 0) return 0.0625F;
+ return mThickNess;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ if (GT_Mod.gregtechproxy.gt6Cable)
+ aNBT.setByte("mConnections", mConnections);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ if (GT_Mod.gregtechproxy.gt6Cable) {
+ if (!aNBT.hasKey("mConnections"))
+ mCheckConnections = true;
+ mConnections = aNBT.getByte("mConnections");
+ }
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return new String[]{
+ //EnumChatFormatting.BLUE + mName + EnumChatFormatting.RESET,
+ "Heat: "+
+ EnumChatFormatting.RED+ mOverheat +EnumChatFormatting.RESET+" / "+EnumChatFormatting.YELLOW+ mMaxOverheat + EnumChatFormatting.RESET,
+ "Max Load (1t):",
+ EnumChatFormatting.GREEN + Integer.toString(mTransferredAmperageOK) + EnumChatFormatting.RESET +" A / "+
+ EnumChatFormatting.YELLOW + Long.toString(mAmperage) + EnumChatFormatting.RESET +" A",
+ "Max EU/p (1t):",
+ EnumChatFormatting.GREEN + Long.toString(mTransferredVoltageOK) + EnumChatFormatting.RESET +" EU / "+
+ EnumChatFormatting.YELLOW + Long.toString(mVoltage) + EnumChatFormatting.RESET +" EU",
+ "Max Load (20t): "+
+ EnumChatFormatting.GREEN + Integer.toString(mTransferredAmperageLast20OK) + EnumChatFormatting.RESET +" A",
+ "Max EU/p (20t): "+
+ EnumChatFormatting.GREEN + Long.toString(mTransferredVoltageLast20OK) + EnumChatFormatting.RESET +" EU"
+ };
+ }
+
+ @Override
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0)
+ return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
+ else
+ return getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ }
+
+ private AxisAlignedBB getActualCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ float tSpace = (1f - mThickNess)/2;
+ float tSide0 = tSpace;
+ float tSide1 = 1f - tSpace;
+ float tSide2 = tSpace;
+ float tSide3 = 1f - tSpace;
+ float tSide4 = tSpace;
+ float tSide5 = 1f - tSpace;
+
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;}
+
+ byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections;
+ if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f;
+ if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f;
+ if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f;
+ if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f;
+ if((tConn & (1 << ForgeDirection.WEST.ordinal()) ) != 0) tSide4 = 0f;
+ if((tConn & (1 << ForgeDirection.EAST.ordinal()) ) != 0) tSide5 = 1f;
+
+ return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3);
+ }
+
+ @Override
+ public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) {
+ super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) {
+ AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ if (inputAABB.intersectsWith(aabb)) outputAABB.add(aabb);
+ }
+ }
+}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java
index 8b2f33bf3b..3e6a13ec07 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java
@@ -1,415 +1,641 @@
-package gregtech.api.metatileentity.implementations;
-
-import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.ICoverable;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.BaseMetaPipeEntity;
-import gregtech.api.metatileentity.MetaPipeEntity;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.GT_Client;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.FluidTankInfo;
-import net.minecraftforge.fluids.IFluidHandler;
-
-import java.util.ArrayList;
-import java.util.Map.Entry;
-import java.util.concurrent.ConcurrentHashMap;
-
-import static gregtech.api.enums.GT_Values.D1;
-import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
-
-public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
- public final float mThickNess;
- public final Materials mMaterial;
- public final int mCapacity, mHeatResistance;
- public final boolean mGasProof;
- public FluidStack mFluid;
- public byte mLastReceivedFrom = 0, oLastReceivedFrom = 0;
-
- public GT_MetaPipeEntity_Fluid(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof) {
- super(aID, aName, aNameRegional, 0);
- mThickNess = aThickNess;
- mMaterial = aMaterial;
- mCapacity = aCapacity;
- mGasProof = aGasProof;
- mHeatResistance = aHeatResistance;
- }
-
- public GT_MetaPipeEntity_Fluid(String aName, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof) {
- super(aName, 0);
- mThickNess = aThickNess;
- mMaterial = aMaterial;
- mCapacity = aCapacity;
- mGasProof = aGasProof;
- mHeatResistance = aHeatResistance;
- }
-
- @Override
- public byte getTileEntityBaseType() {
- return mMaterial == null ? 4 : (byte) ((mMaterial.contains(SubTag.WOOD) ? 12 : 4) + Math.max(0, Math.min(3, mMaterial.mToolQuality)));
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaPipeEntity_Fluid(mName, mThickNess, mMaterial, mCapacity, mHeatResistance, mGasProof);
- }
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
- if (aConnected) {
- float tThickNess = getThickNess();
- if (tThickNess < 0.124F)
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
- if (tThickNess < 0.374F)//0.375
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
- if (tThickNess < 0.499F)//0.500
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
- if (tThickNess < 0.749F)//0.750
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
- if (tThickNess < 0.874F)//0.825
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
- }
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
- }
-
- @Override
- public boolean isSimpleMachine() {
- return true;
- }
-
- @Override
- public boolean isFacingValid(byte aFacing) {
- return false;
- }
-
- @Override
- public boolean isValidSlot(int aIndex) {
- return false;
- }
-
- @Override
- public final boolean renderInside(byte aSide) {
- return false;
- }
-
- @Override
- public int getProgresstime() {
- return getFluidAmount();
- }
-
- @Override
- public int maxProgresstime() {
- return getCapacity();
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- if (mFluid != null) aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound()));
- aNBT.setByte("mLastReceivedFrom", mLastReceivedFrom);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
- mLastReceivedFrom = aNBT.getByte("mLastReceivedFrom");
- }
-
- @Override
- public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) {
- if (mFluid != null && (((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase) {
- int tTemperature = mFluid.getFluid().getTemperature(mFluid);
- if (tTemperature > 320 && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) {
- GT_Utility.applyHeatDamage((EntityLivingBase) aEntity, (tTemperature - 300) / 50.0F);
- } else if (tTemperature < 260 && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) {
- GT_Utility.applyFrostDamage((EntityLivingBase) aEntity, (270 - tTemperature) / 25.0F);
- }
- }
- }
-
- @Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- float tSpace = (1f - mThickNess)/2;
- float tSide0 = tSpace;
- float tSide1 = 1f - tSpace;
- float tSide2 = tSpace;
- float tSide3 = 1f - tSpace;
- float tSide4 = tSpace;
- float tSide5 = 1f - tSpace;
-
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;}
-
- byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections;
- if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f;
- if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f;
- if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f;
- if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f;
- if((tConn & (1 << ForgeDirection.WEST.ordinal()) ) != 0) tSide4 = 0f;
- if((tConn & (1 << ForgeDirection.EAST.ordinal()) ) != 0) tSide5 = 1f;
-
- return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3);
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (aBaseMetaTileEntity.isServerSide() && aTick % 5 == 0) {
- mLastReceivedFrom &= 63;
- if (mLastReceivedFrom == 63) {
- mLastReceivedFrom = 0;
- }
-
- if (mFluid != null && mFluid.amount > 0) {
- int tTemperature = mFluid.getFluid().getTemperature(mFluid);
- if (tTemperature > mHeatResistance) {
- if (aBaseMetaTileEntity.getRandomNumber(100) == 0) {
- aBaseMetaTileEntity.setToFire();
- return;
- }
- aBaseMetaTileEntity.setOnFire();
- }
- if (!mGasProof && mFluid.getFluid().isGaseous(mFluid)) {
- mFluid.amount -= 5;
- sendSound((byte) 9);
- if (tTemperature > 320) {
- try {
- for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord() - 2, getBaseMetaTileEntity().getYCoord() - 2, getBaseMetaTileEntity().getZCoord() - 2, getBaseMetaTileEntity().getXCoord() + 3, getBaseMetaTileEntity().getYCoord() + 3, getBaseMetaTileEntity().getZCoord() + 3))) {
- GT_Utility.applyHeatDamage(tLiving, (tTemperature - 300) / 25.0F);
- }
- } catch (Throwable e) {
- if (D1) e.printStackTrace(GT_Log.err);
- }
- } else if (tTemperature < 260) {
- try {
- for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord() - 2, getBaseMetaTileEntity().getYCoord() - 2, getBaseMetaTileEntity().getZCoord() - 2, getBaseMetaTileEntity().getXCoord() + 3, getBaseMetaTileEntity().getYCoord() + 3, getBaseMetaTileEntity().getZCoord() + 3))) {
- GT_Utility.applyFrostDamage(tLiving, (270 - tTemperature) / 12.5F);
- }
- } catch (Throwable e) {
- if (D1) e.printStackTrace(GT_Log.err);
- }
- }
- if (mFluid.amount <= 0) mFluid = null;
- }
- }
-
- if (mLastReceivedFrom == oLastReceivedFrom) {
- ConcurrentHashMap<IFluidHandler, ForgeDirection> tTanks = new ConcurrentHashMap<IFluidHandler, ForgeDirection>();
-
- mConnections = 0;
-
- for (byte tSide = 0, i = 0, j = (byte) aBaseMetaTileEntity.getRandomNumber(6); i < 6; i++) {
- tSide = (byte) ((j + i) % 6);
-
- IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(tSide);
- if (tTileEntity != null) {
- if (tTileEntity instanceof IGregTechTileEntity) {
- if (aBaseMetaTileEntity.getColorization() >= 0) {
- byte tColor = ((IGregTechTileEntity) tTileEntity).getColorization();
- if (tColor >= 0 && (tColor & 15) != (aBaseMetaTileEntity.getColorization() & 15)) {
- continue;
- }
- }
- }
- FluidTankInfo[] tInfo = tTileEntity.getTankInfo(ForgeDirection.getOrientation(tSide).getOpposite());
- if (tInfo != null && tInfo.length > 0) {
- if (tTileEntity instanceof ICoverable && ((ICoverable) tTileEntity).getCoverBehaviorAtSide(GT_Utility.getOppositeSide(tSide)).alwaysLookConnected(GT_Utility.getOppositeSide(tSide), ((ICoverable) tTileEntity).getCoverIDAtSide(GT_Utility.getOppositeSide(tSide)), ((ICoverable) tTileEntity).getCoverDataAtSide(GT_Utility.getOppositeSide(tSide)), ((ICoverable) tTileEntity))) {
- mConnections |= (1 << tSide);
- }
- if (aBaseMetaTileEntity.getCoverBehaviorAtSide(tSide).letsFluidIn(tSide, aBaseMetaTileEntity.getCoverIDAtSide(tSide), aBaseMetaTileEntity.getCoverDataAtSide(tSide), null, aBaseMetaTileEntity)) {
- mConnections |= (1 << tSide);
- }
- if (aBaseMetaTileEntity.getCoverBehaviorAtSide(tSide).letsFluidOut(tSide, aBaseMetaTileEntity.getCoverIDAtSide(tSide), aBaseMetaTileEntity.getCoverDataAtSide(tSide), null, aBaseMetaTileEntity)) {
- mConnections |= (1 << tSide);
- if (((1 << tSide) & mLastReceivedFrom) == 0)
- tTanks.put(tTileEntity, ForgeDirection.getOrientation(tSide).getOpposite());
- }
-
- if (aBaseMetaTileEntity.getCoverBehaviorAtSide(tSide).alwaysLookConnected(tSide, aBaseMetaTileEntity.getCoverIDAtSide(tSide), aBaseMetaTileEntity.getCoverDataAtSide(tSide), aBaseMetaTileEntity)) {
- mConnections |= (1 << tSide);
- }
- }else if(tInfo != null && tInfo.length == 0){
- IGregTechTileEntity tSideTile = aBaseMetaTileEntity.getIGregTechTileEntityAtSide(tSide);
- if(tSideTile!=null){
- ItemStack tCover = tSideTile.getCoverItemAtSide(GT_Utility.getOppositeSide(tSide));
- if (tCover!=null &&(GT_Utility.areStacksEqual(tCover, ItemList.FluidRegulator_LV.get(1, new Object[]{},true)) ||
- GT_Utility.areStacksEqual(tCover, ItemList.FluidRegulator_MV.get(1, new Object[]{},true)) ||
- GT_Utility.areStacksEqual(tCover, ItemList.FluidRegulator_HV.get(1, new Object[]{},true)) ||
- GT_Utility.areStacksEqual(tCover, ItemList.FluidRegulator_EV.get(1, new Object[]{},true)) ||
- GT_Utility.areStacksEqual(tCover, ItemList.FluidRegulator_IV.get(1, new Object[]{},true)))) {
- mConnections |= (1 << tSide);
- }
- }
- }
- }
- }
-
- if (mFluid != null && mFluid.amount > 0) {
- int tAmount = Math.max(1, Math.min(mCapacity * 10, mFluid.amount / 2)), tSuccessfulTankAmount = 0;
-
- for (Entry<IFluidHandler, ForgeDirection> tEntry : tTanks.entrySet())
- if (tEntry.getKey().fill(tEntry.getValue(), drain(tAmount, false), false) > 0)
- tSuccessfulTankAmount++;
-
- if (tSuccessfulTankAmount > 0) {
- if (tAmount >= tSuccessfulTankAmount) {
- tAmount /= tSuccessfulTankAmount;
- for (Entry<IFluidHandler, ForgeDirection> tTileEntity : tTanks.entrySet()) {
- if (mFluid == null || mFluid.amount <= 0) break;
- int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(), drain(tAmount, false), false);
- if (tFilledAmount > 0)
- tTileEntity.getKey().fill(tTileEntity.getValue(), drain(tFilledAmount, true), true);
- }
- } else {
- for (Entry<IFluidHandler, ForgeDirection> tTileEntity : tTanks.entrySet()) {
- if (mFluid == null || mFluid.amount <= 0) break;
- int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(), drain(mFluid.amount, false), false);
- if (tFilledAmount > 0)
- tTileEntity.getKey().fill(tTileEntity.getValue(), drain(tFilledAmount, true), true);
- }
- }
- }
- }
-
- mLastReceivedFrom = 0;
- }
-
- oLastReceivedFrom = mLastReceivedFrom;
- }else if(aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected==4) aBaseMetaTileEntity.issueTextureUpdate();
- }
-
- @Override
- public void doSound(byte aIndex, double aX, double aY, double aZ) {
- super.doSound(aIndex, aX, aY, aZ);
- if (aIndex == 9) {
- GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(4), 5, 1.0F, aX, aY, aZ);
- for (byte i = 0; i < 6; i++)
- for (int l = 0; l < 2; ++l)
- getBaseMetaTileEntity().getWorld().spawnParticle("largesmoke", aX - 0.5 + XSTR_INSTANCE.nextFloat(), aY - 0.5 + XSTR_INSTANCE.nextFloat(), aZ - 0.5 + XSTR_INSTANCE.nextFloat(), ForgeDirection.getOrientation(i).offsetX / 5.0, ForgeDirection.getOrientation(i).offsetY / 5.0, ForgeDirection.getOrientation(i).offsetZ / 5.0);
- }
- }
-
- @Override
- public final int getCapacity() {
- return mCapacity * 20;
- }
-
- @Override
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return false;
- }
-
- @Override
- public final FluidStack getFluid() {
- return mFluid;
- }
-
- @Override
- public final int getFluidAmount() {
- return mFluid != null ? mFluid.amount : 0;
- }
-
- @Override
- public final int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
- if (aFluid == null || aFluid.getFluid().getID() <= 0) return 0;
-
- if (mFluid == null || mFluid.getFluid().getID() <= 0) {
- if (aFluid.amount <= getCapacity()) {
- if (doFill) {
- mFluid = aFluid.copy();
- mLastReceivedFrom |= (1 << aSide.ordinal());
- }
- return aFluid.amount;
- }
- if (doFill) {
- mFluid = aFluid.copy();
- mLastReceivedFrom |= (1 << aSide.ordinal());
- mFluid.amount = getCapacity();
- }
- return getCapacity();
- }
-
- if (!mFluid.isFluidEqual(aFluid)) return 0;
-
- int space = getCapacity() - mFluid.amount;
- if (aFluid.amount <= space) {
- if (doFill) {
- mFluid.amount += aFluid.amount;
- mLastReceivedFrom |= (1 << aSide.ordinal());
- }
- return aFluid.amount;
- }
- if (doFill) {
- mFluid.amount = getCapacity();
- mLastReceivedFrom |= (1 << aSide.ordinal());
- }
- return space;
- }
-
- @Override
- public final FluidStack drain(int maxDrain, boolean doDrain) {
- if (mFluid == null) return null;
- if (mFluid.amount <= 0) {
- mFluid = null;
- return null;
- }
-
- int used = maxDrain;
- if (mFluid.amount < used)
- used = mFluid.amount;
-
- if (doDrain) {
- mFluid.amount -= used;
- }
-
- FluidStack drained = mFluid.copy();
- drained.amount = used;
-
- if (mFluid.amount <= 0) {
- mFluid = null;
- }
-
- return drained;
- }
-
- @Override
- public int getTankPressure() {
- return (mFluid == null ? 0 : mFluid.amount) - (getCapacity() / 2);
- }
-
- @Override
- public String[] getDescription() {
- return new String[]{
- EnumChatFormatting.BLUE + "Fluid Capacity: %%%" + (mCapacity * 20) + "%%% L/sec" + EnumChatFormatting.GRAY,
- EnumChatFormatting.RED + "Heat Limit: %%%" + mHeatResistance + "%%% K" + EnumChatFormatting.GRAY
- };
- }
-
- @Override
- public float getThickNess() {
- if(GT_Mod.instance.isClientSide() && GT_Client.hideValue==1) return 0.0625F;
- return mThickNess;
- }
-}
+package gregtech.api.metatileentity.implementations;
+
+import gregtech.GT_Mod;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.*;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.ICoverable;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.BaseMetaPipeEntity;
+import gregtech.api.metatileentity.MetaPipeEntity;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.GT_Client;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+import net.minecraftforge.fluids.IFluidHandler;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.concurrent.ConcurrentHashMap;
+
+import static gregtech.api.enums.GT_Values.D1;
+import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
+
+public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
+ public final float mThickNess;
+ public final Materials mMaterial;
+ public final int mCapacity, mHeatResistance, mPipeAmount;
+ public final boolean mGasProof;
+ public final FluidStack[] mFluids;
+ public byte mLastReceivedFrom = 0, oLastReceivedFrom = 0;
+ private boolean mCheckConnections = !GT_Mod.gregtechproxy.gt6Pipe;
+ /**
+ * Bitmask for whether disable fluid input form each side.
+ */
+ public byte mDisableInput = 0;
+
+ public GT_MetaPipeEntity_Fluid(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof) {
+ this(aID, aName, aNameRegional, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1);
+ }
+
+ public GT_MetaPipeEntity_Fluid(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) {
+ super(aID, aName, aNameRegional, 0);
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mCapacity = aCapacity;
+ mGasProof = aGasProof;
+ mHeatResistance = aHeatResistance;
+ mPipeAmount = aFluidTypes;
+ mFluids = new FluidStack[mPipeAmount];
+ }
+
+ @Deprecated
+ public GT_MetaPipeEntity_Fluid(String aName, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof) {
+ this(aName, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1);
+ }
+
+ public GT_MetaPipeEntity_Fluid(String aName, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) {
+ super(aName, 0);
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mCapacity = aCapacity;
+ mGasProof = aGasProof;
+ mHeatResistance = aHeatResistance;
+ mPipeAmount = aFluidTypes;
+ mFluids = new FluidStack[mPipeAmount];
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return mMaterial == null ? 4 : (byte) ((mMaterial.contains(SubTag.WOOD) ? 12 : 4) + Math.max(0, Math.min(3, mMaterial.mToolQuality)));
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaPipeEntity_Fluid(mName, mThickNess, mMaterial, mCapacity, mHeatResistance, mGasProof, mPipeAmount);
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
+ float tThickNess = getThickNess();
+ if (mDisableInput == 0) return new ITexture[]{aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) : new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
+ byte tMask = 0;
+ byte[][] sRestrictionArray = new byte[][]{
+ {2, 3, 5, 4},
+ {2, 3, 4, 5},
+ {1, 0, 4, 5},
+ {1, 0, 4, 5},
+ {1, 0, 2, 3},
+ {1, 0, 2, 3}
+ };
+ if (aSide >= 0 && aSide < 6) for (byte i = 0; i < 4; i++) if ((mDisableInput & (1 << sRestrictionArray[aSide][i])) != 0) tMask |= 1 << i;
+ return new ITexture[]{aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) : new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), getRestrictorTexture(tMask)};
+ }
+
+ protected static final ITexture getBaseTexture(float aThickNess, int aPipeAmount, Materials aMaterial, byte aColorIndex) {
+ if (aPipeAmount >= 9) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeNonuple.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aPipeAmount >= 4) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeQuadruple.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aThickNess < 0.124F) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aThickNess < 0.374F) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aThickNess < 0.499F) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aThickNess < 0.749F) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aThickNess < 0.874F) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ }
+
+ protected static final ITexture getRestrictorTexture(byte aMask) {
+ switch (aMask) {
+ case 1: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_UP);
+ case 2: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_DOWN);
+ case 3: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_UD);
+ case 4: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_LEFT);
+ case 5: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_UL);
+ case 6: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_DL);
+ case 7: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_NR);
+ case 8: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_RIGHT);
+ case 9: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_UR);
+ case 10: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_DR);
+ case 11: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_NL);
+ case 12: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_LR);
+ case 13: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_ND);
+ case 14: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_NU);
+ case 15: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR);
+ default: return null;
+ }
+ }
+
+ @Override
+ public void onValueUpdate(byte aValue) {
+ mDisableInput = aValue;
+ }
+
+ @Override
+ public byte getUpdateData() {
+ return mDisableInput;
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return false;
+ }
+
+ @Override
+ public final boolean renderInside(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return getFluidAmount();
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return getCapacity();
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ for (int i = 0; i < mPipeAmount; i++)
+ if (mFluids[i] != null)
+ aNBT.setTag("mFluid"+(i==0?"":i), mFluids[i].writeToNBT(new NBTTagCompound()));
+ aNBT.setByte("mLastReceivedFrom", mLastReceivedFrom);
+ if (GT_Mod.gregtechproxy.gt6Pipe) {
+ aNBT.setByte("mConnections", mConnections);
+ aNBT.setByte("mDisableInput", mDisableInput);
+ }
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ for (int i = 0; i < mPipeAmount; i++)
+ mFluids[i] = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"+(i==0?"":i)));
+ mLastReceivedFrom = aNBT.getByte("mLastReceivedFrom");
+ if (GT_Mod.gregtechproxy.gt6Pipe) {
+ if (!aNBT.hasKey("mConnections"))
+ mCheckConnections = false;
+ mConnections = aNBT.getByte("mConnections");
+ mDisableInput = aNBT.getByte("mDisableInput");
+ }
+ }
+
+ @Override
+ public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) {
+ if ((((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase) {
+ for (FluidStack tFluid : mFluids) {
+ if (tFluid != null) {
+ int tTemperature = tFluid.getFluid().getTemperature(tFluid);
+ if (tTemperature > 320 && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) {
+ GT_Utility.applyHeatDamage((EntityLivingBase) aEntity, (tTemperature - 300) / 50.0F); break;
+ } else if (tTemperature < 260 && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) {
+ GT_Utility.applyFrostDamage((EntityLivingBase) aEntity, (270 - tTemperature) / 25.0F); break;
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide() && aTick % 5 == 0) {
+ mLastReceivedFrom &= 63;
+ if (mLastReceivedFrom == 63) {
+ mLastReceivedFrom = 0;
+ }
+
+ for (FluidStack tFluid : mFluids) {
+ if (tFluid != null && tFluid.amount > 0) {
+ int tTemperature = tFluid.getFluid().getTemperature(tFluid);
+ if (tTemperature > mHeatResistance) {
+ if (aBaseMetaTileEntity.getRandomNumber(100) == 0) {
+ aBaseMetaTileEntity.setToFire();
+ return;
+ }
+ aBaseMetaTileEntity.setOnFire();
+ }
+ if (!mGasProof && tFluid.getFluid().isGaseous(tFluid)) {
+ tFluid.amount -= 5;
+ sendSound((byte) 9);
+ if (tTemperature > 320) {
+ try {
+ for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord() - 2, getBaseMetaTileEntity().getYCoord() - 2, getBaseMetaTileEntity().getZCoord() - 2, getBaseMetaTileEntity().getXCoord() + 3, getBaseMetaTileEntity().getYCoord() + 3, getBaseMetaTileEntity().getZCoord() + 3))) {
+ GT_Utility.applyHeatDamage(tLiving, (tTemperature - 300) / 25.0F);
+ }
+ } catch (Throwable e) {
+ if (D1) e.printStackTrace(GT_Log.err);
+ }
+ } else if (tTemperature < 260) {
+ try {
+ for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord() - 2, getBaseMetaTileEntity().getYCoord() - 2, getBaseMetaTileEntity().getZCoord() - 2, getBaseMetaTileEntity().getXCoord() + 3, getBaseMetaTileEntity().getYCoord() + 3, getBaseMetaTileEntity().getZCoord() + 3))) {
+ GT_Utility.applyFrostDamage(tLiving, (270 - tTemperature) / 12.5F);
+ }
+ } catch (Throwable e) {
+ if (D1) e.printStackTrace(GT_Log.err);
+ }
+ }
+ if (tFluid.amount <= 0) tFluid = null;
+ }
+ }
+ }
+
+ if (mLastReceivedFrom == oLastReceivedFrom) {
+ ConcurrentHashMap<IFluidHandler, ForgeDirection> tTanks = new ConcurrentHashMap<IFluidHandler, ForgeDirection>();
+
+ for (byte tSide = 0, i = 0, j = (byte) aBaseMetaTileEntity.getRandomNumber(6); i < 6; i++) {
+ tSide = (byte) ((i + j) % 6);
+ if (mCheckConnections || (mConnections & (1 << tSide)) != 0)
+ switch (connect(tSide)) {
+ case 0:
+ disconnect(tSide); break;
+ case 2:
+ if ((mLastReceivedFrom & (1 << tSide)) == 0)
+ tTanks.put(aBaseMetaTileEntity.getITankContainerAtSide(tSide), ForgeDirection.getOrientation(tSide).getOpposite()); break;
+ }
+ }
+ if (GT_Mod.gregtechproxy.gt6Pipe) mCheckConnections = false;
+
+ for (int i = 0, j = aBaseMetaTileEntity.getRandomNumber(mPipeAmount); i < mPipeAmount; i++) {
+ int index = (i + j) % mPipeAmount;
+ if (mFluids[index] != null && mFluids[index].amount > 0) {
+ int tAmount = Math.max(1, Math.min(mCapacity * 10, mFluids[index].amount / 2)), tSuccessfulTankAmount = 0;
+
+ for (Entry<IFluidHandler, ForgeDirection> tEntry : tTanks.entrySet())
+ if (tEntry.getKey().fill(tEntry.getValue(), drainFromIndex(tAmount, false, index), false) > 0)
+ tSuccessfulTankAmount++;
+
+ if (tSuccessfulTankAmount > 0) {
+ if (tAmount >= tSuccessfulTankAmount) {
+ tAmount /= tSuccessfulTankAmount;
+ for (Entry<IFluidHandler, ForgeDirection> tTileEntity : tTanks.entrySet()) {
+ if (mFluids[index] == null || mFluids[index].amount <= 0) break;
+ int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(), drain(tAmount, false), false);
+ if (tFilledAmount > 0)
+ tTileEntity.getKey().fill(tTileEntity.getValue(), drainFromIndex(tFilledAmount, true, index), true);
+ }
+ } else {
+ for (Entry<IFluidHandler, ForgeDirection> tTileEntity : tTanks.entrySet()) {
+ if (mFluids[index] == null || mFluids[index].amount <= 0) break;
+ int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(), drainFromIndex(mFluids[index].amount, false, index), false);
+ if (tFilledAmount > 0)
+ tTileEntity.getKey().fill(tTileEntity.getValue(), drainFromIndex(tFilledAmount, true, index), true);
+ }
+ }
+ }
+ }
+ }
+
+ mLastReceivedFrom = 0;
+ }
+
+ oLastReceivedFrom = mLastReceivedFrom;
+ }else if(aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected==4) aBaseMetaTileEntity.issueTextureUpdate();
+ }
+
+ @Override
+ public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (GT_Mod.gregtechproxy.gt6Pipe) {
+ byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
+ byte tMask = (byte) (1 << tSide);
+ if (aPlayer.isSneaking()) {
+ if ((mDisableInput & tMask) != 0) {
+ mDisableInput &= ~tMask;
+ GT_Utility.sendChatToPlayer(aPlayer, trans("212", "Input enabled"));
+ if ((mConnections & tMask) == 0)
+ connect(tSide);
+ } else {
+ mDisableInput |= tMask;
+ GT_Utility.sendChatToPlayer(aPlayer, trans("213", "Input disabled"));
+ }
+ } else {
+ if ((mConnections & tMask) == 0) {
+ if (connect(tSide) > 0)
+ GT_Utility.sendChatToPlayer(aPlayer, trans("214", "Connected"));
+ }
+ else {
+ disconnect(tSide);
+ GT_Utility.sendChatToPlayer(aPlayer, trans("215", "Disconnected"));
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int connect(byte aSide) {
+ int rConnect = 0;
+ if (aSide >= 6) return rConnect;
+ IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(aSide);
+ GT_MetaPipeEntity_Fluid tFluidPipe = null;
+ byte tSide = GT_Utility.getOppositeSide(aSide);
+ if (tTileEntity != null) {
+ if (tTileEntity instanceof IGregTechTileEntity) {
+ if (getBaseMetaTileEntity().getColorization() >= 0) {
+ byte tColor = ((IGregTechTileEntity) tTileEntity).getColorization();
+ if (tColor >= 0 && (tColor & 15) != (getBaseMetaTileEntity().getColorization() & 15)) {
+ return rConnect;
+ }
+ }
+ if (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() instanceof GT_MetaPipeEntity_Fluid) {
+ tFluidPipe = (GT_MetaPipeEntity_Fluid) ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
+ }
+ }
+ FluidTankInfo[] tInfo = tTileEntity.getTankInfo(ForgeDirection.getOrientation(aSide).getOpposite());
+ if (tInfo != null) {
+ if (tInfo.length > 0) {
+ if ((tTileEntity instanceof ICoverable && ((ICoverable) tTileEntity).getCoverBehaviorAtSide(tSide).alwaysLookConnected(tSide, ((ICoverable) tTileEntity).getCoverIDAtSide(tSide), ((ICoverable) tTileEntity).getCoverDataAtSide(tSide), ((ICoverable) tTileEntity)))
+ || getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsFluidIn(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), null, getBaseMetaTileEntity())
+ || getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).alwaysLookConnected(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), getBaseMetaTileEntity())) {
+ rConnect = 1;
+ }
+ if (getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsFluidOut(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), null, getBaseMetaTileEntity())) {
+ rConnect = 2;
+ }
+ } else if (tInfo.length == 0) {
+ IGregTechTileEntity tSideTile = getBaseMetaTileEntity().getIGregTechTileEntityAtSide(aSide);
+ if (tSideTile != null){
+ ItemStack tCover = tSideTile.getCoverItemAtSide(tSide);
+ if (tCover!=null &&(GT_Utility.areStacksEqual(tCover, ItemList.FluidRegulator_LV.get(1, new Object[]{},true)) ||
+ GT_Utility.areStacksEqual(tCover, ItemList.FluidRegulator_MV.get(1, new Object[]{},true)) ||
+ GT_Utility.areStacksEqual(tCover, ItemList.FluidRegulator_HV.get(1, new Object[]{},true)) ||
+ GT_Utility.areStacksEqual(tCover, ItemList.FluidRegulator_EV.get(1, new Object[]{},true)) ||
+ GT_Utility.areStacksEqual(tCover, ItemList.FluidRegulator_IV.get(1, new Object[]{},true)))) {
+ rConnect = 1;
+ }
+ }
+ }
+ }
+ } else if (getBaseMetaTileEntity().getOffsetX(aSide, 1) >> 4 != getBaseMetaTileEntity().getXCoord() >> 4
+ || getBaseMetaTileEntity().getOffsetZ(aSide, 1) >> 4 != getBaseMetaTileEntity().getZCoord() >> 4) { // if chunk unloaded
+ rConnect = -1;
+ }
+ if (rConnect > 0) {
+ if (GT_Mod.gregtechproxy.gt6Pipe && tFluidPipe != null) {
+ if ((mDisableInput & (1 << aSide)) == 0 || (tFluidPipe.mDisableInput & (1 << tSide)) == 0) {
+ mConnections |= (1 << aSide);
+ if ((tFluidPipe.mConnections & (1 << tSide)) == 0) tFluidPipe.connect(tSide);
+ } else rConnect = 0;
+ } else {
+ mConnections |= (1 << aSide);
+ }
+ }
+ return rConnect;
+ }
+
+ @Override
+ public void doSound(byte aIndex, double aX, double aY, double aZ) {
+ super.doSound(aIndex, aX, aY, aZ);
+ if (aIndex == 9) {
+ GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(4), 5, 1.0F, aX, aY, aZ);
+ for (byte i = 0; i < 6; i++)
+ for (int l = 0; l < 2; ++l)
+ getBaseMetaTileEntity().getWorld().spawnParticle("largesmoke", aX - 0.5 + XSTR_INSTANCE.nextFloat(), aY - 0.5 + XSTR_INSTANCE.nextFloat(), aZ - 0.5 + XSTR_INSTANCE.nextFloat(), ForgeDirection.getOrientation(i).offsetX / 5.0, ForgeDirection.getOrientation(i).offsetY / 5.0, ForgeDirection.getOrientation(i).offsetZ / 5.0);
+ }
+ }
+
+ @Override
+ public final int getCapacity() {
+ return mCapacity * 20 * mPipeAmount;
+ }
+
+ @Override
+ public FluidTankInfo getInfo() {
+ for (FluidStack tFluid : mFluids) {
+ if (tFluid != null)
+ return new FluidTankInfo(tFluid, mCapacity * 20);
+ }
+ return new FluidTankInfo(null, mCapacity * 20);
+ }
+
+ @Override
+ public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
+ if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[]{};
+ ArrayList<FluidTankInfo> tList = new ArrayList<>();
+ for (FluidStack tFluid : mFluids)
+ tList.add(new FluidTankInfo(tFluid, mCapacity * 20));
+ return tList.toArray(new FluidTankInfo[mPipeAmount]);
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public final FluidStack getFluid() {
+ for (FluidStack tFluid : mFluids) {
+ if (tFluid != null)
+ return tFluid;
+ }
+ return null;
+ }
+
+ @Override
+ public final int getFluidAmount() {
+ int rAmount = 0;
+ for (FluidStack tFluid : mFluids) {
+ if (tFluid != null)
+ rAmount += tFluid.amount;
+ }
+ return rAmount;
+ }
+
+ @Override
+ public final int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ if (aFluid == null || aFluid.getFluid().getID() <= 0) return 0;
+
+ int index = -1;
+ for (int i = 0; i < mPipeAmount; i++) {
+ if (mFluids[i] != null && mFluids[i].isFluidEqual(aFluid)) {
+ index = i; break;
+ }
+ else if ((mFluids[i] == null || mFluids[i].getFluid().getID() <= 0) && index < 0) {
+ index = i;
+ }
+ }
+
+ return fill_default_intoIndex(aSide, aFluid, doFill, index);
+ }
+
+ private final int fill_default_intoIndex(ForgeDirection aSide, FluidStack aFluid, boolean doFill, int index) {
+ if (index < 0 || index >= mPipeAmount) return 0;
+ if (aFluid == null || aFluid.getFluid().getID() <= 0) return 0;
+
+ if (mFluids[index] == null || mFluids[index].getFluid().getID() <= 0) {
+ if (aFluid.amount * mPipeAmount <= getCapacity()) {
+ if (doFill) {
+ mFluids[index] = aFluid.copy();
+ mLastReceivedFrom |= (1 << aSide.ordinal());
+ }
+ return aFluid.amount;
+ }
+ if (doFill) {
+ mFluids[index] = aFluid.copy();
+ mLastReceivedFrom |= (1 << aSide.ordinal());
+ mFluids[index].amount = getCapacity() / mPipeAmount;
+ }
+ return getCapacity() / mPipeAmount;
+ }
+
+ if (!mFluids[index].isFluidEqual(aFluid)) return 0;
+
+ int space = getCapacity() / mPipeAmount - mFluids[index].amount;
+ if (aFluid.amount <= space) {
+ if (doFill) {
+ mFluids[index].amount += aFluid.amount;
+ mLastReceivedFrom |= (1 << aSide.ordinal());
+ }
+ return aFluid.amount;
+ }
+ if (doFill) {
+ mFluids[index].amount = getCapacity() / mPipeAmount;
+ mLastReceivedFrom |= (1 << aSide.ordinal());
+ }
+ return space;
+ }
+
+ @Override
+ public final FluidStack drain(int maxDrain, boolean doDrain) {
+ FluidStack drained = null;
+ for (int i = 0; i < mPipeAmount; i++) {
+ if ((drained = drainFromIndex(maxDrain, doDrain, i)) != null)
+ return drained;
+ }
+ return null;
+ }
+
+ private final FluidStack drainFromIndex(int maxDrain, boolean doDrain, int index) {
+ if (index < 0 || index >= mPipeAmount) return null;
+ if (mFluids[index] == null) return null;
+ if (mFluids[index].amount <= 0) {
+ mFluids[index] = null;
+ return null;
+ }
+
+ int used = maxDrain;
+ if (mFluids[index].amount < used)
+ used = mFluids[index].amount;
+
+ if (doDrain) {
+ mFluids[index].amount -= used;
+ }
+
+ FluidStack drained = mFluids[index].copy();
+ drained.amount = used;
+
+ if (mFluids[index].amount <= 0) {
+ mFluids[index] = null;
+ }
+
+ return drained;
+ }
+
+ @Override
+ public int getTankPressure() {
+ return getFluidAmount() - (getCapacity() / 2);
+ }
+
+ @Override
+ public String[] getDescription() {
+ if (mPipeAmount == 1) {
+ return new String[]{
+ EnumChatFormatting.BLUE + "Fluid Capacity: %%%" + (mCapacity * 20) + "%%% L/sec" + EnumChatFormatting.GRAY,
+ EnumChatFormatting.RED + "Heat Limit: %%%" + mHeatResistance + "%%% K" + EnumChatFormatting.GRAY
+ };
+ } else {
+ return new String[]{
+ EnumChatFormatting.BLUE + "Fluid Capacity: %%%" + (mCapacity * 20) + "%%% L/sec" + EnumChatFormatting.GRAY,
+ EnumChatFormatting.RED + "Heat Limit: %%%" + mHeatResistance + "%%% K" + EnumChatFormatting.GRAY,
+ EnumChatFormatting.AQUA + "Pipe Amount: %%%" + mPipeAmount + EnumChatFormatting.GRAY
+ };
+ }
+ }
+
+ @Override
+ public float getThickNess() {
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x1) != 0) return 0.0625F;
+ return mThickNess;
+ }
+
+ @Override
+ public boolean isLiquidInput(byte aSide) {
+ return (mDisableInput & (1 << aSide)) == 0;
+ }
+
+ @Override
+ public boolean isLiquidOutput(byte aSide) {
+ return true;
+ }
+
+ @Override
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0)
+ return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
+ else
+ return getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ }
+
+ private AxisAlignedBB getActualCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ float tSpace = (1f - mThickNess)/2;
+ float tSide0 = tSpace;
+ float tSide1 = 1f - tSpace;
+ float tSide2 = tSpace;
+ float tSide3 = 1f - tSpace;
+ float tSide4 = tSpace;
+ float tSide5 = 1f - tSpace;
+
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;}
+
+ byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections;
+ if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f;
+ if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f;
+ if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f;
+ if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f;
+ if((tConn & (1 << ForgeDirection.WEST.ordinal()) ) != 0) tSide4 = 0f;
+ if((tConn & (1 << ForgeDirection.EAST.ordinal()) ) != 0) tSide5 = 1f;
+
+ return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3);
+ }
+
+ @Override
+ public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) {
+ super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) {
+ AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ if (inputAABB.intersectsWith(aabb)) outputAABB.add(aabb);
+ }
+ }
+}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java
index ee4b204215..fd04893ec7 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java
@@ -91,4 +91,10 @@ public class GT_MetaPipeEntity_Frame extends MetaPipeEntity {
public final boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return false;
}
+
+ @Override
+ public int connect(byte aSide) {return 0;}
+
+ @Override
+ public void disconnect(byte aSide) {/* Do nothing*/}
} \ No newline at end of file
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java
index 9c458ae1f0..3615346641 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java
@@ -12,6 +12,8 @@ import gregtech.api.metatileentity.MetaPipeEntity;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
import gregtech.common.GT_Client;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
@@ -24,6 +26,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import java.util.ArrayList;
+import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileEntityItemPipe {
@@ -34,6 +37,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
public int mTransferredItems = 0;
public byte mLastReceivedFrom = 0, oLastReceivedFrom = 0;
public boolean mIsRestrictive = false;
+ private boolean mCheckConnections = !GT_Mod.gregtechproxy.gt6Pipe;
public GT_MetaPipeEntity_Item(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, int aInvSlotCount, int aStepSize, boolean aIsRestrictive, int aTickTime) {
super(aID, aName, aNameRegional, aInvSlotCount);
@@ -141,70 +145,29 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
@Override
public void saveNBTData(NBTTagCompound aNBT) {
aNBT.setByte("mLastReceivedFrom", mLastReceivedFrom);
+ if (GT_Mod.gregtechproxy.gt6Pipe)
+ aNBT.setByte("mConnections", mConnections);
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
mLastReceivedFrom = aNBT.getByte("mLastReceivedFrom");
+ if (GT_Mod.gregtechproxy.gt6Pipe) {
+ if (!aNBT.hasKey("mConnections"))
+ mCheckConnections = true;
+ mConnections = aNBT.getByte("mConnections");
+ }
}
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isServerSide() && aTick % 10 == 0) {
- mConnections = 0;
if (aTick % mTickTime == 0) mTransferredItems = 0;
for (byte i = 0; i < 6; i++) {
- TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i);
- if (tTileEntity != null) {
- boolean temp = GT_Utility.isConnectableNonInventoryPipe(tTileEntity, GT_Utility.getOppositeSide(i));
- if (tTileEntity instanceof IGregTechTileEntity) {
- temp = true;
- if (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() == null) continue;
- if (aBaseMetaTileEntity.getColorization() >= 0) {
- byte tColor = ((IGregTechTileEntity) tTileEntity).getColorization();
- if (tColor >= 0 && tColor != aBaseMetaTileEntity.getColorization()) {
- continue;
- }
- }
- if (((IGregTechTileEntity) tTileEntity).getMetaTileEntity().connectsToItemPipe(GT_Utility.getOppositeSide(i))) {
- mConnections |= (1 << i);
- continue;
- }
- }
- if (tTileEntity instanceof IInventory) {
- temp = true;
- if (((IInventory) tTileEntity).getSizeInventory() <= 0) {
- continue;
- }
- }
- if (tTileEntity instanceof ISidedInventory) {
- temp = true;
- int[] tSlots = ((ISidedInventory) tTileEntity).getAccessibleSlotsFromSide(GT_Utility.getOppositeSide(i));
- if (tSlots == null || tSlots.length <= 0) {
- continue;
- }
- }
- if (temp) {
- if (tTileEntity instanceof ICoverable && ((ICoverable) tTileEntity).getCoverBehaviorAtSide(GT_Utility.getOppositeSide(i)).alwaysLookConnected(GT_Utility.getOppositeSide(i), ((ICoverable) tTileEntity).getCoverIDAtSide(GT_Utility.getOppositeSide(i)), ((ICoverable) tTileEntity).getCoverDataAtSide(GT_Utility.getOppositeSide(i)), ((ICoverable) tTileEntity))) {
- mConnections |= (1 << i);
- continue;
- }
- if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).alwaysLookConnected(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity)) {
- mConnections |= (1 << i);
- continue;
- }
- if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsItemsIn(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), -1, aBaseMetaTileEntity)) {
- mConnections |= (1 << i);
- continue;
- }
- if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsItemsOut(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), -1, aBaseMetaTileEntity)) {
- mConnections |= (1 << i);
- continue;
- }
- }
- }
+ if ((mCheckConnections || (mConnections & (1 << i)) != 0) && connect(i) == 0) disconnect(i);
}
+ if (GT_Mod.gregtechproxy.gt6Pipe) mCheckConnections = false;
if (oLastReceivedFrom == mLastReceivedFrom) {
doTickProfilingInThisTick = false;
@@ -230,6 +193,77 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
}
@Override
+ public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (GT_Mod.gregtechproxy.gt6Pipe) {
+ byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
+ if ((mConnections & (1 << tSide)) == 0) {
+ if (connect(tSide) > 0)
+ GT_Utility.sendChatToPlayer(aPlayer, trans("214", "Connected"));
+ }
+ else {
+ disconnect(tSide);
+ GT_Utility.sendChatToPlayer(aPlayer, trans("215", "Disconnected"));
+ }
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int connect(byte aSide) {
+ int rConnect = 0;
+ if (aSide >= 6) return rConnect;
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(aSide);
+ byte tSide = GT_Utility.getOppositeSide(aSide);
+ if (tTileEntity != null) {
+ boolean temp = GT_Utility.isConnectableNonInventoryPipe(tTileEntity, tSide);
+ if (tTileEntity instanceof IGregTechTileEntity) {
+ temp = true;
+ if (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() == null) return rConnect;
+ if (getBaseMetaTileEntity().getColorization() >= 0) {
+ byte tColor = ((IGregTechTileEntity) tTileEntity).getColorization();
+ if (tColor >= 0 && tColor != getBaseMetaTileEntity().getColorization()) {
+ return rConnect;
+ }
+ }
+ if (((IGregTechTileEntity) tTileEntity).getMetaTileEntity().connectsToItemPipe(tSide)) {
+ rConnect = 1;
+ }
+ }
+ if (rConnect == 0) {
+ if (tTileEntity instanceof IInventory) {
+ temp = true;
+ if (((IInventory) tTileEntity).getSizeInventory() <= 0) {
+ return rConnect;
+ }
+ }
+ if (tTileEntity instanceof ISidedInventory) {
+ temp = true;
+ int[] tSlots = ((ISidedInventory) tTileEntity).getAccessibleSlotsFromSide(tSide);
+ if (tSlots == null || tSlots.length <= 0) {
+ return rConnect;
+ }
+ }
+ if (temp) {
+ if ((tTileEntity instanceof ICoverable && ((ICoverable) tTileEntity).getCoverBehaviorAtSide(tSide).alwaysLookConnected(tSide, ((ICoverable) tTileEntity).getCoverIDAtSide(tSide), ((ICoverable) tTileEntity).getCoverDataAtSide(tSide), ((ICoverable) tTileEntity)))
+ || getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).alwaysLookConnected(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), getBaseMetaTileEntity())
+ || getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsItemsIn(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), -1, getBaseMetaTileEntity())
+ || getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsItemsOut(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), -1, getBaseMetaTileEntity())) {
+ rConnect = 1;
+ }
+ }
+ }
+ } else if (getBaseMetaTileEntity().getOffsetX(aSide, 1) >> 4 != getBaseMetaTileEntity().getXCoord() >> 4
+ || getBaseMetaTileEntity().getOffsetZ(aSide, 1) >> 4 != getBaseMetaTileEntity().getZCoord() >> 4) { // if chunk unloaded
+ rConnect = -1;
+ }
+ if (rConnect > 0) {
+ super.connect(aSide);
+ }
+ return rConnect;
+ }
+
+ @Override
public boolean incrementTransferCounter(int aIncrement) {
mTransferredItems += aIncrement;
return pipeCapacityCheck();
@@ -320,36 +354,51 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
@Override
public float getThickNess() {
- if(GT_Mod.instance.isClientSide() && GT_Client.hideValue==1) return 0.0625F;
+ if(GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x1) != 0) return 0.0625F;
return mThickNess;
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- float tSpace = (1f - mThickNess)/2;
- float tSide0 = tSpace;
- float tSide1 = 1f - tSpace;
- float tSide2 = tSpace;
- float tSide3 = 1f - tSpace;
- float tSide4 = tSpace;
- float tSide5 = 1f - tSpace;
-
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;}
-
- byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections;
- if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f;
- if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f;
- if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f;
- if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f;
- if((tConn & (1 << ForgeDirection.WEST.ordinal()) ) != 0) tSide4 = 0f;
- if((tConn & (1 << ForgeDirection.EAST.ordinal()) ) != 0) tSide5 = 1f;
-
- return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3);
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0)
+ return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
+ else
+ return getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ }
+ private AxisAlignedBB getActualCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ float tSpace = (1f - mThickNess)/2;
+ float tSide0 = tSpace;
+ float tSide1 = 1f - tSpace;
+ float tSide2 = tSpace;
+ float tSide3 = 1f - tSpace;
+ float tSide4 = tSpace;
+ float tSide5 = 1f - tSpace;
+
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;}
+
+ byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections;
+ if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f;
+ if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f;
+ if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f;
+ if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f;
+ if((tConn & (1 << ForgeDirection.WEST.ordinal()) ) != 0) tSide4 = 0f;
+ if((tConn & (1 << ForgeDirection.EAST.ordinal()) ) != 0) tSide5 = 1f;
+
+ return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3);
+ }
+
+ @Override
+ public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) {
+ super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) {
+ AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ if (inputAABB.intersectsWith(aabb)) outputAABB.add(aabb);
+ }
}
} \ No newline at end of file
diff --git a/src/main/java/gregtech/api/util/GT_LanguageManager.java b/src/main/java/gregtech/api/util/GT_LanguageManager.java
index 8e123145eb..820e1592fd 100644
--- a/src/main/java/gregtech/api/util/GT_LanguageManager.java
+++ b/src/main/java/gregtech/api/util/GT_LanguageManager.java
@@ -317,6 +317,10 @@ public class GT_LanguageManager {
// addStringLocalization("Interaction_DESCRIPTION_Index_209", "Grab");
// addStringLocalization("Interaction_DESCRIPTION_Index_210", "Grab");
addStringLocalization("Interaction_DESCRIPTION_Index_211", "Items per side: ");
+ addStringLocalization("Interaction_DESCRIPTION_Index_212", "Input enabled");
+ addStringLocalization("Interaction_DESCRIPTION_Index_213", "Input disabled");
+ addStringLocalization("Interaction_DESCRIPTION_Index_214", "Connected");
+ addStringLocalization("Interaction_DESCRIPTION_Index_215", "Disconnected");
addStringLocalization("Interaction_DESCRIPTION_Index_500", "Fitting: Loose - More Flow");
addStringLocalization("Interaction_DESCRIPTION_Index_501", "Fitting: Tight - More Efficiency");
diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java
index d91f36dae4..e5793286c9 100644
--- a/src/main/java/gregtech/api/util/GT_ModHandler.java
+++ b/src/main/java/gregtech/api/util/GT_ModHandler.java
@@ -1718,21 +1718,12 @@ public class GT_ModHandler {
EntityPlayer tPlayer = (EntityPlayer) aPlayer;
if (tPlayer.capabilities.isCreativeMode) return true;
if (isElectricItem(aStack) && ic2.api.item.ElectricItem.manager.getCharge(aStack) > 1000.0d) {
- for (int i = 0; i < tPlayer.inventory.mainInventory.length; i++) {
- if (GT_Utility.isStackInList(tPlayer.inventory.mainInventory[i], GregTech_API.sSolderingMetalList)) {
- if (tPlayer.inventory.mainInventory[i].stackSize < 1) return false;
- if (tPlayer.inventory.mainInventory[i].stackSize == 1) {
- tPlayer.inventory.mainInventory[i] = null;
- } else {
- tPlayer.inventory.mainInventory[i].stackSize--;
- }
- if (tPlayer.inventoryContainer != null) tPlayer.inventoryContainer.detectAndSendChanges();
- if (canUseElectricItem(aStack, 10000)) {
- return GT_ModHandler.useElectricItem(aStack, 10000, (EntityPlayer) aPlayer);
- }
- GT_ModHandler.useElectricItem(aStack, (int) ic2.api.item.ElectricItem.manager.getCharge(aStack), (EntityPlayer) aPlayer);
- return false;
+ if (consumeSolderingMaterial(tPlayer)) {
+ if (canUseElectricItem(aStack, 10000)) {
+ return GT_ModHandler.useElectricItem(aStack, 10000, (EntityPlayer) aPlayer);
}
+ GT_ModHandler.useElectricItem(aStack, (int) ic2.api.item.ElectricItem.manager.getCharge(aStack), (EntityPlayer) aPlayer);
+ return false;
}
}
} else {
@@ -1744,6 +1735,26 @@ public class GT_ModHandler {
}
/**
+ * Simply consumes some soldering material
+ */
+ public static boolean consumeSolderingMaterial(EntityPlayer aPlayer) {
+ if (aPlayer.capabilities.isCreativeMode) return true;
+ for (int i = 0; i < aPlayer.inventory.mainInventory.length; i++) {
+ if (GT_Utility.isStackInList(aPlayer.inventory.mainInventory[i], GregTech_API.sSolderingMetalList)) {
+ if (aPlayer.inventory.mainInventory[i].stackSize < 1) return false;
+ if (aPlayer.inventory.mainInventory[i].stackSize == 1) {
+ aPlayer.inventory.mainInventory[i] = null;
+ } else {
+ aPlayer.inventory.mainInventory[i].stackSize--;
+ }
+ if (aPlayer.inventoryContainer != null) aPlayer.inventoryContainer.detectAndSendChanges();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
* Is this an electric Item, which can charge other Items?
*/
public static boolean isChargerItem(ItemStack aStack) {
diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java
index 9a0d448fa2..f3203bab1e 100644
--- a/src/main/java/gregtech/common/GT_Client.java
+++ b/src/main/java/gregtech/common/GT_Client.java
@@ -1,603 +1,681 @@
-// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
-// Jad home page: http://www.kpdus.com/jad.html
-// Decompiler options: packimports(3)
-// Source File Name: GT_Client.java
-
-package gregtech.common;
-
-import codechicken.lib.vec.Rotation;
-import cpw.mods.fml.client.registry.RenderingRegistry;
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import cpw.mods.fml.common.gameevent.TickEvent;
-import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.Materials;
-import gregtech.api.interfaces.tileentity.ICoverable;
-import gregtech.api.interfaces.tileentity.ITurnable;
-import gregtech.api.metatileentity.BaseMetaPipeEntity;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_PlayedSound;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.entities.GT_Entity_Arrow;
-import gregtech.common.entities.GT_Entity_Arrow_Potion;
-import gregtech.common.render.*;
-import ic2.api.tile.IWrenchable;
-import net.minecraft.block.Block;
-import net.minecraft.client.Minecraft;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.stats.StatFileWriter;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-import net.minecraftforge.client.event.DrawBlockHighlightEvent;
-import net.minecraftforge.oredict.OreDictionary;
-import org.lwjgl.opengl.GL11;
-
-import java.net.URL;
-import java.util.*;
-
-// Referenced classes of package gregtech.common:
-// GT_Proxy
-
-public class GT_Client extends GT_Proxy
- implements Runnable {
-
- private static List ROTATABLE_VANILLA_BLOCKS;
-
- static {
- ROTATABLE_VANILLA_BLOCKS = Arrays.asList(new Block[]{
- Blocks.piston, Blocks.sticky_piston, Blocks.furnace, Blocks.lit_furnace, Blocks.dropper, Blocks.dispenser, Blocks.chest, Blocks.trapped_chest, Blocks.ender_chest, Blocks.hopper,
- Blocks.pumpkin, Blocks.lit_pumpkin
- });
- }
-
- private final HashSet mCapeList = new HashSet();
- private final GT_CapeRenderer mCapeRenderer;
- private final List mPosR;
- private final List mPosG;
- private final List mPosB;
- private final List mPosA = Arrays.asList(new Object[0]);
- private final List mNegR;
- private final List mNegG;
- private final List mNegB;
- private final List mNegA = Arrays.asList(new Object[0]);
- private final List mMoltenPosR;
- private final List mMoltenPosG;
- private final List mMoltenPosB;
- private final List mMoltenPosA = Arrays.asList(new Object[0]);
- private final List mMoltenNegR;
- private final List mMoltenNegG;
- private final List mMoltenNegB;
- private final List mMoltenNegA = Arrays.asList(new Object[0]);
- private long mAnimationTick;
- /**This is the place to def the value used below**/
- private long afterSomeTime;
- private boolean mAnimationDirection;
- private boolean isFirstClientPlayerTick;
- private String mMessage;
- public GT_Client() {
- mCapeRenderer = new GT_CapeRenderer(mCapeList);
- mAnimationTick = 0L;
- mAnimationDirection = false;
- isFirstClientPlayerTick = true;
- mMessage = "";
- mPosR = Arrays.asList(new Materials[]{
- /**Materials.ChargedCertusQuartz, **/Materials.Enderium, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.Force,
- Materials.Pyrotheum, Materials.Sunnarium, Materials.Glowstone, Materials.Thaumium, Materials.InfusedVis, Materials.InfusedAir, Materials.InfusedFire, Materials.FierySteel, Materials.Firestone
- });
- mPosG = Arrays.asList(new Materials[]{
- /**Materials.ChargedCertusQuartz, **/Materials.Enderium, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.Force,
- Materials.Pyrotheum, Materials.Sunnarium, Materials.Glowstone, Materials.InfusedAir, Materials.InfusedEarth
- });
- mPosB = Arrays.asList(new Materials[]{
- /**Materials.ChargedCertusQuartz, **/Materials.Enderium, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.InfusedVis,
- Materials.InfusedWater, Materials.Thaumium
- });
- mNegR = Arrays.asList(new Materials[]{
- Materials.InfusedEntropy, Materials.NetherStar
- });
- mNegG = Arrays.asList(new Materials[]{
- Materials.InfusedEntropy, Materials.NetherStar
- });
- mNegB = Arrays.asList(new Materials[]{
- Materials.InfusedEntropy, Materials.NetherStar
- });
- mMoltenPosR = Arrays.asList(new Materials[]{
- Materials.Enderium, Materials.NetherStar, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.Force,
- Materials.Pyrotheum, Materials.Sunnarium, Materials.Glowstone, Materials.Thaumium, Materials.InfusedVis, Materials.InfusedAir, Materials.InfusedFire, Materials.FierySteel, Materials.Firestone
- });
- mMoltenPosG = Arrays.asList(new Materials[]{
- Materials.Enderium, Materials.NetherStar, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.Force,
- Materials.Pyrotheum, Materials.Sunnarium, Materials.Glowstone, Materials.InfusedAir, Materials.InfusedEarth
- });
- mMoltenPosB = Arrays.asList(new Materials[]{
- Materials.Enderium, Materials.NetherStar, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.InfusedVis,
- Materials.InfusedWater, Materials.Thaumium
- });
- mMoltenNegR = Arrays.asList(new Materials[]{
- Materials.InfusedEntropy
- });
- mMoltenNegG = Arrays.asList(new Materials[]{
- Materials.InfusedEntropy
- });
- mMoltenNegB = Arrays.asList(new Materials[]{
- Materials.InfusedEntropy
- });
- }
-
- private static void drawGrid(DrawBlockHighlightEvent aEvent) {
- GL11.glPushMatrix();
- GL11.glTranslated(-(aEvent.player.lastTickPosX + (aEvent.player.posX - aEvent.player.lastTickPosX) * (double) aEvent.partialTicks), -(aEvent.player.lastTickPosY + (aEvent.player.posY - aEvent.player.lastTickPosY) * (double) aEvent.partialTicks), -(aEvent.player.lastTickPosZ + (aEvent.player.posZ - aEvent.player.lastTickPosZ) * (double) aEvent.partialTicks));
- GL11.glTranslated((float) aEvent.target.blockX + 0.5F, (float) aEvent.target.blockY + 0.5F, (float) aEvent.target.blockZ + 0.5F);
- Rotation.sideRotations[aEvent.target.sideHit].glApply();
- GL11.glTranslated(0.0D, -0.501D, 0.0D);
- GL11.glLineWidth(2.0F);
- GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.5F);
- GL11.glBegin(1);
- GL11.glVertex3d(0.5D, 0.0D, -0.25D);
- GL11.glVertex3d(-0.5D, 0.0D, -0.25D);
- GL11.glVertex3d(0.5D, 0.0D, 0.25D);
- GL11.glVertex3d(-0.5D, 0.0D, 0.25D);
- GL11.glVertex3d(0.25D, 0.0D, -0.5D);
- GL11.glVertex3d(0.25D, 0.0D, 0.5D);
- GL11.glVertex3d(-0.25D, 0.0D, -0.5D);
- GL11.glVertex3d(-0.25D, 0.0D, 0.5D);
- GL11.glEnd();
- GL11.glPopMatrix();
- }
-
- //TODO less bad
- //@SubscribeEvent
- //public void manipulateDensity(EntityViewRenderEvent.FogDensity event) {
- // if(GT_Pollution.mPlayerPollution > (GT_Mod.gregtechproxy.mPollutionSmogLimit)){
- // event.density = (0.15f*(Math.min(GT_Pollution.mPlayerPollution/((float)GT_Mod.gregtechproxy.mPollutionSourRainLimit),1.0f)))+0.1f;
- // event.setCanceled(true);
- // }
- //}
-
- //@SubscribeEvent
- //public void manipulateColor(EntityViewRenderEvent.FogColors event) {
- // if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){
- // event.red = 140f/255f;
- // event.green = 80f/255f;
- // event.blue = 40f/255f;
- // }
- //}
-
- //@SubscribeEvent
- //public void manipulateGrassColor(BiomeEvent.GetGrassColor event) {
- // if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){
- // event.newColor = 0xD2691E;
- // }
- //}
-
- //@SubscribeEvent
- //public void manipulateWaterColor(BiomeEvent.GetWaterColor event) {
- // if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){
- // event.newColor = 0x556B2F;
- // }
- //}
-
- //@SubscribeEvent
- //public void manipulateFoliageColor(BiomeEvent.GetFoliageColor event) {
- // if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){
- // event.newColor = 0xCD853F;
- // }
- //}
-
- public boolean isServerSide() {
- return true;
- }
-
- public boolean isClientSide() {
- return true;
- }
-
- public boolean isBukkitSide() {
- return false;
- }
-
- public EntityPlayer getThePlayer() {
- return Minecraft.getMinecraft().thePlayer;
- }
-
- public int addArmor(String aPrefix) {
- return RenderingRegistry.addNewArmourRendererPrefix(aPrefix);
- }
-
- public void onPreLoad() {
- super.onPreLoad();
- String arr$[] = {
- "renadi", "hanakocz", "MysteryDump", "Flaver4", "x_Fame", "Peluche321", "Goshen_Ithilien", "manf", "Bimgo", "leagris",
- "IAmMinecrafter02", "Cerous", "Devilin_Pixy", "Bkarlsson87", "BadAlchemy", "CaballoCraft", "melanclock", "Resursator", "demanzke", "AndrewAmmerlaan",
- "Deathlycraft", "Jirajha", "Axlegear", "kei_kouma", "Dracion", "dungi", "Dorfschwein", "Zero Tw0", "mattiagraz85", "sebastiank30",
- "Plem", "invultri", "grillo126", "malcanteth", "Malevolence_", "Nicholas_Manuel", "Sirbab", "kehaan", "bpgames123", "semig0d",
- "9000bowser", "Sovereignty89", "Kris1432", "xander_cage_", "samuraijp", "bsaa", "SpwnX", "tworf", "Kadah", "kanni",
- "Stute", "Hegik", "Onlyme", "t3hero", "Hotchi", "jagoly", "Nullav", "BH5432", "Sibmer", "inceee",
- "foxxx0", "Hartok", "TMSama", "Shlnen", "Carsso", "zessirb", "meep310", "Seldron", "yttr1um", "hohounk",
- "freebug", "Sylphio", "jmarler", "Saberawr", "r00teniy", "Neonbeta", "yinscape", "voooon24", "Quintine", "peach774",
- "lepthymo", "bildeman", "Kremnari", "Aerosalo", "OndraSter", "oscares91", "mr10movie", "Daxx367x2", "EGERTRONx", "aka13_404",
- "Abouttabs", "Johnstaal", "djshiny99", "megatronp", "DZCreeper", "Kane_Hart", "Truculent", "vidplace7", "simon6689", "MomoNasty",
- "UnknownXLV", "goreacraft", "Fluttermine", "Daddy_Cecil", "MrMaleficus", "TigersFangs", "cublikefoot", "chainman564", "NikitaBuker", "Misha999777",
- "25FiveDetail", "AntiCivilBoy", "michaelbrady", "xXxIceFirexXx", "Speedynutty68", "GarretSidzaka", "HallowCharm977", "mastermind1919", "The_Hypersonic", "diamondguy2798",
- "zF4ll3nPr3d4t0r", "CrafterOfMines57", "XxELIT3xSNIP3RxX", "SuterusuKusanagi", "xavier0014", "adamros", "alexbegt"
- };
- int len$ = arr$.length;
- for (int i$ = 0; i$ < len$; i$++) {
- String tName = arr$[i$];
- mCapeList.add(tName.toLowerCase());
- }
- (new Thread(this)).start();
- }
-
- public void onLoad() {
- super.onLoad();
- new GT_Renderer_Block();
- new GT_MetaGenerated_Item_Renderer();
- new GT_MetaGenerated_Tool_Renderer();
- new GT_Renderer_Entity_Arrow(GT_Entity_Arrow.class, "arrow");
- new GT_Renderer_Entity_Arrow(GT_Entity_Arrow_Potion.class, "arrow_potions");
- }
-
- public void onPostLoad() {
- super.onPostLoad();
- try {
- label0:
- for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++)
- do {
- if (i >= GregTech_API.METATILEENTITIES.length)
- continue label0;
- if (GregTech_API.METATILEENTITIES[i] != null)
- GregTech_API.METATILEENTITIES[i].getStackForm(1L).getTooltip(null, true);
- i++;
- } while (true);
- } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
-
-
-// super.onPostLoad();
-//
-// for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
-// try {
-// for (; i < GregTech_API.METATILEENTITIES.length; i++) if (GregTech_API.METATILEENTITIES[i] != null) GregTech_API.METATILEENTITIES[i].getStackForm(1L).getTooltip(null, true);
-// } catch (Throwable e) {
-// e.printStackTrace(GT_Log.err);
-// }
-// }
- }
-
- public void run() {
- try {
- GT_Log.out.println("GT_Mod: Downloading Cape List.");
- @SuppressWarnings("resource")
- Scanner tScanner = new Scanner(new URL("http://gregtech.overminddl1.com/com/gregoriust/gregtech/supporterlist.txt").openStream());
- while (tScanner.hasNextLine()) {
- String tName = tScanner.nextLine();
- if (!this.mCapeList.contains(tName.toLowerCase())) {
- this.mCapeList.add(tName.toLowerCase());
- }
- }
- } catch (Throwable e) {
- }
- try {
- GT_Log.out.println("GT New Horizons: Downloading Cape List.");
- @SuppressWarnings("resource")
- Scanner tScanner = new Scanner(new URL("https://raw.githubusercontent.com/GTNewHorizons/CustomGTCapeHook-Cape-List/master/capes.txt").openStream());
- while (tScanner.hasNextLine()) {
- String tName = tScanner.nextLine();
- if (tName.contains(":")) {
- int splitLocation = tName.indexOf(":");
- String username = tName.substring(0, splitLocation);
- if (!this.mCapeList.contains(username.toLowerCase()) && !this.mCapeList.contains(tName.toLowerCase())) {
- this.mCapeList.add(tName.toLowerCase());
- }
- } else {
- if (!this.mCapeList.contains(tName.toLowerCase())) {
- this.mCapeList.add(tName.toLowerCase());
- }
- }
- }
- } catch (Throwable e) {
- }
- /**try {
- GT_Log.out.println("GT_Mod: Downloading News.");
- @SuppressWarnings("resource")
- Scanner tScanner = new Scanner(new URL("http://files.minecraftforge.net/maven/com/gregoriust/gregtech/message.txt").openStream());
- while (tScanner.hasNextLine()) {
- this.mMessage = (this.mMessage + tScanner.nextLine() + " ");
- }
- } catch (Throwable e) {
- }**/
- }
-
- @SubscribeEvent
- public void receiveRenderSpecialsEvent(net.minecraftforge.client.event.RenderPlayerEvent.Specials.Pre aEvent) {
- mCapeRenderer.receiveRenderSpecialsEvent(aEvent);
- }
-
- @SubscribeEvent
- public void onPlayerTickEventClient(TickEvent.PlayerTickEvent aEvent) {
- if ((aEvent.side.isClient()) && (aEvent.phase == TickEvent.Phase.END) && (!aEvent.player.isDead)) {
- afterSomeTime++;
- if(afterSomeTime>=100L){
- afterSomeTime=0;
- StatFileWriter sfw= Minecraft.getMinecraft().thePlayer.getStatFileWriter();
- try {
- for(GT_Recipe recipe:GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList){
- recipe.mHidden=!sfw.hasAchievementUnlocked(GT_Mod.achievements.getAchievement(recipe.getOutput(0).getUnlocalizedName()));
- }
- }catch (Exception e){}
- }
- ArrayList<GT_PlayedSound> tList = new ArrayList();
- for (Map.Entry<GT_PlayedSound, Integer> tEntry : GT_Utility.sPlayedSoundMap.entrySet()) {
- if (tEntry.getValue().intValue() < 0) {//Integer -> Integer -> int? >_<, fix
- tList.add(tEntry.getKey());
- } else {
- tEntry.setValue(Integer.valueOf(tEntry.getValue().intValue() - 1));
- }
- }
- GT_PlayedSound tKey;
- for (Iterator i$ = tList.iterator(); i$.hasNext(); GT_Utility.sPlayedSoundMap.remove(tKey)) {
- tKey = (GT_PlayedSound) i$.next();
- }
- if(GregTech_API.mServerStarted == false)GregTech_API.mServerStarted = true;
- /*if ((this.isFirstClientPlayerTick) && (aEvent.player == GT_Values.GT.getThePlayer())) {
- this.isFirstClientPlayerTick = false;
- GT_FluidStack.fixAllThoseFuckingFluidIDs();
- if ((this.mMessage.length() > 5) && (GregTech_API.sSpecialFile.get(ConfigCategories.news, this.mMessage, true))) {
- aEvent.player.addChatComponentMessage(new ChatComponentText(this.mMessage));
- }
- try {
- int tVersion = Integer.parseInt(((String) Class.forName("ic2.core.IC2").getField("VERSION").get(null)).substring(4, 7));
- if (GT_Values.D1) {
- GT_Log.out.println("Industrialcraft Version: " + tVersion);
- }
- if (tVersion < 624) {
- aEvent.player.addChatComponentMessage(new ChatComponentText("GregTech: Please update your IndustrialCraft here:"));
- aEvent.player.addChatComponentMessage(new ChatComponentText("ic2api.player.to:8080/job/IC2_experimental/" + (GT_Mod.MAX_IC2 < Integer.MAX_VALUE ? GT_Mod.MAX_IC2 : 624) + "/"));
- } else if (tVersion > GT_Mod.MAX_IC2) {
- aEvent.player.addChatComponentMessage(new ChatComponentText("GregTech: Please downgrade your IndustrialCraft here:"));
- aEvent.player.addChatComponentMessage(new ChatComponentText("ic2api.player.to:8080/job/IC2_experimental/" + GT_Mod.MAX_IC2 + "/"));
- }
- } catch (Throwable e) {
- aEvent.player.addChatComponentMessage(new ChatComponentText("GregTech: Please get the recommended Version of IndustrialCraft here:"));
- aEvent.player.addChatComponentMessage(new ChatComponentText("ic2api.player.to:8080/job/IC2_experimental/" + (GT_Mod.MAX_IC2 < Integer.MAX_VALUE ? GT_Mod.MAX_IC2 : 624) + "/"));
- }
- }*/
- }
- }
-
- @SubscribeEvent
- public void onDrawBlockHighlight(DrawBlockHighlightEvent aEvent) {
- if (GT_Utility.isStackValid(aEvent.currentItem)) {
- Block aBlock = aEvent.player.worldObj.getBlock(aEvent.target.blockX, aEvent.target.blockY, aEvent.target.blockZ);
- TileEntity aTileEntity = aEvent.player.worldObj.getTileEntity(aEvent.target.blockX, aEvent.target.blockY, aEvent.target.blockZ);
- try {
- Class.forName("codechicken.lib.vec.Rotation");
- if (((aTileEntity instanceof BaseMetaPipeEntity)) && (((ICoverable) aTileEntity).getCoverIDAtSide((byte) aEvent.target.sideHit) == 0) && ((GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sCovers.keySet())) || (GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sCrowbarList)) || (GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sScrewdriverList)))) {
- drawGrid(aEvent);
- return;
- }
- if ((((aTileEntity instanceof ITurnable)) || (ROTATABLE_VANILLA_BLOCKS.contains(aBlock)) || ((aTileEntity instanceof IWrenchable))) && (GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sWrenchList))) {
- drawGrid(aEvent);
- return;
- }
- } catch (Throwable e) {
- if (GT_Values.D1) {
- e.printStackTrace(GT_Log.err);
- }
- }
- }
- }
-
- @SubscribeEvent
- public void receiveRenderEvent(net.minecraftforge.client.event.RenderPlayerEvent.Pre aEvent) {
- if (GT_Utility.getFullInvisibility(aEvent.entityPlayer)) {
- aEvent.setCanceled(true);
- return;
- } else {
- return;
- }
- }
-
- @SubscribeEvent
- public void onClientTickEvent(cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent aEvent) {
- if (aEvent.phase == cpw.mods.fml.common.gameevent.TickEvent.Phase.END) {
- if(changeDetected>0)changeDetected--;
- int newHideValue=shouldHeldItemHideThings();
- if(newHideValue!=hideValue){
- hideValue=newHideValue;
- changeDetected=5;
- }
- mAnimationTick++;
- if (mAnimationTick % 50L == 0L)
- {mAnimationDirection = !mAnimationDirection;}
- int tDirection = mAnimationDirection ? 1 : -1;
- for (Iterator i$ = mPosR.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mRGBa[0] += tDirection;
- }
-
- for (Iterator i$ = mPosG.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mRGBa[1] += tDirection;
- }
-
- for (Iterator i$ = mPosB.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mRGBa[2] += tDirection;
- }
-
- for (Iterator i$ = mPosA.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mRGBa[3] += tDirection;
- }
-
- for (Iterator i$ = mNegR.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mRGBa[0] -= tDirection;
- }
-
- for (Iterator i$ = mNegG.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mRGBa[1] -= tDirection;
- }
-
- for (Iterator i$ = mNegB.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mRGBa[2] -= tDirection;
- }
-
- for (Iterator i$ = mNegA.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mRGBa[3] -= tDirection;
- }
-
- for (Iterator i$ = mMoltenPosR.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mMoltenRGBa[0] += tDirection;
- }
-
- for (Iterator i$ = mMoltenPosG.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mMoltenRGBa[1] += tDirection;
- }
-
- for (Iterator i$ = mMoltenPosB.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mMoltenRGBa[2] += tDirection;
- }
-
- for (Iterator i$ = mMoltenPosA.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mMoltenRGBa[3] += tDirection;
- }
-
- for (Iterator i$ = mMoltenNegR.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mMoltenRGBa[0] -= tDirection;
- }
-
- for (Iterator i$ = mMoltenNegG.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mMoltenRGBa[1] -= tDirection;
- }
-
- for (Iterator i$ = mMoltenNegB.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mMoltenRGBa[2] -= tDirection;
- }
-
- for (Iterator i$ = mMoltenNegA.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mMoltenRGBa[3] -= tDirection;
- }
-
- }
- }
-
- public void doSonictronSound(ItemStack aStack, World aWorld, double aX, double aY, double aZ) {
- if (GT_Utility.isStackInvalid(aStack))
- return;
- String tString = "note.harp";
- int i = 0;
- int j = mSoundItems.size();
- do {
- if (i >= j)
- break;
- if (GT_Utility.areStacksEqual((ItemStack) mSoundItems.get(i), aStack)) {
- tString = (String) mSoundNames.get(i);
- break;
- }
- i++;
- } while (true);
- if (tString.startsWith("random.explode"))
- if (aStack.stackSize == 3)
- tString = "random.fuse";
- else if (aStack.stackSize == 2)
- tString = "random.old_explode";
- if (tString.startsWith("streaming."))
- switch (aStack.stackSize) {
- case 1: // '\001'
- tString = (new StringBuilder()).append(tString).append("13").toString();
- break;
-
- case 2: // '\002'
- tString = (new StringBuilder()).append(tString).append("cat").toString();
- break;
-
- case 3: // '\003'
- tString = (new StringBuilder()).append(tString).append("blocks").toString();
- break;
-
- case 4: // '\004'
- tString = (new StringBuilder()).append(tString).append("chirp").toString();
- break;
-
- case 5: // '\005'
- tString = (new StringBuilder()).append(tString).append("far").toString();
- break;
-
- case 6: // '\006'
- tString = (new StringBuilder()).append(tString).append("mall").toString();
- break;
-
- case 7: // '\007'
- tString = (new StringBuilder()).append(tString).append("mellohi").toString();
- break;
-
- case 8: // '\b'
- tString = (new StringBuilder()).append(tString).append("stal").toString();
- break;
-
- case 9: // '\t'
- tString = (new StringBuilder()).append(tString).append("strad").toString();
- break;
-
- case 10: // '\n'
- tString = (new StringBuilder()).append(tString).append("ward").toString();
- break;
-
- case 11: // '\013'
- tString = (new StringBuilder()).append(tString).append("11").toString();
- break;
-
- case 12: // '\f'
- tString = (new StringBuilder()).append(tString).append("wait").toString();
- break;
-
- default:
- tString = (new StringBuilder()).append(tString).append("wherearewenow").toString();
- break;
- }
- if (tString.startsWith("streaming."))
- aWorld.playRecord(tString.substring(10, tString.length()), (int) aX, (int) aY, (int) aZ);
- else
- aWorld.playSound(aX, aY, aZ, tString, 3F, tString.startsWith("note.") ? (float) Math.pow(2D, (double) (aStack.stackSize - 13) / 12D) : 1.0F, false);
- }
-
- public static int hideValue=0;
- public static int changeDetected=0;
-
- private static int shouldHeldItemHideThings() {
- try {
- EntityPlayer player = Minecraft.getMinecraft().thePlayer;
- if (player == null) return 0;
- ItemStack held = player.getCurrentEquippedItem();
- if (held == null) return 0;
- int[] ids = OreDictionary.getOreIDs(held);
- int hide = 0;
- for (int i : ids) {
- if (OreDictionary.getOreName(i).equals("craftingToolSolderingIron")) {
- hide |= 0x1;
- break;
- }
- }
- return hide;
- }catch(Exception e){
- return 0;
- }
- }
-}
+// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
+// Jad home page: http://www.kpdus.com/jad.html
+// Decompiler options: packimports(3)
+// Source File Name: GT_Client.java
+
+package gregtech.common;
+
+import codechicken.lib.vec.Rotation;
+import cpw.mods.fml.client.registry.RenderingRegistry;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import cpw.mods.fml.common.gameevent.TickEvent;
+import gregtech.GT_Mod;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Materials;
+import gregtech.api.interfaces.tileentity.ICoverable;
+import gregtech.api.interfaces.tileentity.ITurnable;
+import gregtech.api.metatileentity.BaseMetaPipeEntity;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_PlayedSound;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.entities.GT_Entity_Arrow;
+import gregtech.common.entities.GT_Entity_Arrow_Potion;
+import gregtech.common.render.*;
+import ic2.api.tile.IWrenchable;
+import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.stats.StatFileWriter;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+import net.minecraftforge.client.event.DrawBlockHighlightEvent;
+import net.minecraftforge.oredict.OreDictionary;
+import org.lwjgl.opengl.GL11;
+
+import java.net.URL;
+import java.util.*;
+
+// Referenced classes of package gregtech.common:
+// GT_Proxy
+
+public class GT_Client extends GT_Proxy
+ implements Runnable {
+
+ private static List ROTATABLE_VANILLA_BLOCKS;
+
+ static {
+ ROTATABLE_VANILLA_BLOCKS = Arrays.asList(new Block[]{
+ Blocks.piston, Blocks.sticky_piston, Blocks.furnace, Blocks.lit_furnace, Blocks.dropper, Blocks.dispenser, Blocks.chest, Blocks.trapped_chest, Blocks.ender_chest, Blocks.hopper,
+ Blocks.pumpkin, Blocks.lit_pumpkin
+ });
+ }
+
+ private final HashSet mCapeList = new HashSet();
+ private final GT_CapeRenderer mCapeRenderer;
+ private final List mPosR;
+ private final List mPosG;
+ private final List mPosB;
+ private final List mPosA = Arrays.asList(new Object[0]);
+ private final List mNegR;
+ private final List mNegG;
+ private final List mNegB;
+ private final List mNegA = Arrays.asList(new Object[0]);
+ private final List mMoltenPosR;
+ private final List mMoltenPosG;
+ private final List mMoltenPosB;
+ private final List mMoltenPosA = Arrays.asList(new Object[0]);
+ private final List mMoltenNegR;
+ private final List mMoltenNegG;
+ private final List mMoltenNegB;
+ private final List mMoltenNegA = Arrays.asList(new Object[0]);
+ private long mAnimationTick;
+ /**This is the place to def the value used below**/
+ private long afterSomeTime;
+ private boolean mAnimationDirection;
+ private boolean isFirstClientPlayerTick;
+ private String mMessage;
+ public GT_Client() {
+ mCapeRenderer = new GT_CapeRenderer(mCapeList);
+ mAnimationTick = 0L;
+ mAnimationDirection = false;
+ isFirstClientPlayerTick = true;
+ mMessage = "";
+ mPosR = Arrays.asList(new Materials[]{
+ /**Materials.ChargedCertusQuartz, **/Materials.Enderium, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.Force,
+ Materials.Pyrotheum, Materials.Sunnarium, Materials.Glowstone, Materials.Thaumium, Materials.InfusedVis, Materials.InfusedAir, Materials.InfusedFire, Materials.FierySteel, Materials.Firestone
+ });
+ mPosG = Arrays.asList(new Materials[]{
+ /**Materials.ChargedCertusQuartz, **/Materials.Enderium, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.Force,
+ Materials.Pyrotheum, Materials.Sunnarium, Materials.Glowstone, Materials.InfusedAir, Materials.InfusedEarth
+ });
+ mPosB = Arrays.asList(new Materials[]{
+ /**Materials.ChargedCertusQuartz, **/Materials.Enderium, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.InfusedVis,
+ Materials.InfusedWater, Materials.Thaumium
+ });
+ mNegR = Arrays.asList(new Materials[]{
+ Materials.InfusedEntropy, Materials.NetherStar
+ });
+ mNegG = Arrays.asList(new Materials[]{
+ Materials.InfusedEntropy, Materials.NetherStar
+ });
+ mNegB = Arrays.asList(new Materials[]{
+ Materials.InfusedEntropy, Materials.NetherStar
+ });
+ mMoltenPosR = Arrays.asList(new Materials[]{
+ Materials.Enderium, Materials.NetherStar, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.Force,
+ Materials.Pyrotheum, Materials.Sunnarium, Materials.Glowstone, Materials.Thaumium, Materials.InfusedVis, Materials.InfusedAir, Materials.InfusedFire, Materials.FierySteel, Materials.Firestone
+ });
+ mMoltenPosG = Arrays.asList(new Materials[]{
+ Materials.Enderium, Materials.NetherStar, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.Force,
+ Materials.Pyrotheum, Materials.Sunnarium, Materials.Glowstone, Materials.InfusedAir, Materials.InfusedEarth
+ });
+ mMoltenPosB = Arrays.asList(new Materials[]{
+ Materials.Enderium, Materials.NetherStar, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.InfusedVis,
+ Materials.InfusedWater, Materials.Thaumium
+ });
+ mMoltenNegR = Arrays.asList(new Materials[]{
+ Materials.InfusedEntropy
+ });
+ mMoltenNegG = Arrays.asList(new Materials[]{
+ Materials.InfusedEntropy
+ });
+ mMoltenNegB = Arrays.asList(new Materials[]{
+ Materials.InfusedEntropy
+ });
+ }
+
+ private static void drawGrid(DrawBlockHighlightEvent aEvent) {
+ GL11.glPushMatrix();
+ GL11.glTranslated(-(aEvent.player.lastTickPosX + (aEvent.player.posX - aEvent.player.lastTickPosX) * (double) aEvent.partialTicks), -(aEvent.player.lastTickPosY + (aEvent.player.posY - aEvent.player.lastTickPosY) * (double) aEvent.partialTicks), -(aEvent.player.lastTickPosZ + (aEvent.player.posZ - aEvent.player.lastTickPosZ) * (double) aEvent.partialTicks));
+ GL11.glTranslated((float) aEvent.target.blockX + 0.5F, (float) aEvent.target.blockY + 0.5F, (float) aEvent.target.blockZ + 0.5F);
+ Rotation.sideRotations[aEvent.target.sideHit].glApply();
+ GL11.glTranslated(0.0D, -0.501D, 0.0D);
+ GL11.glLineWidth(2.0F);
+ GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.5F);
+ GL11.glBegin(1);
+ GL11.glVertex3d(+.50D, .0D, -.25D);
+ GL11.glVertex3d(-.50D, .0D, -.25D);
+ GL11.glVertex3d(+.50D, .0D, +.25D);
+ GL11.glVertex3d(-.50D, .0D, +.25D);
+ GL11.glVertex3d(+.25D, .0D, -.50D);
+ GL11.glVertex3d(+.25D, .0D, +.50D);
+ GL11.glVertex3d(-.25D, .0D, -.50D);
+ GL11.glVertex3d(-.25D, .0D, +.50D);
+ GL11.glLineWidth(2.0F);
+ TileEntity tTile = aEvent.player.worldObj.getTileEntity(aEvent.target.blockX, aEvent.target.blockY, aEvent.target.blockZ);
+ if (tTile instanceof BaseMetaPipeEntity) {
+ int[][] GridSwitchArr = new int[][]{
+ {0, 5, 3, 1, 2, 4},
+ {5, 0, 1, 3, 2, 4},
+ {1, 3, 0, 5, 2, 4},
+ {3, 1, 5, 0, 2, 4},
+ {4, 2, 3, 1, 0, 5},
+ {2, 4, 3, 1, 5, 0},
+ };
+ int tConnections = ((BaseMetaPipeEntity) tTile).mConnections;
+ for (byte i = 0; i < 6; i++) {
+ if ((tConnections & (1 << i)) != 0) {
+ switch (GridSwitchArr[aEvent.target.sideHit][i]) {
+ case 0:
+ GL11.glVertex3d(+.25D, .0D, +.25D);
+ GL11.glVertex3d(-.25D, .0D, -.25D);
+ GL11.glVertex3d(-.25D, .0D, +.25D);
+ GL11.glVertex3d(+.25D, .0D, -.25D);
+ break;
+ case 1:
+ GL11.glVertex3d(-.25D, .0D, +.50D);
+ GL11.glVertex3d(+.25D, .0D, +.25D);
+ GL11.glVertex3d(-.25D, .0D, +.25D);
+ GL11.glVertex3d(+.25D, .0D, +.50D);
+ break;
+ case 2:
+ GL11.glVertex3d(-.50D, .0D, -.25D);
+ GL11.glVertex3d(-.25D, .0D, +.25D);
+ GL11.glVertex3d(-.50D, .0D, +.25D);
+ GL11.glVertex3d(-.25D, .0D, -.25D);
+ break;
+ case 3:
+ GL11.glVertex3d(-.25D, .0D, -.50D);
+ GL11.glVertex3d(+.25D, .0D, -.25D);
+ GL11.glVertex3d(-.25D, .0D, -.25D);
+ GL11.glVertex3d(+.25D, .0D, -.50D);
+ break;
+ case 4:
+ GL11.glVertex3d(+.50D, .0D, -.25D);
+ GL11.glVertex3d(+.25D, .0D, +.25D);
+ GL11.glVertex3d(+.50D, .0D, +.25D);
+ GL11.glVertex3d(+.25D, .0D, -.25D);
+ break;
+ case 5:
+ GL11.glVertex3d(+.50D, .0D, +.50D);
+ GL11.glVertex3d(+.25D, .0D, +.25D);
+ GL11.glVertex3d(+.50D, .0D, +.25D);
+ GL11.glVertex3d(+.25D, .0D, +.50D);
+ GL11.glVertex3d(+.50D, .0D, -.50D);
+ GL11.glVertex3d(+.25D, .0D, -.25D);
+ GL11.glVertex3d(+.50D, .0D, -.25D);
+ GL11.glVertex3d(+.25D, .0D, -.50D);
+ GL11.glVertex3d(-.50D, .0D, +.50D);
+ GL11.glVertex3d(-.25D, .0D, +.25D);
+ GL11.glVertex3d(-.50D, .0D, +.25D);
+ GL11.glVertex3d(-.25D, .0D, +.50D);
+ GL11.glVertex3d(-.50D, .0D, -.50D);
+ GL11.glVertex3d(-.25D, .0D, -.25D);
+ GL11.glVertex3d(-.50D, .0D, -.25D);
+ GL11.glVertex3d(-.25D, .0D, -.50D);
+ break;
+ }
+ }
+ }
+ }
+ GL11.glEnd();
+ GL11.glPopMatrix();
+ }
+
+ //TODO less bad
+ //@SubscribeEvent
+ //public void manipulateDensity(EntityViewRenderEvent.FogDensity event) {
+ // if(GT_Pollution.mPlayerPollution > (GT_Mod.gregtechproxy.mPollutionSmogLimit)){
+ // event.density = (0.15f*(Math.min(GT_Pollution.mPlayerPollution/((float)GT_Mod.gregtechproxy.mPollutionSourRainLimit),1.0f)))+0.1f;
+ // event.setCanceled(true);
+ // }
+ //}
+
+ //@SubscribeEvent
+ //public void manipulateColor(EntityViewRenderEvent.FogColors event) {
+ // if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){
+ // event.red = 140f/255f;
+ // event.green = 80f/255f;
+ // event.blue = 40f/255f;
+ // }
+ //}
+
+ //@SubscribeEvent
+ //public void manipulateGrassColor(BiomeEvent.GetGrassColor event) {
+ // if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){
+ // event.newColor = 0xD2691E;
+ // }
+ //}
+
+ //@SubscribeEvent
+ //public void manipulateWaterColor(BiomeEvent.GetWaterColor event) {
+ // if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){
+ // event.newColor = 0x556B2F;
+ // }
+ //}
+
+ //@SubscribeEvent
+ //public void manipulateFoliageColor(BiomeEvent.GetFoliageColor event) {
+ // if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){
+ // event.newColor = 0xCD853F;
+ // }
+ //}
+
+ public boolean isServerSide() {
+ return true;
+ }
+
+ public boolean isClientSide() {
+ return true;
+ }
+
+ public boolean isBukkitSide() {
+ return false;
+ }
+
+ public EntityPlayer getThePlayer() {
+ return Minecraft.getMinecraft().thePlayer;
+ }
+
+ public int addArmor(String aPrefix) {
+ return RenderingRegistry.addNewArmourRendererPrefix(aPrefix);
+ }
+
+ public void onPreLoad() {
+ super.onPreLoad();
+ String arr$[] = {
+ "renadi", "hanakocz", "MysteryDump", "Flaver4", "x_Fame", "Peluche321", "Goshen_Ithilien", "manf", "Bimgo", "leagris",
+ "IAmMinecrafter02", "Cerous", "Devilin_Pixy", "Bkarlsson87", "BadAlchemy", "CaballoCraft", "melanclock", "Resursator", "demanzke", "AndrewAmmerlaan",
+ "Deathlycraft", "Jirajha", "Axlegear", "kei_kouma", "Dracion", "dungi", "Dorfschwein", "Zero Tw0", "mattiagraz85", "sebastiank30",
+ "Plem", "invultri", "grillo126", "malcanteth", "Malevolence_", "Nicholas_Manuel", "Sirbab", "kehaan", "bpgames123", "semig0d",
+ "9000bowser", "Sovereignty89", "Kris1432", "xander_cage_", "samuraijp", "bsaa", "SpwnX", "tworf", "Kadah", "kanni",
+ "Stute", "Hegik", "Onlyme", "t3hero", "Hotchi", "jagoly", "Nullav", "BH5432", "Sibmer", "inceee",
+ "foxxx0", "Hartok", "TMSama", "Shlnen", "Carsso", "zessirb", "meep310", "Seldron", "yttr1um", "hohounk",
+ "freebug", "Sylphio", "jmarler", "Saberawr", "r00teniy", "Neonbeta", "yinscape", "voooon24", "Quintine", "peach774",
+ "lepthymo", "bildeman", "Kremnari", "Aerosalo", "OndraSter", "oscares91", "mr10movie", "Daxx367x2", "EGERTRONx", "aka13_404",
+ "Abouttabs", "Johnstaal", "djshiny99", "megatronp", "DZCreeper", "Kane_Hart", "Truculent", "vidplace7", "simon6689", "MomoNasty",
+ "UnknownXLV", "goreacraft", "Fluttermine", "Daddy_Cecil", "MrMaleficus", "TigersFangs", "cublikefoot", "chainman564", "NikitaBuker", "Misha999777",
+ "25FiveDetail", "AntiCivilBoy", "michaelbrady", "xXxIceFirexXx", "Speedynutty68", "GarretSidzaka", "HallowCharm977", "mastermind1919", "The_Hypersonic", "diamondguy2798",
+ "zF4ll3nPr3d4t0r", "CrafterOfMines57", "XxELIT3xSNIP3RxX", "SuterusuKusanagi", "xavier0014", "adamros", "alexbegt"
+ };
+ int len$ = arr$.length;
+ for (int i$ = 0; i$ < len$; i$++) {
+ String tName = arr$[i$];
+ mCapeList.add(tName.toLowerCase());
+ }
+ (new Thread(this)).start();
+ }
+
+ public void onLoad() {
+ super.onLoad();
+ new GT_Renderer_Block();
+ new GT_MetaGenerated_Item_Renderer();
+ new GT_MetaGenerated_Tool_Renderer();
+ new GT_Renderer_Entity_Arrow(GT_Entity_Arrow.class, "arrow");
+ new GT_Renderer_Entity_Arrow(GT_Entity_Arrow_Potion.class, "arrow_potions");
+ }
+
+ public void onPostLoad() {
+ super.onPostLoad();
+ try {
+ label0:
+ for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++)
+ do {
+ if (i >= GregTech_API.METATILEENTITIES.length)
+ continue label0;
+ if (GregTech_API.METATILEENTITIES[i] != null)
+ GregTech_API.METATILEENTITIES[i].getStackForm(1L).getTooltip(null, true);
+ i++;
+ } while (true);
+ } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
+
+
+// super.onPostLoad();
+//
+// for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
+// try {
+// for (; i < GregTech_API.METATILEENTITIES.length; i++) if (GregTech_API.METATILEENTITIES[i] != null) GregTech_API.METATILEENTITIES[i].getStackForm(1L).getTooltip(null, true);
+// } catch (Throwable e) {
+// e.printStackTrace(GT_Log.err);
+// }
+// }
+ }
+
+ public void run() {
+ try {
+ GT_Log.out.println("GT_Mod: Downloading Cape List.");
+ @SuppressWarnings("resource")
+ Scanner tScanner = new Scanner(new URL("http://gregtech.overminddl1.com/com/gregoriust/gregtech/supporterlist.txt").openStream());
+ while (tScanner.hasNextLine()) {
+ String tName = tScanner.nextLine();
+ if (!this.mCapeList.contains(tName.toLowerCase())) {
+ this.mCapeList.add(tName.toLowerCase());
+ }
+ }
+ } catch (Throwable e) {
+ }
+ try {
+ GT_Log.out.println("GT New Horizons: Downloading Cape List.");
+ @SuppressWarnings("resource")
+ Scanner tScanner = new Scanner(new URL("https://raw.githubusercontent.com/GTNewHorizons/CustomGTCapeHook-Cape-List/master/capes.txt").openStream());
+ while (tScanner.hasNextLine()) {
+ String tName = tScanner.nextLine();
+ if (tName.contains(":")) {
+ int splitLocation = tName.indexOf(":");
+ String username = tName.substring(0, splitLocation);
+ if (!this.mCapeList.contains(username.toLowerCase()) && !this.mCapeList.contains(tName.toLowerCase())) {
+ this.mCapeList.add(tName.toLowerCase());
+ }
+ } else {
+ if (!this.mCapeList.contains(tName.toLowerCase())) {
+ this.mCapeList.add(tName.toLowerCase());
+ }
+ }
+ }
+ } catch (Throwable e) {
+ }
+ /**try {
+ GT_Log.out.println("GT_Mod: Downloading News.");
+ @SuppressWarnings("resource")
+ Scanner tScanner = new Scanner(new URL("http://files.minecraftforge.net/maven/com/gregoriust/gregtech/message.txt").openStream());
+ while (tScanner.hasNextLine()) {
+ this.mMessage = (this.mMessage + tScanner.nextLine() + " ");
+ }
+ } catch (Throwable e) {
+ }**/
+ }
+
+ @SubscribeEvent
+ public void receiveRenderSpecialsEvent(net.minecraftforge.client.event.RenderPlayerEvent.Specials.Pre aEvent) {
+ mCapeRenderer.receiveRenderSpecialsEvent(aEvent);
+ }
+
+ @SubscribeEvent
+ public void onPlayerTickEventClient(TickEvent.PlayerTickEvent aEvent) {
+ if ((aEvent.side.isClient()) && (aEvent.phase == TickEvent.Phase.END) && (!aEvent.player.isDead)) {
+ afterSomeTime++;
+ if(afterSomeTime>=100L){
+ afterSomeTime=0;
+ StatFileWriter sfw= Minecraft.getMinecraft().thePlayer.getStatFileWriter();
+ try {
+ for(GT_Recipe recipe:GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList){
+ recipe.mHidden=!sfw.hasAchievementUnlocked(GT_Mod.achievements.getAchievement(recipe.getOutput(0).getUnlocalizedName()));
+ }
+ }catch (Exception e){}
+ }
+ ArrayList<GT_PlayedSound> tList = new ArrayList();
+ for (Map.Entry<GT_PlayedSound, Integer> tEntry : GT_Utility.sPlayedSoundMap.entrySet()) {
+ if (tEntry.getValue().intValue() < 0) {//Integer -> Integer -> int? >_<, fix
+ tList.add(tEntry.getKey());
+ } else {
+ tEntry.setValue(Integer.valueOf(tEntry.getValue().intValue() - 1));
+ }
+ }
+ GT_PlayedSound tKey;
+ for (Iterator i$ = tList.iterator(); i$.hasNext(); GT_Utility.sPlayedSoundMap.remove(tKey)) {
+ tKey = (GT_PlayedSound) i$.next();
+ }
+ if(GregTech_API.mServerStarted == false)GregTech_API.mServerStarted = true;
+ /*if ((this.isFirstClientPlayerTick) && (aEvent.player == GT_Values.GT.getThePlayer())) {
+ this.isFirstClientPlayerTick = false;
+ GT_FluidStack.fixAllThoseFuckingFluidIDs();
+ if ((this.mMessage.length() > 5) && (GregTech_API.sSpecialFile.get(ConfigCategories.news, this.mMessage, true))) {
+ aEvent.player.addChatComponentMessage(new ChatComponentText(this.mMessage));
+ }
+ try {
+ int tVersion = Integer.parseInt(((String) Class.forName("ic2.core.IC2").getField("VERSION").get(null)).substring(4, 7));
+ if (GT_Values.D1) {
+ GT_Log.out.println("Industrialcraft Version: " + tVersion);
+ }
+ if (tVersion < 624) {
+ aEvent.player.addChatComponentMessage(new ChatComponentText("GregTech: Please update your IndustrialCraft here:"));
+ aEvent.player.addChatComponentMessage(new ChatComponentText("ic2api.player.to:8080/job/IC2_experimental/" + (GT_Mod.MAX_IC2 < Integer.MAX_VALUE ? GT_Mod.MAX_IC2 : 624) + "/"));
+ } else if (tVersion > GT_Mod.MAX_IC2) {
+ aEvent.player.addChatComponentMessage(new ChatComponentText("GregTech: Please downgrade your IndustrialCraft here:"));
+ aEvent.player.addChatComponentMessage(new ChatComponentText("ic2api.player.to:8080/job/IC2_experimental/" + GT_Mod.MAX_IC2 + "/"));
+ }
+ } catch (Throwable e) {
+ aEvent.player.addChatComponentMessage(new ChatComponentText("GregTech: Please get the recommended Version of IndustrialCraft here:"));
+ aEvent.player.addChatComponentMessage(new ChatComponentText("ic2api.player.to:8080/job/IC2_experimental/" + (GT_Mod.MAX_IC2 < Integer.MAX_VALUE ? GT_Mod.MAX_IC2 : 624) + "/"));
+ }
+ }*/
+ }
+ }
+
+ @SubscribeEvent
+ public void onDrawBlockHighlight(DrawBlockHighlightEvent aEvent) {
+ if (GT_Utility.isStackValid(aEvent.currentItem)) {
+ Block aBlock = aEvent.player.worldObj.getBlock(aEvent.target.blockX, aEvent.target.blockY, aEvent.target.blockZ);
+ TileEntity aTileEntity = aEvent.player.worldObj.getTileEntity(aEvent.target.blockX, aEvent.target.blockY, aEvent.target.blockZ);
+ try {
+ Class.forName("codechicken.lib.vec.Rotation");
+ if (((aTileEntity instanceof BaseMetaPipeEntity)) && (((ICoverable) aTileEntity).getCoverIDAtSide((byte) aEvent.target.sideHit) == 0) && ((GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sCovers.keySet())) || (GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sCrowbarList)) || (GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sWireCutterList)) || (GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sScrewdriverList)))) {
+ drawGrid(aEvent);
+ return;
+ }
+ if ((((aTileEntity instanceof ITurnable)) || (ROTATABLE_VANILLA_BLOCKS.contains(aBlock)) || ((aTileEntity instanceof IWrenchable))) && (GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sWrenchList))) {
+ drawGrid(aEvent);
+ return;
+ }
+ } catch (Throwable e) {
+ if (GT_Values.D1) {
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+ }
+ }
+
+ @SubscribeEvent
+ public void receiveRenderEvent(net.minecraftforge.client.event.RenderPlayerEvent.Pre aEvent) {
+ if (GT_Utility.getFullInvisibility(aEvent.entityPlayer)) {
+ aEvent.setCanceled(true);
+ return;
+ } else {
+ return;
+ }
+ }
+
+ @SubscribeEvent
+ public void onClientTickEvent(cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent aEvent) {
+ if (aEvent.phase == cpw.mods.fml.common.gameevent.TickEvent.Phase.END) {
+ if(changeDetected>0)changeDetected--;
+ int newHideValue=shouldHeldItemHideThings();
+ if(newHideValue!=hideValue){
+ hideValue=newHideValue;
+ changeDetected=5;
+ }
+ mAnimationTick++;
+ if (mAnimationTick % 50L == 0L)
+ {mAnimationDirection = !mAnimationDirection;}
+ int tDirection = mAnimationDirection ? 1 : -1;
+ for (Iterator i$ = mPosR.iterator(); i$.hasNext(); ) {
+ Materials tMaterial = (Materials) i$.next();
+ tMaterial.mRGBa[0] += tDirection;
+ }
+
+ for (Iterator i$ = mPosG.iterator(); i$.hasNext(); ) {
+ Materials tMaterial = (Materials) i$.next();
+ tMaterial.mRGBa[1] += tDirection;
+ }
+
+ for (Iterator i$ = mPosB.iterator(); i$.hasNext(); ) {
+ Materials tMaterial = (Materials) i$.next();
+ tMaterial.mRGBa[2] += tDirection;
+ }
+
+ for (Iterator i$ = mPosA.iterator(); i$.hasNext(); ) {
+ Materials tMaterial = (Materials) i$.next();
+ tMaterial.mRGBa[3] += tDirection;
+ }
+
+ for (Iterator i$ = mNegR.iterator(); i$.hasNext(); ) {
+ Materials tMaterial = (Materials) i$.next();
+ tMaterial.mRGBa[0] -= tDirection;
+ }
+
+ for (Iterator i$ = mNegG.iterator(); i$.hasNext(); ) {
+ Materials tMaterial = (Materials) i$.next();
+ tMaterial.mRGBa[1] -= tDirection;
+ }
+
+ for (Iterator i$ = mNegB.iterator(); i$.hasNext(); ) {
+ Materials tMaterial = (Materials) i$.next();
+ tMaterial.mRGBa[2] -= tDirection;
+ }
+
+ for (Iterator i$ = mNegA.iterator(); i$.hasNext(); ) {
+ Materials tMaterial = (Materials) i$.next();
+ tMaterial.mRGBa[3] -= tDirection;
+ }
+
+ for (Iterator i$ = mMoltenPosR.iterator(); i$.hasNext(); ) {
+ Materials tMaterial = (Materials) i$.next();
+ tMaterial.mMoltenRGBa[0] += tDirection;
+ }
+
+ for (Iterator i$ = mMoltenPosG.iterator(); i$.hasNext(); ) {
+ Materials tMaterial = (Materials) i$.next();
+ tMaterial.mMoltenRGBa[1] += tDirection;
+ }
+
+ for (Iterator i$ = mMoltenPosB.iterator(); i$.hasNext(); ) {
+ Materials tMaterial = (Materials) i$.next();
+ tMaterial.mMoltenRGBa[2] += tDirection;
+ }
+
+ for (Iterator i$ = mMoltenPosA.iterator(); i$.hasNext(); ) {
+ Materials tMaterial = (Materials) i$.next();
+ tMaterial.mMoltenRGBa[3] += tDirection;
+ }
+
+ for (Iterator i$ = mMoltenNegR.iterator(); i$.hasNext(); ) {
+ Materials tMaterial = (Materials) i$.next();
+ tMaterial.mMoltenRGBa[0] -= tDirection;
+ }
+
+ for (Iterator i$ = mMoltenNegG.iterator(); i$.hasNext(); ) {
+ Materials tMaterial = (Materials) i$.next();
+ tMaterial.mMoltenRGBa[1] -= tDirection;
+ }
+
+ for (Iterator i$ = mMoltenNegB.iterator(); i$.hasNext(); ) {
+ Materials tMaterial = (Materials) i$.next();
+ tMaterial.mMoltenRGBa[2] -= tDirection;
+ }
+
+ for (Iterator i$ = mMoltenNegA.iterator(); i$.hasNext(); ) {
+ Materials tMaterial = (Materials) i$.next();
+ tMaterial.mMoltenRGBa[3] -= tDirection;
+ }
+
+ }
+ }
+
+ public void doSonictronSound(ItemStack aStack, World aWorld, double aX, double aY, double aZ) {
+ if (GT_Utility.isStackInvalid(aStack))
+ return;
+ String tString = "note.harp";
+ int i = 0;
+ int j = mSoundItems.size();
+ do {
+ if (i >= j)
+ break;
+ if (GT_Utility.areStacksEqual((ItemStack) mSoundItems.get(i), aStack)) {
+ tString = (String) mSoundNames.get(i);
+ break;
+ }
+ i++;
+ } while (true);
+ if (tString.startsWith("random.explode"))
+ if (aStack.stackSize == 3)
+ tString = "random.fuse";
+ else if (aStack.stackSize == 2)
+ tString = "random.old_explode";
+ if (tString.startsWith("streaming."))
+ switch (aStack.stackSize) {
+ case 1: // '\001'
+ tString = (new StringBuilder()).append(tString).append("13").toString();
+ break;
+
+ case 2: // '\002'
+ tString = (new StringBuilder()).append(tString).append("cat").toString();
+ break;
+
+ case 3: // '\003'
+ tString = (new StringBuilder()).append(tString).append("blocks").toString();
+ break;
+
+ case 4: // '\004'
+ tString = (new StringBuilder()).append(tString).append("chirp").toString();
+ break;
+
+ case 5: // '\005'
+ tString = (new StringBuilder()).append(tString).append("far").toString();
+ break;
+
+ case 6: // '\006'
+ tString = (new StringBuilder()).append(tString).append("mall").toString();
+ break;
+
+ case 7: // '\007'
+ tString = (new StringBuilder()).append(tString).append("mellohi").toString();
+ break;
+
+ case 8: // '\b'
+ tString = (new StringBuilder()).append(tString).append("stal").toString();
+ break;
+
+ case 9: // '\t'
+ tString = (new StringBuilder()).append(tString).append("strad").toString();
+ break;
+
+ case 10: // '\n'
+ tString = (new StringBuilder()).append(tString).append("ward").toString();
+ break;
+
+ case 11: // '\013'
+ tString = (new StringBuilder()).append(tString).append("11").toString();
+ break;
+
+ case 12: // '\f'
+ tString = (new StringBuilder()).append(tString).append("wait").toString();
+ break;
+
+ default:
+ tString = (new StringBuilder()).append(tString).append("wherearewenow").toString();
+ break;
+ }
+ if (tString.startsWith("streaming."))
+ aWorld.playRecord(tString.substring(10, tString.length()), (int) aX, (int) aY, (int) aZ);
+ else
+ aWorld.playSound(aX, aY, aZ, tString, 3F, tString.startsWith("note.") ? (float) Math.pow(2D, (double) (aStack.stackSize - 13) / 12D) : 1.0F, false);
+ }
+
+ public static int hideValue=0;
+ public static int changeDetected=0;
+
+ private static int shouldHeldItemHideThings() {
+ try {
+ EntityPlayer player = Minecraft.getMinecraft().thePlayer;
+ if (player == null) return 0;
+ ItemStack tCurrentItem = player.getCurrentEquippedItem();
+ if (tCurrentItem == null) return 0;
+ int[] ids = OreDictionary.getOreIDs(tCurrentItem);
+ int hide = 0;
+ for (int i : ids) {
+ if (OreDictionary.getOreName(i).equals("craftingToolSolderingIron")) {
+ hide |= 0x1;
+ break;
+ }
+ }
+ if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList)
+ || GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList)
+ || GT_Utility.isStackInList(tCurrentItem, GregTech_API.sHardHammerList)
+ || GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList)
+ || GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWireCutterList)
+ || GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)
+ || GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCrowbarList)
+ || GregTech_API.sCovers.containsKey(new GT_ItemStack(tCurrentItem))) {
+ hide |= 0x2;
+ }
+ return hide;
+ }catch(Exception e){
+ return 0;
+ }
+ }
+}
diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java
index b3aa77c4e5..3341721cc2 100644
--- a/src/main/java/gregtech/common/GT_Proxy.java
+++ b/src/main/java/gregtech/common/GT_Proxy.java
@@ -1,1896 +1,1899 @@
-package gregtech.common;
-
-import cpw.mods.fml.common.*;
-import cpw.mods.fml.common.eventhandler.Event.Result;
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import cpw.mods.fml.common.gameevent.TickEvent;
-import cpw.mods.fml.common.network.FMLNetworkEvent;
-import cpw.mods.fml.common.network.IGuiHandler;
-import cpw.mods.fml.common.network.NetworkRegistry;
-import cpw.mods.fml.common.registry.GameRegistry;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
-import gregtech.api.enums.TC_Aspects.TC_AspectStack;
-import gregtech.api.interfaces.IProjectileItem;
-import gregtech.api.interfaces.internal.IGT_Mod;
-import gregtech.api.interfaces.internal.IThaumcraftCompat;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.items.GT_MetaGenerated_Item;
-import gregtech.api.items.GT_MetaGenerated_Tool;
-import gregtech.api.net.GT_Packet_Pollution;
-import gregtech.api.objects.*;
-import gregtech.api.util.*;
-import gregtech.common.entities.GT_Entity_Arrow;
-import gregtech.common.items.GT_MetaGenerated_Tool_01;
-import gregtech.common.items.armor.ModularArmor_Item;
-import gregtech.common.items.armor.gui.*;
-import net.minecraft.enchantment.Enchantment;
-import net.minecraft.enchantment.EnchantmentHelper;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.entity.monster.EntityEnderman;
-import net.minecraft.entity.monster.EntitySkeleton;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.entity.projectile.EntityArrow;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemBow;
-import net.minecraft.item.ItemStack;
-import net.minecraft.item.crafting.CraftingManager;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.potion.Potion;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.DamageSource;
-import net.minecraft.world.ChunkCoordIntPair;
-import net.minecraft.world.World;
-import net.minecraft.world.WorldSettings.GameType;
-import net.minecraft.world.gen.feature.WorldGenMinable;
-import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.event.ForgeEventFactory;
-import net.minecraftforge.event.entity.EntityJoinWorldEvent;
-import net.minecraftforge.event.entity.living.EnderTeleportEvent;
-import net.minecraftforge.event.entity.player.ArrowLooseEvent;
-import net.minecraftforge.event.entity.player.ArrowNockEvent;
-import net.minecraftforge.event.entity.player.PlayerEvent;
-import net.minecraftforge.event.entity.player.PlayerInteractEvent;
-import net.minecraftforge.event.terraingen.OreGenEvent;
-import net.minecraftforge.event.world.BlockEvent;
-import net.minecraftforge.event.world.ChunkDataEvent;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidContainerRegistry;
-import net.minecraftforge.fluids.FluidRegistry;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.oredict.OreDictionary;
-import net.minecraftforge.oredict.RecipeSorter;
-import net.minecraftforge.oredict.ShapedOreRecipe;
-import net.minecraftforge.oredict.ShapelessOreRecipe;
-
-import java.io.File;
-import java.text.DateFormat;
-import java.util.*;
-
-public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
- private static final EnumSet<OreGenEvent.GenerateMinable.EventType> PREVENTED_ORES = EnumSet.of(OreGenEvent.GenerateMinable.EventType.COAL,
- new OreGenEvent.GenerateMinable.EventType[]{OreGenEvent.GenerateMinable.EventType.IRON, OreGenEvent.GenerateMinable.EventType.GOLD,
- OreGenEvent.GenerateMinable.EventType.DIAMOND, OreGenEvent.GenerateMinable.EventType.REDSTONE, OreGenEvent.GenerateMinable.EventType.LAPIS,
- OreGenEvent.GenerateMinable.EventType.QUARTZ});
- public final HashSet<ItemStack> mRegisteredOres = new HashSet<ItemStack>(10000);
- public final ArrayList<String> mSoundNames = new ArrayList<String>();
- public final ArrayList<ItemStack> mSoundItems = new ArrayList<ItemStack>();
- public final ArrayList<Integer> mSoundCounts = new ArrayList<Integer>();
- private final Collection<OreDictEventContainer> mEvents = new HashSet<OreDictEventContainer>();
- private final Collection<String> mIgnoredItems = new HashSet<String>(Arrays.asList(new String[]{"itemGhastTear", "itemFlint", "itemClay", "itemBucketSaltWater",
- "itemBucketFreshWater", "itemBucketWater", "itemRock", "itemReed", "itemArrow", "itemSaw", "itemKnife", "itemHammer", "itemChisel", "itemRubber",
- "itemEssence", "itemIlluminatedPanel", "itemSkull", "itemRawRubber", "itemBacon", "itemJetpackAccelerator", "itemLazurite", "itemIridium",
- "itemTear", "itemClaw", "itemFertilizer", "itemTar", "itemSlimeball", "itemCoke", "itemBeeswax", "itemBeeQueen", "itemForcicium", "itemForcillium",
- "itemRoyalJelly", "itemHoneydew", "itemHoney", "itemPollen", "itemReedTypha", "itemSulfuricAcid", "itemPotash", "itemCompressedCarbon",
- "itemBitumen", "itemBioFuel", "itemCokeSugar", "itemCokeCactus", "itemCharcoalSugar", "itemCharcoalCactus", "itemSludge", "itemEnrichedAlloy",
- "itemQuicksilver", "itemMercury", "itemOsmium", "itemUltimateCircuit", "itemEnergizedStar", "itemAntimatterMolecule", "itemAntimatterGlob",
- "itemCoal", "itemBoat", "itemHerbalMedicineCake", "itemCakeSponge", "itemFishandPumpkinCakeSponge", "itemSoulCleaver", "itemInstantCake",
- "itemWhippingCream", "itemGlisteningWhippingCream", "itemCleaver", "itemHerbalMedicineWhippingCream", "itemStrangeWhippingCream",
- "itemBlazeCleaver", "itemBakedCakeSponge", "itemMagmaCake", "itemGlisteningCake", "itemOgreCleaver", "itemFishandPumpkinCake",
- "itemMagmaWhippingCream", "itemMultimeter", "itemSuperconductor"}));
- private final Collection<String> mIgnoredNames = new HashSet<String>(Arrays.asList(new String[]{"grubBee", "chainLink", "candyCane", "bRedString", "bVial",
- "bFlask", "anorthositeSmooth", "migmatiteSmooth", "slateSmooth", "travertineSmooth", "limestoneSmooth", "orthogneissSmooth", "marbleSmooth",
- "honeyDrop", "lumpClay", "honeyEqualssugar", "flourEqualswheat", "bluestoneInsulated", "blockWaterstone", "blockSand", "blockTorch",
- "blockPumpkin", "blockClothRock", "blockStainedHardenedClay", "blockQuartzPillar", "blockQuartzChiselled", "blockSpawner", "blockCloth", "mobHead",
- "mobEgg", "enderFlower", "enderChest", "clayHardened", "dayGemMaterial", "nightGemMaterial", "snowLayer", "bPlaceholder", "hardenedClay",
- "eternalLifeEssence", "sandstone", "wheatRice", "transdimBlock", "bambooBasket", "lexicaBotania", "livingwoodTwig", "redstoneCrystal",
- "pestleAndMortar", "glowstone", "whiteStone", "stoneSlab", "transdimBlock", "clayBowl", "clayPlate", "ceramicBowl", "ceramicPlate", "ovenRack",
- "clayCup", "ceramicCup", "batteryBox", "transmutationStone", "torchRedstoneActive", "coal", "charcoal", "cloth", "cobblestoneSlab",
- "stoneBrickSlab", "cobblestoneWall", "stoneBrickWall", "cobblestoneStair", "stoneBrickStair", "blockCloud", "blockDirt", "blockTyrian",
- "blockCarpet", "blockFft", "blockLavastone", "blockHolystone", "blockConcrete", "sunnariumPart", "brSmallMachineCyaniteProcessor", "meteoriteCoal",
- "blockCobble", "pressOreProcessor", "crusherOreProcessor", "grinderOreProcessor", "blockRubber", "blockHoney", "blockHoneydew", "blockPeat",
- "blockRadioactive", "blockSlime", "blockCocoa", "blockSugarCane", "blockLeather", "blockClayBrick", "solarPanelHV", "cableRedNet", "stoneBowl",
- "crafterWood", "taintedSoil", "brickXyEngineering", "breederUranium", "wireMill", "chunkLazurite", "aluminumNatural", "aluminiumNatural",
- "naturalAluminum", "naturalAluminium", "antimatterMilligram", "antimatterGram", "strangeMatter", "coalGenerator", "electricFurnace",
- "unfinishedTank", "valvePart", "aquaRegia", "leatherSeal", "leatherSlimeSeal", "hambone", "slimeball", "clay", "enrichedUranium", "camoPaste",
- "antiBlock", "burntQuartz", "salmonRaw", "blockHopper", "blockEnderObsidian", "blockIcestone", "blockMagicWood", "blockEnderCore", "blockHeeEndium",
- "oreHeeEndPowder", "oreHeeStardust", "oreHeeIgneousRock", "oreHeeInstabilityOrb", "crystalPureFluix", "shardNether", "gemFluorite",
- "stickObsidian", "caveCrystal", "shardCrystal", "dyeCrystal","shardFire","shardWater","shardAir","shardEarth","ingotRefinedIron","blockMarble","ingotUnstable"}));
- private final Collection<String> mInvalidNames = new HashSet<String>(Arrays.asList(new String[]{"diamondShard", "redstoneRoot", "obsidianStick", "bloodstoneOre",
- "universalCable", "bronzeTube", "ironTube", "netherTube", "obbyTube", "infiniteBattery", "eliteBattery", "advancedBattery", "10kEUStore",
- "blueDye", "MonazitOre", "quartzCrystal", "whiteLuminiteCrystal", "darkStoneIngot", "invisiumIngot", "demoniteOrb", "enderGem", "starconiumGem",
- "osmoniumIngot", "tapaziteGem", "zectiumIngot", "foolsRubyGem", "rubyGem", "meteoriteGem", "adamiteShard", "sapphireGem", "copperIngot",
- "ironStick", "goldStick", "diamondStick", "reinforcedStick", "draconicStick", "emeraldStick", "copperStick", "tinStick", "silverStick",
- "bronzeStick", "steelStick", "leadStick", "manyullynStick", "arditeStick", "cobaltStick", "aluminiumStick", "alumiteStick", "oilsandsOre",
- "copperWire", "superconductorWire", "sulfuricAcid", "conveyorBelt", "ironWire", "aluminumWire", "aluminiumWire", "silverWire", "tinWire",
- "dustSiliconSmall", "AluminumOre", "plateHeavyT2", "blockWool", "alloyPlateEnergizedHardened", "gasWood", "alloyPlateEnergized", "SilverOre",
- "LeadOre", "TinOre", "CopperOre", "silverOre", "leadOre", "tinOre", "copperOre", "bauxiteOre", "HSLivingmetalIngot", "oilMoving", "oilStill",
- "oilBucket", "petroleumOre", "dieselFuel", "diamondNugget", "planks", "wood", "stick", "sticks", "naquadah", "obsidianRod", "stoneRod",
- "thaumiumRod", "steelRod", "netherrackRod", "woodRod", "ironRod", "cactusRod", "flintRod", "copperRod", "cobaltRod", "alumiteRod", "blueslimeRod",
- "arditeRod", "manyullynRod", "bronzeRod", "boneRod", "slimeRod", "redalloyBundled", "bluestoneBundled", "infusedteslatiteInsulated",
- "redalloyInsulated", "infusedteslatiteBundled"}));
- private final DateFormat mDateFormat = DateFormat.getInstance();
- public ArrayList<String> mBufferedPlayerActivity = new ArrayList();
- public boolean mHardcoreCables = false;
- public boolean mDisableVanillaOres = true;
- public boolean mNerfDustCrafting = true;
- public boolean mSortToTheEnd = true;
- public boolean mCraftingUnification = true;
- public boolean mInventoryUnification = true;
- public boolean mIncreaseDungeonLoot = true;
- public boolean mAxeWhenAdventure = true;
- public boolean mSurvivalIntoAdventure = false;
- public boolean mNerfedWoodPlank = true;
- public boolean mNerfedVanillaTools = true;
- public boolean mHardRock = false;
- public boolean mHungerEffect = true;
- public boolean mOnline = true;
- public boolean mIgnoreTcon = true;
- public boolean mDisableIC2Cables = false;
- public boolean mAchievements = true;
- public boolean mAE2Integration = true;
- public boolean mArcSmeltIntoAnnealed = true;
- public boolean mMagneticraftRecipes = true;
- public boolean mImmersiveEngineeringRecipes = true;
- private boolean isFirstServerWorldTick = true;
- private boolean mOreDictActivated = false;
- public boolean mChangeHarvestLevels=false;
- public boolean mNerfedCombs = true;
- public boolean mNerfedCrops = true;
- public boolean mGTBees = true;
- public boolean mHideUnusedOres = true;
- public boolean mHideRecyclingRecipes = true;
- public boolean mPollution = true;
- public boolean mExplosionItemDrop = false;
- public int mSkeletonsShootGTArrows = 16;
- public int mMaxEqualEntitiesAtOneSpot = 3;
- public int mFlintChance = 30;
- public int mItemDespawnTime = 6000;
- public int mUpgradeCount = 4;
- public int[] mHarvestLevel= new int[1000];
- public int mGraniteHavestLevel=3;
- public int mMaxHarvestLevel=7;
- public int mWireHeatingTicks = 4;
- public int mPollutionSmogLimit = 550000;
- public int mPollutionPoisonLimit = 750000;
- public int mPollutionVegetationLimit = 1000000;
- public int mPollutionSourRainLimit = 2000000;
- public final GT_UO_DimensionList mUndergroundOil = new GT_UO_DimensionList();
- public int mTicksUntilNextCraftSound = 0;
- public double mMagneticraftBonusOutputPercent = 100.0d;
- private World mUniverse = null;
- private final String aTextThermalExpansion = "ThermalExpansion";
- private final String aTextRailcraft = "Railcraft";
- private final String aTextTwilightForest = "TwilightForest";
- private final String aTextForestry = "Forestry";
- private final String aTextArsmagica2 = "arsmagica2";
- public boolean mTEMachineRecipes = false;
- public boolean mEnableAllMaterials = false;
- public boolean mEnableAllComponents = false;
- public boolean mAddGTRecipesToIC2Machines = true;
- public boolean mEnableCleanroom = true;
- public boolean mLowGravProcessing = false;
- public boolean mAprilFool = false;
- public boolean mCropNeedBlock = true;
- public boolean mDisableOldChemicalRecipes = false;
- public boolean mAMHInteraction = true;
- public boolean mForceFreeFace = true;
- public boolean mBrickedBlastFurnace = true;
- public boolean mEasierIVPlusCables = false;
- public boolean mMixedOreOnlyYieldsTwoThirdsOfPureOre = false;
- public boolean enableBlackGraniteOres = true;
- public boolean enableRedGraniteOres = true;
- public boolean enableMarbleOres = true;
- public boolean enableBasaltOres = true;
-
- public GT_Proxy() {
- GameRegistry.registerFuelHandler(this);
- MinecraftForge.EVENT_BUS.register(this);
- MinecraftForge.ORE_GEN_BUS.register(this);
- FMLCommonHandler.instance().bus().register(this);
- GregTech_API.sThaumcraftCompat = (IThaumcraftCompat) GT_Utility.callConstructor("gregtech.common.GT_ThaumcraftCompat", 0, null, GT_Values.D1,
- new Object[0]);
- for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
- onFluidContainerRegistration(new FluidContainerRegistry.FluidContainerRegisterEvent(tData));
- }
- try {
- for (String tOreName : OreDictionary.getOreNames()) {
- ItemStack tOreStack;
- for (Iterator i$ = OreDictionary.getOres(tOreName).iterator(); i$.hasNext(); registerOre(new OreDictionary.OreRegisterEvent(tOreName, tOreStack))) {
- tOreStack = (ItemStack) i$.next();
- }
- }
- } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
- }
-
- private static final void registerRecipes(OreDictEventContainer aOre) {
- if ((aOre.mEvent.Ore == null) || (aOre.mEvent.Ore.getItem() == null)) {
- return;
- }
- if (aOre.mEvent.Ore.stackSize != 1) {
- aOre.mEvent.Ore.stackSize = 1;
- }
- if (aOre.mPrefix != null) {
- if (!aOre.mPrefix.isIgnored(aOre.mMaterial)) {
- aOre.mPrefix.processOre(aOre.mMaterial == null ? Materials._NULL : aOre.mMaterial, aOre.mEvent.Name, aOre.mModID,
- GT_Utility.copyAmount(1L, new Object[]{aOre.mEvent.Ore}));
- }
- } else {
-// System.out.println("Thingy Name: "+ aOre.mEvent.Name+ " !!!Unknown 'Thingy' detected!!! This Object seems to probably not follow a valid OreDictionary Convention, or I missed a Convention. Please report to GregTech Intergalactical for additional compatiblity. This is not an Error, an Issue nor a Lag Source, it is just an Information, which you should pass to me.");
- }
- }
-
- public void onPreLoad() {
- GT_Log.out.println("GT_Mod: Preload-Phase started!");
- GT_Log.ore.println("GT_Mod: Preload-Phase started!");
-
- GregTech_API.sPreloadStarted = true;
- this.mIgnoreTcon = GregTech_API.sOPStuff.get(ConfigCategories.general, "ignoreTConstruct", true);
- this.mWireHeatingTicks = GregTech_API.sOPStuff.get(ConfigCategories.general, "WireHeatingTicks", 4);
- NetworkRegistry.INSTANCE.registerGuiHandler(GT_Values.GT, this);
- for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
- if ((tData.filledContainer.getItem() == Items.potionitem) && (tData.filledContainer.getItemDamage() == 0)) {
- tData.fluid.amount = 0;
- break;
- }
- }
- GT_Log.out.println("GT_Mod: Getting required Items of other Mods.");
- ItemList.TE_Slag.set(GT_ModHandler.getModItem(aTextThermalExpansion, "slag", 1L));
- ItemList.TE_Slag_Rich.set(GT_ModHandler.getModItem(aTextThermalExpansion, "slagRich", 1L));
- ItemList.TE_Rockwool.set(GT_ModHandler.getModItem(aTextThermalExpansion, "rockwool", 1L));
- ItemList.TE_Hardened_Glass.set(GT_ModHandler.getModItem(aTextThermalExpansion, "glassHardened", 1L));
-
- ItemList.RC_ShuntingWire.set(GT_ModHandler.getModItem(aTextRailcraft, "tile.railcraft.machine.delta", 1L, 0));
- ItemList.RC_ShuntingWireFrame.set(GT_ModHandler.getModItem(aTextRailcraft, "tile.railcraft.frame", 1L, 0));
- ItemList.RC_Rail_Standard.set(GT_ModHandler.getModItem(aTextRailcraft, "part.rail", 1L, 0));
- ItemList.RC_Rail_Adv.set(GT_ModHandler.getModItem(aTextRailcraft, "part.rail", 1L, 1));
- ItemList.RC_Rail_Wooden.set(GT_ModHandler.getModItem(aTextRailcraft, "part.rail", 1L, 2));
- ItemList.RC_Rail_HS.set(GT_ModHandler.getModItem(aTextRailcraft, "part.rail", 1L, 3));
- ItemList.RC_Rail_Reinforced.set(GT_ModHandler.getModItem(aTextRailcraft, "part.rail", 1L, 4));
- ItemList.RC_Rail_Electric.set(GT_ModHandler.getModItem(aTextRailcraft, "part.rail", 1L, 5));
- ItemList.RC_Tie_Wood.set(GT_ModHandler.getModItem(aTextRailcraft, "part.tie", 1L, 0));
- ItemList.RC_Tie_Stone.set(GT_ModHandler.getModItem(aTextRailcraft, "part.tie", 1L, 1));
- ItemList.RC_Bed_Wood.set(GT_ModHandler.getModItem(aTextRailcraft, "part.railbed", 1L, 0));
- ItemList.RC_Bed_Stone.set(GT_ModHandler.getModItem(aTextRailcraft, "part.railbed", 1L, 1));
- ItemList.RC_Rebar.set(GT_ModHandler.getModItem(aTextRailcraft, "part.rebar", 1L));
- ItemList.Tool_Sword_Steel.set(GT_ModHandler.getModItem(aTextRailcraft, "tool.steel.sword", 1L));
- ItemList.Tool_Pickaxe_Steel.set(GT_ModHandler.getModItem(aTextRailcraft, "tool.steel.pickaxe", 1L));
- ItemList.Tool_Shovel_Steel.set(GT_ModHandler.getModItem(aTextRailcraft, "tool.steel.shovel", 1L));
- ItemList.Tool_Axe_Steel.set(GT_ModHandler.getModItem(aTextRailcraft, "tool.steel.axe", 1L));
- ItemList.Tool_Hoe_Steel.set(GT_ModHandler.getModItem(aTextRailcraft, "tool.steel.hoe", 1L));
-
- ItemList.TF_LiveRoot.set(GT_ModHandler.getModItem(aTextTwilightForest, "item.liveRoot", 1L, 0));
- ItemList.TF_Vial_FieryBlood.set(GT_ModHandler.getModItem(aTextTwilightForest, "item.fieryBlood", 1L));
- ItemList.TF_Vial_FieryTears.set(GT_ModHandler.getModItem(aTextTwilightForest, "item.fieryTears", 1L));
-
- ItemList.FR_Lemon.set(GT_ModHandler.getModItem(aTextForestry, "fruits", 1L, 3));
- ItemList.FR_Mulch.set(GT_ModHandler.getModItem(aTextForestry, "mulch", 1L));
- ItemList.FR_Fertilizer.set(GT_ModHandler.getModItem(aTextForestry, "fertilizerCompound", 1L));
- ItemList.FR_Compost.set(GT_ModHandler.getModItem(aTextForestry, "fertilizerBio", 1L));
- ItemList.FR_Silk.set(GT_ModHandler.getModItem(aTextForestry, "craftingMaterial", 1L, 2));
- ItemList.FR_Wax.set(GT_ModHandler.getModItem(aTextForestry, "beeswax", 1L));
- ItemList.FR_WaxCapsule.set(GT_ModHandler.getModItem(aTextForestry, "waxCapsule", 1L));
- ItemList.FR_RefractoryWax.set(GT_ModHandler.getModItem(aTextForestry, "refractoryWax", 1L));
- ItemList.FR_RefractoryCapsule.set(GT_ModHandler.getModItem(aTextForestry, "refractoryEmpty", 1L));
- ItemList.FR_Bee_Drone.set(GT_ModHandler.getModItem(aTextForestry, "beeDroneGE", 1L));
- ItemList.FR_Bee_Princess.set(GT_ModHandler.getModItem(aTextForestry, "beePrincessGE", 1L));
- ItemList.FR_Bee_Queen.set(GT_ModHandler.getModItem(aTextForestry, "beeQueenGE", 1L));
- ItemList.FR_Tree_Sapling.set(GT_ModHandler.getModItem(aTextForestry, "sapling", 1L, GT_ModHandler.getModItem(aTextForestry, "saplingGE", 1L)));
- ItemList.FR_Butterfly.set(GT_ModHandler.getModItem(aTextForestry, "butterflyGE", 1L));
- ItemList.FR_Larvae.set(GT_ModHandler.getModItem(aTextForestry, "beeLarvaeGE", 1L));
- ItemList.FR_Serum.set(GT_ModHandler.getModItem(aTextForestry, "serumGE", 1L));
- ItemList.FR_Caterpillar.set(GT_ModHandler.getModItem(aTextForestry, "caterpillarGE", 1L));
- ItemList.FR_PollenFertile.set(GT_ModHandler.getModItem(aTextForestry, "pollenFertile", 1L));
- ItemList.FR_Stick.set(GT_ModHandler.getModItem(aTextForestry, "oakStick", 1L));
- ItemList.FR_Casing_Impregnated.set(GT_ModHandler.getModItem(aTextForestry, "impregnatedCasing", 1L));
- ItemList.FR_Casing_Sturdy.set(GT_ModHandler.getModItem(aTextForestry, "sturdyMachine", 1L));
- ItemList.FR_Casing_Hardened.set(GT_ModHandler.getModItem(aTextForestry, "hardenedMachine", 1L));
-
- ItemList.Bottle_Empty.set(new ItemStack(Items.glass_bottle, 1));
-
- ItemList.Cell_Universal_Fluid.set(GT_ModHandler.getIC2Item("FluidCell", 1L));
- ItemList.Cell_Empty.set(GT_ModHandler.getIC2Item("cell", 1L, GT_ModHandler.getIC2Item("cellEmpty", 1L, GT_ModHandler.getIC2Item("emptyCell", 1L))));
- ItemList.Cell_Water.set(GT_ModHandler.getIC2Item("waterCell", 1L, GT_ModHandler.getIC2Item("cellWater", 1L)));
- ItemList.Cell_Lava.set(GT_ModHandler.getIC2Item("lavaCell", 1L, GT_ModHandler.getIC2Item("cellLava", 1L)));
- ItemList.Cell_Air.set(GT_ModHandler.getIC2Item("airCell", 1L, GT_ModHandler.getIC2Item("cellAir", 1L, GT_ModHandler.getIC2Item("cellOxygen", 1L))));
-
- ItemList.IC2_Item_Casing_Iron.set(GT_ModHandler.getIC2Item("casingiron", 1L));
- ItemList.IC2_Item_Casing_Gold.set(GT_ModHandler.getIC2Item("casinggold", 1L));
- ItemList.IC2_Item_Casing_Bronze.set(GT_ModHandler.getIC2Item("casingbronze", 1L));
- ItemList.IC2_Item_Casing_Copper.set(GT_ModHandler.getIC2Item("casingcopper", 1L));
- ItemList.IC2_Item_Casing_Tin.set(GT_ModHandler.getIC2Item("casingtin", 1L));
- ItemList.IC2_Item_Casing_Lead.set(GT_ModHandler.getIC2Item("casinglead", 1L));
- ItemList.IC2_Item_Casing_Steel.set(GT_ModHandler.getIC2Item("casingadviron", 1L));
- ItemList.IC2_Spray_WeedEx.set(GT_ModHandler.getIC2Item("weedEx", 1L));
- ItemList.IC2_Fuel_Can_Empty.set(GT_ModHandler.getIC2Item("fuelCan", 1L, GT_ModHandler.getIC2Item("fuelCanEmpty", 1L, GT_ModHandler.getIC2Item("emptyFuelCan", 1L))));
- ItemList.IC2_Fuel_Can_Filled.set(GT_ModHandler.getIC2Item("filledFuelCan", 1L));
- ItemList.IC2_Mixed_Metal_Ingot.set(GT_ModHandler.getIC2Item("mixedMetalIngot", 1L));
- ItemList.IC2_Fertilizer.set(GT_ModHandler.getIC2Item("fertilizer", 1L));
- ItemList.IC2_CoffeeBeans.set(GT_ModHandler.getIC2Item("coffeeBeans", 1L));
- ItemList.IC2_CoffeePowder.set(GT_ModHandler.getIC2Item("coffeePowder", 1L));
- ItemList.IC2_Hops.set(GT_ModHandler.getIC2Item("hops", 1L));
- ItemList.IC2_Resin.set(GT_ModHandler.getIC2Item("resin", 1L));
- ItemList.IC2_Plantball.set(GT_ModHandler.getIC2Item("plantBall", 1L));
- ItemList.IC2_PlantballCompressed.set(GT_ModHandler.getIC2Item("compressedPlantBall", 1L, ItemList.IC2_Plantball.get(1L, new Object[0])));
- ItemList.IC2_Crop_Seeds.set(GT_ModHandler.getIC2Item("cropSeed", 1L));
- ItemList.IC2_Grin_Powder.set(GT_ModHandler.getIC2Item("grinPowder", 1L));
- ItemList.IC2_Energium_Dust.set(GT_ModHandler.getIC2Item("energiumDust", 1L));
- ItemList.IC2_Scrap.set(GT_ModHandler.getIC2Item("scrap", 1L));
- ItemList.IC2_Scrapbox.set(GT_ModHandler.getIC2Item("scrapBox", 1L));
- ItemList.IC2_Fuel_Rod_Empty.set(GT_ModHandler.getIC2Item("fuelRod", 1L));
- ItemList.IC2_Food_Can_Empty.set(GT_ModHandler.getIC2Item("tinCan", 1L));
- ItemList.IC2_Food_Can_Filled.set(GT_ModHandler.getIC2Item("filledTinCan", 1L, 0));
- ItemList.IC2_Food_Can_Spoiled.set(GT_ModHandler.getIC2Item("filledTinCan", 1L, 1));
- ItemList.IC2_Industrial_Diamond.set(GT_ModHandler.getIC2Item("industrialDiamond", 1L, new ItemStack(Items.diamond, 1)));
- ItemList.IC2_Compressed_Coal_Ball.set(GT_ModHandler.getIC2Item("compressedCoalBall", 1L));
- ItemList.IC2_Compressed_Coal_Chunk.set(GT_ModHandler.getIC2Item("coalChunk", 1L));
- ItemList.IC2_ShaftIron.set(GT_ModHandler.getIC2Item("ironshaft", 1L));
- ItemList.IC2_ShaftSteel.set(GT_ModHandler.getIC2Item("steelshaft", 1L));
-
- ItemList.IC2_SuBattery.set(GT_ModHandler.getIC2Item("suBattery", 1L));
- ItemList.IC2_ReBattery.set(GT_ModHandler.getIC2Item("reBattery", 1L));
- ItemList.IC2_AdvBattery.set(GT_ModHandler.getIC2Item("advBattery", 1L));
- ItemList.IC2_EnergyCrystal.set(GT_ModHandler.getIC2Item("energyCrystal", 1L));
- ItemList.IC2_LapotronCrystal.set(GT_ModHandler.getIC2Item("lapotronCrystal", 1L));
-
- ItemList.Tool_Sword_Bronze.set(GT_ModHandler.getIC2Item("bronzeSword", 1L));
- ItemList.Tool_Pickaxe_Bronze.set(GT_ModHandler.getIC2Item("bronzePickaxe", 1L));
- ItemList.Tool_Shovel_Bronze.set(GT_ModHandler.getIC2Item("bronzeShovel", 1L));
- ItemList.Tool_Axe_Bronze.set(GT_ModHandler.getIC2Item("bronzeAxe", 1L));
- ItemList.Tool_Hoe_Bronze.set(GT_ModHandler.getIC2Item("bronzeHoe", 1L));
- ItemList.IC2_ForgeHammer.set(GT_ModHandler.getIC2Item("ForgeHammer", 1L));
- ItemList.IC2_WireCutter.set(GT_ModHandler.getIC2Item("cutter", 1L));
-
- ItemList.Credit_Iron.set(GT_ModHandler.getIC2Item("coin", 1L));
-
- ItemList.Circuit_Basic.set(GT_ModHandler.getIC2Item("electronicCircuit", 1L));
- ItemList.Circuit_Advanced.set(GT_ModHandler.getIC2Item("advancedCircuit", 1L));
-
- ItemList.Upgrade_Overclocker.set(GT_ModHandler.getIC2Item("overclockerUpgrade", 1L));
- ItemList.Upgrade_Battery.set(GT_ModHandler.getIC2Item("energyStorageUpgrade", 1L));
-
- ItemList.Dye_Bonemeal.set(new ItemStack(Items.dye, 1, 15));
- ItemList.Dye_SquidInk.set(new ItemStack(Items.dye, 1, 0));
- ItemList.Dye_Cocoa.set(new ItemStack(Items.dye, 1, 3));
-
- ItemList.Book_Written_00.set(new ItemStack(Items.written_book, 1, 0));
-
- ItemList.Food_Baked_Bread.set(new ItemStack(Items.bread, 1, 0));
- ItemList.Food_Raw_Potato.set(new ItemStack(Items.potato, 1, 0));
- ItemList.Food_Baked_Potato.set(new ItemStack(Items.baked_potato, 1, 0));
- ItemList.Food_Poisonous_Potato.set(new ItemStack(Items.poisonous_potato, 1, 0));
-
- OrePrefixes.bottle.mContainerItem = ItemList.Bottle_Empty.get(1L, new Object[0]);
- OrePrefixes.bucket.mContainerItem = new ItemStack(Items.bucket, 1);
- OrePrefixes.cellPlasma.mContainerItem = ItemList.Cell_Empty.get(1L, new Object[0]);
- OrePrefixes.cell.mContainerItem = ItemList.Cell_Empty.get(1L, new Object[0]);
-
- GregTech_API.sFrostHazmatList.add(GT_ModHandler.getIC2Item("hazmatHelmet", 1L, 32767));
- GregTech_API.sFrostHazmatList.add(GT_ModHandler.getIC2Item("hazmatChestplate", 1L, 32767));
- GregTech_API.sFrostHazmatList.add(GT_ModHandler.getIC2Item("hazmatLeggings", 1L, 32767));
- GregTech_API.sFrostHazmatList.add(GT_ModHandler.getIC2Item("hazmatBoots", 1L, 32767));
-
- GregTech_API.sHeatHazmatList.add(GT_ModHandler.getIC2Item("hazmatHelmet", 1L, 32767));
- GregTech_API.sHeatHazmatList.add(GT_ModHandler.getIC2Item("hazmatChestplate", 1L, 32767));
- GregTech_API.sHeatHazmatList.add(GT_ModHandler.getIC2Item("hazmatLeggings", 1L, 32767));
- GregTech_API.sHeatHazmatList.add(GT_ModHandler.getIC2Item("hazmatBoots", 1L, 32767));
-
- GregTech_API.sBioHazmatList.add(GT_ModHandler.getIC2Item("hazmatHelmet", 1L, 32767));
- GregTech_API.sBioHazmatList.add(GT_ModHandler.getIC2Item("hazmatChestplate", 1L, 32767));
- GregTech_API.sBioHazmatList.add(GT_ModHandler.getIC2Item("hazmatLeggings", 1L, 32767));
- GregTech_API.sBioHazmatList.add(GT_ModHandler.getIC2Item("hazmatBoots", 1L, 32767));
-
- GregTech_API.sGasHazmatList.add(GT_ModHandler.getIC2Item("hazmatHelmet", 1L, 32767));
- GregTech_API.sGasHazmatList.add(GT_ModHandler.getIC2Item("hazmatChestplate", 1L, 32767));
- GregTech_API.sGasHazmatList.add(GT_ModHandler.getIC2Item("hazmatLeggings", 1L, 32767));
- GregTech_API.sGasHazmatList.add(GT_ModHandler.getIC2Item("hazmatBoots", 1L, 32767));
-
- GregTech_API.sRadioHazmatList.add(GT_ModHandler.getIC2Item("hazmatHelmet", 1L, 32767));
- GregTech_API.sRadioHazmatList.add(GT_ModHandler.getIC2Item("hazmatChestplate", 1L, 32767));
- GregTech_API.sRadioHazmatList.add(GT_ModHandler.getIC2Item("hazmatLeggings", 1L, 32767));
- GregTech_API.sRadioHazmatList.add(GT_ModHandler.getIC2Item("hazmatBoots", 1L, 32767));
-
- GregTech_API.sElectroHazmatList.add(GT_ModHandler.getIC2Item("hazmatHelmet", 1L, 32767));
- GregTech_API.sElectroHazmatList.add(GT_ModHandler.getIC2Item("hazmatChestplate", 1L, 32767));
- GregTech_API.sElectroHazmatList.add(GT_ModHandler.getIC2Item("hazmatLeggings", 1L, 32767));
- GregTech_API.sElectroHazmatList.add(GT_ModHandler.getIC2Item("hazmatBoots", 1L, 32767));
- GregTech_API.sElectroHazmatList.add(new ItemStack(Items.chainmail_helmet, 1, 32767));
- GregTech_API.sElectroHazmatList.add(new ItemStack(Items.chainmail_chestplate, 1, 32767));
- GregTech_API.sElectroHazmatList.add(new ItemStack(Items.chainmail_leggings, 1, 32767));
- GregTech_API.sElectroHazmatList.add(new ItemStack(Items.chainmail_boots, 1, 32767));
-
- GT_ModHandler.sNonReplaceableItems.add(new ItemStack(Items.bow, 1, 32767));
- GT_ModHandler.sNonReplaceableItems.add(new ItemStack(Items.fishing_rod, 1, 32767));
- GT_ModHandler.sNonReplaceableItems.add(ItemList.IC2_ForgeHammer.getWithDamage(1L, 32767L, new Object[0]));
- GT_ModHandler.sNonReplaceableItems.add(ItemList.IC2_WireCutter.getWithDamage(1L, 32767L, new Object[0]));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("painter", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("blackPainter", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("redPainter", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("greenPainter", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("brownPainter", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("bluePainter", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("purplePainter", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("cyanPainter", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("lightGreyPainter", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("darkGreyPainter", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("pinkPainter", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("limePainter", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("yellowPainter", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("cloudPainter", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("magentaPainter", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("orangePainter", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("whitePainter", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("cfPack", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("jetpack", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("treetap", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("weedEx", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("staticBoots", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("compositeArmor", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("hazmatHelmet", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("hazmatChestplate", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("hazmatLeggings", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("hazmatBoots", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextRailcraft, "part.turbine.disk", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextRailcraft, "part.turbine.blade", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextRailcraft, "part.turbine.rotor", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextRailcraft, "borehead.diamond", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextRailcraft, "borehead.steel", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextRailcraft, "borehead.iron", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextTwilightForest, "item.plateNaga", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextTwilightForest, "item.legsNaga", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextTwilightForest, "item.arcticHelm", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextTwilightForest, "item.arcticPlate", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextTwilightForest, "item.arcticLegs", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextTwilightForest, "item.arcticBoots", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextTwilightForest, "item.yetiHelm", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextTwilightForest, "item.yetiPlate", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextTwilightForest, "item.yetiLegs", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextTwilightForest, "item.yetiBoots", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem("appliedenergistics2", "item.ToolCertusQuartzCuttingKnife", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem("appliedenergistics2", "item.ToolNetherQuartzCuttingKnife", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "apiaristHelmet", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "apiaristChest", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "apiaristLegs", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "apiaristBoots", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "frameUntreated", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "frameImpregnated", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "frameProven", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "waxCast", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem("GalacticraftCore", "item.sensorGlasses", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem("IC2NuclearControl", "ItemToolThermometer", 1L, 32767));
-
- RecipeSorter.register("gregtech:shaped", GT_Shaped_Recipe.class, RecipeSorter.Category.SHAPED, "after:minecraft:shaped before:minecraft:shapeless");
- RecipeSorter.register("gregtech:shapeless", GT_Shapeless_Recipe.class, RecipeSorter.Category.SHAPELESS, "after:minecraft:shapeless");
- }
-
- public void onLoad() {
- GT_Log.out.println("GT_Mod: Beginning Load-Phase.");
- GT_Log.ore.println("GT_Mod: Beginning Load-Phase.");
- GT_OreDictUnificator.registerOre("cropChilipepper", GT_ModHandler.getModItem("magicalcrops", "magicalcrops_CropProduce", 1L, 2));
- GT_OreDictUnificator.registerOre("cropTomato", GT_ModHandler.getModItem("magicalcrops", "magicalcrops_CropProduce", 1L, 8));
- GT_OreDictUnificator.registerOre("cropGrape", GT_ModHandler.getModItem("magicalcrops", "magicalcrops_CropProduce", 1L, 4));
- GT_OreDictUnificator.registerOre("cropTea", GT_ModHandler.getModItem("ganyssurface", "teaLeaves", 1L, 0));
-
- GregTech_API.sLoadStarted = true;
- for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
- if ((tData.filledContainer.getItem() == Items.potionitem) && (tData.filledContainer.getItemDamage() == 0)) {
- tData.fluid.amount = 0;
- break;
- }
- }
- GT_LanguageManager.writePlaceholderStrings();
- }
-
- public static long tBits = GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL | GT_ModHandler.RecipeBits.NOT_REMOVABLE;
- public void onPostLoad() {
- GT_Log.out.println("GT_Mod: Beginning PostLoad-Phase.");
- GT_Log.ore.println("GT_Mod: Beginning PostLoad-Phase.");
- if (GT_Log.pal != null) {
- new Thread(new GT_PlayerActivityLogger()).start();
- }
- GregTech_API.sPostloadStarted = true;
- GT_OreDictUnificator.addItemData(new ItemStack(Items.iron_door, 1), new ItemData(Materials.Iron, 21772800L, new MaterialStack[0]));
- GT_OreDictUnificator.addItemData(new ItemStack(Items.wooden_door, 1, 32767), new ItemData(Materials.Wood, 21772800L, new MaterialStack[0]));
- for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
- if ((tData.filledContainer.getItem() == Items.potionitem) && (tData.filledContainer.getItemDamage() == 0)) {
- tData.fluid.amount = 0;
- break;
- }
- }
- GT_Log.out.println("GT_Mod: Adding Configs specific for MetaTileEntities");
- try {
- for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
- for (; i < GregTech_API.METATILEENTITIES.length; i++) {
- if (GregTech_API.METATILEENTITIES[i] != null) {
- GregTech_API.METATILEENTITIES[i].onConfigLoad(GregTech_API.sMachineFile);
- }
- }
- }
- } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
- GT_Log.out.println("GT_Mod: Adding Tool Usage Crafting Recipes for OreDict Items.");
- for (Materials aMaterial : Materials.values()) {
- if ((aMaterial.mUnificatable) && (aMaterial.mMaterialInto == aMaterial)) {
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X",
- 'X', OrePrefixes.crushedCentrifuged.get(aMaterial)});
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X",
- 'X', OrePrefixes.crystalline.get(aMaterial)});
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X",
- 'X', OrePrefixes.crystal.get(aMaterial)});
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustPure, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X",
- 'X', OrePrefixes.crushedPurified.get(aMaterial)});
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustPure, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X",
- 'X', OrePrefixes.cleanGravel.get(aMaterial)});
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustPure, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X",
- 'X', OrePrefixes.reduced.get(aMaterial)});
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X",
- 'X', OrePrefixes.clump.get(aMaterial)});
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X",
- 'X', OrePrefixes.shard.get(aMaterial)});
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X",
- 'X', OrePrefixes.crushed.get(aMaterial)});
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X",
- 'X', OrePrefixes.dirtyGravel.get(aMaterial)});
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustSmall, aMaterial, 4L), tBits,
- new Object[]{" X", " ", 'X', OrePrefixes.dust.get(aMaterial)});
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 9L), tBits,
- new Object[]{"X ", " ", 'X', OrePrefixes.dust.get(aMaterial)});
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, 1L), tBits,
- new Object[]{"XX", "XX", 'X', OrePrefixes.dustSmall.get(aMaterial)});
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, 1L), tBits,
- new Object[]{"XXX", "XXX", "XXX", 'X', OrePrefixes.dustTiny.get(aMaterial)});
- }
- }
- }
-
- public void onServerStarting() {
- GT_Log.out.println("GT_Mod: ServerStarting-Phase started!");
- GT_Log.ore.println("GT_Mod: ServerStarting-Phase started!");
-
- this.mUniverse = null;
- this.isFirstServerWorldTick = true;
- for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
- if ((tData.filledContainer.getItem() == Items.potionitem) && (tData.filledContainer.getItemDamage() == 0)) {
- tData.fluid.amount = 0;
- break;
- }
- }
- try {
- for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
- for (; i < GregTech_API.METATILEENTITIES.length; i++) {
- if (GregTech_API.METATILEENTITIES[i] != null) {
- GregTech_API.METATILEENTITIES[i].onServerStart();
- }
- }
- }
- } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
-
- dimensionWiseChunkData.clear();//!!! IMPORTANT for map switching...
- dimensionWisePollution.clear();//!!! IMPORTANT for map switching...
- }
-
- public void onServerStarted() {
- GregTech_API.sWirelessRedstone.clear();
- GT_FluidStack.fixAllThoseFuckingFluidIDs();
-
- GT_Log.out.println("GT_Mod: Cleaning up all OreDict Crafting Recipes, which have an empty List in them, since they are never meeting any Condition.");
- List tList = CraftingManager.getInstance().getRecipeList();
- for (int i = 0; i < tList.size(); i++) {
- if ((tList.get(i) instanceof ShapedOreRecipe)) {
- for (Object tObject : ((ShapedOreRecipe) tList.get(i)).getInput()) {
- if (((tObject instanceof List)) && (((List) tObject).isEmpty())) {
- tList.remove(i--);
- break;
- }
- }
- } else if ((tList.get(i) instanceof ShapelessOreRecipe)) {
- for (Object tObject : ((ShapelessOreRecipe) tList.get(i)).getInput()) {
- if (((tObject instanceof List)) && (((List) tObject).isEmpty())) {
- tList.remove(i--);
- break;
- }
- }
- }
- }
- }
-
- public void onServerStopping() {
- File tSaveDirectory = getSaveDirectory();
- GregTech_API.sWirelessRedstone.clear();
- if (tSaveDirectory != null) {
- try {
- for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
- for (; i < GregTech_API.METATILEENTITIES.length; i++) {
- if (GregTech_API.METATILEENTITIES[i] != null) {
- GregTech_API.METATILEENTITIES[i].onWorldSave(tSaveDirectory);
- }
- }
- }
- } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
- }
- this.mUniverse = null;
- }
-
- @SubscribeEvent
- public void onClientConnectedToServerEvent(FMLNetworkEvent.ClientConnectedToServerEvent aEvent) {
- }
-
- @SubscribeEvent
- public void onArrowNockEvent(ArrowNockEvent aEvent) {
- if ((!aEvent.isCanceled()) && (GT_Utility.isStackValid(aEvent.result))
- && (GT_Utility.getProjectile(SubTag.PROJECTILE_ARROW, aEvent.entityPlayer.inventory) != null)) {
- aEvent.entityPlayer.setItemInUse(aEvent.result, aEvent.result.getItem().getMaxItemUseDuration(aEvent.result));
- aEvent.setCanceled(true);
- }
- }
-
- @SubscribeEvent
- public void onArrowLooseEvent(ArrowLooseEvent aEvent) {
- ItemStack aArrow = GT_Utility.getProjectile(SubTag.PROJECTILE_ARROW, aEvent.entityPlayer.inventory);
- if ((!aEvent.isCanceled()) && (GT_Utility.isStackValid(aEvent.bow)) && (aArrow != null) && ((aEvent.bow.getItem() instanceof ItemBow))) {
- float tSpeed = aEvent.charge / 20.0F;
- tSpeed = (tSpeed * tSpeed + tSpeed * 2.0F) / 3.0F;
- if (tSpeed < 0.1D) {
- return;
- }
- if (tSpeed > 1.0D) {
- tSpeed = 1.0F;
- }
- EntityArrow tArrowEntity = ((IProjectileItem) aArrow.getItem()).getProjectile(SubTag.PROJECTILE_ARROW, aArrow, aEvent.entityPlayer.worldObj,
- aEvent.entityPlayer, tSpeed * 2.0F);
- if (tSpeed >= 1.0F) {
- tArrowEntity.setIsCritical(true);
- }
- int tLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, aEvent.bow);
- if (tLevel > 0) {
- tArrowEntity.setDamage(tArrowEntity.getDamage() + tLevel * 0.5D + 0.5D);
- }
- tLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, aEvent.bow);
- if (tLevel > 0) {
- tArrowEntity.setKnockbackStrength(tLevel);
- }
- tLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, aEvent.bow);
- if (tLevel > 0) {
- tArrowEntity.setFire(tLevel * 100);
- }
- aEvent.bow.damageItem(1, aEvent.entityPlayer);
- aEvent.bow.getItem();
- aEvent.entityPlayer.worldObj.playSoundAtEntity(aEvent.entityPlayer, "random.bow", 1.0F, 0.64893958288F + tSpeed
- * 0.5F);
-
- tArrowEntity.canBePickedUp = 1;
- if (!aEvent.entityPlayer.capabilities.isCreativeMode) {
- aArrow.stackSize -= 1;
- }
- if (aArrow.stackSize == 0) {
- GT_Utility.removeNullStacksFromInventory(aEvent.entityPlayer.inventory);
- }
- if (!aEvent.entityPlayer.worldObj.isRemote) {
- aEvent.entityPlayer.worldObj.spawnEntityInWorld(tArrowEntity);
- }
- aEvent.setCanceled(true);
- }
- }
-
- @SubscribeEvent
- public void onEndermanTeleportEvent(EnderTeleportEvent aEvent) {
- if (((aEvent.entityLiving instanceof EntityEnderman)) && (aEvent.entityLiving.getActivePotionEffect(Potion.weakness) != null)) {
- aEvent.setCanceled(true);
- }
- }
-
- @SubscribeEvent
- public void onEntitySpawningEvent(EntityJoinWorldEvent aEvent) {
- if ((aEvent.entity != null) && (!aEvent.entity.worldObj.isRemote)) {
- if ((aEvent.entity instanceof EntityItem)) {
- ((EntityItem) aEvent.entity).setEntityItemStack(GT_OreDictUnificator.get(((EntityItem) aEvent.entity).getEntityItem()));
- }
- if ((this.mSkeletonsShootGTArrows > 0) && (aEvent.entity.getClass() == EntityArrow.class)
- && (aEvent.entity.worldObj.rand.nextInt(this.mSkeletonsShootGTArrows) == 0)
- && ((((EntityArrow) aEvent.entity).shootingEntity instanceof EntitySkeleton))) {
- aEvent.entity.worldObj.spawnEntityInWorld(new GT_Entity_Arrow((EntityArrow) aEvent.entity, (ItemStack) OrePrefixes.arrowGtWood.mPrefixedItems
- .get(aEvent.entity.worldObj.rand.nextInt(OrePrefixes.arrowGtWood.mPrefixedItems.size()))));
- aEvent.entity.setDead();
- }
- }
- }
-
- @SubscribeEvent
- public void onOreGenEvent(OreGenEvent.GenerateMinable aGenerator) {
- if ((this.mDisableVanillaOres) && ((aGenerator.generator instanceof WorldGenMinable)) && (PREVENTED_ORES.contains(aGenerator.type))) {
- aGenerator.setResult(Result.DENY);
- }
- }
-
- private String getDataAndTime() {
- return this.mDateFormat.format(new Date());
- }
-
- @SubscribeEvent
- public void onPlayerInteraction(PlayerInteractEvent aEvent) {
- if ((aEvent.entityPlayer == null) || (aEvent.entityPlayer.worldObj == null) || (aEvent.action == null) || (aEvent.world.provider == null)) {
- return;
- }
- if ((!aEvent.entityPlayer.worldObj.isRemote) && (aEvent.action != PlayerInteractEvent.Action.RIGHT_CLICK_AIR)
- && (GT_Log.pal != null)) {
- this.mBufferedPlayerActivity.add(getDataAndTime() + ";" + aEvent.action.name() + ";" + aEvent.entityPlayer.getDisplayName() + ";DIM:"
- + aEvent.world.provider.dimensionId + ";" + aEvent.x + ";" + aEvent.y + ";" + aEvent.z + ";|;" + aEvent.x / 10 + ";" + aEvent.y / 10 + ";"
- + aEvent.z / 10);
- }
- ItemStack aStack = aEvent.entityPlayer.getCurrentEquippedItem();
- if ((aStack != null) && (aEvent.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) && (aStack.getItem() == Items.flint_and_steel)) {
- if ((!aEvent.world.isRemote) && (!aEvent.entityPlayer.capabilities.isCreativeMode) && (aEvent.world.rand.nextInt(100) >= this.mFlintChance)) {
- aEvent.setCanceled(true);
- aStack.damageItem(1, aEvent.entityPlayer);
- if (aStack.getItemDamage() >= aStack.getMaxDamage()) {
- aStack.stackSize -= 1;
- }
- if (aStack.stackSize <= 0) {
- ForgeEventFactory.onPlayerDestroyItem(aEvent.entityPlayer, aStack);
- }
- }
- return;
- }
- }
-
- @SubscribeEvent
- public void onBlockHarvestingEvent(BlockEvent.HarvestDropsEvent aEvent) {
- if (aEvent.harvester != null) {
- if ((!aEvent.world.isRemote) && (GT_Log.pal != null)) {
- this.mBufferedPlayerActivity.add(getDataAndTime() + ";HARVEST_BLOCK;" + aEvent.harvester.getDisplayName() + ";DIM:"
- + aEvent.world.provider.dimensionId + ";" + aEvent.x + ";" + aEvent.y + ";" + aEvent.z + ";|;" + aEvent.x / 10 + ";" + aEvent.y / 10
- + ";" + aEvent.z / 10);
- }
- ItemStack aStack = aEvent.harvester.getCurrentEquippedItem();
- if (aStack != null) {
- if ((aStack.getItem() instanceof GT_MetaGenerated_Tool)) {
- ((GT_MetaGenerated_Tool) aStack.getItem()).onHarvestBlockEvent(aEvent.drops, aStack, aEvent.harvester, aEvent.block, aEvent.x, aEvent.y,
- aEvent.z, (byte) aEvent.blockMetadata, aEvent.fortuneLevel, aEvent.isSilkTouching, aEvent);
- }
- if (EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, aStack) > 2) {
- try {
- for (ItemStack tDrop : aEvent.drops) {
- ItemStack tSmeltingOutput = GT_ModHandler.getSmeltingOutput(tDrop, false, null);
- if (tSmeltingOutput != null) {
- tDrop.stackSize *= tSmeltingOutput.stackSize;
- tSmeltingOutput.stackSize = tDrop.stackSize;
- GT_Utility.setStack(tDrop, tSmeltingOutput);
- }
- }
- } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
- }
- }
- }
- }
-
- @SubscribeEvent
- public void registerOre(OreDictionary.OreRegisterEvent aEvent) {
- ModContainer tContainer = Loader.instance().activeModContainer();
- String aMod = tContainer == null ? "UNKNOWN" : tContainer.getModId();
- String aOriginalMod = aMod;
- if (GT_OreDictUnificator.isRegisteringOres()) {
- aMod = "gregtech";
- } else if (aMod.equals("gregtech")) {
- aMod = "UNKNOWN";
- }
- if ((aEvent == null) || (aEvent.Ore == null) || (aEvent.Ore.getItem() == null) || (aEvent.Name == null) || (aEvent.Name.isEmpty())
- || (aEvent.Name.replaceAll("_", "").length() - aEvent.Name.length() == 9)) {
- if (aOriginalMod.equals("gregtech")) {
- aOriginalMod = "UNKNOWN";
- }
- GT_Log.ore
- .println(aOriginalMod
- + " did something very bad! The registration is too invalid to even be shown properly. This happens only if you register null, invalid Items, empty Strings or even nonexisting Events to the OreDict.");
- throw new IllegalArgumentException(
- aOriginalMod
- + " did something very bad! The registration is too invalid to even be shown properly. This happens only if you register null, invalid Items, empty Strings or even nonexisting Events to the OreDict.");
- }
- try {
- aEvent.Ore.stackSize = 1;
- if (this.mIgnoreTcon || aEvent.Ore.getUnlocalizedName().startsWith("item.oreberry")) {
- if ((aOriginalMod.toLowerCase(Locale.ENGLISH).contains("xycraft")) || (aOriginalMod.toLowerCase(Locale.ENGLISH).contains("tconstruct"))
- || ((aOriginalMod.toLowerCase(Locale.ENGLISH).contains("natura")) && (!aOriginalMod.toLowerCase(Locale.ENGLISH).contains("natural")))) {
- if (GT_Values.D1) {
- GT_Log.ore.println(aMod + " -> " + aEvent.Name + " is getting ignored, because of racism. :P");
- }
- return;
- }
- }
- String tModToName = aMod + " -> " + aEvent.Name;
- if ((this.mOreDictActivated) || (GregTech_API.sPostloadStarted) || ((this.mSortToTheEnd) && (GregTech_API.sLoadFinished))) {
- tModToName = aOriginalMod + " --Late--> " + aEvent.Name;
- }
- if (((aEvent.Ore.getItem() instanceof ItemBlock)) || (GT_Utility.getBlockFromStack(aEvent.Ore) != Blocks.air)) {
- GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
- }
- this.mRegisteredOres.add(aEvent.Ore);
- if (this.mIgnoredItems.contains(aEvent.Name)) {
- if ((aEvent.Name.startsWith("item"))) {
- GT_Log.ore.println(tModToName);
- if (aEvent.Name.equals("itemCopperWire")) {
- GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper, aEvent.Ore);
- }
- if (aEvent.Name.equals("itemRubber")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.Rubber, aEvent.Ore);
- }
- return;
- }
- }else if(this.mIgnoredNames.contains(aEvent.Name)){
- GT_Log.ore.println(tModToName + " is getting ignored via hardcode.");
- return;
- }
- else if (aEvent.Name.equals("stone")) {
- GT_OreDictUnificator.registerOre("stoneSmooth", aEvent.Ore);
- return;
- }
- else if (aEvent.Name.equals("cobblestone")) {
- GT_OreDictUnificator.registerOre("stoneCobble", aEvent.Ore);
- return;
- }
- else if ((aEvent.Name.contains("|")) || (aEvent.Name.contains("*")) || (aEvent.Name.contains(":")) || (aEvent.Name.contains("."))
- || (aEvent.Name.contains("$"))) {
- GT_Log.ore.println(tModToName + " is using a private Prefix and is therefor getting ignored properly.");
- return;
- }
- else if (aEvent.Name.equals("copperWire")) {
- GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper, aEvent.Ore);
- }
- else if (aEvent.Name.equals("oreHeeEndrium")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.ore, Materials.HeeEndium, aEvent.Ore);
- }
- else if (aEvent.Name.equals("sheetPlastic")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.plate, Materials.Plastic, aEvent.Ore);
- }
- else if (aEvent.Name.startsWith("shard")) {
- if (aEvent.Name.equals("shardAir")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedAir, aEvent.Ore);
- return;
- }
- else if (aEvent.Name.equals("shardWater")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedWater, aEvent.Ore);
- return;
- }
- else if (aEvent.Name.equals("shardFire")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedFire, aEvent.Ore);
- return;
- }
- else if (aEvent.Name.equals("shardEarth")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedEarth, aEvent.Ore);
- return;
- }
- else if (aEvent.Name.equals("shardOrder")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedOrder, aEvent.Ore);
- return;
- }
- else if (aEvent.Name.equals("shardEntropy")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedEntropy, aEvent.Ore);
- return;
- }
- } else if (aEvent.Name.equals("fieryIngot")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.FierySteel, aEvent.Ore);
- return;
- }
- else if (aEvent.Name.equals("ironwood")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.IronWood, aEvent.Ore);
- return;
- }
- else if (aEvent.Name.equals("steeleaf")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.Steeleaf, aEvent.Ore);
- return;
- }
- else if (aEvent.Name.equals("knightmetal")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.Knightmetal, aEvent.Ore);
- return;
- }
- else if (aEvent.Name.equals("compressedAluminum")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.compressed, Materials.Aluminium, aEvent.Ore);
- return;
- }
- else if (aEvent.Name.contains(" ")) {
- GT_Log.ore.println(tModToName + " is getting re-registered because the OreDict Name containing invalid spaces.");
- GT_OreDictUnificator.registerOre(aEvent.Name.replaceAll(" ", ""), GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
- aEvent.Ore.setStackDisplayName("Invalid OreDictionary Tag");
- return;
- }
- else if (this.mInvalidNames.contains(aEvent.Name)) {
- GT_Log.ore.println(tModToName + " is wrongly registered and therefor getting ignored.");
-
- return;
- }
- OrePrefixes aPrefix = OrePrefixes.getOrePrefix(aEvent.Name);
- Materials aMaterial = Materials._NULL;
- if ((aPrefix == OrePrefixes.nugget) && (aMod.equals("Thaumcraft")) && (aEvent.Ore.getItem().getUnlocalizedName().contains("ItemResource"))) {
- return;
- }
- if (aPrefix == null) {
- if (aEvent.Name.toLowerCase().equals(aEvent.Name)) {
- GT_Log.ore.println(tModToName + " is invalid due to being solely lowercased.");
- return;
- }else if (aEvent.Name.toUpperCase().equals(aEvent.Name)) {
- GT_Log.ore.println(tModToName + " is invalid due to being solely uppercased.");
- return;
- } else if (Character.isUpperCase(aEvent.Name.charAt(0))) {
- GT_Log.ore.println(tModToName + " is invalid due to the first character being uppercased.");
- }
- } else {
- if (aPrefix.mDontUnificateActively) {
- GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
- }
- if (aPrefix != aPrefix.mPrefixInto) {
- String tNewName = aEvent.Name.replaceFirst(aPrefix.toString(), aPrefix.mPrefixInto.toString());
- if (!GT_OreDictUnificator.isRegisteringOres()) {
- GT_Log.ore.println(tModToName + " uses a depricated Prefix, and is getting re-registered as " + tNewName);
- }
- GT_OreDictUnificator.registerOre(tNewName, aEvent.Ore);
- return;
- }
- String tName = aEvent.Name.replaceFirst(aPrefix.toString(), "");
- if (tName.length() > 0) {
- char firstChar = tName.charAt(0);
- if (Character.isUpperCase(firstChar) || Character.isLowerCase(firstChar) || firstChar == '_') {
- if (aPrefix.mIsMaterialBased) {
- aMaterial = Materials.get(tName);
- if (aMaterial != aMaterial.mMaterialInto) {
- GT_OreDictUnificator.registerOre(aPrefix, aMaterial.mMaterialInto, aEvent.Ore);
- if (!GT_OreDictUnificator.isRegisteringOres()) {
- GT_Log.ore.println(tModToName + " uses a deprecated Material and is getting re-registered as "
- + aPrefix.get(aMaterial.mMaterialInto));
- }
- return;
- }
- if (!aPrefix.isIgnored(aMaterial)) {
- aPrefix.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
- }
- if (aMaterial != Materials._NULL) {
- Materials tReRegisteredMaterial;
- for (Iterator i$ = aMaterial.mOreReRegistrations.iterator(); i$.hasNext(); GT_OreDictUnificator.registerOre(aPrefix,
- tReRegisteredMaterial, aEvent.Ore)) {
- tReRegisteredMaterial = (Materials) i$.next();
- }
- aMaterial.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
-
- if (GregTech_API.sThaumcraftCompat != null && aPrefix.doGenerateItem(aMaterial) && !aPrefix.isIgnored(aMaterial)) {
- List<TC_AspectStack> tAspects = new ArrayList<TC_AspectStack>();
- for (TC_AspectStack tAspect : aPrefix.mAspects) tAspect.addToAspectList(tAspects);
- if (aPrefix.mMaterialAmount >= 3628800 || aPrefix.mMaterialAmount < 0) for (TC_AspectStack tAspect : aMaterial.mAspects) tAspect.addToAspectList(tAspects);
- GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(GT_Utility.copyAmount(1, aEvent.Ore), tAspects, aEvent.Name);
- }
-
- switch (aPrefix) {
- case crystal:
- if ((aMaterial == Materials.CertusQuartz) || (aMaterial == Materials.NetherQuartz) || (aMaterial == Materials.Fluix)) {
- GT_OreDictUnificator.registerOre(OrePrefixes.gem, aMaterial, aEvent.Ore);
- }
- break;
- case gem:
- if (aMaterial == Materials.Lapis || aMaterial == Materials.Sodalite) {
- GT_OreDictUnificator.registerOre(Dyes.dyeBlue, aEvent.Ore);
- } else if (aMaterial == Materials.Lazurite) {
- GT_OreDictUnificator.registerOre(Dyes.dyeCyan, aEvent.Ore);
- } else if (aMaterial == Materials.InfusedAir || aMaterial == Materials.InfusedWater || aMaterial == Materials.InfusedFire || aMaterial == Materials.InfusedEarth || aMaterial == Materials.InfusedOrder || aMaterial == Materials.InfusedEntropy) {
- GT_OreDictUnificator.registerOre(aMaterial.mName.replaceFirst("Infused", "shard"), aEvent.Ore);
- } else if (aMaterial == Materials.Chocolate) {
- GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore);
- } else if (aMaterial == Materials.CertusQuartz || aMaterial == Materials.NetherQuartz) {
- GT_OreDictUnificator.registerOre(OrePrefixes.item.get(aMaterial), aEvent.Ore);
- GT_OreDictUnificator.registerOre(OrePrefixes.crystal, aMaterial, aEvent.Ore);
- GT_OreDictUnificator.registerOre(OreDictNames.craftingQuartz, aEvent.Ore);
- } else if (aMaterial == Materials.Fluix || aMaterial == Materials.Quartz || aMaterial == Materials.Quartzite) {
- GT_OreDictUnificator.registerOre(OrePrefixes.crystal, aMaterial, aEvent.Ore);
- GT_OreDictUnificator.registerOre(OreDictNames.craftingQuartz, aEvent.Ore);
- }
- break;
- case cableGt01:
- if (aMaterial == Materials.Tin) {
- GT_OreDictUnificator.registerOre(OreDictNames.craftingWireTin, aEvent.Ore);
- } else if (aMaterial == Materials.AnyCopper) {
- GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper, aEvent.Ore);
- } else if (aMaterial == Materials.Gold) {
- GT_OreDictUnificator.registerOre(OreDictNames.craftingWireGold, aEvent.Ore);
- } else if (aMaterial == Materials.AnyIron) {
- GT_OreDictUnificator.registerOre(OreDictNames.craftingWireIron, aEvent.Ore);
- }
- break;
- case lens:
- if ((aMaterial.contains(SubTag.TRANSPARENT)) && (aMaterial.mColor != Dyes._NULL)) {
- GT_OreDictUnificator.registerOre("craftingLens" + aMaterial.mColor.toString().replaceFirst("dye", ""), aEvent.Ore);
- }
- break;
- case plate:
- if ((aMaterial == Materials.Plastic) || (aMaterial == Materials.Rubber)) {
- GT_OreDictUnificator.registerOre(OrePrefixes.sheet, aMaterial, aEvent.Ore);
- } else if (aMaterial == Materials.Silicon) {
- GT_OreDictUnificator.registerOre(OrePrefixes.item, aMaterial, aEvent.Ore);
- } else if (aMaterial == Materials.Wood) {
- GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
- GT_OreDictUnificator.registerOre(OrePrefixes.plank, aMaterial, aEvent.Ore);
- }
- break;
- case cell:
- if (aMaterial == Materials.Empty) {
- GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
- }
- break;
- case gearGt:
- GT_OreDictUnificator.registerOre(OrePrefixes.gear, aMaterial, aEvent.Ore);
- break;
- case stick:
- if (!GT_RecipeRegistrator.sRodMaterialList.contains(aMaterial)) {
- GT_RecipeRegistrator.sRodMaterialList.add(aMaterial);
- } else if (aMaterial == Materials.Wood) {
- GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
- } else if ((aMaterial == Materials.Tin) || (aMaterial == Materials.Lead) || (aMaterial == Materials.SolderingAlloy)) {
- GT_OreDictUnificator.registerOre(ToolDictNames.craftingToolSolderingMetal, aEvent.Ore);
- }
- break;
- case dust:
- if (aMaterial == Materials.Salt) {
- GT_OreDictUnificator.registerOre("itemSalt", aEvent.Ore);
- } else if (aMaterial == Materials.Wood) {
- GT_OreDictUnificator.registerOre("pulpWood", aEvent.Ore);
- } else if (aMaterial == Materials.Wheat) {
- GT_OreDictUnificator.registerOre("foodFlour", aEvent.Ore);
- } else if (aMaterial == Materials.Lapis) {
- GT_OreDictUnificator.registerOre(Dyes.dyeBlue, aEvent.Ore);
- } else if (aMaterial == Materials.Lazurite) {
- GT_OreDictUnificator.registerOre(Dyes.dyeCyan, aEvent.Ore);
- } else if (aMaterial == Materials.Sodalite) {
- GT_OreDictUnificator.registerOre(Dyes.dyeBlue, aEvent.Ore);
- } else if (aMaterial == Materials.Cocoa) {
- GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore);
- GT_OreDictUnificator.registerOre("foodCocoapowder", aEvent.Ore);
- } else if (aMaterial == Materials.Coffee) {
- GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore);
- } else if (aMaterial == Materials.BrownLimonite) {
- GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore);
- } else if (aMaterial == Materials.YellowLimonite) {
- GT_OreDictUnificator.registerOre(Dyes.dyeYellow, aEvent.Ore);
- }
- break;
- case ingot:
- if (aMaterial == Materials.Rubber) {
- GT_OreDictUnificator.registerOre("itemRubber", aEvent.Ore);
- } else if (aMaterial == Materials.FierySteel) {
- GT_OreDictUnificator.registerOre("fieryIngot", aEvent.Ore);
- } else if (aMaterial == Materials.IronWood) {
- GT_OreDictUnificator.registerOre("ironwood", aEvent.Ore);
- } else if (aMaterial == Materials.Steeleaf) {
- GT_OreDictUnificator.registerOre("steeleaf", aEvent.Ore);
- } else if (aMaterial == Materials.Knightmetal) {
- GT_OreDictUnificator.registerOre("knightmetal", aEvent.Ore);
- } else if ((aMaterial == Materials.Brass) && (aEvent.Ore.getItemDamage() == 2)
- && (aEvent.Ore.getUnlocalizedName().equals("item.ingotBrass"))
- && (new ItemStack(aEvent.Ore.getItem(), 1, 0).getUnlocalizedName().contains("red"))) {
- GT_OreDictUnificator.set(OrePrefixes.ingot, Materials.RedAlloy, new ItemStack(aEvent.Ore.getItem(), 1, 0));
- GT_OreDictUnificator.set(OrePrefixes.ingot, Materials.BlueAlloy, new ItemStack(aEvent.Ore.getItem(), 1, 1));
- GT_OreDictUnificator.set(OrePrefixes.ingot, Materials.Brass, new ItemStack(aEvent.Ore.getItem(), 1, 2));
- if (!mDisableIC2Cables) {
- GT_Values.RA.addWiremillRecipe(GT_ModHandler.getIC2Item("copperCableItem", 3L), new ItemStack(aEvent.Ore.getItem(), 1,
- 8), 400, 1);
- GT_Values.RA.addWiremillRecipe(GT_ModHandler.getIC2Item("ironCableItem", 6L),
- new ItemStack(aEvent.Ore.getItem(), 1, 9), 400, 2);
- }
- GT_Values.RA.addCutterRecipe(new ItemStack(aEvent.Ore.getItem(), 1, 3), new ItemStack(aEvent.Ore.getItem(), 16, 4),
- null, 400, 8);
- }
- break;
- default:
- break;
- }
- if (aPrefix.mIsUnificatable && !aMaterial.mUnificatable) {
- return;
- }
- } else {
- for (Dyes tDye : Dyes.VALUES) {
- if (aEvent.Name.endsWith(tDye.name().replaceFirst("dye", ""))) {
- GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
- GT_Log.ore.println(tModToName + " Oh man, why the fuck would anyone need a OreDictified Color for this, that is even too much for GregTech... do not report this, this is just a random Comment about how ridiculous this is.");
- return;
- }
- }
-// System.out.println("Material Name: "+aEvent.Name+ " !!!Unknown Material detected!!! Please report to GregTech Intergalactical for additional compatiblity. This is not an Error, an Issue nor a Lag Source, it is just an Information, which you should pass to me.");
-// GT_Log.ore.println(tModToName + " uses an unknown Material. Report this to GregTech.");
- return;
- }
- } else {
- aPrefix.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
- }
- }
- } else if (aPrefix.mIsSelfReferencing) {
- aPrefix.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
- } else {
- GT_Log.ore.println(tModToName + " uses a Prefix as full OreDict Name, and is therefor invalid.");
- aEvent.Ore.setStackDisplayName("Invalid OreDictionary Tag");
- return;
- }
- switch (aPrefix) {
- case dye:
- if (GT_Utility.isStringValid(tName)) {
- GT_OreDictUnificator.registerOre(OrePrefixes.dye, aEvent.Ore);
- }
- break;
- case stoneSmooth:
- GT_OreDictUnificator.registerOre("stone", aEvent.Ore);
- break;
- case stoneCobble:
- GT_OreDictUnificator.registerOre("cobblestone", aEvent.Ore);
- break;
- case plank:
- if (tName.equals("Wood")) {
- GT_OreDictUnificator.addItemData(aEvent.Ore, new ItemData(Materials.Wood, 3628800L, new MaterialStack[0]));
- }
- break;
- case slab:
- if (tName.equals("Wood")) {
- GT_OreDictUnificator.addItemData(aEvent.Ore, new ItemData(Materials.Wood, 1814400L, new MaterialStack[0]));
- }
- break;
- case sheet:
- if (tName.equals("Plastic")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.plate, Materials.Plastic, aEvent.Ore);
- } else if (tName.equals("Rubber")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.plate, Materials.Rubber, aEvent.Ore);
- }
- break;
- case crafting:
- if (tName.equals("ToolSolderingMetal")) {
- GregTech_API.registerSolderingMetal(aEvent.Ore);
- } else if (tName.equals("IndustrialDiamond")) {
- GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
- } else if (tName.equals("WireCopper")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.wire, Materials.Copper, aEvent.Ore);
- }
- break;
- case wood:
- if (tName.equals("Rubber")) {
- GT_OreDictUnificator.registerOre("logRubber", aEvent.Ore);
- }
- break;
- case food:
- if (tName.equals("Cocoapowder")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.dust, Materials.Cocoa, aEvent.Ore);
- }
- break;
- default:
- break;
- }
- }
- GT_Log.ore.println(tModToName);
-
- OreDictEventContainer tOre = new OreDictEventContainer(aEvent, aPrefix, aMaterial, aMod);
- if ((!this.mOreDictActivated) || (!GregTech_API.sUnificationEntriesRegistered)) {
- this.mEvents.add(tOre);
- } else {
- this.mEvents.clear();
- }
- if (this.mOreDictActivated) {
- registerRecipes(tOre);
- }
- } catch (Throwable e) {
- e.printStackTrace(GT_Log.err);
- }
- }
-
- @SubscribeEvent
- public void onFluidContainerRegistration(FluidContainerRegistry.FluidContainerRegisterEvent aFluidEvent) {
- if ((aFluidEvent.data.filledContainer.getItem() == Items.potionitem) && (aFluidEvent.data.filledContainer.getItemDamage() == 0)) {
- aFluidEvent.data.fluid.amount = 0;
- }
- GT_OreDictUnificator.addToBlacklist(aFluidEvent.data.emptyContainer);
- GT_OreDictUnificator.addToBlacklist(aFluidEvent.data.filledContainer);
- GT_Utility.addFluidContainerData(aFluidEvent.data);
- }
-
- @SubscribeEvent
- public void onServerTickEvent(TickEvent.ServerTickEvent aEvent) {
- }
-
- @SubscribeEvent
- public void onWorldTickEvent(TickEvent.WorldTickEvent aEvent) {
- if(aEvent.world.provider.dimensionId == 0)
- mTicksUntilNextCraftSound--;
- if (aEvent.side.isServer()) {
- if (this.mUniverse == null) {
- this.mUniverse = aEvent.world;
- }
- if (this.isFirstServerWorldTick) {
- File tSaveDiretory = getSaveDirectory();
- if (tSaveDiretory != null) {
- this.isFirstServerWorldTick = false;
- try {
- for (IMetaTileEntity tMetaTileEntity : GregTech_API.METATILEENTITIES) {
- if (tMetaTileEntity != null) {
- tMetaTileEntity.onWorldLoad(tSaveDiretory);
- }
- }
- } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
- }
- }
- if ((aEvent.world.getTotalWorldTime() % 100L == 0L) && ((this.mItemDespawnTime != 6000) || (this.mMaxEqualEntitiesAtOneSpot > 0))) {
- for (int i = 0; i < aEvent.world.loadedEntityList.size(); i++) {
- if ((aEvent.world.loadedEntityList.get(i) instanceof Entity)) {
- Entity tEntity = (Entity) aEvent.world.loadedEntityList.get(i);
- if (((tEntity instanceof EntityItem)) && (this.mItemDespawnTime != 6000) && (((EntityItem) tEntity).lifespan == 6000)) {
- ((EntityItem) tEntity).lifespan = this.mItemDespawnTime;
- } else if (((tEntity instanceof EntityLivingBase)) && (this.mMaxEqualEntitiesAtOneSpot > 0) && (!(tEntity instanceof EntityPlayer))
- && (((EntityLivingBase) tEntity).canBePushed()) && (((EntityLivingBase) tEntity).getHealth() > 0.0F)) {
- List tList = tEntity.worldObj.getEntitiesWithinAABBExcludingEntity(tEntity,
- tEntity.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D));
- Class tClass = tEntity.getClass();
- int tEntityCount = 1;
- if (tList != null) {
- for (int j = 0; j < tList.size(); j++) {
- if ((tList.get(j) != null) && (tList.get(j).getClass() == tClass)) {
- tEntityCount++;
- }
- }
- }
- if (tEntityCount > this.mMaxEqualEntitiesAtOneSpot) {
- tEntity.attackEntityFrom(DamageSource.inWall, tEntityCount - this.mMaxEqualEntitiesAtOneSpot);
- }
- }
- }
- }
- }
-
- GT_Pollution.onWorldTick(aEvent);
- }
- }
-
- @SubscribeEvent
- public void onPlayerTickEventServer(TickEvent.PlayerTickEvent aEvent) {
- if ((aEvent.side.isServer()) && (aEvent.phase == TickEvent.Phase.END) && (!aEvent.player.isDead)) {
- if ((aEvent.player.ticksExisted % 200 == 0) && (aEvent.player.capabilities.allowEdit) && (!aEvent.player.capabilities.isCreativeMode)
- && (this.mSurvivalIntoAdventure)) {
- aEvent.player.setGameType(GameType.ADVENTURE);
- aEvent.player.capabilities.allowEdit = false;
- if (this.mAxeWhenAdventure) {
- GT_Utility.sendChatToPlayer(aEvent.player, "It's dangerous to go alone! Take this.");
- aEvent.player.worldObj.spawnEntityInWorld(new EntityItem(aEvent.player.worldObj, aEvent.player.posX, aEvent.player.posY,
- aEvent.player.posZ, GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.AXE, 1, Materials.Flint, Materials.Wood, null)));
- }
- }
- boolean tHungerEffect = (this.mHungerEffect) && (aEvent.player.ticksExisted % 2400 == 1200);
- if (aEvent.player.ticksExisted % 120 == 0) {
- int tCount = 64;
- for (int i = 0; i < 36; i++) {
- ItemStack tStack;
- if ((tStack = aEvent.player.inventory.getStackInSlot(i)) != null) {
- if (!aEvent.player.capabilities.isCreativeMode) {
- GT_Utility.applyRadioactivity(aEvent.player, GT_Utility.getRadioactivityLevel(tStack), tStack.stackSize);
- float tHeat = GT_Utility.getHeatDamageFromItem(tStack);
- if (tHeat != 0.0F) {
- if (tHeat > 0.0F) {
- GT_Utility.applyHeatDamage(aEvent.player, tHeat);
- } else {
- GT_Utility.applyFrostDamage(aEvent.player, -tHeat);
- }
- }
- }
- if (tHungerEffect) {
- tCount += tStack.stackSize * 64 / Math.max(1, tStack.getMaxStackSize());
- }
- if (this.mInventoryUnification) {
- GT_OreDictUnificator.setStack(true, tStack);
- }
- }
- }
- for (int i = 0; i < 4; i++) {
- ItemStack tStack;
- if ((tStack = aEvent.player.inventory.armorInventory[i]) != null) {
- if (!aEvent.player.capabilities.isCreativeMode) {
- GT_Utility.applyRadioactivity(aEvent.player, GT_Utility.getRadioactivityLevel(tStack), tStack.stackSize);
- float tHeat = GT_Utility.getHeatDamageFromItem(tStack);
- if (tHeat != 0.0F) {
- if (tHeat > 0.0F) {
- GT_Utility.applyHeatDamage(aEvent.player, tHeat);
- } else {
- GT_Utility.applyFrostDamage(aEvent.player, -tHeat);
- }
- }
- }
- if (tHungerEffect) {
- tCount += 256;
- }
- }
- }
- if (tHungerEffect) {
- aEvent.player.addExhaustion(Math.max(1.0F, tCount / 666.6F));
- }
- }
- if (aEvent.player.ticksExisted % 10 == 0) {
- int tPollution = 0;
- tPollution = GT_Pollution.getPollution(new ChunkCoordIntPair(aEvent.player.chunkCoordX,aEvent.player.chunkCoordZ), aEvent.player.dimension);
- if(aEvent.player instanceof EntityPlayerMP)GT_Values.NW.sendToPlayer(new GT_Packet_Pollution(tPollution), (EntityPlayerMP) aEvent.player);
- }
- }
- }
-
- public Object getServerGuiElement(int aID, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) {
- if(aID>=1000){
- int ID = aID-1000;
- switch(ID){
- case 0:
- return new ContainerBasicArmor(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getCurrentEquippedItem()));
- case 1:
- return new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getCurrentEquippedItem()));
- case 2:
- return new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getCurrentEquippedItem()));
- default:
- return getRightItem(aPlayer, ID);
- }
- }
- if(aID>=100){
- int tSlot = aID / 100;
- int ID = aID%100;
- switch(ID){
- case 0:
- return new ContainerBasicArmor(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot)));
- case 1:
- return new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot)));
- case 2:
- return new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot)));
- default:
- return getRightItem(aPlayer, ID);
- }
- }
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity instanceof IGregTechTileEntity)) {
- IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
- if (tMetaTileEntity != null) {
- return tMetaTileEntity.getServerGUI(aID, aPlayer.inventory, (IGregTechTileEntity) tTileEntity);
- }
- }
- return null;
- }
-
- public Object getRightItem(EntityPlayer player, int ID){
- ItemStack mStack = player.getEquipmentInSlot(ID/100);
- if(mStack==null||!(mStack.getItem() instanceof ModularArmor_Item))return null;
-
- switch(ID % 100){
- case 0:
- return new ContainerBasicArmor(player, new InventoryArmor(ModularArmor_Item.class, mStack));
- case 1:
- return new ContainerElectricArmor1(player, new InventoryArmor(ModularArmor_Item.class, mStack));
- case 2:
- return new ContainerElectricArmor1(player, new InventoryArmor(ModularArmor_Item.class, mStack));
- }
- return null;
-
- }
-
- public Object getClientGuiElement(int aID, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) {
- if(aID>=1000){
- int ID = aID-1000;
- switch(ID){
- case 0:
- return new GuiModularArmor(new ContainerBasicArmor(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getCurrentEquippedItem())), aPlayer);
- case 1:
- return new GuiElectricArmor1(new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getCurrentEquippedItem())), aPlayer);
- case 2:
- return new GuiElectricArmor1(new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getCurrentEquippedItem())), aPlayer);
- default:
- return getRightItemGui(aPlayer, ID);
- }
- }
- if(aID>=100){
- int tSlot = aID / 100;
- int ID = aID%100;
- switch(ID){
- case 0:
- return new GuiModularArmor(new ContainerBasicArmor(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot))), aPlayer);
- case 1:
- return new GuiElectricArmor1(new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot))), aPlayer);
- case 2:
- return new GuiElectricArmor1(new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot))), aPlayer);
- default:
- return getRightItem(aPlayer, ID);
- }
- }
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity instanceof IGregTechTileEntity)) {
- IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
- if (tMetaTileEntity != null) {
- return tMetaTileEntity.getClientGUI(aID, aPlayer.inventory, (IGregTechTileEntity) tTileEntity);
- }
- }
- return null;
- }
-
- public Object getRightItemGui(EntityPlayer player, int ID){
- ItemStack mStack = player.getEquipmentInSlot(ID/100);
- if(mStack==null||!(mStack.getItem() instanceof ModularArmor_Item))return null;
-
- switch(ID % 100){
- case 0:
- return new GuiModularArmor(new ContainerBasicArmor(player, new InventoryArmor(ModularArmor_Item.class, mStack)),player);
- case 1:
- return new GuiElectricArmor1(new ContainerElectricArmor1(player, new InventoryArmor(ModularArmor_Item.class, mStack)), player);
- case 2:
- return new GuiElectricArmor1(new ContainerElectricArmor1(player, new InventoryArmor(ModularArmor_Item.class, mStack)), player);
- }
- return null;
-
- }
-
- public int getBurnTime(ItemStack aFuel) {
- if ((aFuel == null) || (aFuel.getItem() == null)) {
- return 0;
- }
- int rFuelValue = 0;
- if ((aFuel.getItem() instanceof GT_MetaGenerated_Item)) {
- Short tFuelValue = (Short) ((GT_MetaGenerated_Item) aFuel.getItem()).mBurnValues.get(Short.valueOf((short) aFuel.getItemDamage()));
- if (tFuelValue != null) {
- rFuelValue = Math.max(rFuelValue, tFuelValue.shortValue());
- }
- }
- NBTTagCompound tNBT = aFuel.getTagCompound();
- if (tNBT != null) {
- short tValue = tNBT.getShort("GT.ItemFuelValue");
- rFuelValue = Math.max(rFuelValue, tValue);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemSodium")) {
- rFuelValue = Math.max(rFuelValue, 4000);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedSodium")) {
- rFuelValue = Math.max(rFuelValue, 4000);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureSodium")) {
- rFuelValue = Math.max(rFuelValue, 4000);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSodium")) {
- rFuelValue = Math.max(rFuelValue, 400);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallSodium")) {
- rFuelValue = Math.max(rFuelValue, 100);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinySodium")) {
- rFuelValue = Math.max(rFuelValue, 44);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSulfur")) {
- rFuelValue = Math.max(rFuelValue, 1600);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemLithium")) {
- rFuelValue = Math.max(rFuelValue, 6000);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedLithium")) {
- rFuelValue = Math.max(rFuelValue, 6000);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureLithium")) {
- rFuelValue = Math.max(rFuelValue, 6000);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustLithium")) {
- rFuelValue = Math.max(rFuelValue, 6000);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallLithium")) {
- rFuelValue = Math.max(rFuelValue, 2000);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyLithium")) {
- rFuelValue = Math.max(rFuelValue, 888);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemCaesium")) {
- rFuelValue = Math.max(rFuelValue, 6000);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedCaesium")) {
- rFuelValue = Math.max(rFuelValue, 6000);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureCaesium")) {
- rFuelValue = Math.max(rFuelValue, 6000);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustCaesium")) {
- rFuelValue = Math.max(rFuelValue, 6000);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallCaesium")) {
- rFuelValue = Math.max(rFuelValue, 2000);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyCaesium")) {
- rFuelValue = Math.max(rFuelValue, 888);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemLignite")) {
- rFuelValue = Math.max(rFuelValue, 1200);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedLignite")) {
- rFuelValue = Math.max(rFuelValue, 1200);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureLignite")) {
- rFuelValue = Math.max(rFuelValue, 1200);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustLignite")) {
- rFuelValue = Math.max(rFuelValue, 1200);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallLignite")) {
- rFuelValue = Math.max(rFuelValue, 375);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyLignite")) {
- rFuelValue = Math.max(rFuelValue, 166);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemCoal")) {
- rFuelValue = Math.max(rFuelValue, 1600);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedCoal")) {
- rFuelValue = Math.max(rFuelValue, 1600);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureCoal")) {
- rFuelValue = Math.max(rFuelValue, 1600);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustCoal")) {
- rFuelValue = Math.max(rFuelValue, 1600);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallCoal")) {
- rFuelValue = Math.max(rFuelValue, 400);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyCoal")) {
- rFuelValue = Math.max(rFuelValue, 177);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemCharcoal")) {
- rFuelValue = Math.max(rFuelValue, 1600);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedCharcoal")) {
- rFuelValue = Math.max(rFuelValue, 1600);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureCharcoal")) {
- rFuelValue = Math.max(rFuelValue, 1600);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustCharcoal")) {
- rFuelValue = Math.max(rFuelValue, 1600);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallCharcoal")) {
- rFuelValue = Math.max(rFuelValue, 400);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyCharcoal")) {
- rFuelValue = Math.max(rFuelValue, 177);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustWood")) {
- rFuelValue = Math.max(rFuelValue, 100);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallWood")) {
- rFuelValue = Math.max(rFuelValue, 25);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyWood")) {
- rFuelValue = Math.max(rFuelValue, 11);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "plateWood")) {
- rFuelValue = Math.min(rFuelValue, 300);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "blockLignite")) {
- rFuelValue = Math.max(rFuelValue, 12000);
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "blockCharcoal")) {
- rFuelValue = Math.max(rFuelValue, 16000);
- } else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Blocks.wooden_button, 1))) {
- rFuelValue = Math.max(rFuelValue, 150);
- } else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Blocks.ladder, 1))) {
- rFuelValue = Math.max(rFuelValue, 100);
- } else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Items.sign, 1))) {
- rFuelValue = Math.max(rFuelValue, 600);
- } else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Items.wooden_door, 1))) {
- rFuelValue = Math.max(rFuelValue, 600);
- } else if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_MSSFUEL.get(1, new Object[0]))) {
- rFuelValue = Math.max(rFuelValue, 150000);
- }
- if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_SSFUEL.get(1, new Object[0]))) {
- rFuelValue = Math.max(rFuelValue, 100000);
- }
-
- return rFuelValue;
- }
-
- public Fluid addAutoGeneratedCorrespondingFluid(Materials aMaterial){
- return addFluid(aMaterial.mName.toLowerCase(Locale.ENGLISH), "molten.autogenerated", aMaterial.mDefaultLocalName, aMaterial,
- aMaterial.mRGBa, 1, aMaterial.getLiquidTemperature(), GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- }
-
- public Fluid addAutoGeneratedCorrespondingGas(Materials aMaterial) {
- return addFluid(aMaterial.mName.toLowerCase(Locale.ENGLISH), "molten.autogenerated", aMaterial.mDefaultLocalName, aMaterial,
- aMaterial.mRGBa, 2, aMaterial.getGasTemperature(), GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- }
-
- public Fluid addAutogeneratedMoltenFluid(Materials aMaterial) {
- return addFluid("molten." + aMaterial.mName.toLowerCase(Locale.ENGLISH), "molten.autogenerated", "Molten " + aMaterial.mDefaultLocalName, aMaterial,
- aMaterial.mMoltenRGBa, 4, aMaterial.mMeltingPoint <= 0 ? 1000 : aMaterial.mMeltingPoint, null, null, 0);
- }
-
- public Fluid addAutogeneratedWetFluid(Materials aMaterial) {
- return addFluid("wet." + aMaterial.mName.toLowerCase(Locale.ENGLISH), "wet.autogenerated", "Wet " + aMaterial.mDefaultLocalName, aMaterial,
- aMaterial.mMoltenRGBa, 4, aMaterial.mMeltingPoint <= 0 ? 1000 : aMaterial.mMeltingPoint, GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- }
-
- public Fluid addAutogeneratedPlasmaFluid(Materials aMaterial) {
- return addFluid("plasma." + aMaterial.mName.toLowerCase(Locale.ENGLISH), "plasma.autogenerated", aMaterial.mDefaultLocalName + " Plasma", aMaterial,
- aMaterial.mMoltenRGBa, 3, 10000, GT_OreDictUnificator.get(OrePrefixes.cellPlasma, aMaterial, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- }
-
- public void addAutoGeneratedHydroCrackedFluids(Materials aMaterial){
- Fluid[] crackedFluids = new Fluid[3];
- String[] prefixes = {"lightlyhydrocracked.", "moderatelyhydrocracked.", "severelyhydrocracked."};
- String[] localPrefixes = {"Lightly Hydro-Cracked ", "Moderately Hydro-Cracked ", "Severely Hydro-Cracked "};
- GT_Fluid uncrackedFluid = null;
- if (aMaterial.mFluid != null) {
- uncrackedFluid = (GT_Fluid) aMaterial.mFluid;
- } else if (aMaterial.mGas != null) {
- uncrackedFluid = (GT_Fluid) aMaterial.mGas;
- }
- for (int i = 0; i < 3; i++) {
- crackedFluids[i] = addFluid(prefixes[i] + aMaterial.mName.toLowerCase(Locale.ENGLISH), uncrackedFluid.mTextureName,
- localPrefixes[i] + aMaterial.mDefaultLocalName, null, aMaterial.mRGBa, 2, 775, null, null, 0);
- int hydrogenAmount = 2 * i + 2;
- GT_Values.RA.addCrackingRecipe(i + 1, new FluidStack(uncrackedFluid, 1000), Materials.Hydrogen.getGas(hydrogenAmount * 1000),
- new FluidStack(crackedFluids[i], 1000), 40 + 20 * i, 120 + 60 * i);
- GT_Values.RA.addChemicalRecipe(Materials.Hydrogen.getCells(hydrogenAmount), GT_Utility.getIntegratedCircuit(i + 1), new FluidStack(uncrackedFluid, 1000),
- new FluidStack(crackedFluids[i], 800), Materials.Empty.getCells(hydrogenAmount), 160 + 80 * i, 30);
- GT_Values.RA.addChemicalRecipe(aMaterial.getCells(1), GT_Utility.getIntegratedCircuit(i + 1), Materials.Hydrogen.getGas(hydrogenAmount * 1000),
- new FluidStack(crackedFluids[i], 800), Materials.Empty.getCells(1), 160 + 80 * i, 30);
- }
- aMaterial.setHydroCrackedFluids(crackedFluids);
- }
-
- public void addAutoGeneratedSteamCrackedFluids(Materials aMaterial){
- Fluid[] crackedFluids = new Fluid[3];
- String[] prefixes = {"lightlysteamcracked.", "moderatelysteamcracked.", "severelysteamcracked."};
- String[] localPrefixes = {"Lightly Steam-Cracked ", "Moderately Steam-Cracked ", "Severely Steam-Cracked "};
- GT_Fluid uncrackedFluid = null;
- if (aMaterial.mFluid != null) {
- uncrackedFluid = (GT_Fluid) aMaterial.mFluid;
- } else if (aMaterial.mGas != null) {
- uncrackedFluid = (GT_Fluid) aMaterial.mGas;
- }
- for (int i = 0; i < 3; i++) {
- crackedFluids[i] = addFluid(prefixes[i] + aMaterial.mName.toLowerCase(Locale.ENGLISH), uncrackedFluid.mTextureName,
- localPrefixes[i] + aMaterial.mDefaultLocalName, null, aMaterial.mRGBa, 2, 775, null, null, 0);
- GT_Values.RA.addCrackingRecipe(i + 1, new FluidStack(uncrackedFluid, 1000), GT_ModHandler.getSteam(1000),
- new FluidStack(crackedFluids[i], 1000), 40 + 20 * i, 240 + 120 * i);
- GT_Values.RA.addChemicalRecipe(GT_ModHandler.getIC2Item("steamCell", 1L), GT_Utility.getIntegratedCircuit(i + 1), new FluidStack(uncrackedFluid, 1000),
- new FluidStack(crackedFluids[i], 800), Materials.Empty.getCells(1), 160 + 80 * i, 30);
- GT_Values.RA.addChemicalRecipe(aMaterial.getCells(1), GT_Utility.getIntegratedCircuit(i + 1), GT_ModHandler.getSteam(1000),
- new FluidStack(crackedFluids[i], 800), Materials.Empty.getCells(1), 160 + 80 * i, 30);
- }
- aMaterial.setSteamCrackedFluids(crackedFluids);
- }
-
- public Fluid addFluid(String aName, String aLocalized, Materials aMaterial, int aState, int aTemperatureK) {
- return addFluid(aName, aLocalized, aMaterial, aState, aTemperatureK, null, null, 0);
- }
-
- public Fluid addFluid(String aName, String aLocalized, Materials aMaterial, int aState, int aTemperatureK, ItemStack aFullContainer,
- ItemStack aEmptyContainer, int aFluidAmount) {
- return addFluid(aName, aName.toLowerCase(Locale.ENGLISH), aLocalized, aMaterial, null, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount);
- }
-
- public Fluid addFluid(String aName, String aTexture, String aLocalized, Materials aMaterial, short[] aRGBa, int aState, int aTemperatureK,
- ItemStack aFullContainer, ItemStack aEmptyContainer, int aFluidAmount) {
- aName = aName.toLowerCase(Locale.ENGLISH);
- Fluid rFluid = new GT_Fluid(aName, aTexture, aRGBa != null ? aRGBa : Dyes._NULL.getRGBA());
- GT_LanguageManager.addStringLocalization(rFluid.getUnlocalizedName(), aLocalized == null ? aName : aLocalized);
- if (FluidRegistry.registerFluid(rFluid)) {
- switch (aState) {
- case 0:
- rFluid.setGaseous(false);
- rFluid.setViscosity(10000);
- break;
- case 1:
- case 4:
- rFluid.setGaseous(false);
- rFluid.setViscosity(1000);
- break;
- case 2:
- rFluid.setGaseous(true);
- rFluid.setDensity(-100);
- rFluid.setViscosity(200);
- break;
- case 3:
- rFluid.setGaseous(true);
- rFluid.setDensity(55536);
- rFluid.setViscosity(10);
- rFluid.setLuminosity(15);
- }
- } else {
- rFluid = FluidRegistry.getFluid(aName);
- }
- if (rFluid.getTemperature() == new Fluid("test").getTemperature()) {
- rFluid.setTemperature(aTemperatureK);
- }
- if (aMaterial != null) {
- switch (aState) {
- case 0:
- aMaterial.mSolid = rFluid;
- break;
- case 1:
- aMaterial.mFluid = rFluid;
- break;
- case 2:
- aMaterial.mGas = rFluid;
- break;
- case 3:
- aMaterial.mPlasma = rFluid;
- break;
- case 4:
- aMaterial.mStandardMoltenFluid = rFluid;
- }
- }
- if ((aFullContainer != null) && (aEmptyContainer != null)
- && (!FluidContainerRegistry.registerFluidContainer(new FluidStack(rFluid, aFluidAmount), aFullContainer, aEmptyContainer))) {
- GT_Values.RA.addFluidCannerRecipe(aFullContainer, GT_Utility.getContainerItem(aFullContainer, false), null, new FluidStack(rFluid, aFluidAmount));
- }
- return rFluid;
- }
-
- public File getSaveDirectory() {
- return this.mUniverse == null ? null : this.mUniverse.getSaveHandler().getWorldDirectory();
- }
-
- public void registerUnificationEntries() {
- GregTech_API.sUnification.mConfig.save();
- GregTech_API.sUnification.mConfig.load();
- GT_OreDictUnificator.resetUnificationEntries();
- for (OreDictEventContainer tOre : this.mEvents) {
- if ((!(tOre.mEvent.Ore.getItem() instanceof GT_MetaGenerated_Item)) && (tOre.mPrefix != null) && (tOre.mPrefix.mIsUnificatable) && (tOre.mMaterial != null)) {
- boolean chkmi = tOre.mModID != null;
- if (chkmi) {
- if (tOre.mModID.equalsIgnoreCase("enderio") && tOre.mPrefix == OrePrefixes.ingot && tOre.mMaterial == Materials.DarkSteel) {
- GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
- GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
- } else if (tOre.mModID.equalsIgnoreCase("thermalfoundation") && tOre.mPrefix == OrePrefixes.dust && tOre.mMaterial == Materials.Blizz) {
- GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
- GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
- } else if (tOre.mModID.equalsIgnoreCase("thermalfoundation") && tOre.mPrefix == OrePrefixes.dust && tOre.mMaterial == Materials.Pyrotheum) {
- GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
- GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
- } else if (tOre.mModID.equalsIgnoreCase(aTextArsmagica2) && tOre.mPrefix == OrePrefixes.dust && tOre.mMaterial == Materials.Vinteum) {
- GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
- GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
- } else if (tOre.mModID.equalsIgnoreCase(aTextArsmagica2) && tOre.mPrefix == OrePrefixes.gem && tOre.mMaterial == Materials.BlueTopaz) {
- GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
- GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
- } else if (tOre.mModID.equalsIgnoreCase(aTextArsmagica2) && tOre.mPrefix == OrePrefixes.gem && tOre.mMaterial == Materials.Chimerite) {
- GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
- GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
- } else if (tOre.mModID.equalsIgnoreCase(aTextArsmagica2) && tOre.mPrefix == OrePrefixes.gem && tOre.mMaterial == Materials.Moonstone) {
- GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
- GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
- } else if (tOre.mModID.equalsIgnoreCase(aTextArsmagica2) && tOre.mPrefix == OrePrefixes.gem && tOre.mMaterial == Materials.Sunstone) {
- GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
- GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
- } else if (tOre.mModID.equalsIgnoreCase("rotarycraft") && tOre.mPrefix == OrePrefixes.ingot && tOre.mMaterial == Materials.HSLA) {
- GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
- GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
- } else if (tOre.mModID.equalsIgnoreCase("appliedenergistics2") && tOre.mPrefix == OrePrefixes.gem && tOre.mMaterial == Materials.CertusQuartz) {
- GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
- GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
- } else if (tOre.mModID.equalsIgnoreCase("appliedenergistics2") && tOre.mPrefix == OrePrefixes.dust && tOre.mMaterial == Materials.CertusQuartz) {
- GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
- GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
- }
- }
- if (GT_OreDictUnificator.isBlacklisted(tOre.mEvent.Ore)) {
- GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, true);
- } else {
- GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
- GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (chkmi) && (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, false)), true);
- }
- }
- }
- for (OreDictEventContainer tOre : this.mEvents) {
- if (((tOre.mEvent.Ore.getItem() instanceof GT_MetaGenerated_Item)) && (tOre.mPrefix != null) && (tOre.mPrefix.mIsUnificatable)
- && (tOre.mMaterial != null)) {
- if (GT_OreDictUnificator.isBlacklisted(tOre.mEvent.Ore)) {
- GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, true);
- } else {
- GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
- GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (tOre.mModID != null) &&
- (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID), tOre.mEvent.Name, false)), true);
- }
- }
- }
- GregTech_API.sUnificationEntriesRegistered = true;
- GregTech_API.sUnification.mConfig.save();
- GT_Recipe.reInit();
- }
-
- public void activateOreDictHandler() {
- this.mOreDictActivated = true;
- ProgressManager.ProgressBar progressBar = ProgressManager.push("Register materials", mEvents.size());
- OreDictEventContainer tEvent;
- for (Iterator i$ = this.mEvents.iterator(); i$.hasNext(); registerRecipes(tEvent)) {
- tEvent = (OreDictEventContainer) i$.next();
-
- progressBar.step(tEvent.mMaterial == null ? "" : tEvent.mMaterial.toString());
- }
- ProgressManager.pop(progressBar);
- }
-
- public static final HashMap<Integer,HashMap<ChunkCoordIntPair,int []>> dimensionWiseChunkData = new HashMap<>(16);//stores chunk data that is loaded/saved
- public static final HashMap<Integer,GT_Pollution> dimensionWisePollution = new HashMap<>(16);//stores GT_Polluttors objects
- public static final byte GTOIL=3,GTOILFLUID=2,GTPOLLUTION=1,GTMETADATA=0,NOT_LOADED=0,LOADED=1;//consts
- //@Deprecated
- //public static final HashMap<ChunkPosition, int[]> chunkData = new HashMap<>(0);
-
- private static final byte oilVer=(byte)20;//non zero plz
-
- //TO get default's fast
- public static int[] getDefaultChunkDataOnCreation(){
- return new int[]{NOT_LOADED,0,-1,-1};
- }
- public static int[] getDefaultChunkDataOnLoad(){
- return new int[]{LOADED,0,-1,-1};
- }
-
-
- @SubscribeEvent
- public void handleChunkSaveEvent(ChunkDataEvent.Save event) {//ALWAYS SAVE FROM THE HASH MAP DATA
- HashMap<ChunkCoordIntPair,int []> chunkData=dimensionWiseChunkData.get(event.world.provider.dimensionId);
- if(chunkData==null) return;//no dim info stored
-
- int[] tInts = chunkData.get(event.getChunk().getChunkCoordIntPair());
- if(tInts==null) return;//no chunk data stored
- //assuming len of this array 4
- if(tInts[3]>=0)event.getData().setInteger("GTOIL", tInts[GTOIL]);
- else event.getData().removeTag("GTOIL");
- if(tInts[2]>=0)event.getData().setInteger("GTOILFLUID", tInts[GTOILFLUID]);
- else event.getData().removeTag("GTOILFLUID");
- if(tInts[1]>0)event.getData().setInteger("GTPOLLUTION", tInts[GTPOLLUTION]);
- else event.getData().removeTag("GTPOLLUTION");
- event.getData().setByte("GTOILVER", oilVer);//version mark
- }
-
- @SubscribeEvent
- public void handleChunkLoadEvent(ChunkDataEvent.Load event) {
- final int worldID=event.world.provider.dimensionId;
- HashMap<ChunkCoordIntPair, int[]> chunkData = dimensionWiseChunkData.get(worldID);
- if (chunkData == null){
- chunkData=new HashMap<>(1024);
- dimensionWiseChunkData.put(worldID, chunkData);
- }
- if (dimensionWisePollution.get(worldID) == null)
- dimensionWisePollution.put(worldID, new GT_Pollution(event.world));
-
- int[] tInts = chunkData.get(event.getChunk().getChunkCoordIntPair());
- if (tInts == null) {
- //NOT LOADED and NOT PROCESSED by pollution algorithms
- //regular load
- tInts = getDefaultChunkDataOnLoad();
-
- if (event.getData().getByte("GTOILVER") == oilVer) {
- if (event.getData().hasKey("GTOIL"))
- tInts[GTOIL] = event.getData().getInteger("GTOIL");
- if (event.getData().hasKey("GTOILFLUID"))
- tInts[GTOILFLUID] = event.getData().getInteger("GTOILFLUID");
- }
-
- tInts[GTPOLLUTION] = event.getData().getInteger("GTPOLLUTION");//Defaults to 0
-
- //store in HASH MAP if has useful data
- if (tInts[GTPOLLUTION] > 0 || tInts[GTOIL] >= 0 || tInts[GTOILFLUID] >= 0)
- chunkData.put(event.getChunk().getChunkCoordIntPair(), tInts);
- } else if (tInts[GTMETADATA] == NOT_LOADED) {//was NOT loaded from chunk save game data
- //NOT LOADED but generated
- //append load
- if (event.getData().getByte("GTOILVER") == oilVer) {
- if (tInts[GTOIL] < 0 && event.getData().hasKey("GTOIL"))//if was not yet initialized
- tInts[GTOIL] = event.getData().getInteger("GTOIL");
-
- if (tInts[GTOILFLUID] < 0 && event.getData().hasKey("GTOILFLUID"))//if was not yet initialized
- tInts[GTOILFLUID] = event.getData().getInteger("GTOILFLUID");
- } else {
- tInts[GTOIL] = -1;
- tInts[GTOILFLUID] = -1;
- }
-
- tInts[GTPOLLUTION] += event.getData().getInteger("GTPOLLUTION");//Defaults to 0, add stored pollution to data
- tInts[GTMETADATA] = LOADED;//mark as = loaded
- //store in HASHMAP
-
- chunkData.put(event.getChunk().getChunkCoordIntPair(), tInts);
- }//else if(tInts[0]==1){
- ////Already loaded chunk data
- ////DO NOTHING - this chunk data was already loaded and stored in hash map
- //}
- }
-
- @SubscribeEvent
- public void onBlockBreakSpeedEvent(PlayerEvent.BreakSpeed aEvent)
- {
- if (aEvent.newSpeed > 0.0F)
- {
- if (aEvent.entityPlayer != null)
- {
- ItemStack aStack = aEvent.entityPlayer.getCurrentEquippedItem();
- if ((aStack != null) && ((aStack.getItem() instanceof GT_MetaGenerated_Tool))) {
- aEvent.newSpeed = ((GT_MetaGenerated_Tool)aStack.getItem()).onBlockBreakSpeedEvent(aEvent.newSpeed, aStack, aEvent.entityPlayer, aEvent.block, aEvent.x, aEvent.y, aEvent.z, (byte)aEvent.metadata, aEvent);
- }
- }
- }
- }
-
- public static class OreDictEventContainer {
- public final OreDictionary.OreRegisterEvent mEvent;
- public final OrePrefixes mPrefix;
- public final Materials mMaterial;
- public final String mModID;
-
- public OreDictEventContainer(OreDictionary.OreRegisterEvent aEvent, OrePrefixes aPrefix, Materials aMaterial, String aModID) {
- this.mEvent = aEvent;
- this.mPrefix = aPrefix;
- this.mMaterial = aMaterial;
- this.mModID = ((aModID == null) || (aModID.equals("UNKNOWN")) ? null : aModID);
- }
- }
-
- @SubscribeEvent
- public void onBlockEvent(BlockEvent event) {
- if (event.block.getUnlocalizedName().equals("blockAlloyGlass"))
- GregTech_API.causeMachineUpdate(event.world, event.x, event.y, event.z);
- }
-}
+package gregtech.common;
+
+import cpw.mods.fml.common.*;
+import cpw.mods.fml.common.eventhandler.Event.Result;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import cpw.mods.fml.common.gameevent.TickEvent;
+import cpw.mods.fml.common.network.FMLNetworkEvent;
+import cpw.mods.fml.common.network.IGuiHandler;
+import cpw.mods.fml.common.network.NetworkRegistry;
+import cpw.mods.fml.common.registry.GameRegistry;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.*;
+import gregtech.api.enums.TC_Aspects.TC_AspectStack;
+import gregtech.api.interfaces.IProjectileItem;
+import gregtech.api.interfaces.internal.IGT_Mod;
+import gregtech.api.interfaces.internal.IThaumcraftCompat;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.items.GT_MetaGenerated_Item;
+import gregtech.api.items.GT_MetaGenerated_Tool;
+import gregtech.api.net.GT_Packet_Pollution;
+import gregtech.api.objects.*;
+import gregtech.api.util.*;
+import gregtech.common.entities.GT_Entity_Arrow;
+import gregtech.common.items.GT_MetaGenerated_Tool_01;
+import gregtech.common.items.armor.ModularArmor_Item;
+import gregtech.common.items.armor.gui.*;
+import net.minecraft.enchantment.Enchantment;
+import net.minecraft.enchantment.EnchantmentHelper;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.monster.EntityEnderman;
+import net.minecraft.entity.monster.EntitySkeleton;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.entity.projectile.EntityArrow;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemBow;
+import net.minecraft.item.ItemStack;
+import net.minecraft.item.crafting.CraftingManager;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.potion.Potion;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.DamageSource;
+import net.minecraft.world.ChunkCoordIntPair;
+import net.minecraft.world.World;
+import net.minecraft.world.WorldSettings.GameType;
+import net.minecraft.world.gen.feature.WorldGenMinable;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.ForgeEventFactory;
+import net.minecraftforge.event.entity.EntityJoinWorldEvent;
+import net.minecraftforge.event.entity.living.EnderTeleportEvent;
+import net.minecraftforge.event.entity.player.ArrowLooseEvent;
+import net.minecraftforge.event.entity.player.ArrowNockEvent;
+import net.minecraftforge.event.entity.player.PlayerEvent;
+import net.minecraftforge.event.entity.player.PlayerInteractEvent;
+import net.minecraftforge.event.terraingen.OreGenEvent;
+import net.minecraftforge.event.world.BlockEvent;
+import net.minecraftforge.event.world.ChunkDataEvent;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidContainerRegistry;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.oredict.OreDictionary;
+import net.minecraftforge.oredict.RecipeSorter;
+import net.minecraftforge.oredict.ShapedOreRecipe;
+import net.minecraftforge.oredict.ShapelessOreRecipe;
+
+import java.io.File;
+import java.text.DateFormat;
+import java.util.*;
+
+public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
+ private static final EnumSet<OreGenEvent.GenerateMinable.EventType> PREVENTED_ORES = EnumSet.of(OreGenEvent.GenerateMinable.EventType.COAL,
+ new OreGenEvent.GenerateMinable.EventType[]{OreGenEvent.GenerateMinable.EventType.IRON, OreGenEvent.GenerateMinable.EventType.GOLD,
+ OreGenEvent.GenerateMinable.EventType.DIAMOND, OreGenEvent.GenerateMinable.EventType.REDSTONE, OreGenEvent.GenerateMinable.EventType.LAPIS,
+ OreGenEvent.GenerateMinable.EventType.QUARTZ});
+ public final HashSet<ItemStack> mRegisteredOres = new HashSet<ItemStack>(10000);
+ public final ArrayList<String> mSoundNames = new ArrayList<String>();
+ public final ArrayList<ItemStack> mSoundItems = new ArrayList<ItemStack>();
+ public final ArrayList<Integer> mSoundCounts = new ArrayList<Integer>();
+ private final Collection<OreDictEventContainer> mEvents = new HashSet<OreDictEventContainer>();
+ private final Collection<String> mIgnoredItems = new HashSet<String>(Arrays.asList(new String[]{"itemGhastTear", "itemFlint", "itemClay", "itemBucketSaltWater",
+ "itemBucketFreshWater", "itemBucketWater", "itemRock", "itemReed", "itemArrow", "itemSaw", "itemKnife", "itemHammer", "itemChisel", "itemRubber",
+ "itemEssence", "itemIlluminatedPanel", "itemSkull", "itemRawRubber", "itemBacon", "itemJetpackAccelerator", "itemLazurite", "itemIridium",
+ "itemTear", "itemClaw", "itemFertilizer", "itemTar", "itemSlimeball", "itemCoke", "itemBeeswax", "itemBeeQueen", "itemForcicium", "itemForcillium",
+ "itemRoyalJelly", "itemHoneydew", "itemHoney", "itemPollen", "itemReedTypha", "itemSulfuricAcid", "itemPotash", "itemCompressedCarbon",
+ "itemBitumen", "itemBioFuel", "itemCokeSugar", "itemCokeCactus", "itemCharcoalSugar", "itemCharcoalCactus", "itemSludge", "itemEnrichedAlloy",
+ "itemQuicksilver", "itemMercury", "itemOsmium", "itemUltimateCircuit", "itemEnergizedStar", "itemAntimatterMolecule", "itemAntimatterGlob",
+ "itemCoal", "itemBoat", "itemHerbalMedicineCake", "itemCakeSponge", "itemFishandPumpkinCakeSponge", "itemSoulCleaver", "itemInstantCake",
+ "itemWhippingCream", "itemGlisteningWhippingCream", "itemCleaver", "itemHerbalMedicineWhippingCream", "itemStrangeWhippingCream",
+ "itemBlazeCleaver", "itemBakedCakeSponge", "itemMagmaCake", "itemGlisteningCake", "itemOgreCleaver", "itemFishandPumpkinCake",
+ "itemMagmaWhippingCream", "itemMultimeter", "itemSuperconductor"}));
+ private final Collection<String> mIgnoredNames = new HashSet<String>(Arrays.asList(new String[]{"grubBee", "chainLink", "candyCane", "bRedString", "bVial",
+ "bFlask", "anorthositeSmooth", "migmatiteSmooth", "slateSmooth", "travertineSmooth", "limestoneSmooth", "orthogneissSmooth", "marbleSmooth",
+ "honeyDrop", "lumpClay", "honeyEqualssugar", "flourEqualswheat", "bluestoneInsulated", "blockWaterstone", "blockSand", "blockTorch",
+ "blockPumpkin", "blockClothRock", "blockStainedHardenedClay", "blockQuartzPillar", "blockQuartzChiselled", "blockSpawner", "blockCloth", "mobHead",
+ "mobEgg", "enderFlower", "enderChest", "clayHardened", "dayGemMaterial", "nightGemMaterial", "snowLayer", "bPlaceholder", "hardenedClay",
+ "eternalLifeEssence", "sandstone", "wheatRice", "transdimBlock", "bambooBasket", "lexicaBotania", "livingwoodTwig", "redstoneCrystal",
+ "pestleAndMortar", "glowstone", "whiteStone", "stoneSlab", "transdimBlock", "clayBowl", "clayPlate", "ceramicBowl", "ceramicPlate", "ovenRack",
+ "clayCup", "ceramicCup", "batteryBox", "transmutationStone", "torchRedstoneActive", "coal", "charcoal", "cloth", "cobblestoneSlab",
+ "stoneBrickSlab", "cobblestoneWall", "stoneBrickWall", "cobblestoneStair", "stoneBrickStair", "blockCloud", "blockDirt", "blockTyrian",
+ "blockCarpet", "blockFft", "blockLavastone", "blockHolystone", "blockConcrete", "sunnariumPart", "brSmallMachineCyaniteProcessor", "meteoriteCoal",
+ "blockCobble", "pressOreProcessor", "crusherOreProcessor", "grinderOreProcessor", "blockRubber", "blockHoney", "blockHoneydew", "blockPeat",
+ "blockRadioactive", "blockSlime", "blockCocoa", "blockSugarCane", "blockLeather", "blockClayBrick", "solarPanelHV", "cableRedNet", "stoneBowl",
+ "crafterWood", "taintedSoil", "brickXyEngineering", "breederUranium", "wireMill", "chunkLazurite", "aluminumNatural", "aluminiumNatural",
+ "naturalAluminum", "naturalAluminium", "antimatterMilligram", "antimatterGram", "strangeMatter", "coalGenerator", "electricFurnace",
+ "unfinishedTank", "valvePart", "aquaRegia", "leatherSeal", "leatherSlimeSeal", "hambone", "slimeball", "clay", "enrichedUranium", "camoPaste",
+ "antiBlock", "burntQuartz", "salmonRaw", "blockHopper", "blockEnderObsidian", "blockIcestone", "blockMagicWood", "blockEnderCore", "blockHeeEndium",
+ "oreHeeEndPowder", "oreHeeStardust", "oreHeeIgneousRock", "oreHeeInstabilityOrb", "crystalPureFluix", "shardNether", "gemFluorite",
+ "stickObsidian", "caveCrystal", "shardCrystal", "dyeCrystal","shardFire","shardWater","shardAir","shardEarth","ingotRefinedIron","blockMarble","ingotUnstable"}));
+ private final Collection<String> mInvalidNames = new HashSet<String>(Arrays.asList(new String[]{"diamondShard", "redstoneRoot", "obsidianStick", "bloodstoneOre",
+ "universalCable", "bronzeTube", "ironTube", "netherTube", "obbyTube", "infiniteBattery", "eliteBattery", "advancedBattery", "10kEUStore",
+ "blueDye", "MonazitOre", "quartzCrystal", "whiteLuminiteCrystal", "darkStoneIngot", "invisiumIngot", "demoniteOrb", "enderGem", "starconiumGem",
+ "osmoniumIngot", "tapaziteGem", "zectiumIngot", "foolsRubyGem", "rubyGem", "meteoriteGem", "adamiteShard", "sapphireGem", "copperIngot",
+ "ironStick", "goldStick", "diamondStick", "reinforcedStick", "draconicStick", "emeraldStick", "copperStick", "tinStick", "silverStick",
+ "bronzeStick", "steelStick", "leadStick", "manyullynStick", "arditeStick", "cobaltStick", "aluminiumStick", "alumiteStick", "oilsandsOre",
+ "copperWire", "superconductorWire", "sulfuricAcid", "conveyorBelt", "ironWire", "aluminumWire", "aluminiumWire", "silverWire", "tinWire",
+ "dustSiliconSmall", "AluminumOre", "plateHeavyT2", "blockWool", "alloyPlateEnergizedHardened", "gasWood", "alloyPlateEnergized", "SilverOre",
+ "LeadOre", "TinOre", "CopperOre", "silverOre", "leadOre", "tinOre", "copperOre", "bauxiteOre", "HSLivingmetalIngot", "oilMoving", "oilStill",
+ "oilBucket", "petroleumOre", "dieselFuel", "diamondNugget", "planks", "wood", "stick", "sticks", "naquadah", "obsidianRod", "stoneRod",
+ "thaumiumRod", "steelRod", "netherrackRod", "woodRod", "ironRod", "cactusRod", "flintRod", "copperRod", "cobaltRod", "alumiteRod", "blueslimeRod",
+ "arditeRod", "manyullynRod", "bronzeRod", "boneRod", "slimeRod", "redalloyBundled", "bluestoneBundled", "infusedteslatiteInsulated",
+ "redalloyInsulated", "infusedteslatiteBundled"}));
+ private final DateFormat mDateFormat = DateFormat.getInstance();
+ public ArrayList<String> mBufferedPlayerActivity = new ArrayList();
+ public boolean mHardcoreCables = false;
+ public boolean mDisableVanillaOres = true;
+ public boolean mNerfDustCrafting = true;
+ public boolean mSortToTheEnd = true;
+ public boolean mCraftingUnification = true;
+ public boolean mInventoryUnification = true;
+ public boolean mIncreaseDungeonLoot = true;
+ public boolean mAxeWhenAdventure = true;
+ public boolean mSurvivalIntoAdventure = false;
+ public boolean mNerfedWoodPlank = true;
+ public boolean mNerfedVanillaTools = true;
+ public boolean mHardRock = false;
+ public boolean mHungerEffect = true;
+ public boolean mOnline = true;
+ public boolean mIgnoreTcon = true;
+ public boolean mDisableIC2Cables = false;
+ public boolean mAchievements = true;
+ public boolean mAE2Integration = true;
+ public boolean mArcSmeltIntoAnnealed = true;
+ public boolean mMagneticraftRecipes = true;
+ public boolean mImmersiveEngineeringRecipes = true;
+ private boolean isFirstServerWorldTick = true;
+ private boolean mOreDictActivated = false;
+ public boolean mChangeHarvestLevels=false;
+ public boolean mNerfedCombs = true;
+ public boolean mNerfedCrops = true;
+ public boolean mGTBees = true;
+ public boolean mHideUnusedOres = true;
+ public boolean mHideRecyclingRecipes = true;
+ public boolean mPollution = true;
+ public boolean mExplosionItemDrop = false;
+ public int mSkeletonsShootGTArrows = 16;
+ public int mMaxEqualEntitiesAtOneSpot = 3;
+ public int mFlintChance = 30;
+ public int mItemDespawnTime = 6000;
+ public int mUpgradeCount = 4;
+ public int[] mHarvestLevel= new int[1000];
+ public int mGraniteHavestLevel=3;
+ public int mMaxHarvestLevel=7;
+ public int mWireHeatingTicks = 4;
+ public int mPollutionSmogLimit = 550000;
+ public int mPollutionPoisonLimit = 750000;
+ public int mPollutionVegetationLimit = 1000000;
+ public int mPollutionSourRainLimit = 2000000;
+ public final GT_UO_DimensionList mUndergroundOil = new GT_UO_DimensionList();
+ public int mTicksUntilNextCraftSound = 0;
+ public double mMagneticraftBonusOutputPercent = 100.0d;
+ private World mUniverse = null;
+ private final String aTextThermalExpansion = "ThermalExpansion";
+ private final String aTextRailcraft = "Railcraft";
+ private final String aTextTwilightForest = "TwilightForest";
+ private final String aTextForestry = "Forestry";
+ private final String aTextArsmagica2 = "arsmagica2";
+ public boolean mTEMachineRecipes = false;
+ public boolean mEnableAllMaterials = false;
+ public boolean mEnableAllComponents = false;
+ public boolean mAddGTRecipesToIC2Machines = true;
+ public boolean mEnableCleanroom = true;
+ public boolean mLowGravProcessing = false;
+ public boolean mAprilFool = false;
+ public boolean mCropNeedBlock = true;
+ public boolean mDisableOldChemicalRecipes = false;
+ public boolean mAMHInteraction = true;
+ public boolean mForceFreeFace = true;
+ public boolean mBrickedBlastFurnace = true;
+ public boolean mEasierIVPlusCables = false;
+ public boolean mMixedOreOnlyYieldsTwoThirdsOfPureOre = false;
+ public boolean enableBlackGraniteOres = true;
+ public boolean enableRedGraniteOres = true;
+ public boolean enableMarbleOres = true;
+ public boolean enableBasaltOres = true;
+ public boolean gt6Pipe = true;
+ public boolean gt6Cable = true;
+ public boolean costlyCableConnection = false;
+
+ public GT_Proxy() {
+ GameRegistry.registerFuelHandler(this);
+ MinecraftForge.EVENT_BUS.register(this);
+ MinecraftForge.ORE_GEN_BUS.register(this);
+ FMLCommonHandler.instance().bus().register(this);
+ GregTech_API.sThaumcraftCompat = (IThaumcraftCompat) GT_Utility.callConstructor("gregtech.common.GT_ThaumcraftCompat", 0, null, GT_Values.D1,
+ new Object[0]);
+ for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
+ onFluidContainerRegistration(new FluidContainerRegistry.FluidContainerRegisterEvent(tData));
+ }
+ try {
+ for (String tOreName : OreDictionary.getOreNames()) {
+ ItemStack tOreStack;
+ for (Iterator i$ = OreDictionary.getOres(tOreName).iterator(); i$.hasNext(); registerOre(new OreDictionary.OreRegisterEvent(tOreName, tOreStack))) {
+ tOreStack = (ItemStack) i$.next();
+ }
+ }
+ } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
+ }
+
+ private static final void registerRecipes(OreDictEventContainer aOre) {
+ if ((aOre.mEvent.Ore == null) || (aOre.mEvent.Ore.getItem() == null)) {
+ return;
+ }
+ if (aOre.mEvent.Ore.stackSize != 1) {
+ aOre.mEvent.Ore.stackSize = 1;
+ }
+ if (aOre.mPrefix != null) {
+ if (!aOre.mPrefix.isIgnored(aOre.mMaterial)) {
+ aOre.mPrefix.processOre(aOre.mMaterial == null ? Materials._NULL : aOre.mMaterial, aOre.mEvent.Name, aOre.mModID,
+ GT_Utility.copyAmount(1L, new Object[]{aOre.mEvent.Ore}));
+ }
+ } else {
+// System.out.println("Thingy Name: "+ aOre.mEvent.Name+ " !!!Unknown 'Thingy' detected!!! This Object seems to probably not follow a valid OreDictionary Convention, or I missed a Convention. Please report to GregTech Intergalactical for additional compatiblity. This is not an Error, an Issue nor a Lag Source, it is just an Information, which you should pass to me.");
+ }
+ }
+
+ public void onPreLoad() {
+ GT_Log.out.println("GT_Mod: Preload-Phase started!");
+ GT_Log.ore.println("GT_Mod: Preload-Phase started!");
+
+ GregTech_API.sPreloadStarted = true;
+ this.mIgnoreTcon = GregTech_API.sOPStuff.get(ConfigCategories.general, "ignoreTConstruct", true);
+ this.mWireHeatingTicks = GregTech_API.sOPStuff.get(ConfigCategories.general, "WireHeatingTicks", 4);
+ NetworkRegistry.INSTANCE.registerGuiHandler(GT_Values.GT, this);
+ for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
+ if ((tData.filledContainer.getItem() == Items.potionitem) && (tData.filledContainer.getItemDamage() == 0)) {
+ tData.fluid.amount = 0;
+ break;
+ }
+ }
+ GT_Log.out.println("GT_Mod: Getting required Items of other Mods.");
+ ItemList.TE_Slag.set(GT_ModHandler.getModItem(aTextThermalExpansion, "slag", 1L));
+ ItemList.TE_Slag_Rich.set(GT_ModHandler.getModItem(aTextThermalExpansion, "slagRich", 1L));
+ ItemList.TE_Rockwool.set(GT_ModHandler.getModItem(aTextThermalExpansion, "rockwool", 1L));
+ ItemList.TE_Hardened_Glass.set(GT_ModHandler.getModItem(aTextThermalExpansion, "glassHardened", 1L));
+
+ ItemList.RC_ShuntingWire.set(GT_ModHandler.getModItem(aTextRailcraft, "tile.railcraft.machine.delta", 1L, 0));
+ ItemList.RC_ShuntingWireFrame.set(GT_ModHandler.getModItem(aTextRailcraft, "tile.railcraft.frame", 1L, 0));
+ ItemList.RC_Rail_Standard.set(GT_ModHandler.getModItem(aTextRailcraft, "part.rail", 1L, 0));
+ ItemList.RC_Rail_Adv.set(GT_ModHandler.getModItem(aTextRailcraft, "part.rail", 1L, 1));
+ ItemList.RC_Rail_Wooden.set(GT_ModHandler.getModItem(aTextRailcraft, "part.rail", 1L, 2));
+ ItemList.RC_Rail_HS.set(GT_ModHandler.getModItem(aTextRailcraft, "part.rail", 1L, 3));
+ ItemList.RC_Rail_Reinforced.set(GT_ModHandler.getModItem(aTextRailcraft, "part.rail", 1L, 4));
+ ItemList.RC_Rail_Electric.set(GT_ModHandler.getModItem(aTextRailcraft, "part.rail", 1L, 5));
+ ItemList.RC_Tie_Wood.set(GT_ModHandler.getModItem(aTextRailcraft, "part.tie", 1L, 0));
+ ItemList.RC_Tie_Stone.set(GT_ModHandler.getModItem(aTextRailcraft, "part.tie", 1L, 1));
+ ItemList.RC_Bed_Wood.set(GT_ModHandler.getModItem(aTextRailcraft, "part.railbed", 1L, 0));
+ ItemList.RC_Bed_Stone.set(GT_ModHandler.getModItem(aTextRailcraft, "part.railbed", 1L, 1));
+ ItemList.RC_Rebar.set(GT_ModHandler.getModItem(aTextRailcraft, "part.rebar", 1L));
+ ItemList.Tool_Sword_Steel.set(GT_ModHandler.getModItem(aTextRailcraft, "tool.steel.sword", 1L));
+ ItemList.Tool_Pickaxe_Steel.set(GT_ModHandler.getModItem(aTextRailcraft, "tool.steel.pickaxe", 1L));
+ ItemList.Tool_Shovel_Steel.set(GT_ModHandler.getModItem(aTextRailcraft, "tool.steel.shovel", 1L));
+ ItemList.Tool_Axe_Steel.set(GT_ModHandler.getModItem(aTextRailcraft, "tool.steel.axe", 1L));
+ ItemList.Tool_Hoe_Steel.set(GT_ModHandler.getModItem(aTextRailcraft, "tool.steel.hoe", 1L));
+
+ ItemList.TF_LiveRoot.set(GT_ModHandler.getModItem(aTextTwilightForest, "item.liveRoot", 1L, 0));
+ ItemList.TF_Vial_FieryBlood.set(GT_ModHandler.getModItem(aTextTwilightForest, "item.fieryBlood", 1L));
+ ItemList.TF_Vial_FieryTears.set(GT_ModHandler.getModItem(aTextTwilightForest, "item.fieryTears", 1L));
+
+ ItemList.FR_Lemon.set(GT_ModHandler.getModItem(aTextForestry, "fruits", 1L, 3));
+ ItemList.FR_Mulch.set(GT_ModHandler.getModItem(aTextForestry, "mulch", 1L));
+ ItemList.FR_Fertilizer.set(GT_ModHandler.getModItem(aTextForestry, "fertilizerCompound", 1L));
+ ItemList.FR_Compost.set(GT_ModHandler.getModItem(aTextForestry, "fertilizerBio", 1L));
+ ItemList.FR_Silk.set(GT_ModHandler.getModItem(aTextForestry, "craftingMaterial", 1L, 2));
+ ItemList.FR_Wax.set(GT_ModHandler.getModItem(aTextForestry, "beeswax", 1L));
+ ItemList.FR_WaxCapsule.set(GT_ModHandler.getModItem(aTextForestry, "waxCapsule", 1L));
+ ItemList.FR_RefractoryWax.set(GT_ModHandler.getModItem(aTextForestry, "refractoryWax", 1L));
+ ItemList.FR_RefractoryCapsule.set(GT_ModHandler.getModItem(aTextForestry, "refractoryEmpty", 1L));
+ ItemList.FR_Bee_Drone.set(GT_ModHandler.getModItem(aTextForestry, "beeDroneGE", 1L));
+ ItemList.FR_Bee_Princess.set(GT_ModHandler.getModItem(aTextForestry, "beePrincessGE", 1L));
+ ItemList.FR_Bee_Queen.set(GT_ModHandler.getModItem(aTextForestry, "beeQueenGE", 1L));
+ ItemList.FR_Tree_Sapling.set(GT_ModHandler.getModItem(aTextForestry, "sapling", 1L, GT_ModHandler.getModItem(aTextForestry, "saplingGE", 1L)));
+ ItemList.FR_Butterfly.set(GT_ModHandler.getModItem(aTextForestry, "butterflyGE", 1L));
+ ItemList.FR_Larvae.set(GT_ModHandler.getModItem(aTextForestry, "beeLarvaeGE", 1L));
+ ItemList.FR_Serum.set(GT_ModHandler.getModItem(aTextForestry, "serumGE", 1L));
+ ItemList.FR_Caterpillar.set(GT_ModHandler.getModItem(aTextForestry, "caterpillarGE", 1L));
+ ItemList.FR_PollenFertile.set(GT_ModHandler.getModItem(aTextForestry, "pollenFertile", 1L));
+ ItemList.FR_Stick.set(GT_ModHandler.getModItem(aTextForestry, "oakStick", 1L));
+ ItemList.FR_Casing_Impregnated.set(GT_ModHandler.getModItem(aTextForestry, "impregnatedCasing", 1L));
+ ItemList.FR_Casing_Sturdy.set(GT_ModHandler.getModItem(aTextForestry, "sturdyMachine", 1L));
+ ItemList.FR_Casing_Hardened.set(GT_ModHandler.getModItem(aTextForestry, "hardenedMachine", 1L));
+
+ ItemList.Bottle_Empty.set(new ItemStack(Items.glass_bottle, 1));
+
+ ItemList.Cell_Universal_Fluid.set(GT_ModHandler.getIC2Item("FluidCell", 1L));
+ ItemList.Cell_Empty.set(GT_ModHandler.getIC2Item("cell", 1L, GT_ModHandler.getIC2Item("cellEmpty", 1L, GT_ModHandler.getIC2Item("emptyCell", 1L))));
+ ItemList.Cell_Water.set(GT_ModHandler.getIC2Item("waterCell", 1L, GT_ModHandler.getIC2Item("cellWater", 1L)));
+ ItemList.Cell_Lava.set(GT_ModHandler.getIC2Item("lavaCell", 1L, GT_ModHandler.getIC2Item("cellLava", 1L)));
+ ItemList.Cell_Air.set(GT_ModHandler.getIC2Item("airCell", 1L, GT_ModHandler.getIC2Item("cellAir", 1L, GT_ModHandler.getIC2Item("cellOxygen", 1L))));
+
+ ItemList.IC2_Item_Casing_Iron.set(GT_ModHandler.getIC2Item("casingiron", 1L));
+ ItemList.IC2_Item_Casing_Gold.set(GT_ModHandler.getIC2Item("casinggold", 1L));
+ ItemList.IC2_Item_Casing_Bronze.set(GT_ModHandler.getIC2Item("casingbronze", 1L));
+ ItemList.IC2_Item_Casing_Copper.set(GT_ModHandler.getIC2Item("casingcopper", 1L));
+ ItemList.IC2_Item_Casing_Tin.set(GT_ModHandler.getIC2Item("casingtin", 1L));
+ ItemList.IC2_Item_Casing_Lead.set(GT_ModHandler.getIC2Item("casinglead", 1L));
+ ItemList.IC2_Item_Casing_Steel.set(GT_ModHandler.getIC2Item("casingadviron", 1L));
+ ItemList.IC2_Spray_WeedEx.set(GT_ModHandler.getIC2Item("weedEx", 1L));
+ ItemList.IC2_Fuel_Can_Empty.set(GT_ModHandler.getIC2Item("fuelCan", 1L, GT_ModHandler.getIC2Item("fuelCanEmpty", 1L, GT_ModHandler.getIC2Item("emptyFuelCan", 1L))));
+ ItemList.IC2_Fuel_Can_Filled.set(GT_ModHandler.getIC2Item("filledFuelCan", 1L));
+ ItemList.IC2_Mixed_Metal_Ingot.set(GT_ModHandler.getIC2Item("mixedMetalIngot", 1L));
+ ItemList.IC2_Fertilizer.set(GT_ModHandler.getIC2Item("fertilizer", 1L));
+ ItemList.IC2_CoffeeBeans.set(GT_ModHandler.getIC2Item("coffeeBeans", 1L));
+ ItemList.IC2_CoffeePowder.set(GT_ModHandler.getIC2Item("coffeePowder", 1L));
+ ItemList.IC2_Hops.set(GT_ModHandler.getIC2Item("hops", 1L));
+ ItemList.IC2_Resin.set(GT_ModHandler.getIC2Item("resin", 1L));
+ ItemList.IC2_Plantball.set(GT_ModHandler.getIC2Item("plantBall", 1L));
+ ItemList.IC2_PlantballCompressed.set(GT_ModHandler.getIC2Item("compressedPlantBall", 1L, ItemList.IC2_Plantball.get(1L, new Object[0])));
+ ItemList.IC2_Crop_Seeds.set(GT_ModHandler.getIC2Item("cropSeed", 1L));
+ ItemList.IC2_Grin_Powder.set(GT_ModHandler.getIC2Item("grinPowder", 1L));
+ ItemList.IC2_Energium_Dust.set(GT_ModHandler.getIC2Item("energiumDust", 1L));
+ ItemList.IC2_Scrap.set(GT_ModHandler.getIC2Item("scrap", 1L));
+ ItemList.IC2_Scrapbox.set(GT_ModHandler.getIC2Item("scrapBox", 1L));
+ ItemList.IC2_Fuel_Rod_Empty.set(GT_ModHandler.getIC2Item("fuelRod", 1L));
+ ItemList.IC2_Food_Can_Empty.set(GT_ModHandler.getIC2Item("tinCan", 1L));
+ ItemList.IC2_Food_Can_Filled.set(GT_ModHandler.getIC2Item("filledTinCan", 1L, 0));
+ ItemList.IC2_Food_Can_Spoiled.set(GT_ModHandler.getIC2Item("filledTinCan", 1L, 1));
+ ItemList.IC2_Industrial_Diamond.set(GT_ModHandler.getIC2Item("industrialDiamond", 1L, new ItemStack(Items.diamond, 1)));
+ ItemList.IC2_Compressed_Coal_Ball.set(GT_ModHandler.getIC2Item("compressedCoalBall", 1L));
+ ItemList.IC2_Compressed_Coal_Chunk.set(GT_ModHandler.getIC2Item("coalChunk", 1L));
+ ItemList.IC2_ShaftIron.set(GT_ModHandler.getIC2Item("ironshaft", 1L));
+ ItemList.IC2_ShaftSteel.set(GT_ModHandler.getIC2Item("steelshaft", 1L));
+
+ ItemList.IC2_SuBattery.set(GT_ModHandler.getIC2Item("suBattery", 1L));
+ ItemList.IC2_ReBattery.set(GT_ModHandler.getIC2Item("reBattery", 1L));
+ ItemList.IC2_AdvBattery.set(GT_ModHandler.getIC2Item("advBattery", 1L));
+ ItemList.IC2_EnergyCrystal.set(GT_ModHandler.getIC2Item("energyCrystal", 1L));
+ ItemList.IC2_LapotronCrystal.set(GT_ModHandler.getIC2Item("lapotronCrystal", 1L));
+
+ ItemList.Tool_Sword_Bronze.set(GT_ModHandler.getIC2Item("bronzeSword", 1L));
+ ItemList.Tool_Pickaxe_Bronze.set(GT_ModHandler.getIC2Item("bronzePickaxe", 1L));
+ ItemList.Tool_Shovel_Bronze.set(GT_ModHandler.getIC2Item("bronzeShovel", 1L));
+ ItemList.Tool_Axe_Bronze.set(GT_ModHandler.getIC2Item("bronzeAxe", 1L));
+ ItemList.Tool_Hoe_Bronze.set(GT_ModHandler.getIC2Item("bronzeHoe", 1L));
+ ItemList.IC2_ForgeHammer.set(GT_ModHandler.getIC2Item("ForgeHammer", 1L));
+ ItemList.IC2_WireCutter.set(GT_ModHandler.getIC2Item("cutter", 1L));
+
+ ItemList.Credit_Iron.set(GT_ModHandler.getIC2Item("coin", 1L));
+
+ ItemList.Circuit_Basic.set(GT_ModHandler.getIC2Item("electronicCircuit", 1L));
+ ItemList.Circuit_Advanced.set(GT_ModHandler.getIC2Item("advancedCircuit", 1L));
+
+ ItemList.Upgrade_Overclocker.set(GT_ModHandler.getIC2Item("overclockerUpgrade", 1L));
+ ItemList.Upgrade_Battery.set(GT_ModHandler.getIC2Item("energyStorageUpgrade", 1L));
+
+ ItemList.Dye_Bonemeal.set(new ItemStack(Items.dye, 1, 15));
+ ItemList.Dye_SquidInk.set(new ItemStack(Items.dye, 1, 0));
+ ItemList.Dye_Cocoa.set(new ItemStack(Items.dye, 1, 3));
+
+ ItemList.Book_Written_00.set(new ItemStack(Items.written_book, 1, 0));
+
+ ItemList.Food_Baked_Bread.set(new ItemStack(Items.bread, 1, 0));
+ ItemList.Food_Raw_Potato.set(new ItemStack(Items.potato, 1, 0));
+ ItemList.Food_Baked_Potato.set(new ItemStack(Items.baked_potato, 1, 0));
+ ItemList.Food_Poisonous_Potato.set(new ItemStack(Items.poisonous_potato, 1, 0));
+
+ OrePrefixes.bottle.mContainerItem = ItemList.Bottle_Empty.get(1L, new Object[0]);
+ OrePrefixes.bucket.mContainerItem = new ItemStack(Items.bucket, 1);
+ OrePrefixes.cellPlasma.mContainerItem = ItemList.Cell_Empty.get(1L, new Object[0]);
+ OrePrefixes.cell.mContainerItem = ItemList.Cell_Empty.get(1L, new Object[0]);
+
+ GregTech_API.sFrostHazmatList.add(GT_ModHandler.getIC2Item("hazmatHelmet", 1L, 32767));
+ GregTech_API.sFrostHazmatList.add(GT_ModHandler.getIC2Item("hazmatChestplate", 1L, 32767));
+ GregTech_API.sFrostHazmatList.add(GT_ModHandler.getIC2Item("hazmatLeggings", 1L, 32767));
+ GregTech_API.sFrostHazmatList.add(GT_ModHandler.getIC2Item("hazmatBoots", 1L, 32767));
+
+ GregTech_API.sHeatHazmatList.add(GT_ModHandler.getIC2Item("hazmatHelmet", 1L, 32767));
+ GregTech_API.sHeatHazmatList.add(GT_ModHandler.getIC2Item("hazmatChestplate", 1L, 32767));
+ GregTech_API.sHeatHazmatList.add(GT_ModHandler.getIC2Item("hazmatLeggings", 1L, 32767));
+ GregTech_API.sHeatHazmatList.add(GT_ModHandler.getIC2Item("hazmatBoots", 1L, 32767));
+
+ GregTech_API.sBioHazmatList.add(GT_ModHandler.getIC2Item("hazmatHelmet", 1L, 32767));
+ GregTech_API.sBioHazmatList.add(GT_ModHandler.getIC2Item("hazmatChestplate", 1L, 32767));
+ GregTech_API.sBioHazmatList.add(GT_ModHandler.getIC2Item("hazmatLeggings", 1L, 32767));
+ GregTech_API.sBioHazmatList.add(GT_ModHandler.getIC2Item("hazmatBoots", 1L, 32767));
+
+ GregTech_API.sGasHazmatList.add(GT_ModHandler.getIC2Item("hazmatHelmet", 1L, 32767));
+ GregTech_API.sGasHazmatList.add(GT_ModHandler.getIC2Item("hazmatChestplate", 1L, 32767));
+ GregTech_API.sGasHazmatList.add(GT_ModHandler.getIC2Item("hazmatLeggings", 1L, 32767));
+ GregTech_API.sGasHazmatList.add(GT_ModHandler.getIC2Item("hazmatBoots", 1L, 32767));
+
+ GregTech_API.sRadioHazmatList.add(GT_ModHandler.getIC2Item("hazmatHelmet", 1L, 32767));
+ GregTech_API.sRadioHazmatList.add(GT_ModHandler.getIC2Item("hazmatChestplate", 1L, 32767));
+ GregTech_API.sRadioHazmatList.add(GT_ModHandler.getIC2Item("hazmatLeggings", 1L, 32767));
+ GregTech_API.sRadioHazmatList.add(GT_ModHandler.getIC2Item("hazmatBoots", 1L, 32767));
+
+ GregTech_API.sElectroHazmatList.add(GT_ModHandler.getIC2Item("hazmatHelmet", 1L, 32767));
+ GregTech_API.sElectroHazmatList.add(GT_ModHandler.getIC2Item("hazmatChestplate", 1L, 32767));
+ GregTech_API.sElectroHazmatList.add(GT_ModHandler.getIC2Item("hazmatLeggings", 1L, 32767));
+ GregTech_API.sElectroHazmatList.add(GT_ModHandler.getIC2Item("hazmatBoots", 1L, 32767));
+ GregTech_API.sElectroHazmatList.add(new ItemStack(Items.chainmail_helmet, 1, 32767));
+ GregTech_API.sElectroHazmatList.add(new ItemStack(Items.chainmail_chestplate, 1, 32767));
+ GregTech_API.sElectroHazmatList.add(new ItemStack(Items.chainmail_leggings, 1, 32767));
+ GregTech_API.sElectroHazmatList.add(new ItemStack(Items.chainmail_boots, 1, 32767));
+
+ GT_ModHandler.sNonReplaceableItems.add(new ItemStack(Items.bow, 1, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(new ItemStack(Items.fishing_rod, 1, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(ItemList.IC2_ForgeHammer.getWithDamage(1L, 32767L, new Object[0]));
+ GT_ModHandler.sNonReplaceableItems.add(ItemList.IC2_WireCutter.getWithDamage(1L, 32767L, new Object[0]));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("painter", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("blackPainter", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("redPainter", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("greenPainter", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("brownPainter", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("bluePainter", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("purplePainter", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("cyanPainter", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("lightGreyPainter", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("darkGreyPainter", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("pinkPainter", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("limePainter", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("yellowPainter", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("cloudPainter", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("magentaPainter", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("orangePainter", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("whitePainter", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("cfPack", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("jetpack", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("treetap", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("weedEx", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("staticBoots", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("compositeArmor", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("hazmatHelmet", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("hazmatChestplate", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("hazmatLeggings", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("hazmatBoots", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextRailcraft, "part.turbine.disk", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextRailcraft, "part.turbine.blade", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextRailcraft, "part.turbine.rotor", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextRailcraft, "borehead.diamond", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextRailcraft, "borehead.steel", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextRailcraft, "borehead.iron", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextTwilightForest, "item.plateNaga", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextTwilightForest, "item.legsNaga", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextTwilightForest, "item.arcticHelm", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextTwilightForest, "item.arcticPlate", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextTwilightForest, "item.arcticLegs", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextTwilightForest, "item.arcticBoots", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextTwilightForest, "item.yetiHelm", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextTwilightForest, "item.yetiPlate", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextTwilightForest, "item.yetiLegs", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextTwilightForest, "item.yetiBoots", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem("appliedenergistics2", "item.ToolCertusQuartzCuttingKnife", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem("appliedenergistics2", "item.ToolNetherQuartzCuttingKnife", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "apiaristHelmet", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "apiaristChest", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "apiaristLegs", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "apiaristBoots", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "frameUntreated", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "frameImpregnated", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "frameProven", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(aTextForestry, "waxCast", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem("GalacticraftCore", "item.sensorGlasses", 1L, 32767));
+ GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem("IC2NuclearControl", "ItemToolThermometer", 1L, 32767));
+
+ RecipeSorter.register("gregtech:shaped", GT_Shaped_Recipe.class, RecipeSorter.Category.SHAPED, "after:minecraft:shaped before:minecraft:shapeless");
+ RecipeSorter.register("gregtech:shapeless", GT_Shapeless_Recipe.class, RecipeSorter.Category.SHAPELESS, "after:minecraft:shapeless");
+ }
+
+ public void onLoad() {
+ GT_Log.out.println("GT_Mod: Beginning Load-Phase.");
+ GT_Log.ore.println("GT_Mod: Beginning Load-Phase.");
+ GT_OreDictUnificator.registerOre("cropChilipepper", GT_ModHandler.getModItem("magicalcrops", "magicalcrops_CropProduce", 1L, 2));
+ GT_OreDictUnificator.registerOre("cropTomato", GT_ModHandler.getModItem("magicalcrops", "magicalcrops_CropProduce", 1L, 8));
+ GT_OreDictUnificator.registerOre("cropGrape", GT_ModHandler.getModItem("magicalcrops", "magicalcrops_CropProduce", 1L, 4));
+ GT_OreDictUnificator.registerOre("cropTea", GT_ModHandler.getModItem("ganyssurface", "teaLeaves", 1L, 0));
+
+ GregTech_API.sLoadStarted = true;
+ for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
+ if ((tData.filledContainer.getItem() == Items.potionitem) && (tData.filledContainer.getItemDamage() == 0)) {
+ tData.fluid.amount = 0;
+ break;
+ }
+ }
+ GT_LanguageManager.writePlaceholderStrings();
+ }
+
+ public static long tBits = GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL | GT_ModHandler.RecipeBits.NOT_REMOVABLE;
+ public void onPostLoad() {
+ GT_Log.out.println("GT_Mod: Beginning PostLoad-Phase.");
+ GT_Log.ore.println("GT_Mod: Beginning PostLoad-Phase.");
+ if (GT_Log.pal != null) {
+ new Thread(new GT_PlayerActivityLogger()).start();
+ }
+ GregTech_API.sPostloadStarted = true;
+ GT_OreDictUnificator.addItemData(new ItemStack(Items.iron_door, 1), new ItemData(Materials.Iron, 21772800L, new MaterialStack[0]));
+ GT_OreDictUnificator.addItemData(new ItemStack(Items.wooden_door, 1, 32767), new ItemData(Materials.Wood, 21772800L, new MaterialStack[0]));
+ for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
+ if ((tData.filledContainer.getItem() == Items.potionitem) && (tData.filledContainer.getItemDamage() == 0)) {
+ tData.fluid.amount = 0;
+ break;
+ }
+ }
+ GT_Log.out.println("GT_Mod: Adding Configs specific for MetaTileEntities");
+ try {
+ for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
+ for (; i < GregTech_API.METATILEENTITIES.length; i++) {
+ if (GregTech_API.METATILEENTITIES[i] != null) {
+ GregTech_API.METATILEENTITIES[i].onConfigLoad(GregTech_API.sMachineFile);
+ }
+ }
+ }
+ } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
+ GT_Log.out.println("GT_Mod: Adding Tool Usage Crafting Recipes for OreDict Items.");
+ for (Materials aMaterial : Materials.values()) {
+ if ((aMaterial.mUnificatable) && (aMaterial.mMaterialInto == aMaterial)) {
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X",
+ 'X', OrePrefixes.crushedCentrifuged.get(aMaterial)});
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X",
+ 'X', OrePrefixes.crystalline.get(aMaterial)});
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X",
+ 'X', OrePrefixes.crystal.get(aMaterial)});
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustPure, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X",
+ 'X', OrePrefixes.crushedPurified.get(aMaterial)});
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustPure, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X",
+ 'X', OrePrefixes.cleanGravel.get(aMaterial)});
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustPure, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X",
+ 'X', OrePrefixes.reduced.get(aMaterial)});
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X",
+ 'X', OrePrefixes.clump.get(aMaterial)});
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X",
+ 'X', OrePrefixes.shard.get(aMaterial)});
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X",
+ 'X', OrePrefixes.crushed.get(aMaterial)});
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial.mMacerateInto, 1L), tBits, new Object[]{"h", "X",
+ 'X', OrePrefixes.dirtyGravel.get(aMaterial)});
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustSmall, aMaterial, 4L), tBits,
+ new Object[]{" X", " ", 'X', OrePrefixes.dust.get(aMaterial)});
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 9L), tBits,
+ new Object[]{"X ", " ", 'X', OrePrefixes.dust.get(aMaterial)});
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, 1L), tBits,
+ new Object[]{"XX", "XX", 'X', OrePrefixes.dustSmall.get(aMaterial)});
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, 1L), tBits,
+ new Object[]{"XXX", "XXX", "XXX", 'X', OrePrefixes.dustTiny.get(aMaterial)});
+ }
+ }
+ }
+
+ public void onServerStarting() {
+ GT_Log.out.println("GT_Mod: ServerStarting-Phase started!");
+ GT_Log.ore.println("GT_Mod: ServerStarting-Phase started!");
+
+ this.mUniverse = null;
+ this.isFirstServerWorldTick = true;
+ for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
+ if ((tData.filledContainer.getItem() == Items.potionitem) && (tData.filledContainer.getItemDamage() == 0)) {
+ tData.fluid.amount = 0;
+ break;
+ }
+ }
+ try {
+ for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
+ for (; i < GregTech_API.METATILEENTITIES.length; i++) {
+ if (GregTech_API.METATILEENTITIES[i] != null) {
+ GregTech_API.METATILEENTITIES[i].onServerStart();
+ }
+ }
+ }
+ } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
+
+ dimensionWiseChunkData.clear();//!!! IMPORTANT for map switching...
+ dimensionWisePollution.clear();//!!! IMPORTANT for map switching...
+ }
+
+ public void onServerStarted() {
+ GregTech_API.sWirelessRedstone.clear();
+ GT_FluidStack.fixAllThoseFuckingFluidIDs();
+
+ GT_Log.out.println("GT_Mod: Cleaning up all OreDict Crafting Recipes, which have an empty List in them, since they are never meeting any Condition.");
+ List tList = CraftingManager.getInstance().getRecipeList();
+ for (int i = 0; i < tList.size(); i++) {
+ if ((tList.get(i) instanceof ShapedOreRecipe)) {
+ for (Object tObject : ((ShapedOreRecipe) tList.get(i)).getInput()) {
+ if (((tObject instanceof List)) && (((List) tObject).isEmpty())) {
+ tList.remove(i--);
+ break;
+ }
+ }
+ } else if ((tList.get(i) instanceof ShapelessOreRecipe)) {
+ for (Object tObject : ((ShapelessOreRecipe) tList.get(i)).getInput()) {
+ if (((tObject instanceof List)) && (((List) tObject).isEmpty())) {
+ tList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ public void onServerStopping() {
+ File tSaveDirectory = getSaveDirectory();
+ GregTech_API.sWirelessRedstone.clear();
+ if (tSaveDirectory != null) {
+ try {
+ for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
+ for (; i < GregTech_API.METATILEENTITIES.length; i++) {
+ if (GregTech_API.METATILEENTITIES[i] != null) {
+ GregTech_API.METATILEENTITIES[i].onWorldSave(tSaveDirectory);
+ }
+ }
+ }
+ } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
+ }
+ this.mUniverse = null;
+ }
+
+ @SubscribeEvent
+ public void onClientConnectedToServerEvent(FMLNetworkEvent.ClientConnectedToServerEvent aEvent) {
+ }
+
+ @SubscribeEvent
+ public void onArrowNockEvent(ArrowNockEvent aEvent) {
+ if ((!aEvent.isCanceled()) && (GT_Utility.isStackValid(aEvent.result))
+ && (GT_Utility.getProjectile(SubTag.PROJECTILE_ARROW, aEvent.entityPlayer.inventory) != null)) {
+ aEvent.entityPlayer.setItemInUse(aEvent.result, aEvent.result.getItem().getMaxItemUseDuration(aEvent.result));
+ aEvent.setCanceled(true);
+ }
+ }
+
+ @SubscribeEvent
+ public void onArrowLooseEvent(ArrowLooseEvent aEvent) {
+ ItemStack aArrow = GT_Utility.getProjectile(SubTag.PROJECTILE_ARROW, aEvent.entityPlayer.inventory);
+ if ((!aEvent.isCanceled()) && (GT_Utility.isStackValid(aEvent.bow)) && (aArrow != null) && ((aEvent.bow.getItem() instanceof ItemBow))) {
+ float tSpeed = aEvent.charge / 20.0F;
+ tSpeed = (tSpeed * tSpeed + tSpeed * 2.0F) / 3.0F;
+ if (tSpeed < 0.1D) {
+ return;
+ }
+ if (tSpeed > 1.0D) {
+ tSpeed = 1.0F;
+ }
+ EntityArrow tArrowEntity = ((IProjectileItem) aArrow.getItem()).getProjectile(SubTag.PROJECTILE_ARROW, aArrow, aEvent.entityPlayer.worldObj,
+ aEvent.entityPlayer, tSpeed * 2.0F);
+ if (tSpeed >= 1.0F) {
+ tArrowEntity.setIsCritical(true);
+ }
+ int tLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, aEvent.bow);
+ if (tLevel > 0) {
+ tArrowEntity.setDamage(tArrowEntity.getDamage() + tLevel * 0.5D + 0.5D);
+ }
+ tLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, aEvent.bow);
+ if (tLevel > 0) {
+ tArrowEntity.setKnockbackStrength(tLevel);
+ }
+ tLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, aEvent.bow);
+ if (tLevel > 0) {
+ tArrowEntity.setFire(tLevel * 100);
+ }
+ aEvent.bow.damageItem(1, aEvent.entityPlayer);
+ aEvent.bow.getItem();
+ aEvent.entityPlayer.worldObj.playSoundAtEntity(aEvent.entityPlayer, "random.bow", 1.0F, 0.64893958288F + tSpeed
+ * 0.5F);
+
+ tArrowEntity.canBePickedUp = 1;
+ if (!aEvent.entityPlayer.capabilities.isCreativeMode) {
+ aArrow.stackSize -= 1;
+ }
+ if (aArrow.stackSize == 0) {
+ GT_Utility.removeNullStacksFromInventory(aEvent.entityPlayer.inventory);
+ }
+ if (!aEvent.entityPlayer.worldObj.isRemote) {
+ aEvent.entityPlayer.worldObj.spawnEntityInWorld(tArrowEntity);
+ }
+ aEvent.setCanceled(true);
+ }
+ }
+
+ @SubscribeEvent
+ public void onEndermanTeleportEvent(EnderTeleportEvent aEvent) {
+ if (((aEvent.entityLiving instanceof EntityEnderman)) && (aEvent.entityLiving.getActivePotionEffect(Potion.weakness) != null)) {
+ aEvent.setCanceled(true);
+ }
+ }
+
+ @SubscribeEvent
+ public void onEntitySpawningEvent(EntityJoinWorldEvent aEvent) {
+ if ((aEvent.entity != null) && (!aEvent.entity.worldObj.isRemote)) {
+ if ((aEvent.entity instanceof EntityItem)) {
+ ((EntityItem) aEvent.entity).setEntityItemStack(GT_OreDictUnificator.get(((EntityItem) aEvent.entity).getEntityItem()));
+ }
+ if ((this.mSkeletonsShootGTArrows > 0) && (aEvent.entity.getClass() == EntityArrow.class)
+ && (aEvent.entity.worldObj.rand.nextInt(this.mSkeletonsShootGTArrows) == 0)
+ && ((((EntityArrow) aEvent.entity).shootingEntity instanceof EntitySkeleton))) {
+ aEvent.entity.worldObj.spawnEntityInWorld(new GT_Entity_Arrow((EntityArrow) aEvent.entity, (ItemStack) OrePrefixes.arrowGtWood.mPrefixedItems
+ .get(aEvent.entity.worldObj.rand.nextInt(OrePrefixes.arrowGtWood.mPrefixedItems.size()))));
+ aEvent.entity.setDead();
+ }
+ }
+ }
+
+ @SubscribeEvent
+ public void onOreGenEvent(OreGenEvent.GenerateMinable aGenerator) {
+ if ((this.mDisableVanillaOres) && ((aGenerator.generator instanceof WorldGenMinable)) && (PREVENTED_ORES.contains(aGenerator.type))) {
+ aGenerator.setResult(Result.DENY);
+ }
+ }
+
+ private String getDataAndTime() {
+ return this.mDateFormat.format(new Date());
+ }
+
+ @SubscribeEvent
+ public void onPlayerInteraction(PlayerInteractEvent aEvent) {
+ if ((aEvent.entityPlayer == null) || (aEvent.entityPlayer.worldObj == null) || (aEvent.action == null) || (aEvent.world.provider == null)) {
+ return;
+ }
+ if ((!aEvent.entityPlayer.worldObj.isRemote) && (aEvent.action != PlayerInteractEvent.Action.RIGHT_CLICK_AIR)
+ && (GT_Log.pal != null)) {
+ this.mBufferedPlayerActivity.add(getDataAndTime() + ";" + aEvent.action.name() + ";" + aEvent.entityPlayer.getDisplayName() + ";DIM:"
+ + aEvent.world.provider.dimensionId + ";" + aEvent.x + ";" + aEvent.y + ";" + aEvent.z + ";|;" + aEvent.x / 10 + ";" + aEvent.y / 10 + ";"
+ + aEvent.z / 10);
+ }
+ ItemStack aStack = aEvent.entityPlayer.getCurrentEquippedItem();
+ if ((aStack != null) && (aEvent.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) && (aStack.getItem() == Items.flint_and_steel)) {
+ if ((!aEvent.world.isRemote) && (!aEvent.entityPlayer.capabilities.isCreativeMode) && (aEvent.world.rand.nextInt(100) >= this.mFlintChance)) {
+ aEvent.setCanceled(true);
+ aStack.damageItem(1, aEvent.entityPlayer);
+ if (aStack.getItemDamage() >= aStack.getMaxDamage()) {
+ aStack.stackSize -= 1;
+ }
+ if (aStack.stackSize <= 0) {
+ ForgeEventFactory.onPlayerDestroyItem(aEvent.entityPlayer, aStack);
+ }
+ }
+ return;
+ }
+ }
+
+ @SubscribeEvent
+ public void onBlockHarvestingEvent(BlockEvent.HarvestDropsEvent aEvent) {
+ if (aEvent.harvester != null) {
+ if ((!aEvent.world.isRemote) && (GT_Log.pal != null)) {
+ this.mBufferedPlayerActivity.add(getDataAndTime() + ";HARVEST_BLOCK;" + aEvent.harvester.getDisplayName() + ";DIM:"
+ + aEvent.world.provider.dimensionId + ";" + aEvent.x + ";" + aEvent.y + ";" + aEvent.z + ";|;" + aEvent.x / 10 + ";" + aEvent.y / 10
+ + ";" + aEvent.z / 10);
+ }
+ ItemStack aStack = aEvent.harvester.getCurrentEquippedItem();
+ if (aStack != null) {
+ if ((aStack.getItem() instanceof GT_MetaGenerated_Tool)) {
+ ((GT_MetaGenerated_Tool) aStack.getItem()).onHarvestBlockEvent(aEvent.drops, aStack, aEvent.harvester, aEvent.block, aEvent.x, aEvent.y,
+ aEvent.z, (byte) aEvent.blockMetadata, aEvent.fortuneLevel, aEvent.isSilkTouching, aEvent);
+ }
+ if (EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, aStack) > 2) {
+ try {
+ for (ItemStack tDrop : aEvent.drops) {
+ ItemStack tSmeltingOutput = GT_ModHandler.getSmeltingOutput(tDrop, false, null);
+ if (tSmeltingOutput != null) {
+ tDrop.stackSize *= tSmeltingOutput.stackSize;
+ tSmeltingOutput.stackSize = tDrop.stackSize;
+ GT_Utility.setStack(tDrop, tSmeltingOutput);
+ }
+ }
+ } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
+ }
+ }
+ }
+ }
+
+ @SubscribeEvent
+ public void registerOre(OreDictionary.OreRegisterEvent aEvent) {
+ ModContainer tContainer = Loader.instance().activeModContainer();
+ String aMod = tContainer == null ? "UNKNOWN" : tContainer.getModId();
+ String aOriginalMod = aMod;
+ if (GT_OreDictUnificator.isRegisteringOres()) {
+ aMod = "gregtech";
+ } else if (aMod.equals("gregtech")) {
+ aMod = "UNKNOWN";
+ }
+ if ((aEvent == null) || (aEvent.Ore == null) || (aEvent.Ore.getItem() == null) || (aEvent.Name == null) || (aEvent.Name.isEmpty())
+ || (aEvent.Name.replaceAll("_", "").length() - aEvent.Name.length() == 9)) {
+ if (aOriginalMod.equals("gregtech")) {
+ aOriginalMod = "UNKNOWN";
+ }
+ GT_Log.ore
+ .println(aOriginalMod
+ + " did something very bad! The registration is too invalid to even be shown properly. This happens only if you register null, invalid Items, empty Strings or even nonexisting Events to the OreDict.");
+ throw new IllegalArgumentException(
+ aOriginalMod
+ + " did something very bad! The registration is too invalid to even be shown properly. This happens only if you register null, invalid Items, empty Strings or even nonexisting Events to the OreDict.");
+ }
+ try {
+ aEvent.Ore.stackSize = 1;
+ if (this.mIgnoreTcon || aEvent.Ore.getUnlocalizedName().startsWith("item.oreberry")) {
+ if ((aOriginalMod.toLowerCase(Locale.ENGLISH).contains("xycraft")) || (aOriginalMod.toLowerCase(Locale.ENGLISH).contains("tconstruct"))
+ || ((aOriginalMod.toLowerCase(Locale.ENGLISH).contains("natura")) && (!aOriginalMod.toLowerCase(Locale.ENGLISH).contains("natural")))) {
+ if (GT_Values.D1) {
+ GT_Log.ore.println(aMod + " -> " + aEvent.Name + " is getting ignored, because of racism. :P");
+ }
+ return;
+ }
+ }
+ String tModToName = aMod + " -> " + aEvent.Name;
+ if ((this.mOreDictActivated) || (GregTech_API.sPostloadStarted) || ((this.mSortToTheEnd) && (GregTech_API.sLoadFinished))) {
+ tModToName = aOriginalMod + " --Late--> " + aEvent.Name;
+ }
+ if (((aEvent.Ore.getItem() instanceof ItemBlock)) || (GT_Utility.getBlockFromStack(aEvent.Ore) != Blocks.air)) {
+ GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
+ }
+ this.mRegisteredOres.add(aEvent.Ore);
+ if (this.mIgnoredItems.contains(aEvent.Name)) {
+ if ((aEvent.Name.startsWith("item"))) {
+ GT_Log.ore.println(tModToName);
+ if (aEvent.Name.equals("itemCopperWire")) {
+ GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper, aEvent.Ore);
+ }
+ if (aEvent.Name.equals("itemRubber")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.Rubber, aEvent.Ore);
+ }
+ return;
+ }
+ }else if(this.mIgnoredNames.contains(aEvent.Name)){
+ GT_Log.ore.println(tModToName + " is getting ignored via hardcode.");
+ return;
+ }
+ else if (aEvent.Name.equals("stone")) {
+ GT_OreDictUnificator.registerOre("stoneSmooth", aEvent.Ore);
+ return;
+ }
+ else if (aEvent.Name.equals("cobblestone")) {
+ GT_OreDictUnificator.registerOre("stoneCobble", aEvent.Ore);
+ return;
+ }
+ else if ((aEvent.Name.contains("|")) || (aEvent.Name.contains("*")) || (aEvent.Name.contains(":")) || (aEvent.Name.contains("."))
+ || (aEvent.Name.contains("$"))) {
+ GT_Log.ore.println(tModToName + " is using a private Prefix and is therefor getting ignored properly.");
+ return;
+ }
+ else if (aEvent.Name.equals("copperWire")) {
+ GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper, aEvent.Ore);
+ }
+ else if (aEvent.Name.equals("oreHeeEndrium")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.ore, Materials.HeeEndium, aEvent.Ore);
+ }
+ else if (aEvent.Name.equals("sheetPlastic")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.plate, Materials.Plastic, aEvent.Ore);
+ }
+ else if (aEvent.Name.startsWith("shard")) {
+ if (aEvent.Name.equals("shardAir")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedAir, aEvent.Ore);
+ return;
+ }
+ else if (aEvent.Name.equals("shardWater")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedWater, aEvent.Ore);
+ return;
+ }
+ else if (aEvent.Name.equals("shardFire")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedFire, aEvent.Ore);
+ return;
+ }
+ else if (aEvent.Name.equals("shardEarth")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedEarth, aEvent.Ore);
+ return;
+ }
+ else if (aEvent.Name.equals("shardOrder")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedOrder, aEvent.Ore);
+ return;
+ }
+ else if (aEvent.Name.equals("shardEntropy")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedEntropy, aEvent.Ore);
+ return;
+ }
+ } else if (aEvent.Name.equals("fieryIngot")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.FierySteel, aEvent.Ore);
+ return;
+ }
+ else if (aEvent.Name.equals("ironwood")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.IronWood, aEvent.Ore);
+ return;
+ }
+ else if (aEvent.Name.equals("steeleaf")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.Steeleaf, aEvent.Ore);
+ return;
+ }
+ else if (aEvent.Name.equals("knightmetal")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.Knightmetal, aEvent.Ore);
+ return;
+ }
+ else if (aEvent.Name.equals("compressedAluminum")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.compressed, Materials.Aluminium, aEvent.Ore);
+ return;
+ }
+ else if (aEvent.Name.contains(" ")) {
+ GT_Log.ore.println(tModToName + " is getting re-registered because the OreDict Name containing invalid spaces.");
+ GT_OreDictUnificator.registerOre(aEvent.Name.replaceAll(" ", ""), GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
+ aEvent.Ore.setStackDisplayName("Invalid OreDictionary Tag");
+ return;
+ }
+ else if (this.mInvalidNames.contains(aEvent.Name)) {
+ GT_Log.ore.println(tModToName + " is wrongly registered and therefor getting ignored.");
+
+ return;
+ }
+ OrePrefixes aPrefix = OrePrefixes.getOrePrefix(aEvent.Name);
+ Materials aMaterial = Materials._NULL;
+ if ((aPrefix == OrePrefixes.nugget) && (aMod.equals("Thaumcraft")) && (aEvent.Ore.getItem().getUnlocalizedName().contains("ItemResource"))) {
+ return;
+ }
+ if (aPrefix == null) {
+ if (aEvent.Name.toLowerCase().equals(aEvent.Name)) {
+ GT_Log.ore.println(tModToName + " is invalid due to being solely lowercased.");
+ return;
+ }else if (aEvent.Name.toUpperCase().equals(aEvent.Name)) {
+ GT_Log.ore.println(tModToName + " is invalid due to being solely uppercased.");
+ return;
+ } else if (Character.isUpperCase(aEvent.Name.charAt(0))) {
+ GT_Log.ore.println(tModToName + " is invalid due to the first character being uppercased.");
+ }
+ } else {
+ if (aPrefix.mDontUnificateActively) {
+ GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
+ }
+ if (aPrefix != aPrefix.mPrefixInto) {
+ String tNewName = aEvent.Name.replaceFirst(aPrefix.toString(), aPrefix.mPrefixInto.toString());
+ if (!GT_OreDictUnificator.isRegisteringOres()) {
+ GT_Log.ore.println(tModToName + " uses a depricated Prefix, and is getting re-registered as " + tNewName);
+ }
+ GT_OreDictUnificator.registerOre(tNewName, aEvent.Ore);
+ return;
+ }
+ String tName = aEvent.Name.replaceFirst(aPrefix.toString(), "");
+ if (tName.length() > 0) {
+ char firstChar = tName.charAt(0);
+ if (Character.isUpperCase(firstChar) || Character.isLowerCase(firstChar) || firstChar == '_') {
+ if (aPrefix.mIsMaterialBased) {
+ aMaterial = Materials.get(tName);
+ if (aMaterial != aMaterial.mMaterialInto) {
+ GT_OreDictUnificator.registerOre(aPrefix, aMaterial.mMaterialInto, aEvent.Ore);
+ if (!GT_OreDictUnificator.isRegisteringOres()) {
+ GT_Log.ore.println(tModToName + " uses a deprecated Material and is getting re-registered as "
+ + aPrefix.get(aMaterial.mMaterialInto));
+ }
+ return;
+ }
+ if (!aPrefix.isIgnored(aMaterial)) {
+ aPrefix.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
+ }
+ if (aMaterial != Materials._NULL) {
+ Materials tReRegisteredMaterial;
+ for (Iterator i$ = aMaterial.mOreReRegistrations.iterator(); i$.hasNext(); GT_OreDictUnificator.registerOre(aPrefix,
+ tReRegisteredMaterial, aEvent.Ore)) {
+ tReRegisteredMaterial = (Materials) i$.next();
+ }
+ aMaterial.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
+
+ if (GregTech_API.sThaumcraftCompat != null && aPrefix.doGenerateItem(aMaterial) && !aPrefix.isIgnored(aMaterial)) {
+ List<TC_AspectStack> tAspects = new ArrayList<TC_AspectStack>();
+ for (TC_AspectStack tAspect : aPrefix.mAspects) tAspect.addToAspectList(tAspects);
+ if (aPrefix.mMaterialAmount >= 3628800 || aPrefix.mMaterialAmount < 0) for (TC_AspectStack tAspect : aMaterial.mAspects) tAspect.addToAspectList(tAspects);
+ GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(GT_Utility.copyAmount(1, aEvent.Ore), tAspects, aEvent.Name);
+ }
+
+ switch (aPrefix) {
+ case crystal:
+ if ((aMaterial == Materials.CertusQuartz) || (aMaterial == Materials.NetherQuartz) || (aMaterial == Materials.Fluix)) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.gem, aMaterial, aEvent.Ore);
+ }
+ break;
+ case gem:
+ if (aMaterial == Materials.Lapis || aMaterial == Materials.Sodalite) {
+ GT_OreDictUnificator.registerOre(Dyes.dyeBlue, aEvent.Ore);
+ } else if (aMaterial == Materials.Lazurite) {
+ GT_OreDictUnificator.registerOre(Dyes.dyeCyan, aEvent.Ore);
+ } else if (aMaterial == Materials.InfusedAir || aMaterial == Materials.InfusedWater || aMaterial == Materials.InfusedFire || aMaterial == Materials.InfusedEarth || aMaterial == Materials.InfusedOrder || aMaterial == Materials.InfusedEntropy) {
+ GT_OreDictUnificator.registerOre(aMaterial.mName.replaceFirst("Infused", "shard"), aEvent.Ore);
+ } else if (aMaterial == Materials.Chocolate) {
+ GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore);
+ } else if (aMaterial == Materials.CertusQuartz || aMaterial == Materials.NetherQuartz) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.item.get(aMaterial), aEvent.Ore);
+ GT_OreDictUnificator.registerOre(OrePrefixes.crystal, aMaterial, aEvent.Ore);
+ GT_OreDictUnificator.registerOre(OreDictNames.craftingQuartz, aEvent.Ore);
+ } else if (aMaterial == Materials.Fluix || aMaterial == Materials.Quartz || aMaterial == Materials.Quartzite) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.crystal, aMaterial, aEvent.Ore);
+ GT_OreDictUnificator.registerOre(OreDictNames.craftingQuartz, aEvent.Ore);
+ }
+ break;
+ case cableGt01:
+ if (aMaterial == Materials.Tin) {
+ GT_OreDictUnificator.registerOre(OreDictNames.craftingWireTin, aEvent.Ore);
+ } else if (aMaterial == Materials.AnyCopper) {
+ GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper, aEvent.Ore);
+ } else if (aMaterial == Materials.Gold) {
+ GT_OreDictUnificator.registerOre(OreDictNames.craftingWireGold, aEvent.Ore);
+ } else if (aMaterial == Materials.AnyIron) {
+ GT_OreDictUnificator.registerOre(OreDictNames.craftingWireIron, aEvent.Ore);
+ }
+ break;
+ case lens:
+ if ((aMaterial.contains(SubTag.TRANSPARENT)) && (aMaterial.mColor != Dyes._NULL)) {
+ GT_OreDictUnificator.registerOre("craftingLens" + aMaterial.mColor.toString().replaceFirst("dye", ""), aEvent.Ore);
+ }
+ break;
+ case plate:
+ if ((aMaterial == Materials.Plastic) || (aMaterial == Materials.Rubber)) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.sheet, aMaterial, aEvent.Ore);
+ } else if (aMaterial == Materials.Silicon) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.item, aMaterial, aEvent.Ore);
+ } else if (aMaterial == Materials.Wood) {
+ GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
+ GT_OreDictUnificator.registerOre(OrePrefixes.plank, aMaterial, aEvent.Ore);
+ }
+ break;
+ case cell:
+ if (aMaterial == Materials.Empty) {
+ GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
+ }
+ break;
+ case gearGt:
+ GT_OreDictUnificator.registerOre(OrePrefixes.gear, aMaterial, aEvent.Ore);
+ break;
+ case stick:
+ if (!GT_RecipeRegistrator.sRodMaterialList.contains(aMaterial)) {
+ GT_RecipeRegistrator.sRodMaterialList.add(aMaterial);
+ } else if (aMaterial == Materials.Wood) {
+ GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
+ } else if ((aMaterial == Materials.Tin) || (aMaterial == Materials.Lead) || (aMaterial == Materials.SolderingAlloy)) {
+ GT_OreDictUnificator.registerOre(ToolDictNames.craftingToolSolderingMetal, aEvent.Ore);
+ }
+ break;
+ case dust:
+ if (aMaterial == Materials.Salt) {
+ GT_OreDictUnificator.registerOre("itemSalt", aEvent.Ore);
+ } else if (aMaterial == Materials.Wood) {
+ GT_OreDictUnificator.registerOre("pulpWood", aEvent.Ore);
+ } else if (aMaterial == Materials.Wheat) {
+ GT_OreDictUnificator.registerOre("foodFlour", aEvent.Ore);
+ } else if (aMaterial == Materials.Lapis) {
+ GT_OreDictUnificator.registerOre(Dyes.dyeBlue, aEvent.Ore);
+ } else if (aMaterial == Materials.Lazurite) {
+ GT_OreDictUnificator.registerOre(Dyes.dyeCyan, aEvent.Ore);
+ } else if (aMaterial == Materials.Sodalite) {
+ GT_OreDictUnificator.registerOre(Dyes.dyeBlue, aEvent.Ore);
+ } else if (aMaterial == Materials.Cocoa) {
+ GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore);
+ GT_OreDictUnificator.registerOre("foodCocoapowder", aEvent.Ore);
+ } else if (aMaterial == Materials.Coffee) {
+ GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore);
+ } else if (aMaterial == Materials.BrownLimonite) {
+ GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore);
+ } else if (aMaterial == Materials.YellowLimonite) {
+ GT_OreDictUnificator.registerOre(Dyes.dyeYellow, aEvent.Ore);
+ }
+ break;
+ case ingot:
+ if (aMaterial == Materials.Rubber) {
+ GT_OreDictUnificator.registerOre("itemRubber", aEvent.Ore);
+ } else if (aMaterial == Materials.FierySteel) {
+ GT_OreDictUnificator.registerOre("fieryIngot", aEvent.Ore);
+ } else if (aMaterial == Materials.IronWood) {
+ GT_OreDictUnificator.registerOre("ironwood", aEvent.Ore);
+ } else if (aMaterial == Materials.Steeleaf) {
+ GT_OreDictUnificator.registerOre("steeleaf", aEvent.Ore);
+ } else if (aMaterial == Materials.Knightmetal) {
+ GT_OreDictUnificator.registerOre("knightmetal", aEvent.Ore);
+ } else if ((aMaterial == Materials.Brass) && (aEvent.Ore.getItemDamage() == 2)
+ && (aEvent.Ore.getUnlocalizedName().equals("item.ingotBrass"))
+ && (new ItemStack(aEvent.Ore.getItem(), 1, 0).getUnlocalizedName().contains("red"))) {
+ GT_OreDictUnificator.set(OrePrefixes.ingot, Materials.RedAlloy, new ItemStack(aEvent.Ore.getItem(), 1, 0));
+ GT_OreDictUnificator.set(OrePrefixes.ingot, Materials.BlueAlloy, new ItemStack(aEvent.Ore.getItem(), 1, 1));
+ GT_OreDictUnificator.set(OrePrefixes.ingot, Materials.Brass, new ItemStack(aEvent.Ore.getItem(), 1, 2));
+ if (!mDisableIC2Cables) {
+ GT_Values.RA.addWiremillRecipe(GT_ModHandler.getIC2Item("copperCableItem", 3L), new ItemStack(aEvent.Ore.getItem(), 1,
+ 8), 400, 1);
+ GT_Values.RA.addWiremillRecipe(GT_ModHandler.getIC2Item("ironCableItem", 6L),
+ new ItemStack(aEvent.Ore.getItem(), 1, 9), 400, 2);
+ }
+ GT_Values.RA.addCutterRecipe(new ItemStack(aEvent.Ore.getItem(), 1, 3), new ItemStack(aEvent.Ore.getItem(), 16, 4),
+ null, 400, 8);
+ }
+ break;
+ default:
+ break;
+ }
+ if (aPrefix.mIsUnificatable && !aMaterial.mUnificatable) {
+ return;
+ }
+ } else {
+ for (Dyes tDye : Dyes.VALUES) {
+ if (aEvent.Name.endsWith(tDye.name().replaceFirst("dye", ""))) {
+ GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
+ GT_Log.ore.println(tModToName + " Oh man, why the fuck would anyone need a OreDictified Color for this, that is even too much for GregTech... do not report this, this is just a random Comment about how ridiculous this is.");
+ return;
+ }
+ }
+// System.out.println("Material Name: "+aEvent.Name+ " !!!Unknown Material detected!!! Please report to GregTech Intergalactical for additional compatiblity. This is not an Error, an Issue nor a Lag Source, it is just an Information, which you should pass to me.");
+// GT_Log.ore.println(tModToName + " uses an unknown Material. Report this to GregTech.");
+ return;
+ }
+ } else {
+ aPrefix.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
+ }
+ }
+ } else if (aPrefix.mIsSelfReferencing) {
+ aPrefix.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
+ } else {
+ GT_Log.ore.println(tModToName + " uses a Prefix as full OreDict Name, and is therefor invalid.");
+ aEvent.Ore.setStackDisplayName("Invalid OreDictionary Tag");
+ return;
+ }
+ switch (aPrefix) {
+ case dye:
+ if (GT_Utility.isStringValid(tName)) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.dye, aEvent.Ore);
+ }
+ break;
+ case stoneSmooth:
+ GT_OreDictUnificator.registerOre("stone", aEvent.Ore);
+ break;
+ case stoneCobble:
+ GT_OreDictUnificator.registerOre("cobblestone", aEvent.Ore);
+ break;
+ case plank:
+ if (tName.equals("Wood")) {
+ GT_OreDictUnificator.addItemData(aEvent.Ore, new ItemData(Materials.Wood, 3628800L, new MaterialStack[0]));
+ }
+ break;
+ case slab:
+ if (tName.equals("Wood")) {
+ GT_OreDictUnificator.addItemData(aEvent.Ore, new ItemData(Materials.Wood, 1814400L, new MaterialStack[0]));
+ }
+ break;
+ case sheet:
+ if (tName.equals("Plastic")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.plate, Materials.Plastic, aEvent.Ore);
+ } else if (tName.equals("Rubber")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.plate, Materials.Rubber, aEvent.Ore);
+ }
+ break;
+ case crafting:
+ if (tName.equals("ToolSolderingMetal")) {
+ GregTech_API.registerSolderingMetal(aEvent.Ore);
+ } else if (tName.equals("IndustrialDiamond")) {
+ GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
+ } else if (tName.equals("WireCopper")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.wire, Materials.Copper, aEvent.Ore);
+ }
+ break;
+ case wood:
+ if (tName.equals("Rubber")) {
+ GT_OreDictUnificator.registerOre("logRubber", aEvent.Ore);
+ }
+ break;
+ case food:
+ if (tName.equals("Cocoapowder")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.dust, Materials.Cocoa, aEvent.Ore);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ GT_Log.ore.println(tModToName);
+
+ OreDictEventContainer tOre = new OreDictEventContainer(aEvent, aPrefix, aMaterial, aMod);
+ if ((!this.mOreDictActivated) || (!GregTech_API.sUnificationEntriesRegistered)) {
+ this.mEvents.add(tOre);
+ } else {
+ this.mEvents.clear();
+ }
+ if (this.mOreDictActivated) {
+ registerRecipes(tOre);
+ }
+ } catch (Throwable e) {
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+
+ @SubscribeEvent
+ public void onFluidContainerRegistration(FluidContainerRegistry.FluidContainerRegisterEvent aFluidEvent) {
+ if ((aFluidEvent.data.filledContainer.getItem() == Items.potionitem) && (aFluidEvent.data.filledContainer.getItemDamage() == 0)) {
+ aFluidEvent.data.fluid.amount = 0;
+ }
+ GT_OreDictUnificator.addToBlacklist(aFluidEvent.data.emptyContainer);
+ GT_OreDictUnificator.addToBlacklist(aFluidEvent.data.filledContainer);
+ GT_Utility.addFluidContainerData(aFluidEvent.data);
+ }
+
+ @SubscribeEvent
+ public void onServerTickEvent(TickEvent.ServerTickEvent aEvent) {
+ }
+
+ @SubscribeEvent
+ public void onWorldTickEvent(TickEvent.WorldTickEvent aEvent) {
+ if(aEvent.world.provider.dimensionId == 0)
+ mTicksUntilNextCraftSound--;
+ if (aEvent.side.isServer()) {
+ if (this.mUniverse == null) {
+ this.mUniverse = aEvent.world;
+ }
+ if (this.isFirstServerWorldTick) {
+ File tSaveDiretory = getSaveDirectory();
+ if (tSaveDiretory != null) {
+ this.isFirstServerWorldTick = false;
+ try {
+ for (IMetaTileEntity tMetaTileEntity : GregTech_API.METATILEENTITIES) {
+ if (tMetaTileEntity != null) {
+ tMetaTileEntity.onWorldLoad(tSaveDiretory);
+ }
+ }
+ } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
+ }
+ }
+ if ((aEvent.world.getTotalWorldTime() % 100L == 0L) && ((this.mItemDespawnTime != 6000) || (this.mMaxEqualEntitiesAtOneSpot > 0))) {
+ for (int i = 0; i < aEvent.world.loadedEntityList.size(); i++) {
+ if ((aEvent.world.loadedEntityList.get(i) instanceof Entity)) {
+ Entity tEntity = (Entity) aEvent.world.loadedEntityList.get(i);
+ if (((tEntity instanceof EntityItem)) && (this.mItemDespawnTime != 6000) && (((EntityItem) tEntity).lifespan == 6000)) {
+ ((EntityItem) tEntity).lifespan = this.mItemDespawnTime;
+ } else if (((tEntity instanceof EntityLivingBase)) && (this.mMaxEqualEntitiesAtOneSpot > 0) && (!(tEntity instanceof EntityPlayer))
+ && (((EntityLivingBase) tEntity).canBePushed()) && (((EntityLivingBase) tEntity).getHealth() > 0.0F)) {
+ List tList = tEntity.worldObj.getEntitiesWithinAABBExcludingEntity(tEntity,
+ tEntity.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D));
+ Class tClass = tEntity.getClass();
+ int tEntityCount = 1;
+ if (tList != null) {
+ for (int j = 0; j < tList.size(); j++) {
+ if ((tList.get(j) != null) && (tList.get(j).getClass() == tClass)) {
+ tEntityCount++;
+ }
+ }
+ }
+ if (tEntityCount > this.mMaxEqualEntitiesAtOneSpot) {
+ tEntity.attackEntityFrom(DamageSource.inWall, tEntityCount - this.mMaxEqualEntitiesAtOneSpot);
+ }
+ }
+ }
+ }
+ }
+
+ GT_Pollution.onWorldTick(aEvent);
+ }
+ }
+
+ @SubscribeEvent
+ public void onPlayerTickEventServer(TickEvent.PlayerTickEvent aEvent) {
+ if ((aEvent.side.isServer()) && (aEvent.phase == TickEvent.Phase.END) && (!aEvent.player.isDead)) {
+ if ((aEvent.player.ticksExisted % 200 == 0) && (aEvent.player.capabilities.allowEdit) && (!aEvent.player.capabilities.isCreativeMode)
+ && (this.mSurvivalIntoAdventure)) {
+ aEvent.player.setGameType(GameType.ADVENTURE);
+ aEvent.player.capabilities.allowEdit = false;
+ if (this.mAxeWhenAdventure) {
+ GT_Utility.sendChatToPlayer(aEvent.player, "It's dangerous to go alone! Take this.");
+ aEvent.player.worldObj.spawnEntityInWorld(new EntityItem(aEvent.player.worldObj, aEvent.player.posX, aEvent.player.posY,
+ aEvent.player.posZ, GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.AXE, 1, Materials.Flint, Materials.Wood, null)));
+ }
+ }
+ boolean tHungerEffect = (this.mHungerEffect) && (aEvent.player.ticksExisted % 2400 == 1200);
+ if (aEvent.player.ticksExisted % 120 == 0) {
+ int tCount = 64;
+ for (int i = 0; i < 36; i++) {
+ ItemStack tStack;
+ if ((tStack = aEvent.player.inventory.getStackInSlot(i)) != null) {
+ if (!aEvent.player.capabilities.isCreativeMode) {
+ GT_Utility.applyRadioactivity(aEvent.player, GT_Utility.getRadioactivityLevel(tStack), tStack.stackSize);
+ float tHeat = GT_Utility.getHeatDamageFromItem(tStack);
+ if (tHeat != 0.0F) {
+ if (tHeat > 0.0F) {
+ GT_Utility.applyHeatDamage(aEvent.player, tHeat);
+ } else {
+ GT_Utility.applyFrostDamage(aEvent.player, -tHeat);
+ }
+ }
+ }
+ if (tHungerEffect) {
+ tCount += tStack.stackSize * 64 / Math.max(1, tStack.getMaxStackSize());
+ }
+ if (this.mInventoryUnification) {
+ GT_OreDictUnificator.setStack(true, tStack);
+ }
+ }
+ }
+ for (int i = 0; i < 4; i++) {
+ ItemStack tStack;
+ if ((tStack = aEvent.player.inventory.armorInventory[i]) != null) {
+ if (!aEvent.player.capabilities.isCreativeMode) {
+ GT_Utility.applyRadioactivity(aEvent.player, GT_Utility.getRadioactivityLevel(tStack), tStack.stackSize);
+ float tHeat = GT_Utility.getHeatDamageFromItem(tStack);
+ if (tHeat != 0.0F) {
+ if (tHeat > 0.0F) {
+ GT_Utility.applyHeatDamage(aEvent.player, tHeat);
+ } else {
+ GT_Utility.applyFrostDamage(aEvent.player, -tHeat);
+ }
+ }
+ }
+ if (tHungerEffect) {
+ tCount += 256;
+ }
+ }
+ }
+ if (tHungerEffect) {
+ aEvent.player.addExhaustion(Math.max(1.0F, tCount / 666.6F));
+ }
+ }
+ if (aEvent.player.ticksExisted % 10 == 0) {
+ int tPollution = 0;
+ tPollution = GT_Pollution.getPollution(new ChunkCoordIntPair(aEvent.player.chunkCoordX,aEvent.player.chunkCoordZ), aEvent.player.dimension);
+ if(aEvent.player instanceof EntityPlayerMP)GT_Values.NW.sendToPlayer(new GT_Packet_Pollution(tPollution), (EntityPlayerMP) aEvent.player);
+ }
+ }
+ }
+
+ public Object getServerGuiElement(int aID, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) {
+ if(aID>=1000){
+ int ID = aID-1000;
+ switch(ID){
+ case 0:
+ return new ContainerBasicArmor(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getCurrentEquippedItem()));
+ case 1:
+ return new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getCurrentEquippedItem()));
+ case 2:
+ return new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getCurrentEquippedItem()));
+ default:
+ return getRightItem(aPlayer, ID);
+ }
+ }
+ if(aID>=100){
+ int tSlot = aID / 100;
+ int ID = aID%100;
+ switch(ID){
+ case 0:
+ return new ContainerBasicArmor(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot)));
+ case 1:
+ return new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot)));
+ case 2:
+ return new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot)));
+ default:
+ return getRightItem(aPlayer, ID);
+ }
+ }
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if ((tTileEntity instanceof IGregTechTileEntity)) {
+ IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
+ if (tMetaTileEntity != null) {
+ return tMetaTileEntity.getServerGUI(aID, aPlayer.inventory, (IGregTechTileEntity) tTileEntity);
+ }
+ }
+ return null;
+ }
+
+ public Object getRightItem(EntityPlayer player, int ID){
+ ItemStack mStack = player.getEquipmentInSlot(ID/100);
+ if(mStack==null||!(mStack.getItem() instanceof ModularArmor_Item))return null;
+
+ switch(ID % 100){
+ case 0:
+ return new ContainerBasicArmor(player, new InventoryArmor(ModularArmor_Item.class, mStack));
+ case 1:
+ return new ContainerElectricArmor1(player, new InventoryArmor(ModularArmor_Item.class, mStack));
+ case 2:
+ return new ContainerElectricArmor1(player, new InventoryArmor(ModularArmor_Item.class, mStack));
+ }
+ return null;
+
+ }
+
+ public Object getClientGuiElement(int aID, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) {
+ if(aID>=1000){
+ int ID = aID-1000;
+ switch(ID){
+ case 0:
+ return new GuiModularArmor(new ContainerBasicArmor(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getCurrentEquippedItem())), aPlayer);
+ case 1:
+ return new GuiElectricArmor1(new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getCurrentEquippedItem())), aPlayer);
+ case 2:
+ return new GuiElectricArmor1(new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getCurrentEquippedItem())), aPlayer);
+ default:
+ return getRightItemGui(aPlayer, ID);
+ }
+ }
+ if(aID>=100){
+ int tSlot = aID / 100;
+ int ID = aID%100;
+ switch(ID){
+ case 0:
+ return new GuiModularArmor(new ContainerBasicArmor(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot))), aPlayer);
+ case 1:
+ return new GuiElectricArmor1(new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot))), aPlayer);
+ case 2:
+ return new GuiElectricArmor1(new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot))), aPlayer);
+ default:
+ return getRightItem(aPlayer, ID);
+ }
+ }
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if ((tTileEntity instanceof IGregTechTileEntity)) {
+ IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
+ if (tMetaTileEntity != null) {
+ return tMetaTileEntity.getClientGUI(aID, aPlayer.inventory, (IGregTechTileEntity) tTileEntity);
+ }
+ }
+ return null;
+ }
+
+ public Object getRightItemGui(EntityPlayer player, int ID){
+ ItemStack mStack = player.getEquipmentInSlot(ID/100);
+ if(mStack==null||!(mStack.getItem() instanceof ModularArmor_Item))return null;
+
+ switch(ID % 100){
+ case 0:
+ return new GuiModularArmor(new ContainerBasicArmor(player, new InventoryArmor(ModularArmor_Item.class, mStack)),player);
+ case 1:
+ return new GuiElectricArmor1(new ContainerElectricArmor1(player, new InventoryArmor(ModularArmor_Item.class, mStack)), player);
+ case 2:
+ return new GuiElectricArmor1(new ContainerElectricArmor1(player, new InventoryArmor(ModularArmor_Item.class, mStack)), player);
+ }
+ return null;
+
+ }
+
+ public int getBurnTime(ItemStack aFuel) {
+ if ((aFuel == null) || (aFuel.getItem() == null)) {
+ return 0;
+ }
+ int rFuelValue = 0;
+ if ((aFuel.getItem() instanceof GT_MetaGenerated_Item)) {
+ Short tFuelValue = (Short) ((GT_MetaGenerated_Item) aFuel.getItem()).mBurnValues.get(Short.valueOf((short) aFuel.getItemDamage()));
+ if (tFuelValue != null) {
+ rFuelValue = Math.max(rFuelValue, tFuelValue.shortValue());
+ }
+ }
+ NBTTagCompound tNBT = aFuel.getTagCompound();
+ if (tNBT != null) {
+ short tValue = tNBT.getShort("GT.ItemFuelValue");
+ rFuelValue = Math.max(rFuelValue, tValue);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemSodium")) {
+ rFuelValue = Math.max(rFuelValue, 4000);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedSodium")) {
+ rFuelValue = Math.max(rFuelValue, 4000);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureSodium")) {
+ rFuelValue = Math.max(rFuelValue, 4000);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSodium")) {
+ rFuelValue = Math.max(rFuelValue, 400);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallSodium")) {
+ rFuelValue = Math.max(rFuelValue, 100);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinySodium")) {
+ rFuelValue = Math.max(rFuelValue, 44);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSulfur")) {
+ rFuelValue = Math.max(rFuelValue, 1600);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemLithium")) {
+ rFuelValue = Math.max(rFuelValue, 6000);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedLithium")) {
+ rFuelValue = Math.max(rFuelValue, 6000);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureLithium")) {
+ rFuelValue = Math.max(rFuelValue, 6000);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustLithium")) {
+ rFuelValue = Math.max(rFuelValue, 6000);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallLithium")) {
+ rFuelValue = Math.max(rFuelValue, 2000);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyLithium")) {
+ rFuelValue = Math.max(rFuelValue, 888);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemCaesium")) {
+ rFuelValue = Math.max(rFuelValue, 6000);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedCaesium")) {
+ rFuelValue = Math.max(rFuelValue, 6000);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureCaesium")) {
+ rFuelValue = Math.max(rFuelValue, 6000);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustCaesium")) {
+ rFuelValue = Math.max(rFuelValue, 6000);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallCaesium")) {
+ rFuelValue = Math.max(rFuelValue, 2000);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyCaesium")) {
+ rFuelValue = Math.max(rFuelValue, 888);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemLignite")) {
+ rFuelValue = Math.max(rFuelValue, 1200);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedLignite")) {
+ rFuelValue = Math.max(rFuelValue, 1200);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureLignite")) {
+ rFuelValue = Math.max(rFuelValue, 1200);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustLignite")) {
+ rFuelValue = Math.max(rFuelValue, 1200);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallLignite")) {
+ rFuelValue = Math.max(rFuelValue, 375);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyLignite")) {
+ rFuelValue = Math.max(rFuelValue, 166);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemCoal")) {
+ rFuelValue = Math.max(rFuelValue, 1600);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedCoal")) {
+ rFuelValue = Math.max(rFuelValue, 1600);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureCoal")) {
+ rFuelValue = Math.max(rFuelValue, 1600);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustCoal")) {
+ rFuelValue = Math.max(rFuelValue, 1600);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallCoal")) {
+ rFuelValue = Math.max(rFuelValue, 400);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyCoal")) {
+ rFuelValue = Math.max(rFuelValue, 177);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemCharcoal")) {
+ rFuelValue = Math.max(rFuelValue, 1600);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedCharcoal")) {
+ rFuelValue = Math.max(rFuelValue, 1600);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureCharcoal")) {
+ rFuelValue = Math.max(rFuelValue, 1600);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustCharcoal")) {
+ rFuelValue = Math.max(rFuelValue, 1600);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallCharcoal")) {
+ rFuelValue = Math.max(rFuelValue, 400);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyCharcoal")) {
+ rFuelValue = Math.max(rFuelValue, 177);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustWood")) {
+ rFuelValue = Math.max(rFuelValue, 100);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallWood")) {
+ rFuelValue = Math.max(rFuelValue, 25);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyWood")) {
+ rFuelValue = Math.max(rFuelValue, 11);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "plateWood")) {
+ rFuelValue = Math.min(rFuelValue, 300);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "blockLignite")) {
+ rFuelValue = Math.max(rFuelValue, 12000);
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "blockCharcoal")) {
+ rFuelValue = Math.max(rFuelValue, 16000);
+ } else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Blocks.wooden_button, 1))) {
+ rFuelValue = Math.max(rFuelValue, 150);
+ } else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Blocks.ladder, 1))) {
+ rFuelValue = Math.max(rFuelValue, 100);
+ } else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Items.sign, 1))) {
+ rFuelValue = Math.max(rFuelValue, 600);
+ } else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Items.wooden_door, 1))) {
+ rFuelValue = Math.max(rFuelValue, 600);
+ } else if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_MSSFUEL.get(1, new Object[0]))) {
+ rFuelValue = Math.max(rFuelValue, 150000);
+ }
+ if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_SSFUEL.get(1, new Object[0]))) {
+ rFuelValue = Math.max(rFuelValue, 100000);
+ }
+
+ return rFuelValue;
+ }
+
+ public Fluid addAutoGeneratedCorrespondingFluid(Materials aMaterial){
+ return addFluid(aMaterial.mName.toLowerCase(Locale.ENGLISH), "molten.autogenerated", aMaterial.mDefaultLocalName, aMaterial,
+ aMaterial.mRGBa, 1, aMaterial.getLiquidTemperature(), GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ }
+
+ public Fluid addAutoGeneratedCorrespondingGas(Materials aMaterial) {
+ return addFluid(aMaterial.mName.toLowerCase(Locale.ENGLISH), "molten.autogenerated", aMaterial.mDefaultLocalName, aMaterial,
+ aMaterial.mRGBa, 2, aMaterial.getGasTemperature(), GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ }
+
+ public Fluid addAutogeneratedMoltenFluid(Materials aMaterial) {
+ return addFluid("molten." + aMaterial.mName.toLowerCase(Locale.ENGLISH), "molten.autogenerated", "Molten " + aMaterial.mDefaultLocalName, aMaterial,
+ aMaterial.mMoltenRGBa, 4, aMaterial.mMeltingPoint <= 0 ? 1000 : aMaterial.mMeltingPoint, null, null, 0);
+ }
+
+ public Fluid addAutogeneratedWetFluid(Materials aMaterial) {
+ return addFluid("wet." + aMaterial.mName.toLowerCase(Locale.ENGLISH), "wet.autogenerated", "Wet " + aMaterial.mDefaultLocalName, aMaterial,
+ aMaterial.mMoltenRGBa, 4, aMaterial.mMeltingPoint <= 0 ? 1000 : aMaterial.mMeltingPoint, GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ }
+
+ public Fluid addAutogeneratedPlasmaFluid(Materials aMaterial) {
+ return addFluid("plasma." + aMaterial.mName.toLowerCase(Locale.ENGLISH), "plasma.autogenerated", aMaterial.mDefaultLocalName + " Plasma", aMaterial,
+ aMaterial.mMoltenRGBa, 3, 10000, GT_OreDictUnificator.get(OrePrefixes.cellPlasma, aMaterial, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ }
+
+ public void addAutoGeneratedHydroCrackedFluids(Materials aMaterial){
+ Fluid[] crackedFluids = new Fluid[3];
+ String[] prefixes = {"lightlyhydrocracked.", "moderatelyhydrocracked.", "severelyhydrocracked."};
+ String[] localPrefixes = {"Lightly Hydro-Cracked ", "Moderately Hydro-Cracked ", "Severely Hydro-Cracked "};
+ GT_Fluid uncrackedFluid = null;
+ if (aMaterial.mFluid != null) {
+ uncrackedFluid = (GT_Fluid) aMaterial.mFluid;
+ } else if (aMaterial.mGas != null) {
+ uncrackedFluid = (GT_Fluid) aMaterial.mGas;
+ }
+ for (int i = 0; i < 3; i++) {
+ crackedFluids[i] = addFluid(prefixes[i] + aMaterial.mName.toLowerCase(Locale.ENGLISH), uncrackedFluid.mTextureName,
+ localPrefixes[i] + aMaterial.mDefaultLocalName, null, aMaterial.mRGBa, 2, 775, null, null, 0);
+ int hydrogenAmount = 2 * i + 2;
+ GT_Values.RA.addCrackingRecipe(i + 1, new FluidStack(uncrackedFluid, 1000), Materials.Hydrogen.getGas(hydrogenAmount * 1000),
+ new FluidStack(crackedFluids[i], 1000), 40 + 20 * i, 120 + 60 * i);
+ GT_Values.RA.addChemicalRecipe(Materials.Hydrogen.getCells(hydrogenAmount), GT_Utility.getIntegratedCircuit(i + 1), new FluidStack(uncrackedFluid, 1000),
+ new FluidStack(crackedFluids[i], 800), Materials.Empty.getCells(hydrogenAmount), 160 + 80 * i, 30);
+ GT_Values.RA.addChemicalRecipe(aMaterial.getCells(1), GT_Utility.getIntegratedCircuit(i + 1), Materials.Hydrogen.getGas(hydrogenAmount * 1000),
+ new FluidStack(crackedFluids[i], 800), Materials.Empty.getCells(1), 160 + 80 * i, 30);
+ }
+ aMaterial.setHydroCrackedFluids(crackedFluids);
+ }
+
+ public void addAutoGeneratedSteamCrackedFluids(Materials aMaterial){
+ Fluid[] crackedFluids = new Fluid[3];
+ String[] prefixes = {"lightlysteamcracked.", "moderatelysteamcracked.", "severelysteamcracked."};
+ String[] localPrefixes = {"Lightly Steam-Cracked ", "Moderately Steam-Cracked ", "Severely Steam-Cracked "};
+ GT_Fluid uncrackedFluid = null;
+ if (aMaterial.mFluid != null) {
+ uncrackedFluid = (GT_Fluid) aMaterial.mFluid;
+ } else if (aMaterial.mGas != null) {
+ uncrackedFluid = (GT_Fluid) aMaterial.mGas;
+ }
+ for (int i = 0; i < 3; i++) {
+ crackedFluids[i] = addFluid(prefixes[i] + aMaterial.mName.toLowerCase(Locale.ENGLISH), uncrackedFluid.mTextureName,
+ localPrefixes[i] + aMaterial.mDefaultLocalName, null, aMaterial.mRGBa, 2, 775, null, null, 0);
+ GT_Values.RA.addCrackingRecipe(i + 1, new FluidStack(uncrackedFluid, 1000), GT_ModHandler.getSteam(1000),
+ new FluidStack(crackedFluids[i], 1000), 40 + 20 * i, 240 + 120 * i);
+ GT_Values.RA.addChemicalRecipe(GT_ModHandler.getIC2Item("steamCell", 1L), GT_Utility.getIntegratedCircuit(i + 1), new FluidStack(uncrackedFluid, 1000),
+ new FluidStack(crackedFluids[i], 800), Materials.Empty.getCells(1), 160 + 80 * i, 30);
+ GT_Values.RA.addChemicalRecipe(aMaterial.getCells(1), GT_Utility.getIntegratedCircuit(i + 1), GT_ModHandler.getSteam(1000),
+ new FluidStack(crackedFluids[i], 800), Materials.Empty.getCells(1), 160 + 80 * i, 30);
+ }
+ aMaterial.setSteamCrackedFluids(crackedFluids);
+ }
+
+ public Fluid addFluid(String aName, String aLocalized, Materials aMaterial, int aState, int aTemperatureK) {
+ return addFluid(aName, aLocalized, aMaterial, aState, aTemperatureK, null, null, 0);
+ }
+
+ public Fluid addFluid(String aName, String aLocalized, Materials aMaterial, int aState, int aTemperatureK, ItemStack aFullContainer,
+ ItemStack aEmptyContainer, int aFluidAmount) {
+ return addFluid(aName, aName.toLowerCase(Locale.ENGLISH), aLocalized, aMaterial, null, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount);
+ }
+
+ public Fluid addFluid(String aName, String aTexture, String aLocalized, Materials aMaterial, short[] aRGBa, int aState, int aTemperatureK,
+ ItemStack aFullContainer, ItemStack aEmptyContainer, int aFluidAmount) {
+ aName = aName.toLowerCase(Locale.ENGLISH);
+ Fluid rFluid = new GT_Fluid(aName, aTexture, aRGBa != null ? aRGBa : Dyes._NULL.getRGBA());
+ GT_LanguageManager.addStringLocalization(rFluid.getUnlocalizedName(), aLocalized == null ? aName : aLocalized);
+ if (FluidRegistry.registerFluid(rFluid)) {
+ switch (aState) {
+ case 0:
+ rFluid.setGaseous(false);
+ rFluid.setViscosity(10000);
+ break;
+ case 1:
+ case 4:
+ rFluid.setGaseous(false);
+ rFluid.setViscosity(1000);
+ break;
+ case 2:
+ rFluid.setGaseous(true);
+ rFluid.setDensity(-100);
+ rFluid.setViscosity(200);
+ break;
+ case 3:
+ rFluid.setGaseous(true);
+ rFluid.setDensity(55536);
+ rFluid.setViscosity(10);
+ rFluid.setLuminosity(15);
+ }
+ } else {
+ rFluid = FluidRegistry.getFluid(aName);
+ }
+ if (rFluid.getTemperature() == new Fluid("test").getTemperature()) {
+ rFluid.setTemperature(aTemperatureK);
+ }
+ if (aMaterial != null) {
+ switch (aState) {
+ case 0:
+ aMaterial.mSolid = rFluid;
+ break;
+ case 1:
+ aMaterial.mFluid = rFluid;
+ break;
+ case 2:
+ aMaterial.mGas = rFluid;
+ break;
+ case 3:
+ aMaterial.mPlasma = rFluid;
+ break;
+ case 4:
+ aMaterial.mStandardMoltenFluid = rFluid;
+ }
+ }
+ if ((aFullContainer != null) && (aEmptyContainer != null)
+ && (!FluidContainerRegistry.registerFluidContainer(new FluidStack(rFluid, aFluidAmount), aFullContainer, aEmptyContainer))) {
+ GT_Values.RA.addFluidCannerRecipe(aFullContainer, GT_Utility.getContainerItem(aFullContainer, false), null, new FluidStack(rFluid, aFluidAmount));
+ }
+ return rFluid;
+ }
+
+ public File getSaveDirectory() {
+ return this.mUniverse == null ? null : this.mUniverse.getSaveHandler().getWorldDirectory();
+ }
+
+ public void registerUnificationEntries() {
+ GregTech_API.sUnification.mConfig.save();
+ GregTech_API.sUnification.mConfig.load();
+ GT_OreDictUnificator.resetUnificationEntries();
+ for (OreDictEventContainer tOre : this.mEvents) {
+ if ((!(tOre.mEvent.Ore.getItem() instanceof GT_MetaGenerated_Item)) && (tOre.mPrefix != null) && (tOre.mPrefix.mIsUnificatable) && (tOre.mMaterial != null)) {
+ boolean chkmi = tOre.mModID != null;
+ if (chkmi) {
+ if (tOre.mModID.equalsIgnoreCase("enderio") && tOre.mPrefix == OrePrefixes.ingot && tOre.mMaterial == Materials.DarkSteel) {
+ GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
+ GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
+ } else if (tOre.mModID.equalsIgnoreCase("thermalfoundation") && tOre.mPrefix == OrePrefixes.dust && tOre.mMaterial == Materials.Blizz) {
+ GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
+ GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
+ } else if (tOre.mModID.equalsIgnoreCase("thermalfoundation") && tOre.mPrefix == OrePrefixes.dust && tOre.mMaterial == Materials.Pyrotheum) {
+ GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
+ GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
+ } else if (tOre.mModID.equalsIgnoreCase(aTextArsmagica2) && tOre.mPrefix == OrePrefixes.dust && tOre.mMaterial == Materials.Vinteum) {
+ GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
+ GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
+ } else if (tOre.mModID.equalsIgnoreCase(aTextArsmagica2) && tOre.mPrefix == OrePrefixes.gem && tOre.mMaterial == Materials.BlueTopaz) {
+ GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
+ GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
+ } else if (tOre.mModID.equalsIgnoreCase(aTextArsmagica2) && tOre.mPrefix == OrePrefixes.gem && tOre.mMaterial == Materials.Chimerite) {
+ GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
+ GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
+ } else if (tOre.mModID.equalsIgnoreCase(aTextArsmagica2) && tOre.mPrefix == OrePrefixes.gem && tOre.mMaterial == Materials.Moonstone) {
+ GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
+ GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
+ } else if (tOre.mModID.equalsIgnoreCase(aTextArsmagica2) && tOre.mPrefix == OrePrefixes.gem && tOre.mMaterial == Materials.Sunstone) {
+ GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
+ GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
+ } else if (tOre.mModID.equalsIgnoreCase("rotarycraft") && tOre.mPrefix == OrePrefixes.ingot && tOre.mMaterial == Materials.HSLA) {
+ GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
+ GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
+ } else if (tOre.mModID.equalsIgnoreCase("appliedenergistics2") && tOre.mPrefix == OrePrefixes.gem && tOre.mMaterial == Materials.CertusQuartz) {
+ GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
+ GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
+ } else if (tOre.mModID.equalsIgnoreCase("appliedenergistics2") && tOre.mPrefix == OrePrefixes.dust && tOre.mMaterial == Materials.CertusQuartz) {
+ GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
+ GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, true)), true);continue;
+ }
+ }
+ if (GT_OreDictUnificator.isBlacklisted(tOre.mEvent.Ore)) {
+ GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, true);
+ } else {
+ GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
+ GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (chkmi) && (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID).toString(), tOre.mEvent.Name, false)), true);
+ }
+ }
+ }
+ for (OreDictEventContainer tOre : this.mEvents) {
+ if (((tOre.mEvent.Ore.getItem() instanceof GT_MetaGenerated_Item)) && (tOre.mPrefix != null) && (tOre.mPrefix.mIsUnificatable)
+ && (tOre.mMaterial != null)) {
+ if (GT_OreDictUnificator.isBlacklisted(tOre.mEvent.Ore)) {
+ GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, true);
+ } else {
+ GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
+ GT_OreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (tOre.mModID != null) &&
+ (GregTech_API.sUnification.get(new StringBuilder().append(ConfigCategories.specialunificationtargets).append(".").append(tOre.mModID), tOre.mEvent.Name, false)), true);
+ }
+ }
+ }
+ GregTech_API.sUnificationEntriesRegistered = true;
+ GregTech_API.sUnification.mConfig.save();
+ GT_Recipe.reInit();
+ }
+
+ public void activateOreDictHandler() {
+ this.mOreDictActivated = true;
+ ProgressManager.ProgressBar progressBar = ProgressManager.push("Register materials", mEvents.size());
+ OreDictEventContainer tEvent;
+ for (Iterator i$ = this.mEvents.iterator(); i$.hasNext(); registerRecipes(tEvent)) {
+ tEvent = (OreDictEventContainer) i$.next();
+
+ progressBar.step(tEvent.mMaterial == null ? "" : tEvent.mMaterial.toString());
+ }
+ ProgressManager.pop(progressBar);
+ }
+
+ public static final HashMap<Integer,HashMap<ChunkCoordIntPair,int []>> dimensionWiseChunkData = new HashMap<>(16);//stores chunk data that is loaded/saved
+ public static final HashMap<Integer,GT_Pollution> dimensionWisePollution = new HashMap<>(16);//stores GT_Polluttors objects
+ public static final byte GTOIL=3,GTOILFLUID=2,GTPOLLUTION=1,GTMETADATA=0,NOT_LOADED=0,LOADED=1;//consts
+ //@Deprecated
+ //public static final HashMap<ChunkPosition, int[]> chunkData = new HashMap<>(0);
+
+ private static final byte oilVer=(byte)20;//non zero plz
+
+ //TO get default's fast
+ public static int[] getDefaultChunkDataOnCreation(){
+ return new int[]{NOT_LOADED,0,-1,-1};
+ }
+ public static int[] getDefaultChunkDataOnLoad(){
+ return new int[]{LOADED,0,-1,-1};
+ }
+
+
+ @SubscribeEvent
+ public void handleChunkSaveEvent(ChunkDataEvent.Save event) {//ALWAYS SAVE FROM THE HASH MAP DATA
+ HashMap<ChunkCoordIntPair,int []> chunkData=dimensionWiseChunkData.get(event.world.provider.dimensionId);
+ if(chunkData==null) return;//no dim info stored
+
+ int[] tInts = chunkData.get(event.getChunk().getChunkCoordIntPair());
+ if(tInts==null) return;//no chunk data stored
+ //assuming len of this array 4
+ if(tInts[3]>=0)event.getData().setInteger("GTOIL", tInts[GTOIL]);
+ else event.getData().removeTag("GTOIL");
+ if(tInts[2]>=0)event.getData().setInteger("GTOILFLUID", tInts[GTOILFLUID]);
+ else event.getData().removeTag("GTOILFLUID");
+ if(tInts[1]>0)event.getData().setInteger("GTPOLLUTION", tInts[GTPOLLUTION]);
+ else event.getData().removeTag("GTPOLLUTION");
+ event.getData().setByte("GTOILVER", oilVer);//version mark
+ }
+
+ @SubscribeEvent
+ public void handleChunkLoadEvent(ChunkDataEvent.Load event) {
+ final int worldID=event.world.provider.dimensionId;
+ HashMap<ChunkCoordIntPair, int[]> chunkData = dimensionWiseChunkData.get(worldID);
+ if (chunkData == null){
+ chunkData=new HashMap<>(1024);
+ dimensionWiseChunkData.put(worldID, chunkData);
+ }
+ if (dimensionWisePollution.get(worldID) == null)
+ dimensionWisePollution.put(worldID, new GT_Pollution(event.world));
+
+ int[] tInts = chunkData.get(event.getChunk().getChunkCoordIntPair());
+ if (tInts == null) {
+ //NOT LOADED and NOT PROCESSED by pollution algorithms
+ //regular load
+ tInts = getDefaultChunkDataOnLoad();
+
+ if (event.getData().getByte("GTOILVER") == oilVer) {
+ if (event.getData().hasKey("GTOIL"))
+ tInts[GTOIL] = event.getData().getInteger("GTOIL");
+ if (event.getData().hasKey("GTOILFLUID"))
+ tInts[GTOILFLUID] = event.getData().getInteger("GTOILFLUID");
+ }
+
+ tInts[GTPOLLUTION] = event.getData().getInteger("GTPOLLUTION");//Defaults to 0
+
+ //store in HASH MAP if has useful data
+ if (tInts[GTPOLLUTION] > 0 || tInts[GTOIL] >= 0 || tInts[GTOILFLUID] >= 0)
+ chunkData.put(event.getChunk().getChunkCoordIntPair(), tInts);
+ } else if (tInts[GTMETADATA] == NOT_LOADED) {//was NOT loaded from chunk save game data
+ //NOT LOADED but generated
+ //append load
+ if (event.getData().getByte("GTOILVER") == oilVer) {
+ if (tInts[GTOIL] < 0 && event.getData().hasKey("GTOIL"))//if was not yet initialized
+ tInts[GTOIL] = event.getData().getInteger("GTOIL");
+
+ if (tInts[GTOILFLUID] < 0 && event.getData().hasKey("GTOILFLUID"))//if was not yet initialized
+ tInts[GTOILFLUID] = event.getData().getInteger("GTOILFLUID");
+ } else {
+ tInts[GTOIL] = -1;
+ tInts[GTOILFLUID] = -1;
+ }
+
+ tInts[GTPOLLUTION] += event.getData().getInteger("GTPOLLUTION");//Defaults to 0, add stored pollution to data
+ tInts[GTMETADATA] = LOADED;//mark as = loaded
+ //store in HASHMAP
+
+ chunkData.put(event.getChunk().getChunkCoordIntPair(), tInts);
+ }//else if(tInts[0]==1){
+ ////Already loaded chunk data
+ ////DO NOTHING - this chunk data was already loaded and stored in hash map
+ //}
+ }
+
+ @SubscribeEvent
+ public void onBlockBreakSpeedEvent(PlayerEvent.BreakSpeed aEvent)
+ {
+ if (aEvent.newSpeed > 0.0F)
+ {
+ if (aEvent.entityPlayer != null)
+ {
+ ItemStack aStack = aEvent.entityPlayer.getCurrentEquippedItem();
+ if ((aStack != null) && ((aStack.getItem() instanceof GT_MetaGenerated_Tool))) {
+ aEvent.newSpeed = ((GT_MetaGenerated_Tool)aStack.getItem()).onBlockBreakSpeedEvent(aEvent.newSpeed, aStack, aEvent.entityPlayer, aEvent.block, aEvent.x, aEvent.y, aEvent.z, (byte)aEvent.metadata, aEvent);
+ }
+ }
+ }
+ }
+
+ public static class OreDictEventContainer {
+ public final OreDictionary.OreRegisterEvent mEvent;
+ public final OrePrefixes mPrefix;
+ public final Materials mMaterial;
+ public final String mModID;
+
+ public OreDictEventContainer(OreDictionary.OreRegisterEvent aEvent, OrePrefixes aPrefix, Materials aMaterial, String aModID) {
+ this.mEvent = aEvent;
+ this.mPrefix = aPrefix;
+ this.mMaterial = aMaterial;
+ this.mModID = ((aModID == null) || (aModID.equals("UNKNOWN")) ? null : aModID);
+ }
+ }
+
+ @SubscribeEvent
+ public void onBlockEvent(BlockEvent event) {
+ if (event.block.getUnlocalizedName().equals("blockAlloyGlass"))
+ GregTech_API.causeMachineUpdate(event.world, event.x, event.y, event.z);
+ }
+}
diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java
index 7586787505..a742994ddc 100644
--- a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java
+++ b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java
@@ -3,6 +3,7 @@ package gregtech.common.blocks;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
+import gregtech.api.interfaces.metatileentity.IConnectable;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable;
import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid;
@@ -157,6 +158,9 @@ public class GT_Item_Machines
tTileEntity.setOwnerName(aPlayer.getDisplayName());
}
tTileEntity.getMetaTileEntity().initDefaultModes(aStack.getTagCompound());
+ if (tTileEntity.getMetaTileEntity() instanceof IConnectable) {
+ ((IConnectable) tTileEntity.getMetaTileEntity()).connect(GT_Utility.getOppositeSide(side));
+ }
}
} else if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tDamage, 3)) {
return false;
diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java
index fa45a51ebc..188ef1db6d 100644
--- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java
+++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java
@@ -71,7 +71,7 @@ public class GT_MetaGenerated_Tool_01 extends GT_MetaGenerated_Tool {
GregTech_API.registerTool(addTool(20, "Crowbar", "Dismounts Covers and Rotates Rails", new GT_Tool_Crowbar(), ToolDictNames.craftingToolCrowbar, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 2L)), GregTech_API.sCrowbarList);
GregTech_API.registerTool(addTool(22, "Screwdriver", "Adjusts Covers and Machines", new GT_Tool_Screwdriver(), ToolDictNames.craftingToolScrewdriver, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sScrewdriverList);
addTool(24, "Mortar", "", new GT_Tool_Mortar(), ToolDictNames.craftingToolMortar, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L));
- addTool(26, "Wire Cutter", "", new GT_Tool_WireCutter(), ToolDictNames.craftingToolWireCutter, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L));
+ GregTech_API.registerTool(addTool(26, "Wire Cutter", "", new GT_Tool_WireCutter(), ToolDictNames.craftingToolWireCutter, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sWireCutterList);
addTool(28, "Scoop", "", new GT_Tool_Scoop(), ToolDictNames.craftingToolScoop, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.BESTIA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PANNUS, 2L));
addTool(30, "Branch Cutter", "", new GT_Tool_BranchCutter(), ToolDictNames.craftingToolBranchCutter, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L));
GregTech_API.registerTool(addTool(32, "Universal Spade", "", new GT_Tool_UniversalSpade(), ToolDictNames.craftingToolBlade, ToolDictNames.craftingToolShovel, ToolDictNames.craftingToolCrowbar, ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L)), GregTech_API.sCrowbarList);
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java
index 90d882f048..5fd46ab2fe 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java
@@ -34,7 +34,7 @@ public class Behaviour_Plunger_Item
if ((aTileEntity instanceof IGregTechTileEntity)) {
IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aTileEntity).getMetaTileEntity();
if ((tMetaTileEntity instanceof IMetaTileEntityItemPipe)) {
- for (Object tTileEntity : GT_Utility.sortMapByValuesAcending(IMetaTileEntityItemPipe.Util.scanPipes((IMetaTileEntityItemPipe) tMetaTileEntity, new ConcurrentHashMap(), 0L, false, true)).keySet())
+ for (Object tTileEntity : GT_Utility.sortMapByValuesAcending(IMetaTileEntityItemPipe.Util.scanPipes((IMetaTileEntityItemPipe) tMetaTileEntity, new ConcurrentHashMap<IMetaTileEntityItemPipe, Long>(), 0L, false, true)).keySet())
{
int i = 0;
diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingPipe.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingPipe.java
index eb3fa17cc1..3e4c89360f 100644
--- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingPipe.java
+++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingPipe.java
@@ -1,49 +1,60 @@
-package gregtech.loaders.oreprocessing;
-
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.enums.SubTag;
-import gregtech.api.enums.ToolDictNames;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.item.ItemStack;
-
-public class ProcessingPipe implements gregtech.api.interfaces.IOreRecipeRegistrator {
- public ProcessingPipe() {
- OrePrefixes.pipeHuge.add(this);
- OrePrefixes.pipeLarge.add(this);
- OrePrefixes.pipeMedium.add(this);
- OrePrefixes.pipeSmall.add(this);
- OrePrefixes.pipeTiny.add(this);
- OrePrefixes.pipeRestrictiveHuge.add(this);
- OrePrefixes.pipeRestrictiveLarge.add(this);
- OrePrefixes.pipeRestrictiveMedium.add(this);
- OrePrefixes.pipeRestrictiveSmall.add(this);
- OrePrefixes.pipeRestrictiveTiny.add(this);
- }
-
- @Override
- public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
- switch (aPrefix) {
- case pipeHuge:
- case pipeLarge:
- case pipeMedium:
- case pipeSmall:
- case pipeTiny:
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.pipeTiny, aMaterial, 8L), new Object[]{"PPP", "h w", "PPP", 'P', OrePrefixes.plate.get(aMaterial)});
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.pipeSmall, aMaterial, 6L), new Object[]{"PWP", "P P", "PHP", 'P', aMaterial == Materials.Wood ? OrePrefixes.plank.get(aMaterial) : OrePrefixes.plate.get(aMaterial), 'H', aMaterial.contains(SubTag.WOOD) ? ToolDictNames.craftingToolSoftHammer : ToolDictNames.craftingToolHardHammer, 'W', aMaterial.contains(SubTag.WOOD) ? ToolDictNames.craftingToolSaw : ToolDictNames.craftingToolWrench});
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.pipeMedium, aMaterial, 2L), new Object[]{"PPP", "W H", "PPP", 'P', aMaterial == Materials.Wood ? OrePrefixes.plank.get(aMaterial) : OrePrefixes.plate.get(aMaterial), 'H', aMaterial.contains(SubTag.WOOD) ? ToolDictNames.craftingToolSoftHammer : ToolDictNames.craftingToolHardHammer, 'W', aMaterial.contains(SubTag.WOOD) ? ToolDictNames.craftingToolSaw : ToolDictNames.craftingToolWrench});
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.pipeLarge, aMaterial, 1L), new Object[]{"PHP", "P P", "PWP", 'P', aMaterial == Materials.Wood ? OrePrefixes.plank.get(aMaterial) : OrePrefixes.plate.get(aMaterial), 'H', aMaterial.contains(SubTag.WOOD) ? ToolDictNames.craftingToolSoftHammer : ToolDictNames.craftingToolHardHammer, 'W', aMaterial.contains(SubTag.WOOD) ? ToolDictNames.craftingToolSaw : ToolDictNames.craftingToolWrench});
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.pipeHuge, aMaterial, 1L), new Object[]{"DhD", "D D", "DwD", 'D', OrePrefixes.plateDouble.get(aMaterial)});
- break;
- case pipeRestrictiveHuge:
- case pipeRestrictiveLarge:
- case pipeRestrictiveMedium:
- case pipeRestrictiveSmall:
- case pipeRestrictiveTiny:
- gregtech.api.enums.GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(aOreDictName.replaceFirst("Restrictive", ""), null, 1L, false, true), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Steel, aPrefix.mSecondaryMaterial.mAmount / OrePrefixes.ring.mMaterialAmount), GT_Utility.copyAmount(1L, new Object[]{aStack}), (int) (aPrefix.mSecondaryMaterial.mAmount * 400L / OrePrefixes.ring.mMaterialAmount), 4);
- break;
- }
- }
+package gregtech.loaders.oreprocessing;
+
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.SubTag;
+import gregtech.api.enums.ToolDictNames;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.item.ItemStack;
+
+public class ProcessingPipe implements gregtech.api.interfaces.IOreRecipeRegistrator {
+ public ProcessingPipe() {
+ OrePrefixes.pipeHuge.add(this);
+ OrePrefixes.pipeLarge.add(this);
+ OrePrefixes.pipeMedium.add(this);
+ OrePrefixes.pipeSmall.add(this);
+ OrePrefixes.pipeTiny.add(this);
+ OrePrefixes.pipeRestrictiveHuge.add(this);
+ OrePrefixes.pipeRestrictiveLarge.add(this);
+ OrePrefixes.pipeRestrictiveMedium.add(this);
+ OrePrefixes.pipeRestrictiveSmall.add(this);
+ OrePrefixes.pipeRestrictiveTiny.add(this);
+ OrePrefixes.pipeQuadruple.add(this);
+ OrePrefixes.pipeNonuple.add(this);
+ }
+
+ @Override
+ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
+ switch (aPrefix) {
+ case pipeHuge:
+ case pipeLarge:
+ case pipeMedium:
+ case pipeSmall:
+ case pipeTiny:
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.pipeTiny, aMaterial, 8L), new Object[]{"PPP", "h w", "PPP", 'P', OrePrefixes.plate.get(aMaterial)});
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.pipeSmall, aMaterial, 6L), new Object[]{"PWP", "P P", "PHP", 'P', aMaterial == Materials.Wood ? OrePrefixes.plank.get(aMaterial) : OrePrefixes.plate.get(aMaterial), 'H', aMaterial.contains(SubTag.WOOD) ? ToolDictNames.craftingToolSoftHammer : ToolDictNames.craftingToolHardHammer, 'W', aMaterial.contains(SubTag.WOOD) ? ToolDictNames.craftingToolSaw : ToolDictNames.craftingToolWrench});
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.pipeMedium, aMaterial, 2L), new Object[]{"PPP", "W H", "PPP", 'P', aMaterial == Materials.Wood ? OrePrefixes.plank.get(aMaterial) : OrePrefixes.plate.get(aMaterial), 'H', aMaterial.contains(SubTag.WOOD) ? ToolDictNames.craftingToolSoftHammer : ToolDictNames.craftingToolHardHammer, 'W', aMaterial.contains(SubTag.WOOD) ? ToolDictNames.craftingToolSaw : ToolDictNames.craftingToolWrench});
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.pipeLarge, aMaterial, 1L), new Object[]{"PHP", "P P", "PWP", 'P', aMaterial == Materials.Wood ? OrePrefixes.plank.get(aMaterial) : OrePrefixes.plate.get(aMaterial), 'H', aMaterial.contains(SubTag.WOOD) ? ToolDictNames.craftingToolSoftHammer : ToolDictNames.craftingToolHardHammer, 'W', aMaterial.contains(SubTag.WOOD) ? ToolDictNames.craftingToolSaw : ToolDictNames.craftingToolWrench});
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.pipeHuge, aMaterial, 1L), new Object[]{"DhD", "D D", "DwD", 'D', OrePrefixes.plateDouble.get(aMaterial)});
+ break;
+ case pipeRestrictiveHuge:
+ case pipeRestrictiveLarge:
+ case pipeRestrictiveMedium:
+ case pipeRestrictiveSmall:
+ case pipeRestrictiveTiny:
+ gregtech.api.enums.GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(aOreDictName.replaceFirst("Restrictive", ""), null, 1L, false, true), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Steel, aPrefix.mSecondaryMaterial.mAmount / OrePrefixes.ring.mMaterialAmount), GT_Utility.copyAmount(1L, new Object[]{aStack}), (int) (aPrefix.mSecondaryMaterial.mAmount * 400L / OrePrefixes.ring.mMaterialAmount), 4);
+ break;
+ case pipeQuadruple:
+ GT_ModHandler.addCraftingRecipe(GT_Utility.copyAmount(1, new Object[]{aStack}), GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PP ", "PP ", " ", 'P', GT_OreDictUnificator.get(aOreDictName.replaceFirst("Quadruple", "Medium"), null, 1L, false, true)});
+ gregtech.api.enums.GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(aOreDictName.replaceFirst("Quadruple", "Medium"), null, 4L, false, true), ItemList.Circuit_Integrated.getWithDamage(0, 4), GT_Utility.copyAmount(1L, new Object[]{aStack}), 40 ,8);
+ break;
+ case pipeNonuple:
+ GT_ModHandler.addCraftingRecipe(GT_Utility.copyAmount(1, new Object[]{aStack}), GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "PPP", "PPP", 'P', GT_OreDictUnificator.get(aOreDictName.replaceFirst("Nonuple", "Small"), null, 1L, false, true)});
+ gregtech.api.enums.GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(aOreDictName.replaceFirst("Nonuple", "Small"), null, 9L, false, true), ItemList.Circuit_Integrated.getWithDamage(0, 9), GT_Utility.copyAmount(1L, new Object[]{aStack}), 60 ,8);
+ break;
+ }
+ }
} \ No newline at end of file
diff --git a/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java b/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java
index ec01d5cb2b..8c2ecb2f1b 100644
--- a/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java
+++ b/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java
@@ -1670,4 +1670,13 @@ public class GT_Loader_MetaTileEntities implements Runnable {//TODO CHECK CIRCUI
GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(aMaterial), new GT_MetaPipeEntity_Fluid(startID + 3, "GT_Pipe_" + name + "_Large", "Large " + displayName + " Fluid Pipe", 0.75F, aMaterial, baseCapacity * 2, heatCapacity, gasProof).getStackForm(1L));
GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(aMaterial), new GT_MetaPipeEntity_Fluid(startID + 4, "GT_Pipe_" + name + "_Huge", "Huge " + displayName + " Fluid Pipe", 0.875F, aMaterial, baseCapacity * 4, heatCapacity, gasProof).getStackForm(1L));
}
+
+ private static void generateFluidMultiPipes(Materials aMaterial, String name, int startID, int baseCapacity, int heatCapacity, boolean gasProof){
+ generateFluidMultiPipes(aMaterial, name, "%material", startID, baseCapacity, heatCapacity, gasProof);
+ }
+
+ private static void generateFluidMultiPipes(Materials aMaterial, String name, String displayName, int startID, int baseCapacity, int heatCapacity, boolean gasProof){
+ GT_OreDictUnificator.registerOre(OrePrefixes.pipeQuadruple.get(aMaterial), new GT_MetaPipeEntity_Fluid(startID, "GT_Pipe_" + name + "_Quadruple", "Quadruple " + displayName + " Fluid Pipe", 1.0F, aMaterial, baseCapacity, heatCapacity, gasProof, 4).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.pipeNonuple.get(aMaterial), new GT_MetaPipeEntity_Fluid(startID + 1, "GT_Pipe_" + name + "_Nonuple", "Nonuple " + displayName + " Fluid Pipe", 1.0F, aMaterial, baseCapacity / 3, heatCapacity, gasProof, 9).getStackForm(1L));
+ }
}
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_DL.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_DL.png
new file mode 100644
index 0000000000..766311a952
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_DL.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_DOWN.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_DOWN.png
new file mode 100644
index 0000000000..285fbf58e8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_DOWN.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_DR.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_DR.png
new file mode 100644
index 0000000000..4d35191c5a
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_DR.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_LEFT.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_LEFT.png
new file mode 100644
index 0000000000..a4e79be13e
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_LEFT.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_LR.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_LR.png
new file mode 100644
index 0000000000..9346841e20
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_LR.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_ND.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_ND.png
new file mode 100644
index 0000000000..9c759e8446
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_ND.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_NL.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_NL.png
new file mode 100644
index 0000000000..c59fde72c8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_NL.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_NR.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_NR.png
new file mode 100644
index 0000000000..9578cf6b80
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_NR.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_NU.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_NU.png
new file mode 100644
index 0000000000..4fdda008b4
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_NU.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_RIGHT.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_RIGHT.png
new file mode 100644
index 0000000000..87fc09f32e
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_RIGHT.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_UD.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_UD.png
new file mode 100644
index 0000000000..1fd53d6da3
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_UD.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_UL.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_UL.png
new file mode 100644
index 0000000000..e1f7e75f0d
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_UL.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_UP.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_UP.png
new file mode 100644
index 0000000000..344d254342
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_UP.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_UR.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_UR.png
new file mode 100644
index 0000000000..cc316b91d4
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/PIPE_RESTRICTOR_UR.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/pipeNonuple.png
new file mode 100644
index 0000000000..1fa5d94142
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/pipeQuadruple.png
new file mode 100644
index 0000000000..8ceeb8e25f
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/pipeNonuple.png
new file mode 100644
index 0000000000..b33a1bac91
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/pipeQuadruple.png
new file mode 100644
index 0000000000..343e8ff5b8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/pipeQuadruple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/pipeNonuple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/pipeNonuple.png
new file mode 100644
index 0000000000..1fa5d94142
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/pipeNonuple.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/pipeQuadruple.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/pipeQuadruple.png
new file mode 100644
index 0000000000..8ceeb8e25f
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/pipeQuadruple.png
Binary files differ