From 072f6322fb789703f163030edf4b60bf5a0201af Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Sat, 27 Aug 2016 01:34:08 +1000 Subject: + Attempted to add custom IC2 generators. % Refactored the xmod package to be a parent, beside core. No longer is it a child, it needs room to grow. --- .../xmod/gregtech/common/Meta_GT_Proxy.java | 429 ++++++++++++++++++++ .../common/blocks/GregtechMetaCasingBlocks.java | 76 ++++ .../blocks/GregtechMetaCasingBlocksAbstract.java | 143 +++++++ .../common/blocks/GregtechMetaCasingItems.java | 11 + .../common/blocks/GregtechMetaItemCasings1.java | 33 ++ .../blocks/GregtechMetaItemCasingsAbstract.java | 45 +++ .../common/blocks/fluid/GregtechFluidHandler.java | 39 ++ .../blocks/textures/CasingTextureHandler.java | 66 +++ .../common/blocks/textures/TexturesGregtech58.java | 441 ++++++++++++++++++++ .../common/blocks/textures/TexturesGregtech59.java | 442 +++++++++++++++++++++ .../common/items/MetaGeneratedGregtechItems.java | 163 ++++++++ .../common/items/MetaGeneratedGregtechTools.java | 39 ++ .../generators/GT_MetaTileEntity_Boiler_Solar.java | 144 +++++++ .../GregtechMetaTileEntityRocketFuelGenerator.java | 119 ++++++ .../GregtechMetaTileEntitySolarGenerator.java | 174 ++++++++ .../GregtechMetaTileEntitySuperCondensor.java | 104 +++++ ...GregtechMetaTileEntityIndustrialCentrifuge.java | 326 +++++++++++++++ .../GregtechMetaTileEntityIndustrialCokeOven.java | 272 +++++++++++++ ...egtechMetaTileEntityIndustrialElectrolyzer.java | 258 ++++++++++++ .../GregtechMetaTileEntityIndustrialMacerator.java | 278 +++++++++++++ ...GregtechMetaTileEntityIndustrialPlatePress.java | 204 ++++++++++ .../GregtechMetaTileEntityIndustrialSinter.java | 263 ++++++++++++ .../GregtechMetaTileEntityIndustrialWireMill.java | 246 ++++++++++++ .../GregtechMetaTileEntityIronBlastFurnace.java | 373 +++++++++++++++++ .../GregtechMetaTileEntityMassFabricator.java | 304 ++++++++++++++ .../gregtech/common/tools/TOOL_Gregtech_Base.java | 168 ++++++++ .../tools/TOOL_Gregtech_BaseMultiblockItem.java | 49 +++ .../common/tools/TOOL_Gregtech_Choocher.java | 198 +++++++++ .../TOOL_Gregtech_MaxEfficiencyMultiBlockItem.java | 27 ++ 29 files changed, 5434 insertions(+) create mode 100644 src/Java/miscutil/xmod/gregtech/common/Meta_GT_Proxy.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySuperCondensor.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialElectrolyzer.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialMacerator.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialPlatePress.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialSinter.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialWireMill.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIronBlastFurnace.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/tools/TOOL_Gregtech_BaseMultiblockItem.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java create mode 100644 src/Java/miscutil/xmod/gregtech/common/tools/TOOL_Gregtech_MaxEfficiencyMultiBlockItem.java (limited to 'src/Java/miscutil/xmod/gregtech/common') diff --git a/src/Java/miscutil/xmod/gregtech/common/Meta_GT_Proxy.java b/src/Java/miscutil/xmod/gregtech/common/Meta_GT_Proxy.java new file mode 100644 index 0000000000..5be3170471 --- /dev/null +++ b/src/Java/miscutil/xmod/gregtech/common/Meta_GT_Proxy.java @@ -0,0 +1,429 @@ +package miscutil.xmod.gregtech.common; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Proxy.OreDictEventContainer; + +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; + +import miscutil.core.lib.CORE; +import miscutil.core.util.Utils; +import miscutil.xmod.gregtech.api.enums.GregtechOrePrefixes; +import miscutil.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; +import miscutil.xmod.gregtech.api.objects.GregtechFluid; +import miscutil.xmod.gregtech.api.util.GregtechOreDictUnificator; +import miscutil.xmod.gregtech.api.util.GregtechRecipeRegistrator; +import miscutil.xmod.gregtech.common.items.MetaGeneratedGregtechItems; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +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 cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class Meta_GT_Proxy { + + //Silly Vars + private static final Collection mIgnoredItems = new HashSet(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 static final Collection mIgnoredNames = new HashSet(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 static final Collection mInvalidNames = new HashSet(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"})); + public static boolean mOreDictActivated = false; + public static boolean mSortToTheEnd = true; + public final static HashSet mRegisteredOres = new HashSet(10000); + public final static Collection mEvents = new HashSet(); + + public Meta_GT_Proxy() { + Utils.LOG_INFO("GT_PROXY - initialized."); + 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(); + } + } + } + + public static Fluid addFluid(String aName, String aLocalized, GT_Materials aMaterial, int aState, int aTemperatureK) { + return addFluid(aName, aLocalized, aMaterial, aState, aTemperatureK, null, null, 0); + } + + public static Fluid addFluid(String aName, String aLocalized, GT_Materials aMaterial, int aState, int aTemperatureK, ItemStack aFullContainer, + ItemStack aEmptyContainer, int aFluidAmount) { + return addFluid(aName, aName.toLowerCase(), aLocalized, aMaterial, null, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount); + } + + public static Fluid addFluid(String aName, String aTexture, String aLocalized, GT_Materials aMaterial, short[] aRGBa, int aState, int aTemperatureK, + ItemStack aFullContainer, ItemStack aEmptyContainer, int aFluidAmount) { + aName = aName.toLowerCase(); + Fluid rFluid = new GregtechFluid(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; + } + + @SubscribeEvent + public static void registerOre(OreDictionary.OreRegisterEvent aEvent) { + ModContainer tContainer = Loader.instance().activeModContainer(); + String aMod = tContainer == null ? "UNKNOWN" : tContainer.getModId(); + String aOriginalMod = aMod; + if (GregtechOreDictUnificator.isRegisteringOres()) { + aMod = CORE.MODID; + } else if (aMod.equals(CORE.MODID)) { + 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(CORE.MODID)) { + 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; + + String tModToName = aMod + " -> " + aEvent.Name; + if ((mOreDictActivated) || (GregTech_API.sPostloadStarted) || ((mSortToTheEnd) && (GregTech_API.sLoadFinished))) { + tModToName = aOriginalMod + " --Late--> " + aEvent.Name; + } + if (((aEvent.Ore.getItem() instanceof ItemBlock)) || (GT_Utility.getBlockFromStack(aEvent.Ore) != Blocks.air)) { + GregtechOreDictUnificator.addToBlacklist(aEvent.Ore); + } + mRegisteredOres.add(aEvent.Ore); + if (mIgnoredNames.contains(aEvent.Name)) { + GT_Log.ore.println(tModToName + " is getting ignored via hardcode."); + return; + } + 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; + } + if (aEvent.Name.contains(" ")) { + GT_Log.ore.println(tModToName + " is getting re-registered because the OreDict Name containing invalid spaces."); + GregtechOreDictUnificator.registerOre(aEvent.Name.replaceAll(" ", ""), GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore})); + aEvent.Ore.setStackDisplayName("Invalid OreDictionary Tag"); + return; + } + if (mInvalidNames.contains(aEvent.Name)) { + GT_Log.ore.println(tModToName + " is wrongly registered and therefor getting ignored."); + + return; + } + GregtechOrePrefixes aPrefix = GregtechOrePrefixes.getOrePrefix(aEvent.Name); + GT_Materials aMaterial = GT_Materials._NULL; + if (aPrefix == null) { + if (aEvent.Name.toLowerCase().equals(aEvent.Name)) { + GT_Log.ore.println(tModToName + " is invalid due to being solely lowercased."); + return; + } + if (aEvent.Name.toUpperCase().equals(aEvent.Name)) { + GT_Log.ore.println(tModToName + " is invalid due to being solely uppercased."); + return; + } + 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) { + GregtechOreDictUnificator.addToBlacklist(aEvent.Ore); + } + if (aPrefix != aPrefix.mPrefixInto) { + String tNewName = aEvent.Name.replaceFirst(aPrefix.toString(), aPrefix.mPrefixInto.toString()); + if (!GregtechOreDictUnificator.isRegisteringOres()) { + GT_Log.ore.println(tModToName + " uses a depricated Prefix, and is getting re-registered as " + tNewName); + } + GregtechOreDictUnificator.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 = GT_Materials.get(tName); + if (aMaterial != aMaterial.mMaterialInto) { + GregtechOreDictUnificator.registerOre(aPrefix, aMaterial.mMaterialInto, aEvent.Ore); + if (!GregtechOreDictUnificator.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 != GT_Materials._NULL) { + GT_Materials tReRegisteredMaterial; + for (Iterator i$ = aMaterial.mOreReRegistrations.iterator(); i$.hasNext(); GregtechOreDictUnificator.registerOre(aPrefix, + tReRegisteredMaterial, aEvent.Ore)) { + tReRegisteredMaterial = (GT_Materials) i$.next(); + } + aMaterial.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore})); + switch (aPrefix) { + case gem: + break; + case plate: + break; + case stick: + if (!GregtechRecipeRegistrator.sRodMaterialList.contains(aMaterial)) { + GregtechRecipeRegistrator.sRodMaterialList.add(aMaterial); + } + break; + case dust: + break; + case ingot: + break; + } + if (aPrefix.mIsUnificatable && !aMaterial.mUnificatable) { + return; + } + } else { + for (Dyes tDye : Dyes.VALUES) { + if (aEvent.Name.endsWith(tDye.name().replaceFirst("dye", ""))) { + GregtechOreDictUnificator.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; + } + } + GT_Log.ore.println(tModToName); + GregtechOreDictEventContainer tOre = new GregtechOreDictEventContainer(aEvent, aPrefix, aMaterial, aMod); + if ((!mOreDictActivated) || (!GregTech_API.sUnificationEntriesRegistered)) { + mEvents.add(tOre); + } else { + mEvents.clear(); + } + if (mOreDictActivated) { + registerRecipes(tOre); + } + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } + } + + private static final void registerRecipes(GregtechOreDictEventContainer tOre) { + if ((tOre.mEvent.Ore == null) || (tOre.mEvent.Ore.getItem() == null)) { + return; + } + if (tOre.mEvent.Ore.stackSize != 1) { + tOre.mEvent.Ore.stackSize = 1; + } + if (tOre.mPrefix != null) { + if (!tOre.mPrefix.isIgnored(tOre.mMaterial)) { + tOre.mPrefix.processOre((GT_Materials) (tOre.mMaterial == null ? GT_Materials._NULL : tOre.mMaterial), tOre.mEvent.Name, tOre.mModID, + GT_Utility.copyAmount(1L, new Object[]{tOre.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."); + } + } + + 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 static void registerUnificationEntries() { + GregTech_API.sUnification.mConfig.save(); + GregTech_API.sUnification.mConfig.load(); + GregtechOreDictUnificator.resetUnificationEntries(); + for (GregtechOreDictEventContainer tOre : mEvents) { + if ((!(tOre.mEvent.Ore.getItem() instanceof MetaGeneratedGregtechItems)) && (tOre.mPrefix != null) && (tOre.mPrefix.mIsUnificatable) + && (tOre.mMaterial != null)) { + if (GregtechOreDictUnificator.isBlacklisted(tOre.mEvent.Ore)) { + GregtechOreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, true); + } else { + GregtechOreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); + GregtechOreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (tOre.mModID != null) && (GregTech_API.sUnification.get(ConfigCategories.specialunificationtargets + "." + tOre.mModID, tOre.mEvent.Name, false)), true); + } + } + } + for (GregtechOreDictEventContainer tOre : mEvents) { + if (((tOre.mEvent.Ore.getItem() instanceof MetaGeneratedGregtechItems)) && (tOre.mPrefix != null) && (tOre.mPrefix.mIsUnificatable) + && (tOre.mMaterial != null)) { + if (GregtechOreDictUnificator.isBlacklisted(tOre.mEvent.Ore)) { + GregtechOreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, true); + } else { + GregtechOreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); + GregtechOreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (tOre.mModID != null) && + (GregTech_API.sUnification.get(ConfigCategories.specialunificationtargets + "." + tOre.mModID, tOre.mEvent.Name, false)), true); + } + } + } + GregTech_API.sUnificationEntriesRegistered = true; + GregTech_API.sUnification.mConfig.save(); + GT_Recipe.reInit(); + } + + public static void activateOreDictHandler() { + mOreDictActivated = true; + GregtechOreDictEventContainer tEvent; + for (Iterator i$ = mEvents.iterator(); i$.hasNext(); registerRecipes(tEvent)) { + tEvent = (GregtechOreDictEventContainer) i$.next(); + } + } + + + //Dunno + public static class GregtechOreDictEventContainer { + public final OreDictionary.OreRegisterEvent mEvent; + public final GregtechOrePrefixes mPrefix; + public final GT_Materials mMaterial; + public final String mModID; + + public GregtechOreDictEventContainer(OreDictionary.OreRegisterEvent aEvent, GregtechOrePrefixes aPrefix, GT_Materials aMaterial, String aModID) { + this.mEvent = aEvent; + this.mPrefix = aPrefix; + this.mMaterial = aMaterial; + this.mModID = ((aModID == null) || (aModID.equals("UNKNOWN")) ? null : aModID); + } + } + + public static boolean areWeUsingGregtech5uExperimental(){ + int version = GregTech_API.VERSION; + if (version == 508){ + return false; + } + else if (version == 509){ + return true; + } + else { + return false; + } + } + +} diff --git a/src/Java/miscutil/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java b/src/Java/miscutil/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java new file mode 100644 index 0000000000..b6a79955a8 --- /dev/null +++ b/src/Java/miscutil/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java @@ -0,0 +1,76 @@ +package miscutil.xmod.gregtech.common.blocks; + +import gregtech.api.enums.Textures; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.util.GT_LanguageManager; +import gregtech.common.blocks.GT_Material_Casings; +import miscutil.xmod.gregtech.api.enums.GregtechItemList; +import miscutil.xmod.gregtech.common.blocks.textures.CasingTextureHandler; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class GregtechMetaCasingBlocks +extends GregtechMetaCasingBlocksAbstract { + + public final static int GTID = 57; + + CasingTextureHandler TextureHandler = new CasingTextureHandler(); + + public GregtechMetaCasingBlocks() { + super(GregtechMetaCasingItems.class, "miscutils.blockcasings", GT_Material_Casings.INSTANCE); + for (byte i = 0; i < 16; i = (byte) (i + 1)) { + Textures.BlockIcons.CASING_BLOCKS[GTID + i] = new GT_CopiedBlockTexture(this, 6, i); + } + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Centrifuge Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Structural Coke Oven Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Heat Resistant Coke Oven Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Heat Proof Coke Oven Casing"); //60 + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Material Press Machine Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Electrolyzer Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Wire Factory Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Maceration Stack Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Matter Generation Coil"); //65 + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "Matter Fabricator Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Iron Plated Bricks"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Unused Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Unused Coil Block"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Unused Coil Block"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Unused Coil Block"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Unused Coil Block"); + GregtechItemList.Casing_Centrifuge1.set(new ItemStack(this, 1, 0)); + GregtechItemList.Casing_CokeOven.set(new ItemStack(this, 1, 1)); + GregtechItemList.Casing_CokeOven_Coil1.set(new ItemStack(this, 1, 2)); + GregtechItemList.Casing_CokeOven_Coil2.set(new ItemStack(this, 1, 3)); + GregtechItemList.Casing_MaterialPress.set(new ItemStack(this, 1, 4)); + GregtechItemList.Casing_Electrolyzer.set(new ItemStack(this, 1, 5)); + GregtechItemList.Casing_WireFactory.set(new ItemStack(this, 1, 6)); + GregtechItemList.Casing_MacerationStack.set(new ItemStack(this, 1, 7)); + GregtechItemList.Casing_MatterGen.set(new ItemStack(this, 1, 8)); + GregtechItemList.Casing_MatterFab.set(new ItemStack(this, 1, 9)); + GregtechItemList.Casing_IronPlatedBricks.set(new ItemStack(this, 1, 10)); + GregtechItemList.Casing_U7.set(new ItemStack(this, 1, 11)); + GregtechItemList.Casing_Coil_U1.set(new ItemStack(this, 1, 12)); + GregtechItemList.Casing_Coil_U2.set(new ItemStack(this, 1, 13)); + GregtechItemList.Casing_Coil_U3.set(new ItemStack(this, 1, 14)); + GregtechItemList.Casing_Coil_U4.set(new ItemStack(this, 1, 15)); + } + + @Override + public IIcon getIcon(int aSide, int aMeta) { //Texture ID's. case 0 == ID[57] + return TextureHandler.getIcon(aSide, aMeta); + } + + + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide) { + GregtechMetaCasingBlocks i = this; + return TextureHandler.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, i); + } + + +} diff --git a/src/Java/miscutil/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java b/src/Java/miscutil/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java new file mode 100644 index 0000000000..3286fa51c4 --- /dev/null +++ b/src/Java/miscutil/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java @@ -0,0 +1,143 @@ +package miscutil.xmod.gregtech.common.blocks; + +import gregtech.api.GregTech_API; +import gregtech.api.util.GT_LanguageManager; +import gregtech.common.blocks.GT_Block_Casings_Abstract; + +import java.util.List; +import java.util.Random; + +import miscutil.core.creative.AddToCreativeTab; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public abstract class GregtechMetaCasingBlocksAbstract + extends GT_Block_Casings_Abstract { + public GregtechMetaCasingBlocksAbstract(Class aItemClass, String aName, Material aMaterial) { + super(aItemClass, aName, aMaterial); + setStepSound(soundTypeMetal); + setCreativeTab(AddToCreativeTab.tabMachines); + GregTech_API.registerMachineBlock(this, -1); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + 32767 + ".name", "Any Sub Block of this"); + } + + @Override + public String getHarvestTool(int aMeta) { + return "wrench"; + } + + @Override + public int getHarvestLevel(int aMeta) { + return 2; + } + + @Override + public float getBlockHardness(World aWorld, int aX, int aY, int aZ) { + return Blocks.iron_block.getBlockHardness(aWorld, aX, aY, aZ); + } + + @Override + public float getExplosionResistance(Entity aTNT) { + return Blocks.iron_block.getExplosionResistance(aTNT); + } + + @Override + protected boolean canSilkHarvest() { + return false; + } + + @Override + public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { + if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + } + } + + @Override + public String getUnlocalizedName() { + return this.mUnlocalizedName; + } + + @Override + public String getLocalizedName() { + return StatCollector.translateToLocal(this.mUnlocalizedName + ".name"); + } + + @Override + public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) { + return false; + } + + @Override + public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) { + return true; + } + + @Override + public boolean renderAsNormalBlock() { + return true; + } + + @Override + public boolean isOpaqueCube() { + return true; + } + + @Override + public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) { + if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + } + } + + @Override + public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) { + return false; + } + + @Override + public int damageDropped(int par1) { + return par1; + } + + @Override + public int getDamageValue(World par1World, int par2, int par3, int par4) { + return par1World.getBlockMetadata(par2, par3, par4); + } + + @Override + public int quantityDropped(Random par1Random) { + return 1; + } + + @Override + public Item getItemDropped(int par1, Random par2Random, int par3) { + return Item.getItemFromBlock(this); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister aIconRegister) { + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { + for (int i = 0; i < 16; i++) { + aList.add(new ItemStack(aItem, 1, i)); + } + } +} diff --git a/src/Java/miscutil/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java b/src/Java/miscutil/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java new file mode 100644 index 0000000000..a3307e4946 --- /dev/null +++ b/src/Java/miscutil/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java @@ -0,0 +1,11 @@ +package miscutil.xmod.gregtech.common.blocks; + +import gregtech.common.blocks.GT_Item_Casings_Abstract; +import net.minecraft.block.Block; + +public class GregtechMetaCasingItems + extends GT_Item_Casings_Abstract { + public GregtechMetaCasingItems(Block par1) { + super(par1); + } +} diff --git a/src/Java/miscutil/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java b/src/Java/miscutil/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java new file mode 100644 index 0000000000..fbc8d1e06c --- /dev/null +++ b/src/Java/miscutil/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java @@ -0,0 +1,33 @@ +package miscutil.xmod.gregtech.common.blocks; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class GregtechMetaItemCasings1 +extends GregtechMetaItemCasingsAbstract { + public GregtechMetaItemCasings1(Block par1) { + super(par1); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + super.addInformation(aStack, aPlayer, aList, aF3_H); + switch (getDamage(aStack)) { + case 0: + aList.add(this.mCasing_Centrifuge); + break; + case 1: + aList.add(this.mCasing_CokeOven); + break; + case 2: + aList.add(this.mCasing_CokeCoil1); + break; + case 3: + aList.add(this.mCasing_CokeCoil2); + break; + } + } +} diff --git a/src/Java/miscutil/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java b/src/Java/miscutil/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java new file mode 100644 index 0000000000..e2cd31174d --- /dev/null +++ b/src/Java/miscutil/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java @@ -0,0 +1,45 @@ +package miscutil.xmod.gregtech.common.blocks; + +import gregtech.api.util.GT_LanguageManager; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public abstract class GregtechMetaItemCasingsAbstract + extends ItemBlock { + + protected final String mCasing_Centrifuge = GT_LanguageManager.addStringLocalization("mu.centrifugecasing", "Warning! Standing in the Centrifuge not recommended"); + protected final String mCasing_CokeOven = GT_LanguageManager.addStringLocalization("mu.cokeoven", "Sturdy and Strong"); + protected final String mCasing_CokeCoil1 = GT_LanguageManager.addStringLocalization("mu.coil01tooltip", "Base Heating Capacity = 1350 Kelvin"); + protected final String mCasing_CokeCoil2 = GT_LanguageManager.addStringLocalization("mu.coil02tooltip", "Base Heating Capacity = 2275 Kelvin"); + protected final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); + protected final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); + + public GregtechMetaItemCasingsAbstract(Block par1) { + super(par1); + setMaxDamage(0); + setHasSubtypes(true); + //setCreativeTab(AddToCreativeTab.tabMachines); + } + + @Override + public int getMetadata(int aMeta) { + return aMeta; + } + + @Override + public String getUnlocalizedName(ItemStack aStack) { + return this.field_150939_a.getUnlocalizedName() + "." + getDamage(aStack); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + super.addInformation(aStack, aPlayer, aList, aF3_H); + aList.add(this.mNoMobsToolTip); + aList.add(this.mNoTileEntityToolTip); + } +} diff --git a/src/Java/miscutil/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java b/src/Java/miscutil/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java new file mode 100644 index 0000000000..ff6f3ae01a --- /dev/null +++ b/src/Java/miscutil/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java @@ -0,0 +1,39 @@ +package miscutil.xmod.gregtech.common.blocks.fluid; + +import gregtech.api.enums.ItemList; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_OreDictUnificator; +import miscutil.core.util.Utils; +import miscutil.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; +import miscutil.xmod.gregtech.common.Meta_GT_Proxy; + +public class GregtechFluidHandler { + + public static void run(){ + start(); + } + + private static void start(){ + + /* Meta_GT_Proxy.addFluid("lubricant", "Lubricant", Materials.Lubricant, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Lubricant, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); + Meta_GT_Proxy.addFluid("creosote", "Creosote Oil", Materials.Creosote, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Creosote, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); + Meta_GT_Proxy.addFluid("seedoil", "Seed Oil", Materials.SeedOil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.SeedOil, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); + Meta_GT_Proxy.addFluid("fishoil", "Fish Oil", Materials.FishOil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.FishOil, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); + Meta_GT_Proxy.addFluid("oil", "Oil", Materials.Oil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Oil, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); + Meta_GT_Proxy.addFluid("fuel", "Diesel", Materials.Fuel, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fuel, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); + Meta_GT_Proxy.addFluid("for.honey", "Honey", Materials.Honey, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Honey, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); + Meta_GT_Proxy.addFluid("biomass", "Biomass", Materials.Biomass, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Biomass, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); + Meta_GT_Proxy.addFluid("bioethanol", "Bio Ethanol", Materials.Ethanol, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Ethanol, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); + Meta_GT_Proxy.addFluid("sulfuricacid", "Sulfuric Acid", Materials.SulfuricAcid, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.SulfuricAcid, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); + Meta_GT_Proxy.addFluid("milk", "Milk", Materials.Milk, 1, 290, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Milk, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); + Meta_GT_Proxy.addFluid("mcguffium", "Mc Guffium 239", Materials.McGuffium239, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.McGuffium239, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); + Meta_GT_Proxy.addFluid("glue", "Glue", Materials.Glue, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Glue, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); + */ + Utils.LOG_INFO("Adding Gregtech versions of Gelic Cryotheum and Blazing Pyrotheum."); + + Meta_GT_Proxy.addFluid("cryotheum", "Gelid Cryotheum", GT_Materials.Cryotheum, 4, -1200, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Cryotheum, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); + Meta_GT_Proxy.addFluid("pyrotheum", "Blazing Pyrotheum", GT_Materials.Pyrotheum, 4, 4000, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Pyrotheum, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); + + } + +} diff --git a/src/Java/miscutil/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java b/src/Java/miscutil/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java new file mode 100644 index 0000000000..0b2ef3f620 --- /dev/null +++ b/src/Java/miscutil/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java @@ -0,0 +1,66 @@ +package miscutil.xmod.gregtech.common.blocks.textures; + +import gregtech.api.enums.Textures; +import miscutil.core.lib.CORE; +import miscutil.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +public class CasingTextureHandler { + + private static final TexturesGregtech59 gregtech59 = new TexturesGregtech59(); + private static final TexturesGregtech58 gregtech58 = new TexturesGregtech58(); + + public static IIcon getIcon(int aSide, int aMeta) { //Texture ID's. case 0 == ID[57] + if ((aMeta >= 0) && (aMeta < 16)) { + switch (aMeta) { + //Centrifuge + case 0: + return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); + //Coke Oven Frame + case 1: + return Textures.BlockIcons.MACHINE_CASING_RADIATIONPROOF.getIcon(); + //Coke Oven Casing Tier 1 + case 2: + return Textures.BlockIcons.MACHINE_CASING_FIREBOX_BRONZE.getIcon(); + //Coke Oven Casing Tier 2 + case 3: + return Textures.BlockIcons.MACHINE_CASING_FIREBOX_STEEL.getIcon(); + //Material Press Casings + case 4: + return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); + //Electrolyzer Casings + case 5: + return Textures.BlockIcons.MACHINE_CASING_FUSION_2.getIcon(); + //Broken Blue Fusion Casings + case 6: + return Textures.BlockIcons.MACHINE_CASING_FUSION.getIcon(); + //Maceration Stack Casings + case 7: + return Textures.BlockIcons.MACHINE_LuV_BOTTOM.getIcon(); + //Broken Pink Fusion Casings + case 8: + return Textures.BlockIcons.MACHINE_CASING_FUSION_2.getIcon(); + //Matter Fabricator Casings + case 9: + return Textures.BlockIcons.MACHINE_CASING_DRAGONEGG.getIcon(); + //Iron Blast Fuance Textures + case 10: + return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); + + default: + return Textures.BlockIcons.MACHINE_CASING_RADIOACTIVEHAZARD.getIcon(); + + } + } + return Textures.BlockIcons.MACHINE_CASING_GEARBOX_TUNGSTENSTEEL.getIcon(); + } + + + public static IIcon handleCasingsGT(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide, GregtechMetaCasingBlocks thisBlock) { + if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ + return gregtech59.handleCasingsGT59(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock); + } + return gregtech58.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock); + } +} \ No newline at end of file diff --git a/src/Java/miscutil/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java b/src/Java/miscutil/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java new file mode 100644 index 0000000000..112c07fbc4 --- /dev/null +++ b/src/Java/miscutil/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java @@ -0,0 +1,441 @@ +package miscutil.xmod.gregtech.common.blocks.textures; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import miscutil.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks; +import miscutil.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityIndustrialCentrifuge; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +public class TexturesGregtech58 { + + private static Textures.BlockIcons.CustomIcon GT8_1_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE1"); + private static Textures.BlockIcons.CustomIcon GT8_1 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE1"); + private static Textures.BlockIcons.CustomIcon GT8_2_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE2"); + private static Textures.BlockIcons.CustomIcon GT8_2 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE2"); + private static Textures.BlockIcons.CustomIcon GT8_3_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE3"); + private static Textures.BlockIcons.CustomIcon GT8_3 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE3"); + private static Textures.BlockIcons.CustomIcon GT8_4_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE4"); + private static Textures.BlockIcons.CustomIcon GT8_4 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE4"); + private static Textures.BlockIcons.CustomIcon GT8_5_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE5"); + private static Textures.BlockIcons.CustomIcon GT8_5 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE5"); + private static Textures.BlockIcons.CustomIcon GT8_6_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE6"); + private static Textures.BlockIcons.CustomIcon GT8_6 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE6"); + private static Textures.BlockIcons.CustomIcon GT8_7_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE7"); + private static Textures.BlockIcons.CustomIcon GT8_7 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE7"); + private static Textures.BlockIcons.CustomIcon GT8_8_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE8"); + private static Textures.BlockIcons.CustomIcon GT8_8 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE8"); + private static Textures.BlockIcons.CustomIcon GT8_9_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE9"); + private static Textures.BlockIcons.CustomIcon GT8_9 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE9"); + + private static Textures.BlockIcons.CustomIcon frontFace_0 = (GT8_1); + private static Textures.BlockIcons.CustomIcon frontFaceActive_0 = (GT8_1_Active); + private static Textures.BlockIcons.CustomIcon frontFace_1 = (GT8_2); + private static Textures.BlockIcons.CustomIcon frontFaceActive_1 = (GT8_2_Active); + private static Textures.BlockIcons.CustomIcon frontFace_2 = (GT8_3); + private static Textures.BlockIcons.CustomIcon frontFaceActive_2 = (GT8_3_Active); + private static Textures.BlockIcons.CustomIcon frontFace_3 = (GT8_4); + private static Textures.BlockIcons.CustomIcon frontFaceActive_3 = (GT8_4_Active); + private static Textures.BlockIcons.CustomIcon frontFace_4 = (GT8_5); + private static Textures.BlockIcons.CustomIcon frontFaceActive_4 = (GT8_5_Active); + private static Textures.BlockIcons.CustomIcon frontFace_5 = (GT8_6); + private static Textures.BlockIcons.CustomIcon frontFaceActive_5 = (GT8_6_Active); + private static Textures.BlockIcons.CustomIcon frontFace_6 = (GT8_7); + private static Textures.BlockIcons.CustomIcon frontFaceActive_6 = (GT8_7_Active); + private static Textures.BlockIcons.CustomIcon frontFace_7 = (GT8_8); + private static Textures.BlockIcons.CustomIcon frontFaceActive_7 = (GT8_8_Active); + private static Textures.BlockIcons.CustomIcon frontFace_8 = (GT8_9); + private static Textures.BlockIcons.CustomIcon frontFaceActive_8 = (GT8_9_Active); + + Textures.BlockIcons.CustomIcon[] TURBINE = new Textures.BlockIcons.CustomIcon[]{ + frontFace_0, + frontFace_1, + frontFace_2, + frontFace_3, + frontFace_4, + frontFace_5, + frontFace_6, + frontFace_7, + frontFace_8 + }; + + Textures.BlockIcons.CustomIcon[] TURBINE_ACTIVE = new Textures.BlockIcons.CustomIcon[]{ + frontFaceActive_0, + frontFaceActive_1, + frontFaceActive_2, + frontFaceActive_3, + frontFaceActive_4, + frontFaceActive_5, + frontFaceActive_6, + frontFaceActive_7, + frontFaceActive_8 + }; + + + public IIcon handleCasingsGT(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide, GregtechMetaCasingBlocks thisBlock) { + return handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock); + } + + + public IIcon handleCasingsGT58(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide, GregtechMetaCasingBlocks thisBlock) { + int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); + if (((tMeta != 6) && (tMeta != 8) && (tMeta != 0))) { + return CasingTextureHandler.getIcon(aSide, tMeta); + } + int tStartIndex = tMeta == 6 ? 1 : 13; + if (tMeta == 0) { + if ((aSide == 2) || (aSide == 3)) { + TileEntity tTileEntity; + IMetaTileEntity tMetaTileEntity; + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return TURBINE_ACTIVE[0].getIcon(); + } + return TURBINE[0].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return TURBINE_ACTIVE[3].getIcon(); + } + return TURBINE[3].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return TURBINE_ACTIVE[6].getIcon(); + } + return TURBINE[6].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return TURBINE_ACTIVE[1].getIcon(); + } + return TURBINE[1].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return TURBINE_ACTIVE[7].getIcon(); + } + return TURBINE[7].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return TURBINE_ACTIVE[8].getIcon(); + } + return TURBINE[8].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return TURBINE_ACTIVE[5].getIcon(); + } + return TURBINE[5].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return TURBINE_ACTIVE[2].getIcon(); + } + return TURBINE[2].getIcon(); + } + } else if ((aSide == 4) || (aSide == 5)) { + TileEntity tTileEntity; + Object tMetaTileEntity; + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return TURBINE_ACTIVE[0].getIcon(); + } + return TURBINE[0].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return TURBINE_ACTIVE[3].getIcon(); + } + return TURBINE[3].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return TURBINE_ACTIVE[6].getIcon(); + } + return TURBINE[6].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return TURBINE_ACTIVE[1].getIcon(); + } + return TURBINE[1].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return TURBINE_ACTIVE[7].getIcon(); + } + return TURBINE[7].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return TURBINE_ACTIVE[8].getIcon(); + } + return TURBINE[8].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return TURBINE_ACTIVE[5].getIcon(); + } + return TURBINE[5].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return TURBINE_ACTIVE[2].getIcon(); + } + return TURBINE[2].getIcon(); + } + } + return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); + } + boolean[] tConnectedSides = {(aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta), (aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta), (aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta)}; + switch (aSide) { + case 0: + if (tConnectedSides[0]) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); + } + if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon(); + } + if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon(); + } + if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon(); + } + if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon(); + } + if ((tConn