diff options
author | GlodBlock <60341015+GlodBlock@users.noreply.github.com> | 2021-09-27 15:39:31 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-27 15:39:31 +0800 |
commit | 097438be70486735a8940dd5ce4e9484b6d951af (patch) | |
tree | 90f26b34d5059eb9858d9c82aabbd5373638acfa /src/main/java/gregtech/common/GT_Proxy.java | |
parent | a0a77f0b9868a4ca8a3df8ae8d50b4dcfb4030db (diff) | |
parent | 92433a5b85bb2fcca541ac25ca4033fac24f841e (diff) | |
download | GT5-Unofficial-097438be70486735a8940dd5ce4e9484b6d951af.tar.gz GT5-Unofficial-097438be70486735a8940dd5ce4e9484b6d951af.tar.bz2 GT5-Unofficial-097438be70486735a8940dd5ce4e9484b6d951af.zip |
Merge pull request #1 from GlodBlock/fix-crack-recipe-check
Fix crack recipe check
Diffstat (limited to 'src/main/java/gregtech/common/GT_Proxy.java')
-rw-r--r-- | src/main/java/gregtech/common/GT_Proxy.java | 730 |
1 files changed, 387 insertions, 343 deletions
diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 5b762d6d58..282542c152 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -21,15 +21,12 @@ 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.gui.GT_ContainerVolumetricFlask; import gregtech.common.gui.GT_GUIContainerVolumetricFlask; import gregtech.common.items.GT_MetaGenerated_Tool_01; -import gregtech.common.items.armor.ModularArmor_Item; -import gregtech.common.items.armor.gui.*; import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; @@ -39,7 +36,6 @@ 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; @@ -52,6 +48,7 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.potion.Potion; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.MathHelper; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; @@ -62,10 +59,7 @@ import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.living.EnderTeleportEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -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.entity.player.*; import net.minecraftforge.event.terraingen.OreGenEvent; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.event.world.ChunkDataEvent; @@ -83,8 +77,12 @@ import java.io.File; import java.lang.reflect.InvocationTargetException; import java.text.DateFormat; import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.locks.ReentrantLock; +import java.util.stream.Collectors; -import static gregtech.api.enums.GT_Values.debugEntityCramming; +import static gregtech.api.enums.GT_Values.*; public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { @@ -92,12 +90,13 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { 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("itemGhastTear", "itemFlint", "itemClay", "itemBucketSaltWater", + public final HashSet<ItemStack> mRegisteredOres = new HashSet<>(10000); + public final ArrayList<String> mSoundNames = new ArrayList<>(); + public final ArrayList<ItemStack> mSoundItems = new ArrayList<>(); + public final ArrayList<Integer> mSoundCounts = new ArrayList<>(); + private final Collection<OreDictEventContainer> mEvents = new HashSet<>(); + private final Collection<String> mIgnoredItems = new HashSet<>(Arrays.asList( + "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", @@ -108,7 +107,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { "itemWhippingCream", "itemGlisteningWhippingCream", "itemCleaver", "itemHerbalMedicineWhippingCream", "itemStrangeWhippingCream", "itemBlazeCleaver", "itemBakedCakeSponge", "itemMagmaCake", "itemGlisteningCake", "itemOgreCleaver", "itemFishandPumpkinCake", "itemMagmaWhippingCream", "itemMultimeter", "itemSuperconductor")); - private final Collection<String> mIgnoredNames = new HashSet<String>(Arrays.asList("grubBee", "chainLink", "candyCane", "bRedString", "bVial", + private final Collection<String> mIgnoredNames = new HashSet<>(Arrays.asList("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", @@ -125,8 +124,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { "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("diamondShard", "redstoneRoot", "obsidianStick", "bloodstoneOre", + "stickObsidian", "caveCrystal", "shardCrystal", "dyeCrystal", "shardFire", "shardWater", "shardAir", "shardEarth", "ingotRefinedIron", "blockMarble", "ingotUnstable")); + private final Collection<String> mInvalidNames = new HashSet<>(Arrays.asList("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", @@ -192,15 +191,11 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { 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; @@ -219,8 +214,79 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public boolean gt6Cable = true; public boolean ic2EnergySourceCompat = true; public boolean costlyCableConnection = false; + + /** + * This enables ambient-occlusion smooth lighting on tiles + */ + public boolean mRenderTileAmbientOcclusion = true; + + /** + * This enables rendering of glowing textures + */ + public boolean mRenderGlowTextures = true; + + /** + * Render flipped textures + */ + public boolean mRenderFlippedMachinesFlipped = true; + public static final int GUI_ID_COVER_SIDE_BASE = 10; // Takes GUI ID 10 - 15 + public static Map<String, Integer> oreDictBurnTimes = new HashMap<>(); + + // Locking + public static ReentrantLock TICK_LOCK = new ReentrantLock(); + + private final ConcurrentMap<UUID, GT_ClientPreference> mClientPrefernces = new ConcurrentHashMap<>(); + + static { + oreDictBurnTimes.put("dustTinyWood", 11); + oreDictBurnTimes.put("dustTinySodium", 44); + oreDictBurnTimes.put("dustSmallWood", 25); + oreDictBurnTimes.put("dustSmallSodium", 100); + oreDictBurnTimes.put("dustWood", 100); + oreDictBurnTimes.put("dustTinyCoal", 177); + oreDictBurnTimes.put("dustTinyCharcoal", 177); + oreDictBurnTimes.put("dustTinyLignite", 166); + oreDictBurnTimes.put("plateWood", 300); + oreDictBurnTimes.put("dustSmallLignite", 375); + oreDictBurnTimes.put("dustSodium", 400); + oreDictBurnTimes.put("dustSmallCoal", 400); + oreDictBurnTimes.put("dustSmallCharcoal", 400); + oreDictBurnTimes.put("dustTinyLithium", 888); + oreDictBurnTimes.put("dustTinyCaesium", 888); + oreDictBurnTimes.put("gemLignite", 1200); + oreDictBurnTimes.put("crushedLignite", 1200); + oreDictBurnTimes.put("dustImpureLignite", 1200); + oreDictBurnTimes.put("dustLignite", 1200); + oreDictBurnTimes.put("dustSulfur", 1600); + oreDictBurnTimes.put("gemCoal", 1600); + oreDictBurnTimes.put("crushedCoal", 1600); + oreDictBurnTimes.put("dustImpureCoal", 1600); + oreDictBurnTimes.put("dustCoal", 1600); + oreDictBurnTimes.put("gemCharcoal", 1600); + oreDictBurnTimes.put("crushedCharcoal", 1600); + oreDictBurnTimes.put("dustImpureCharcoal", 1600); + oreDictBurnTimes.put("dustCharcoal", 1600); + oreDictBurnTimes.put("dustSmallLithium", 2000); + oreDictBurnTimes.put("dustSmallCaesium", 2000); + oreDictBurnTimes.put("gemSodium", 4000); + oreDictBurnTimes.put("crushedSodium", 4000); + oreDictBurnTimes.put("dustImpureSodium", 4000); + oreDictBurnTimes.put("gemLithium", 6000); + oreDictBurnTimes.put("crushedLithium", 6000); + oreDictBurnTimes.put("dustImpureLithium", 6000); + oreDictBurnTimes.put("dustLithium", 6000); + oreDictBurnTimes.put("gemCaesium", 6000); + oreDictBurnTimes.put("crushedCaesium", 6000); + oreDictBurnTimes.put("dustImpureCaesium", 6000); + oreDictBurnTimes.put("dustCaesium", 6000); + oreDictBurnTimes.put("blockLignite", 12000); + oreDictBurnTimes.put("blockCharcoal", 16000); + } + + + public GT_Proxy() { GameRegistry.registerFuelHandler(this); MinecraftForge.EVENT_BUS.register(this); @@ -257,33 +323,33 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { } } 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.TE_Slag.set(GT_ModHandler.getModItem(MOD_ID_TE, "slag", 1L)); + ItemList.TE_Slag_Rich.set(GT_ModHandler.getModItem(MOD_ID_TE, "slagRich", 1L)); + ItemList.TE_Rockwool.set(GT_ModHandler.getModItem(MOD_ID_TE, "rockwool", 1L)); + ItemList.TE_Hardened_Glass.set(GT_ModHandler.getModItem(MOD_ID_TE, "glassHardened", 1L)); + + ItemList.RC_ShuntingWire.set(GT_ModHandler.getModItem(MOD_ID_RC, "machine.delta", 1L, 0)); + ItemList.RC_ShuntingWireFrame.set(GT_ModHandler.getModItem(MOD_ID_RC, "frame", 1L, 0)); + ItemList.RC_Rail_Standard.set(GT_ModHandler.getModItem(MOD_ID_RC, "part.rail", 1L, 0)); + ItemList.RC_Rail_Adv.set(GT_ModHandler.getModItem(MOD_ID_RC, "part.rail", 1L, 1)); + ItemList.RC_Rail_Wooden.set(GT_ModHandler.getModItem(MOD_ID_RC, "part.rail", 1L, 2)); + ItemList.RC_Rail_HS.set(GT_ModHandler.getModItem(MOD_ID_RC, "part.rail", 1L, 3)); + ItemList.RC_Rail_Reinforced.set(GT_ModHandler.getModItem(MOD_ID_RC, "part.rail", 1L, 4)); + ItemList.RC_Rail_Electric.set(GT_ModHandler.getModItem(MOD_ID_RC, "part.rail", 1L, 5)); + ItemList.RC_Tie_Wood.set(GT_ModHandler.getModItem(MOD_ID_RC, "part.tie", 1L, 0)); + ItemList.RC_Tie_Stone.set(GT_ModHandler.getModItem(MOD_ID_RC, "part.tie", 1L, 1)); + ItemList.RC_Bed_Wood.set(GT_ModHandler.getModItem(MOD_ID_RC, "part.railbed", 1L, 0)); + ItemList.RC_Bed_Stone.set(GT_ModHandler.getModItem(MOD_ID_RC, "part.railbed", 1L, 1)); + ItemList.RC_Rebar.set(GT_ModHandler.getModItem(MOD_ID_RC, "part.rebar", 1L)); + ItemList.Tool_Sword_Steel.set(GT_ModHandler.getModItem(MOD_ID_RC, "tool.steel.sword", 1L)); + ItemList.Tool_Pickaxe_Steel.set(GT_ModHandler.getModItem(MOD_ID_RC, "tool.steel.pickaxe", 1L)); + ItemList.Tool_Shovel_Steel.set(GT_ModHandler.getModItem(MOD_ID_RC, "tool.steel.shovel", 1L)); + ItemList.Tool_Axe_Steel.set(GT_ModHandler.getModItem(MOD_ID_RC, "tool.steel.axe", 1L)); + ItemList.Tool_Hoe_Steel.set(GT_ModHandler.getModItem(MOD_ID_RC, "tool.steel.hoe", 1L)); + + ItemList.TF_LiveRoot.set(GT_ModHandler.getModItem(MOD_ID_TF, "item.liveRoot", 1L, 0)); + ItemList.TF_Vial_FieryBlood.set(GT_ModHandler.getModItem(MOD_ID_TF, "item.fieryBlood", 1L)); + ItemList.TF_Vial_FieryTears.set(GT_ModHandler.getModItem(MOD_ID_TF, "item.fieryTears", 1L)); ItemList.FR_Lemon.set(GT_ModHandler.getModItem(aTextForestry, "fruits", 1L, 3)); ItemList.FR_Mulch.set(GT_ModHandler.getModItem(aTextForestry, "mulch", 1L)); @@ -388,39 +454,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { OrePrefixes.cellMolten.mContainerItem = ItemList.Cell_Empty.get(1L); OrePrefixes.cell.mContainerItem = ItemList.Cell_Empty.get(1L); - 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)); @@ -453,22 +487,22 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { 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(MOD_ID_RC, "part.turbine.disk", 1L, 32767)); + GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(MOD_ID_RC, "part.turbine.blade", 1L, 32767)); + GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(MOD_ID_RC, "part.turbine.rotor", 1L, 32767)); + GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(MOD_ID_RC, "borehead.diamond", 1L, 32767)); + GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(MOD_ID_RC, "borehead.steel", 1L, 32767)); + GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(MOD_ID_RC, "borehead.iron", 1L, 32767)); + GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(MOD_ID_TF, "item.plateNaga", 1L, 32767)); + GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(MOD_ID_TF, "item.legsNaga", 1L, 32767)); + GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(MOD_ID_TF, "item.arcticHelm", 1L, 32767)); + GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(MOD_ID_TF, "item.arcticPlate", 1L, 32767)); + GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(MOD_ID_TF, "item.arcticLegs", 1L, 32767)); + GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(MOD_ID_TF, "item.arcticBoots", 1L, 32767)); + GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(MOD_ID_TF, "item.yetiHelm", 1L, 32767)); + GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(MOD_ID_TF, "item.yetiPlate", 1L, 32767)); + GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(MOD_ID_TF, "item.yetiLegs", 1L, 32767)); + GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getModItem(MOD_ID_TF, "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)); @@ -497,10 +531,100 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { 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.sGasHazmatList.add(GT_ModHandler.getModItem("EMT", "NanoBootsTraveller", 1L, 32767)); - GregTech_API.sGasHazmatList.add(GT_ModHandler.getModItem("EMT", "NanosuitGogglesRevealing", 1L, 32767)); - GregTech_API.sGasHazmatList.add(GT_ModHandler.getModItem("EMT", "QuantumBootsTraveller", 1L, 32767)); - GregTech_API.sGasHazmatList.add(GT_ModHandler.getModItem("EMT", "QuantumGogglesRevealing", 1L, 32767)); + // Clay buckets, which don't get registered until Iguana Tweaks pre-init + if (Loader.isModLoaded("IguanaTweaksTConstruct")) { + OrePrefixes.bucketClay.mContainerItem = GT_ModHandler.getModItem("IguanaTweaksTConstruct", "clayBucketFired", 1L, 0); + GT_OreDictUnificator.set(OrePrefixes.bucketClay, Materials.Empty, GT_ModHandler.getModItem("IguanaTweaksTConstruct", "clayBucketFired", 1L, 0)); + GT_OreDictUnificator.set(OrePrefixes.bucketClay, Materials.Water, GT_ModHandler.getModItem("IguanaTweaksTConstruct", "clayBucketWater", 1L, 0)); + GT_OreDictUnificator.set(OrePrefixes.bucketClay, Materials.Lava, GT_ModHandler.getModItem("IguanaTweaksTConstruct", "clayBucketLava", 1L, 0)); + GT_OreDictUnificator.set(OrePrefixes.bucketClay, Materials.Milk, GT_ModHandler.getModItem("IguanaTweaksTConstruct", "clayBucketMilk", 1L, 0)); + + FluidContainerRegistry.registerFluidContainer( + new FluidContainerRegistry.FluidContainerData( + Materials.Milk.getFluid(1000L), + GT_OreDictUnificator.get(OrePrefixes.bucketClay, Materials.Milk, 1L), + GT_OreDictUnificator.get(OrePrefixes.bucketClay, Materials.Empty, 1L))); + } + + // IC2 Hazmat + addFullHazmatToIC2Item("hazmatHelmet"); + addFullHazmatToIC2Item("hazmatChestplate"); + addFullHazmatToIC2Item("hazmatLeggings"); + addFullHazmatToIC2Item("hazmatBoots"); + addFullHazmatToIC2Item("nanoHelmet"); + addFullHazmatToIC2Item("nanoBoots"); + addFullHazmatToIC2Item("nanoLeggings"); + addFullHazmatToIC2Item("nanoBodyarmor"); + addFullHazmatToIC2Item("quantumHelmet"); + addFullHazmatToIC2Item("quantumBodyarmor"); + addFullHazmatToIC2Item("quantumLeggings"); + addFullHazmatToIC2Item("quantumBoots"); + + //GraviSuite Hazmat + addFullHazmatToGeneralItem("GraviSuite", "graviChestPlate", 1L); + addFullHazmatToGeneralItem("GraviSuite", "advNanoChestPlate", 1L); + + // EMT Hazmat + addFullHazmatToGeneralItem("EMT", "itemArmorQuantumChestplate", 1L); + addFullHazmatToGeneralItem("EMT", "NanoBootsTraveller", 1L); + addFullHazmatToGeneralItem("EMT", "NanosuitGogglesRevealing", 1L); + addFullHazmatToGeneralItem("EMT", "QuantumBootsTraveller", 1L); + addFullHazmatToGeneralItem("EMT", "QuantumGogglesRevealing", 1L); + addFullHazmatToGeneralItem("EMT", "SolarHelmetRevealing", 1L); + addFullHazmatToGeneralItem("EMT", "NanosuitWing", 1L); + addFullHazmatToGeneralItem("EMT", "QuantumWing", 1L); + + // DraconicEvolution Hazmat + addFullHazmatToGeneralItem("DraconicEvolution", "draconicBoots", 1L, 0); + addFullHazmatToGeneralItem("DraconicEvolution", "draconicHelm", 1L, 0); + addFullHazmatToGeneralItem("DraconicEvolution", "draconicLeggs", 1L, 0); + addFullHazmatToGeneralItem("DraconicEvolution", "draconicChest", 1L, 0); + addFullHazmatToGeneralItem("DraconicEvolution", "wyvernBoots", 1L, 0); + addFullHazmatToGeneralItem("DraconicEvolution", "wyvernHelm", 1L, 0); + addFullHazmatToGeneralItem("DraconicEvolution", "wyvernLeggs", 1L, 0); + addFullHazmatToGeneralItem("DraconicEvolution", "wyvernChest", 1L, 0); + + //AdvancedSolarPanel + addFullHazmatToGeneralItem("AdvancedSolarPanel", "advanced_solar_helmet", 1L); + addFullHazmatToGeneralItem("AdvancedSolarPanel", "hybrid_solar_helmet", 1L); + addFullHazmatToGeneralItem("AdvancedSolarPanel", "ultimate_solar_helmet", 1L); + + //TaintedMagic Hazmat + addFullHazmatToGeneralItem("TaintedMagic", "ItemVoidwalkerBoots", 1L); + addFullHazmatToGeneralItem("TaintedMagic", "ItemShadowFortressHelmet", 1L); + addFullHazmatToGeneralItem("TaintedMagic", "ItemShadowFortressChestplate", 1L); + addFullHazmatToGeneralItem("TaintedMagic", "ItemShadowFortressLeggings", 1L); + addFullHazmatToGeneralItem("TaintedMagic", "ItemVoidFortressHelmet", 1L); + addFullHazmatToGeneralItem("TaintedMagic", "ItemVoidFortressChestplate", 1L); + addFullHazmatToGeneralItem("TaintedMagic", "ItemVoidFortressLeggings", 1L); + addFullHazmatToGeneralItem("TaintedMagic", "ItemVoidmetalGoggles", 1L); + + //WitchingGadgets Hazmat + addFullHazmatToGeneralItem("WitchingGadgets", "item.WG_PrimordialHelm", 1L); + addFullHazmatToGeneralItem("WitchingGadgets", "item.WG_PrimordialChest", 1L); + addFullHazmatToGeneralItem("WitchingGadgets", "item.WG_PrimordialLegs", 1L); + addFullHazmatToGeneralItem("WitchingGadgets", "item.WG_PrimordialBoots", 1L); + + //ThaumicTinkerer Hazmat + addFullHazmatToGeneralItem("ThaumicTinkerer", "ichorclothChestGem", 1L); + addFullHazmatToGeneralItem("ThaumicTinkerer", "ichorclothBootsGem", 1L); + addFullHazmatToGeneralItem("ThaumicTinkerer", "ichorclothHelmGem", 1L); + addFullHazmatToGeneralItem("ThaumicTinkerer", "ichorclothLegsGem", 1L); + + //GalaxySpace Hazmat + addFullHazmatToGeneralItem("GalaxySpace", "item.spacesuit_helmet", 1L); + addFullHazmatToGeneralItem("GalaxySpace", "item.spacesuit_helmetglasses", 1L); + addFullHazmatToGeneralItem("GalaxySpace", "item.spacesuit_plate", 1L); + addFullHazmatToGeneralItem("GalaxySpace", "item.spacesuit_jetplate", 1L); + addFullHazmatToGeneralItem("GalaxySpace", "item.spacesuit_leg", 1L); + addFullHazmatToGeneralItem("GalaxySpace", "item.spacesuit_boots", 1L); + addFullHazmatToGeneralItem("GalaxySpace", "item.spacesuit_gravityboots", 1L); + + //Extra Hazmat + GregTech_API.sElectroHazmatList.add(new ItemStack(Items.chainmail_helmet, 1, W)); + GregTech_API.sElectroHazmatList.add(new ItemStack(Items.chainmail_chestplate, 1, W)); + GregTech_API.sElectroHazmatList.add(new ItemStack(Items.chainmail_leggings, 1, W)); + GregTech_API.sElectroHazmatList.add(new ItemStack(Items.chainmail_boots, 1, W)); GregTech_API.sLoadStarted = true; for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { @@ -687,8 +811,14 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { } aEvent.bow.damageItem(1, aEvent.entityPlayer); aEvent.bow.getItem(); - aEvent.entityPlayer.worldObj.playSoundAtEntity(aEvent.entityPlayer, "random.bow", 1.0F, 0.64893958288F + tSpeed - * 0.5F); + + new WorldSpawnedEventBuilder.SoundAtEntityEventBuilder() + .setPitch(0.64893958288F + tSpeed * 0.5F) + .setVolume(1f) + .setIdentifier("random.bow") + .setEntity(aEvent.entityPlayer) + .setWorld(aEvent.entityPlayer.worldObj) + .run(); tArrowEntity.canBePickedUp = 1; if (!aEvent.entityPlayer.capabilities.isCreativeMode) { @@ -982,7 +1112,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { aMaterial.add(GT_Utility.copyAmount(1L, aEvent.Ore)); if (GregTech_API.sThaumcraftCompat != null && aPrefix.doGenerateItem(aMaterial) && !aPrefix.isIgnored(aMaterial)) { - List<TC_AspectStack> tAspects = new ArrayList<TC_AspectStack>(); + List<TC_AspectStack> tAspects = new ArrayList<>(); 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); @@ -1241,6 +1371,14 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { @SubscribeEvent public void onServerTickEvent(TickEvent.ServerTickEvent aEvent) { + if (aEvent.side.isServer()) { + if (aEvent.phase == TickEvent.Phase.START) { + TICK_LOCK.lock(); + } else { + TICK_LOCK.unlock(); + } + } + } @SubscribeEvent @@ -1282,8 +1420,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { 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)) { + for (Object o : tList) { + if ((o != null) && (o.getClass() == tClass)) { tEntityCount++; } } @@ -1355,7 +1493,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { float tHeat = GT_Utility.getHeatDamageFromItem(tStack); if (tHeat != 0.0F) { if (tHeat > 0.0F) { - GT_Utility.applyHeatDamage(aEvent.player, tHeat); + GT_Utility.applyHeatDamageFromItem(aEvent.player, tHeat, tStack); } else { GT_Utility.applyFrostDamage(aEvent.player, -tHeat); } @@ -1475,7 +1613,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { float tHeat = GT_Utility.getHeatDamageFromItem(tStack); if (tHeat != 0.0F) { if (tHeat > 0.0F) { - GT_Utility.applyHeatDamage(aEvent.player, tHeat); + GT_Utility.applyHeatDamageFromItem(aEvent.player, tHeat, tStack); } else { GT_Utility.applyFrostDamage(aEvent.player, -tHeat); } @@ -1493,35 +1631,22 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { } } + public GT_ClientPreference getClientPreference(UUID aPlayerID) { + return mClientPrefernces.get(aPlayerID); + } + + public void setClientPreference(UUID aPlayerID, GT_ClientPreference aPreference) { + mClientPrefernces.put(aPlayerID, aPreference); + } + + @Override 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())); - case 10: - return new GT_ContainerVolumetricFlask(aPlayer.inventory); - default: - return getRightItem(aPlayer, ID); + if (ID == 10) { + return new GT_ContainerVolumetricFlask(aPlayer.inventory); } - } - 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); - } + return null; } TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if ((tTileEntity instanceof IGregTechTileEntity)) { @@ -1536,52 +1661,14 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { 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; - - } - @Override 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); - case 10: - return new GT_GUIContainerVolumetricFlask(new GT_ContainerVolumetricFlask(aPlayer.inventory)); - default: - return getRightItemGui(aPlayer, ID); + if (ID == 10) { + return new GT_GUIContainerVolumetricFlask(new GT_ContainerVolumetricFlask(aPlayer.inventory)); } - } - 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); - } + return null; } TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if ((tTileEntity instanceof IGregTechTileEntity)) { @@ -1604,139 +1691,45 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { 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; + private static List<String> getOreDictNames(ItemStack stack) { + return Arrays.stream(OreDictionary.getOreIDs(stack)).mapToObj(OreDictionary::getOreName).collect(Collectors.toList()); + } - } + @Override 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 = ((GT_MetaGenerated_Item) aFuel.getItem()).mBurnValues.get(Short.valueOf((short) aFuel.getItemDamage())); + Short tFuelValue = ((GT_MetaGenerated_Item) aFuel.getItem()).mBurnValues.get((short) aFuel.getItemDamage()); if (tFuelValue != null) { - rFuelValue = Math.max(rFuelValue, tFuelValue.shortValue()); + rFuelValue = Math.max(rFuelValue, tFuelValue); } } NBTTagCompound tNBT = aFuel.getTagCompound(); if (tNBT != null) { + // See if we have something defined by NBT 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))) { - rFuelValue = Math.max(rFuelValue, 150000); - } - if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_SSFUEL.get(1))) { - rFuelValue = Math.max(rFuelValue, 100000); + } else { + // If not check the ore dict + rFuelValue = Math.max(rFuelValue, getOreDictNames(aFuel).stream().mapToInt(f -> oreDictBurnTimes.getOrDefault(f, 0)).max().orElse(0)); } - - return rFuelValue; + + // If we have something from the GT MetaGenerated_Item, ItemFuelValue, or OreDict return + if (rFuelValue > 0) return rFuelValue; + + // Otherwise a few more checks + if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Blocks.wooden_button, 1))) return 150; + else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Blocks.ladder, 1))) return 100; + else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Items.sign, 1))) return 600; + else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Items.wooden_door, 1))) return 600; + else if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_MSSFUEL.get(1))) return 150000; + else if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_SSFUEL.get(1))) return 100000; + + return 0; } public Fluid addAutoGeneratedCorrespondingFluid(Materials aMaterial){ @@ -1754,61 +1747,66 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { aMaterial.mMoltenRGBa, 4, aMaterial.mMeltingPoint <= 0 ? 1000 : aMaterial.mMeltingPoint, GT_OreDictUnificator.get(OrePrefixes.cellMolten, aMaterial, 1L), ItemList.Cell_Empty.get(1L), 144); } - 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), 144); - } - 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), 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); + Fluid[] crackedFluids = new Fluid[3]; + String[] namePrefixes = { "lightlyhydrocracked.", "moderatelyhydrocracked.", "severelyhydrocracked." }; + OrePrefixes[] orePrefixes = { OrePrefixes.cellHydroCracked1, OrePrefixes.cellHydroCracked2, OrePrefixes.cellHydroCracked3 }; + 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( + namePrefixes[i] + aMaterial.mName.toLowerCase(Locale.ENGLISH), uncrackedFluid.mTextureName, + orePrefixes[i].mLocalizedMaterialPre + aMaterial.mDefaultLocalName, + null, aMaterial.mRGBa, 2, 775, + GT_OreDictUnificator.get(orePrefixes[i], aMaterial, 1L), + ItemList.Cell_Empty.get(1L), 1000); + + 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); + Fluid[] crackedFluids = new Fluid[3]; + String[] namePrefixes = { "lightlysteamcracked.", "moderatelysteamcracked.", "severelysteamcracked." }; + OrePrefixes[] orePrefixes = { OrePrefixes.cellSteamCracked1, OrePrefixes.cellSteamCracked2, OrePrefixes.cellSteamCracked3 }; + 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( + namePrefixes[i] + aMaterial.mName.toLowerCase(Locale.ENGLISH), uncrackedFluid.mTextureName, + orePrefixes[i].mLocalizedMaterialPre + aMaterial.mDefaultLocalName, + null, aMaterial.mRGBa, 2, 775, + GT_OreDictUnificator.get(orePrefixes[i], aMaterial, 1L), + ItemList.Cell_Empty.get(1L), 1000); + + 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) { @@ -1954,6 +1952,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public void activateOreDictHandler() { this.mOreDictActivated = true; ProgressManager.ProgressBar progressBar = ProgressManager.push("Register materials", mEvents.size()); + if (Loader.isModLoaded("betterloadingscreen")){ GT_Values.cls_enabled = true; try { @@ -1964,6 +1963,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { } else GT_Proxy.stepMaterialsVanilla(this.mEvents,progressBar); + } public static final HashMap<Integer,HashMap<ChunkCoordIntPair,int []>> dimensionWiseChunkData = new HashMap<>(16);//stores chunk data that is loaded/saved @@ -2002,11 +2002,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { @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); - } + HashMap<ChunkCoordIntPair, int[]> chunkData = dimensionWiseChunkData.computeIfAbsent(worldID, k -> new HashMap<>(1024)); if (dimensionWisePollution.get(worldID) == null) dimensionWisePollution.put(worldID, new GT_Pollution(event.world)); @@ -2087,4 +2083,52 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { if (event.block.getUnlocalizedName().equals("blockAlloyGlass")) GregTech_API.causeMachineUpdate(event.world, event.x, event.y, event.z); } + + public static void addFullHazmatToGeneralItem(String aModID, String aItem, long aAmount, int aMeta){ + ItemStack item = GT_ModHandler.getModItem(aModID, aItem, aAmount, aMeta); + addItemToHazmatLists(item); + } + + public static void addFullHazmatToGeneralItem(String aModID, String aItem, long aAmount){ + ItemStack item = GT_ModHandler.getModItem(aModID, aItem, aAmount, W); + addItemToHazmatLists(item); + } + + public static void addFullHazmatToIC2Item(String aItem){ + ItemStack item = GT_ModHandler.getIC2Item(aItem, 1L, W); + addItemToHazmatLists(item); + } + + private static void addItemToHazmatLists(ItemStack item){ + GregTech_API.sGasHazmatList.add(item); + GregTech_API.sBioHazmatList.add(item); + GregTech_API.sFrostHazmatList.add(item); + GregTech_API.sHeatHazmatList.add(item); + GregTech_API.sRadioHazmatList.add(item); + GregTech_API.sElectroHazmatList.add(item); + } + + public static boolean providesProtection(ItemStack aStack){ + boolean isGas = GT_Utility.isStackInList(aStack, GregTech_API.sGasHazmatList); + boolean isBio = GT_Utility.isStackInList(aStack, GregTech_API.sBioHazmatList); + boolean isFrost = GT_Utility.isStackInList(aStack, GregTech_API.sFrostHazmatList); + boolean isHeat = GT_Utility.isStackInList(aStack, GregTech_API.sHeatHazmatList); + boolean isRadio = GT_Utility.isStackInList(aStack, GregTech_API.sRadioHazmatList); + boolean isElectro = GT_Utility.isStackInList(aStack, GregTech_API.sElectroHazmatList); + return isGas && isBio && isFrost && isHeat && isRadio && isElectro; + } + + @SubscribeEvent + public void onItemTooltip(ItemTooltipEvent event) { + if (event.itemStack == null) { + return; + } + else { + ItemStack aStackTemp = event.itemStack; + GT_ItemStack aStack = new GT_ItemStack(aStackTemp); + if (providesProtection(aStackTemp)) { + event.toolTip.add(EnumChatFormatting.LIGHT_PURPLE + "Provides full hazmat protection."); + } + } + } } |