From 56ccd3188d353f9eb85a4ecbdf761b96e7a1612c Mon Sep 17 00:00:00 2001 From: WayofTime Date: Fri, 16 Jan 2015 10:00:50 -0500 Subject: [PATCH] Refactoring --- .../AlchemicalWizardry.java | 2 + .../alchemicalWizardry/ModItems.java | 7 + .../api/items/ItemSpellMultiTool.java | 22 +-- .../items/interfaces}/ILPGauge.java | 2 +- .../api/rituals/LocalRitualStorage.java | 29 +++- .../api/rituals/RitualEffect.java | 2 +- .../api/soulNetwork/SoulNetworkHandler.java | 16 +- .../common/AlchemicalWizardryFuelHandler.java | 2 +- .../common/block/ArmourForge.java | 2 +- .../common/block/BlockBelljar.java | 2 +- .../common/block/BlockHomHeart.java | 4 +- .../common/block/BlockSpellParadigm.java | 4 +- .../common/block/BlockTeleposer.java | 4 +- .../common/commands/CommandUnbind.java | 2 +- .../demon/EntityMinorDemonGrunt.java | 17 ++- .../demonHoard/demon/IHoardDemon.java | 3 +- .../tileEntity/TEDemonPortal.java | 2 +- .../common/items/ActivationCrystal.java | 4 +- .../common/items/ArmourInhibitor.java | 20 +-- .../common/items/BlankSpell.java | 14 +- .../common/items/BoundAxe.java | 22 +-- .../common/items/BoundPickaxe.java | 22 +-- .../common/items/BoundShovel.java | 22 +-- .../common/items/CheatyItem.java | 8 +- .../common/items/DemonPlacer.java | 22 +-- .../items/DemonicTelepositionFocus.java | 8 +- .../common/items/EnergyBattery.java | 8 +- .../common/items/EnergyBazooka.java | 26 ++-- .../common/items/EnergyBlast.java | 26 ++-- .../common/items/EnergyItems.java | 14 +- .../common/items/EnergySword.java | 22 +-- .../items/EnhancedTelepositionFocus.java | 8 +- .../common/items/ItemBloodLetterPack.java | 6 +- .../common/items/ItemComplexSpellCrystal.java | 14 +- .../common/items/ItemDiabloKey.java | 6 +- .../common/items/ItemRitualDiviner.java | 30 ++-- .../common/items/LavaCrystal.java | 4 +- .../items/ReinforcedTelepositionFocus.java | 8 +- .../common/items/ScribeTool.java | 4 +- .../common/items/TelepositionFocus.java | 24 +-- .../common/items/armour/BoundArmour.java | 16 +- .../items/energy/ItemAttunedCrystal.java | 2 +- .../items/energy/ItemTankSegmenter.java | 2 +- .../common/items/forestry/ItemBloodFrame.java | 4 +- .../common/items/potion/AlchemyFlask.java | 8 +- .../items/routing/InputRoutingFocus.java | 20 +++ .../common/items/routing/RoutingFocus.java | 142 ++++++++++++++++++ .../common/items/sigil/AirSigil.java | 4 +- .../common/items/sigil/DivinationSigil.java | 6 +- .../items/sigil/ItemBloodLightSigil.java | 6 +- .../common/items/sigil/ItemFluidSigil.java | 50 +++--- .../common/items/sigil/ItemHarvestSigil.java | 22 +-- .../common/items/sigil/ItemPackRatSigil.java | 22 +-- .../common/items/sigil/ItemSeerSigil.java | 6 +- .../sigil/ItemSigilOfEnderSeverance.java | 22 +-- .../items/sigil/ItemSigilOfSupression.java | 22 +-- .../items/sigil/ItemSigilOfTheAssassin.java | 6 +- .../common/items/sigil/LavaSigil.java | 4 +- .../items/sigil/SigilOfElementalAffinity.java | 22 +-- .../common/items/sigil/SigilOfGrowth.java | 22 +-- .../common/items/sigil/SigilOfHaste.java | 24 +-- .../common/items/sigil/SigilOfHolding.java | 20 +-- .../common/items/sigil/SigilOfMagnetism.java | 22 +-- .../common/items/sigil/SigilOfTheBridge.java | 34 ++--- .../items/sigil/SigilOfTheFastMiner.java | 24 +-- .../common/items/sigil/SigilOfWind.java | 24 +-- .../common/items/sigil/VoidSigil.java | 4 +- .../common/items/sigil/WaterSigil.java | 6 +- .../common/rituals/LocalStorageAlphaPact.java | 25 +++ .../common/rituals/RitualEffectAlphaPact.java | 115 +++++++++++++- .../rituals/RitualEffectItemRouting.java | 95 ++++++++++++ .../common/rituals/RitualEffectUnbinding.java | 4 +- .../spell/complex/effect/SpellHelper.java | 2 +- .../common/spell/simple/HomSpell.java | 18 +-- .../common/tileEntity/TEAltar.java | 2 +- .../common/tileEntity/TEMasterStone.java | 18 ++- 76 files changed, 876 insertions(+), 433 deletions(-) rename src/main/java/WayofTime/alchemicalWizardry/{common/items => api/items/interfaces}/ILPGauge.java (67%) create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/items/routing/InputRoutingFocus.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/items/routing/RoutingFocus.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/rituals/LocalStorageAlphaPact.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemRouting.java diff --git a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index efc2beb3..532dac44 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -154,6 +154,7 @@ import WayofTime.alchemicalWizardry.common.rituals.RitualEffectGrowth; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectHarvest; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectHealing; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectInterdiction; +import WayofTime.alchemicalWizardry.common.rituals.RitualEffectItemRouting; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectItemSuction; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectJumping; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectLava; @@ -1282,6 +1283,7 @@ public class AlchemicalWizardry Rituals.registerRitual("AW032", 1, 100, new RitualEffectOmegaTest(), "Symmetry of the Omega"); Rituals.registerRitual("AW033", 2, 100, new RitualEffectOmegaStalling(), "Omega Stalling"); Rituals.registerRitual("AW034", 2, 100, new RitualEffectAlphaPact(), "Alpha Pact"); + Rituals.registerRitual("AW035", 1, 100, new RitualEffectItemRouting(), "Ritual of the Phantom Hands"); //Rituals.registerRitual(1,100,new RitualEffectApiaryOverclock(),"Apiary Overclock")); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/ModItems.java b/src/main/java/WayofTime/alchemicalWizardry/ModItems.java index 6595378b..db4b71d1 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/ModItems.java +++ b/src/main/java/WayofTime/alchemicalWizardry/ModItems.java @@ -67,6 +67,7 @@ import WayofTime.alchemicalWizardry.common.items.potion.StandardBindingAgent; import WayofTime.alchemicalWizardry.common.items.potion.StandardFillingAgent; import WayofTime.alchemicalWizardry.common.items.potion.WeakBindingAgent; import WayofTime.alchemicalWizardry.common.items.potion.WeakFillingAgent; +import WayofTime.alchemicalWizardry.common.items.routing.InputRoutingFocus; import WayofTime.alchemicalWizardry.common.items.sigil.AirSigil; import WayofTime.alchemicalWizardry.common.items.sigil.DivinationSigil; import WayofTime.alchemicalWizardry.common.items.sigil.ItemBloodLightSigil; @@ -225,6 +226,8 @@ public class ModItems public static OmegaArmour boundPlateWind; public static OmegaArmour boundLeggingsWind; public static OmegaArmour boundBootsWind; + + public static Item inputRoutingFocus; public static void init() { @@ -343,6 +346,8 @@ public class ModItems boundPlateWind = (OmegaArmour) new OmegaArmourWind(1).setUnlocalizedName("boundPlateWind"); boundLeggingsWind = (OmegaArmour) new OmegaArmourWind(2).setUnlocalizedName("boundLeggingsWind"); boundBootsWind = (OmegaArmour) new OmegaArmourWind(3).setUnlocalizedName("boundBootsWind"); + + inputRoutingFocus = new InputRoutingFocus().setUnlocalizedName("inputRoutingFocus"); } public static void registerItems() @@ -466,6 +471,8 @@ public class ModItems GameRegistry.registerItem(ModItems.boundPlateWind, "boundPlateWind"); GameRegistry.registerItem(ModItems.boundLeggingsWind, "boundLeggingsWind"); GameRegistry.registerItem(ModItems.boundBootsWind, "boundBootsWind"); + + GameRegistry.registerItem(ModItems.inputRoutingFocus, "inputRoutingFocus"); //GameRegistry.registerItem(ModItems.itemBloodFrame, "itemBloodFrame"); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/items/ItemSpellMultiTool.java b/src/main/java/WayofTime/alchemicalWizardry/api/items/ItemSpellMultiTool.java index 72f0c83c..93ed96f5 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/items/ItemSpellMultiTool.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/items/ItemSpellMultiTool.java @@ -392,11 +392,11 @@ public class ItemSpellMultiTool extends Item { par3List.add("A mace filled with ancient alchemy"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } for (String str : this.getToolListString(par1ItemStack)) @@ -479,7 +479,7 @@ public class ItemSpellMultiTool extends Item tag.setFloat("itemAttack", Math.max(damage, 0.0f)); - stack.stackTagCompound.setTag(tagName, tag); + stack.getTagCompound().setTag(tagName, tag); } else { stack.setTagCompound(new NBTTagCompound()); @@ -488,7 +488,7 @@ public class ItemSpellMultiTool extends Item tag.setFloat("itemAttack", Math.max(damage, 0.0f)); - stack.stackTagCompound.setTag(tagName, tag); + stack.getTagCompound().setTag(tagName, tag); } } @@ -655,7 +655,7 @@ public class ItemSpellMultiTool extends Item tag.setBoolean("silkTouch", silkTouch); - stack.stackTagCompound.setTag(tagName, tag); + stack.getTagCompound().setTag(tagName, tag); } else { stack.setTagCompound(new NBTTagCompound()); @@ -664,7 +664,7 @@ public class ItemSpellMultiTool extends Item tag.setBoolean("silkTouch", silkTouch); - stack.stackTagCompound.setTag(tagName, tag); + stack.getTagCompound().setTag(tagName, tag); } } @@ -691,7 +691,7 @@ public class ItemSpellMultiTool extends Item tag.setInteger("fortuneLevel", Math.max(fortune, 0)); - stack.stackTagCompound.setTag(tagName, tag); + stack.getTagCompound().setTag(tagName, tag); } else { stack.setTagCompound(new NBTTagCompound()); @@ -700,7 +700,7 @@ public class ItemSpellMultiTool extends Item tag.setInteger("fortuneLevel", Math.max(fortune, 0)); - stack.stackTagCompound.setTag(tagName, tag); + stack.getTagCompound().setTag(tagName, tag); } } @@ -776,7 +776,7 @@ public class ItemSpellMultiTool extends Item tag.setFloat("critChance", Math.max(chance, 0)); - container.stackTagCompound.setTag(tagName, tag); + container.getTagCompound().setTag(tagName, tag); } else { container.setTagCompound(new NBTTagCompound()); @@ -785,7 +785,7 @@ public class ItemSpellMultiTool extends Item tag.setFloat("critChance", Math.max(chance, 0)); - container.stackTagCompound.setTag(tagName, tag); + container.getTagCompound().setTag(tagName, tag); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ILPGauge.java b/src/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/ILPGauge.java similarity index 67% rename from src/main/java/WayofTime/alchemicalWizardry/common/items/ILPGauge.java rename to src/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/ILPGauge.java index 18368063..7607023f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ILPGauge.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/ILPGauge.java @@ -1,4 +1,4 @@ -package WayofTime.alchemicalWizardry.common.items; +package WayofTime.alchemicalWizardry.api.items.interfaces; import net.minecraft.item.ItemStack; diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/rituals/LocalRitualStorage.java b/src/main/java/WayofTime/alchemicalWizardry/api/rituals/LocalRitualStorage.java index 7f41cdc7..f5c008d6 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/rituals/LocalRitualStorage.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/rituals/LocalRitualStorage.java @@ -1,6 +1,7 @@ package WayofTime.alchemicalWizardry.api.rituals; import net.minecraft.nbt.NBTTagCompound; +import WayofTime.alchemicalWizardry.common.Int3; /** * This class is used to pass ritual-specific data into the RitualEffect from the containing Master Ritual Stone. This is basically used as auxillarary storage, @@ -9,13 +10,33 @@ import net.minecraft.nbt.NBTTagCompound; */ public class LocalRitualStorage { - public void writeToNBT(NBTTagCompound tag) - { + public int xCoord; + public int yCoord; + public int zCoord; + public void writeToNBT(NBTTagCompound tag) + { + tag.setInteger("xCoord", xCoord); + tag.setInteger("yCoord", yCoord); + tag.setInteger("zCoord", zCoord); + } + + public void readFromNBT(NBTTagCompound tag) + { + this.xCoord = tag.getInteger("xCoord"); + this.yCoord = tag.getInteger("yCoord"); + this.zCoord = tag.getInteger("zCoord"); } - public void readFromNBT(NBTTagCompound tag) + public Int3 getLocation() { - + return new Int3(xCoord, yCoord, zCoord); + } + + public void setLocation(Int3 location) + { + this.xCoord = location.xCoord; + this.yCoord = location.yCoord; + this.zCoord = location.zCoord; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/rituals/RitualEffect.java b/src/main/java/WayofTime/alchemicalWizardry/api/rituals/RitualEffect.java index dacfde60..85f291c7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/rituals/RitualEffect.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/rituals/RitualEffect.java @@ -57,7 +57,7 @@ public abstract class RitualEffect public LocalRitualStorage getNewLocalStorage() { - return null; + return new LocalRitualStorage(); } public void addOffsetRunes(ArrayList ritualList, int off1, int off2, int y, int rune) diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/SoulNetworkHandler.java b/src/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/SoulNetworkHandler.java index e366ee65..74cbc72d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/SoulNetworkHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/SoulNetworkHandler.java @@ -381,32 +381,32 @@ public class SoulNetworkHandler public static void checkAndSetItemOwner(ItemStack item, EntityPlayer player) { - if (item.stackTagCompound == null) + if (item.getTagCompound() == null) { item.setTagCompound(new NBTTagCompound()); } - if (item.stackTagCompound.getString("ownerName").equals("")) + if (item.getTagCompound().getString("ownerName").equals("")) { ItemBindEvent event = new ItemBindEvent(player, SoulNetworkHandler.getUsername(player), item); if(!MinecraftForge.EVENT_BUS.post(event)) { - item.stackTagCompound.setString("ownerName", event.key); + item.getTagCompound().setString("ownerName", event.key); } } } public static void checkAndSetItemOwner(ItemStack item, String ownerName) { - if (item.stackTagCompound == null) + if (item.getTagCompound() == null) { item.setTagCompound(new NBTTagCompound()); } - if (item.stackTagCompound.getString("ownerName").equals("")) + if (item.getTagCompound().getString("ownerName").equals("")) { - item.stackTagCompound.setString("ownerName", ownerName); + item.getTagCompound().setString("ownerName", ownerName); } } @@ -448,11 +448,11 @@ public class SoulNetworkHandler public static String getOwnerName(ItemStack item) { - if (item.stackTagCompound == null) + if (item.getTagCompound() == null) { item.setTagCompound(new NBTTagCompound()); } - return item.stackTagCompound.getString("ownerName"); + return item.getTagCompound().getString("ownerName"); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryFuelHandler.java b/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryFuelHandler.java index 11c11587..167559d5 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryFuelHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryFuelHandler.java @@ -34,7 +34,7 @@ public class AlchemicalWizardryFuelHandler implements IFuelHandler return 200; } else { - NBTTagCompound tag = itemStack.stackTagCompound; + NBTTagCompound tag = itemStack.getTagCompound(); if (tag == null) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/ArmourForge.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/ArmourForge.java index 1926e450..e9f8eee9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/ArmourForge.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/ArmourForge.java @@ -105,7 +105,7 @@ public class ArmourForge extends Block return false; } - if (armourPiece.stackTagCompound == null) + if (armourPiece.getTagCompound() == null) { armourPiece.setTagCompound(new NBTTagCompound()); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBelljar.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBelljar.java index a529e45c..e04354f3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBelljar.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBelljar.java @@ -153,7 +153,7 @@ public class BlockBelljar extends BlockContainer ItemStack drop = new ItemStack(this); NBTTagCompound tag = new NBTTagCompound(); ((TEBellJar) tile).writeTankNBT(tag); - drop.stackTagCompound = tag; + drop.setTagCompound(tag); list.add(drop); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockHomHeart.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockHomHeart.java index fcb8c82b..c12b89e6 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockHomHeart.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockHomHeart.java @@ -70,12 +70,12 @@ public class BlockHomHeart extends BlockContainer { if (playerItem.getItem() instanceof BlankSpell) { - if (playerItem.stackTagCompound == null) + if (playerItem.getTagCompound() == null) { playerItem.setTagCompound(new NBTTagCompound()); } - NBTTagCompound itemTag = playerItem.stackTagCompound; + NBTTagCompound itemTag = playerItem.getTagCompound(); itemTag.setInteger("xCoord", x); itemTag.setInteger("yCoord", y); itemTag.setInteger("zCoord", z); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellParadigm.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellParadigm.java index de4c60e1..e63981de 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellParadigm.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellParadigm.java @@ -58,12 +58,12 @@ public class BlockSpellParadigm extends BlockOrientable if (stack != null && stack.getItem() instanceof ItemComplexSpellCrystal) { - if (stack.stackTagCompound == null) + if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound itemTag = stack.stackTagCompound; + NBTTagCompound itemTag = stack.getTagCompound(); itemTag.setInteger("xCoord", x); itemTag.setInteger("yCoord", y); itemTag.setInteger("zCoord", z); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockTeleposer.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockTeleposer.java index 04aa2013..53fbc75f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockTeleposer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockTeleposer.java @@ -85,12 +85,12 @@ public class BlockTeleposer extends BlockContainer { SoulNetworkHandler.checkAndSetItemOwner(playerItem, player); - if (playerItem.stackTagCompound == null) + if (playerItem.getTagCompound() == null) { playerItem.setTagCompound(new NBTTagCompound()); } - NBTTagCompound itemTag = playerItem.stackTagCompound; + NBTTagCompound itemTag = playerItem.getTagCompound(); itemTag.setInteger("xCoord", x); itemTag.setInteger("yCoord", y); itemTag.setInteger("zCoord", z); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandUnbind.java b/src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandUnbind.java index 7c2988ff..26a2cd71 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandUnbind.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandUnbind.java @@ -36,7 +36,7 @@ public class CommandUnbind extends CommandBase { if (!EnergyItems.getOwnerName(item).isEmpty()) { - item.stackTagCompound.setString("ownerName", ""); + item.getTagCompound().setString("ownerName", ""); func_152373_a(iCommandSender, this, "commands.unbind.success", new Object[0]); } else diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/EntityMinorDemonGrunt.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/EntityMinorDemonGrunt.java index 24b04cee..654e1a2b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/EntityMinorDemonGrunt.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/EntityMinorDemonGrunt.java @@ -25,6 +25,8 @@ import net.minecraft.util.DamageSource; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; +import WayofTime.alchemicalWizardry.api.rituals.LocalRitualStorage; import WayofTime.alchemicalWizardry.common.EntityAITargetAggroCloaking; import WayofTime.alchemicalWizardry.common.Int3; import WayofTime.alchemicalWizardry.common.demonVillage.ai.EntityAIOccasionalRangedAttack; @@ -33,6 +35,7 @@ import WayofTime.alchemicalWizardry.common.demonVillage.ai.IOccasionalRangedAtta import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal; import WayofTime.alchemicalWizardry.common.entity.mob.EntityDemon; import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile; +import WayofTime.alchemicalWizardry.common.rituals.LocalStorageAlphaPact; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRangedAttackMob, IHoardDemon @@ -255,6 +258,16 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan { ((TEDemonPortal) tile).enthrallDemon(this); this.enthralled = true; + }else if(tile instanceof IMasterRitualStone) + { + IMasterRitualStone stone = (IMasterRitualStone)tile; + LocalRitualStorage stor = stone.getLocalStorage(); + if(stor instanceof LocalStorageAlphaPact) + { + LocalStorageAlphaPact storage = (LocalStorageAlphaPact)stor; + + storage.thrallDemon(this); + } } } super.onUpdate(); @@ -491,9 +504,9 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan } @Override - public boolean thrallDemon(TEDemonPortal teDemonPortal) + public boolean thrallDemon(Int3 location) { - this.setPortalLocation(new Int3(teDemonPortal.xCoord, teDemonPortal.yCoord, teDemonPortal.zCoord)); + this.setPortalLocation(location); return true; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/IHoardDemon.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/IHoardDemon.java index 10c0b2a9..9942f519 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/IHoardDemon.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/IHoardDemon.java @@ -1,12 +1,11 @@ package WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon; import WayofTime.alchemicalWizardry.common.Int3; -import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal; public interface IHoardDemon { public void setPortalLocation(Int3 position); public Int3 getPortalLocation(); - public boolean thrallDemon(TEDemonPortal teDemonPortal); + public boolean thrallDemon(Int3 location); public boolean isSamePortal(IHoardDemon demon); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/TEDemonPortal.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/TEDemonPortal.java index bde97f35..2357dd75 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/TEDemonPortal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/TEDemonPortal.java @@ -282,7 +282,7 @@ public class TEDemonPortal extends TileEntity { if(demon instanceof IHoardDemon) { - boolean enthrall = ((IHoardDemon) demon).thrallDemon(this); + boolean enthrall = ((IHoardDemon) demon).thrallDemon(new Int3(this.xCoord, this.yCoord, this.zCoord)); if(enthrall) { this.hoardList.add((IHoardDemon)demon); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ActivationCrystal.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ActivationCrystal.java index ea6f74cf..0357a7ea 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ActivationCrystal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ActivationCrystal.java @@ -92,9 +92,9 @@ public class ActivationCrystal extends EnergyItems } } - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ArmourInhibitor.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ArmourInhibitor.java index 5266b685..372ad65e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ArmourInhibitor.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ArmourInhibitor.java @@ -34,9 +34,9 @@ public class ArmourInhibitor extends EnergyItems par3List.add("Used to suppress a soul's"); par3List.add("unnatural abilities."); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add("Activated"); } else @@ -44,7 +44,7 @@ public class ArmourInhibitor extends EnergyItems par3List.add("Deactivated"); } - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } @@ -60,12 +60,12 @@ public class ArmourInhibitor extends EnergyItems @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - if (stack.stackTagCompound == null) + if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = stack.stackTagCompound; + NBTTagCompound tag = stack.getTagCompound(); if (tag.getBoolean("isActive")) { @@ -99,12 +99,12 @@ public class ArmourInhibitor extends EnergyItems return par1ItemStack; } - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = par1ItemStack.stackTagCompound; + NBTTagCompound tag = par1ItemStack.getTagCompound(); tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); if (tag.getBoolean("isActive")) @@ -133,14 +133,14 @@ public class ArmourInhibitor extends EnergyItems EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { - if (par2World.getWorldTime() % tickDelay == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer) + if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer) { } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BlankSpell.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BlankSpell.java index 0f955d01..4e4cf326 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BlankSpell.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/BlankSpell.java @@ -35,13 +35,13 @@ public class BlankSpell extends EnergyItems { par3List.add("Crystal of infinite possibilities."); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); - if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } par3List.add("Coords: " + itemTag.getInteger("xCoord") + ", " + itemTag.getInteger("yCoord") + ", " + itemTag.getInteger("zCoord")); @@ -65,7 +65,7 @@ public class BlankSpell extends EnergyItems if (world != null) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); TileEntity tileEntity = world.getTileEntity(itemTag.getInteger("xCoord"), itemTag.getInteger("yCoord"), itemTag.getInteger("zCoord")); if (tileEntity instanceof TEHomHeart) @@ -100,11 +100,11 @@ public class BlankSpell extends EnergyItems public int getDimensionID(ItemStack itemStack) { - if (itemStack.stackTagCompound == null) + if (itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - return itemStack.stackTagCompound.getInteger("dimensionId"); + return itemStack.getTagCompound().getInteger("dimensionId"); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java index 38aaa056..e7e0f4b0 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java @@ -57,9 +57,9 @@ public class BoundAxe extends ItemAxe implements IBindable { par3List.add("Axe me about my puns!"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add("Activated"); } else @@ -67,9 +67,9 @@ public class BoundAxe extends ItemAxe implements IBindable par3List.add("Deactivated"); } - if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } } @@ -86,12 +86,12 @@ public class BoundAxe extends ItemAxe implements IBindable @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - if (stack.stackTagCompound == null) + if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = stack.stackTagCompound; + NBTTagCompound tag = stack.getTagCompound(); if (tag.getBoolean("isActive")) { @@ -110,7 +110,7 @@ public class BoundAxe extends ItemAxe implements IBindable if (par3EntityPlayer.isSneaking()) { this.setActivated(par1ItemStack, !getActivated(par1ItemStack)); - par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); + par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); return par1ItemStack; } @@ -195,11 +195,11 @@ public class BoundAxe extends ItemAxe implements IBindable EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { @@ -216,7 +216,7 @@ public class BoundAxe extends ItemAxe implements IBindable public void setActivated(ItemStack par1ItemStack, boolean newActivated) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null) { @@ -228,7 +228,7 @@ public class BoundAxe extends ItemAxe implements IBindable public boolean getActivated(ItemStack par1ItemStack) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java index d7baeb54..11f09a3e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java @@ -59,9 +59,9 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable par3List.add("The Souls of the Damned"); par3List.add("do not like stone..."); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add("Activated"); } else @@ -69,9 +69,9 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable par3List.add("Deactivated"); } - if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } } @@ -88,12 +88,12 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - if (stack.stackTagCompound == null) + if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = stack.stackTagCompound; + NBTTagCompound tag = stack.getTagCompound(); if (tag.getBoolean("isActive")) { @@ -112,7 +112,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable if (par3EntityPlayer.isSneaking()) { this.setActivated(par1ItemStack, !getActivated(par1ItemStack)); - par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); + par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); return par1ItemStack; } @@ -202,12 +202,12 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { @@ -224,7 +224,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable public void setActivated(ItemStack par1ItemStack, boolean newActivated) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null) { @@ -236,7 +236,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable public boolean getActivated(ItemStack par1ItemStack) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java index b8891120..b7973e1a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java @@ -63,9 +63,9 @@ public class BoundShovel extends ItemSpade implements IBindable { par3List.add("No, not that type of spade."); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add("Activated"); } else @@ -73,9 +73,9 @@ public class BoundShovel extends ItemSpade implements IBindable par3List.add("Deactivated"); } - if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } } @@ -92,12 +92,12 @@ public class BoundShovel extends ItemSpade implements IBindable @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - if (stack.stackTagCompound == null) + if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = stack.stackTagCompound; + NBTTagCompound tag = stack.getTagCompound(); if (tag.getBoolean("isActive")) { @@ -116,7 +116,7 @@ public class BoundShovel extends ItemSpade implements IBindable if (par3EntityPlayer.isSneaking()) { this.setActivated(par1ItemStack, !getActivated(par1ItemStack)); - par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); + par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); return par1ItemStack; } @@ -201,11 +201,11 @@ public class BoundShovel extends ItemSpade implements IBindable EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { @@ -222,7 +222,7 @@ public class BoundShovel extends ItemSpade implements IBindable public void setActivated(ItemStack par1ItemStack, boolean newActivated) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null) { @@ -234,7 +234,7 @@ public class BoundShovel extends ItemSpade implements IBindable public boolean getActivated(ItemStack par1ItemStack) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/CheatyItem.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/CheatyItem.java index ebcea70a..77fabc75 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/CheatyItem.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/CheatyItem.java @@ -42,9 +42,9 @@ public class CheatyItem extends Item implements IBindable par3List.add("Right-click to fill network,"); par3List.add("shift-right to empty."); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } @@ -72,7 +72,7 @@ public class CheatyItem extends Item implements IBindable return par1ItemStack; } - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null || itemTag.getString("ownerName").equals("")) { @@ -156,7 +156,7 @@ public class CheatyItem extends Item implements IBindable return 0; } - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null || itemTag.getString("ownerName").equals("")) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/DemonPlacer.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/DemonPlacer.java index e0b6f52e..c5091278 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/DemonPlacer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/DemonPlacer.java @@ -183,42 +183,42 @@ public class DemonPlacer extends Item public static void setOwnerName(ItemStack par1ItemStack, String ownerName) { - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - par1ItemStack.stackTagCompound.setString("ownerName", ownerName); + par1ItemStack.getTagCompound().setString("ownerName", ownerName); } public static String getOwnerName(ItemStack par1ItemStack) { - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - return par1ItemStack.stackTagCompound.getString("ownerName"); + return par1ItemStack.getTagCompound().getString("ownerName"); } public static void setDemonString(ItemStack itemStack, String demonName) { - if (itemStack.stackTagCompound == null) + if (itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - itemStack.stackTagCompound.setString("demonName", demonName); + itemStack.getTagCompound().setString("demonName", demonName); } public static String getDemonString(ItemStack itemStack) { - if (itemStack.stackTagCompound == null) + if (itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - return itemStack.stackTagCompound.getString("demonName"); + return itemStack.getTagCompound().getString("demonName"); } @Override @@ -226,11 +226,11 @@ public class DemonPlacer extends Item { par3List.add("Used to spawn demons."); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) { - par3List.add("Demon's Owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Demon's Owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/DemonicTelepositionFocus.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/DemonicTelepositionFocus.java index d976128b..a810dbe1 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/DemonicTelepositionFocus.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/DemonicTelepositionFocus.java @@ -29,13 +29,13 @@ public class DemonicTelepositionFocus extends TelepositionFocus par3List.add("A stronger version of the focus,"); par3List.add("using a demonic shard"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); - if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } par3List.add("Coords: " + itemTag.getInteger("xCoord") + ", " + itemTag.getInteger("yCoord") + ", " + itemTag.getInteger("zCoord")); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBattery.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBattery.java index a8148393..72bc8225 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBattery.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBattery.java @@ -46,9 +46,9 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add("Stores raw Life Essence"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } @@ -65,7 +65,7 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ); } - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if(SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) { @@ -187,7 +187,7 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl return 0; } - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null || itemTag.getString("ownerName").equals("")) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBazooka.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBazooka.java index 34b0d19a..b191bd10 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBazooka.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBazooka.java @@ -45,12 +45,12 @@ public class EnergyBazooka extends EnergyItems @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - if (stack.stackTagCompound == null) + if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = stack.stackTagCompound; + NBTTagCompound tag = stack.getTagCompound(); if (tag.getBoolean("isActive")) { @@ -69,7 +69,7 @@ public class EnergyBazooka extends EnergyItems if (par3EntityPlayer.isSneaking()) { this.setActivated(par1ItemStack, !getActivated(par1ItemStack)); - par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100); + par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100); return par1ItemStack; } @@ -119,7 +119,7 @@ public class EnergyBazooka extends EnergyItems EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } @@ -130,7 +130,7 @@ public class EnergyBazooka extends EnergyItems this.setDelay(par1ItemStack, delay - 1); } - if (par2World.getWorldTime() % 100 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par2World.getWorldTime() % 100 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { @@ -150,9 +150,9 @@ public class EnergyBazooka extends EnergyItems { par3List.add("Boom."); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add("Activated"); } else @@ -160,16 +160,16 @@ public class EnergyBazooka extends EnergyItems par3List.add("Deactivated"); } - if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } } public void setActivated(ItemStack par1ItemStack, boolean newActivated) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null) { @@ -181,7 +181,7 @@ public class EnergyBazooka extends EnergyItems public boolean getActivated(ItemStack par1ItemStack) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null) { @@ -193,7 +193,7 @@ public class EnergyBazooka extends EnergyItems public void setDelay(ItemStack par1ItemStack, int newDelay) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null) { @@ -205,7 +205,7 @@ public class EnergyBazooka extends EnergyItems public int getDelay(ItemStack par1ItemStack) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBlast.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBlast.java index 09827829..abc14e9e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBlast.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBlast.java @@ -45,12 +45,12 @@ public class EnergyBlast extends EnergyItems @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - if (stack.stackTagCompound == null) + if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = stack.stackTagCompound; + NBTTagCompound tag = stack.getTagCompound(); if (tag.getBoolean("isActive")) { @@ -69,7 +69,7 @@ public class EnergyBlast extends EnergyItems if (par3EntityPlayer.isSneaking()) { this.setActivated(par1ItemStack, !getActivated(par1ItemStack)); - par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100); + par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100); return par1ItemStack; } @@ -111,7 +111,7 @@ public class EnergyBlast extends EnergyItems } EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } @@ -122,7 +122,7 @@ public class EnergyBlast extends EnergyItems this.setDelay(par1ItemStack, delay - 1); } - if (par2World.getWorldTime() % 100 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par2World.getWorldTime() % 100 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { @@ -144,9 +144,9 @@ public class EnergyBlast extends EnergyItems par3List.add("projectiles."); par3List.add("Damage: " + damage); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add("Activated"); } else @@ -154,16 +154,16 @@ public class EnergyBlast extends EnergyItems par3List.add("Deactivated"); } - if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } } public void setActivated(ItemStack par1ItemStack, boolean newActivated) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null) { @@ -175,7 +175,7 @@ public class EnergyBlast extends EnergyItems public boolean getActivated(ItemStack par1ItemStack) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null) { @@ -187,7 +187,7 @@ public class EnergyBlast extends EnergyItems public void setDelay(ItemStack par1ItemStack, int newDelay) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null) { @@ -199,7 +199,7 @@ public class EnergyBlast extends EnergyItems public int getDelay(ItemStack par1ItemStack) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyItems.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyItems.java index 2bd0dde0..2035261d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyItems.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyItems.java @@ -191,35 +191,35 @@ public class EnergyItems extends Item implements IBindable public static void setItemOwner(ItemStack item, String ownerName) { - if (item.stackTagCompound == null) + if (item.getTagCompound() == null) { item.setTagCompound(new NBTTagCompound()); } - item.stackTagCompound.setString("ownerName", ownerName); + item.getTagCompound().setString("ownerName", ownerName); } public static void checkAndSetItemOwner(ItemStack item, String ownerName) { - if (item.stackTagCompound == null) + if (item.getTagCompound() == null) { item.setTagCompound(new NBTTagCompound()); } - if (item.stackTagCompound.getString("ownerName").equals("")) + if (item.getTagCompound().getString("ownerName").equals("")) { - item.stackTagCompound.setString("ownerName", ownerName); + item.getTagCompound().setString("ownerName", ownerName); } } public static String getOwnerName(ItemStack item) { - if (item.stackTagCompound == null) + if (item.getTagCompound() == null) { item.setTagCompound(new NBTTagCompound()); } - return item.stackTagCompound.getString("ownerName"); + return item.getTagCompound().getString("ownerName"); } public static void drainPlayerNetwork(EntityPlayer player, int damageToBeDone) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergySword.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergySword.java index d811608b..7d489e9b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergySword.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergySword.java @@ -59,12 +59,12 @@ public class EnergySword extends ItemSword @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - if (stack.stackTagCompound == null) + if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = stack.stackTagCompound; + NBTTagCompound tag = stack.getTagCompound(); if (tag.getBoolean("isActive")) { @@ -106,7 +106,7 @@ public class EnergySword extends ItemSword if (par3EntityPlayer.isSneaking()) { this.setActivated(par1ItemStack, !getActivated(par1ItemStack)); - par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100); + par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100); return par1ItemStack; } @@ -134,12 +134,12 @@ public class EnergySword extends ItemSword EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (par2World.getWorldTime() % 100 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par2World.getWorldTime() % 100 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { @@ -156,7 +156,7 @@ public class EnergySword extends ItemSword public void setActivated(ItemStack par1ItemStack, boolean newActivated) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null) { @@ -168,7 +168,7 @@ public class EnergySword extends ItemSword public boolean getActivated(ItemStack par1ItemStack) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null) { @@ -189,9 +189,9 @@ public class EnergySword extends ItemSword par3List.add("Caution: may cause"); par3List.add("a bad day..."); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add("Activated"); } else @@ -199,9 +199,9 @@ public class EnergySword extends ItemSword par3List.add("Deactivated"); } - if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/EnhancedTelepositionFocus.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnhancedTelepositionFocus.java index 4ef5bf57..8a1598d4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/EnhancedTelepositionFocus.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnhancedTelepositionFocus.java @@ -28,13 +28,13 @@ public class EnhancedTelepositionFocus extends TelepositionFocus { par3List.add("A focus further enhanced in an altar"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); - if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } par3List.add("Coords: " + itemTag.getInteger("xCoord") + ", " + itemTag.getInteger("yCoord") + ", " + itemTag.getInteger("zCoord")); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemBloodLetterPack.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemBloodLetterPack.java index 183b59a5..78adb82f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemBloodLetterPack.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemBloodLetterPack.java @@ -47,9 +47,9 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl { par3List.add("This pack really chaffes..."); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); par3List.add("Stored LP: " + this.getStoredLP(par1ItemStack)); } @@ -143,7 +143,7 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { //This is where I need to do the updating - if(!world.isRemote) + if(world.isRemote) { return; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemComplexSpellCrystal.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemComplexSpellCrystal.java index fbca39d6..bef99c14 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemComplexSpellCrystal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemComplexSpellCrystal.java @@ -35,13 +35,13 @@ public class ItemComplexSpellCrystal extends EnergyItems { par3List.add("Crystal of unimaginable power"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); - if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } par3List.add("Coords: " + itemTag.getInteger("xCoord") + ", " + itemTag.getInteger("yCoord") + ", " + itemTag.getInteger("zCoord")); @@ -65,7 +65,7 @@ public class ItemComplexSpellCrystal extends EnergyItems if (world != null) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); TileEntity tileEntity = world.getTileEntity(itemTag.getInteger("xCoord"), itemTag.getInteger("yCoord"), itemTag.getInteger("zCoord")); if (tileEntity instanceof TESpellParadigmBlock) @@ -91,11 +91,11 @@ public class ItemComplexSpellCrystal extends EnergyItems public int getDimensionID(ItemStack itemStack) { - if (itemStack.stackTagCompound == null) + if (itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - return itemStack.stackTagCompound.getInteger("dimensionId"); + return itemStack.getTagCompound().getInteger("dimensionId"); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemDiabloKey.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemDiabloKey.java index a675e79d..81e13fbd 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemDiabloKey.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemDiabloKey.java @@ -42,9 +42,9 @@ public class ItemDiabloKey extends EnergyItems public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add("Binds other items to the owner's network"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } @@ -77,7 +77,7 @@ public class ItemDiabloKey extends EnergyItems return par1ItemStack; } - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null || itemTag.getString("ownerName").equals("")) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDiviner.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDiviner.java index ecd66773..1582ba75 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDiviner.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDiviner.java @@ -67,11 +67,11 @@ public class ItemRitualDiviner extends EnergyItems if(sneaking) { - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { String ritualID = this.getCurrentRitual(par1ItemStack); //TODO - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); par3List.add("RitualID: " + ritualID); List ritualList = Rituals.getRitualList(this.getCurrentRitual(par1ItemStack)); if (ritualList == null) @@ -133,7 +133,7 @@ public class ItemRitualDiviner extends EnergyItems @Override public String getItemStackDisplayName(ItemStack par1ItemStack) { - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { String ritualID = this.getCurrentRitual(par1ItemStack); if (ritualID.equals("")) @@ -303,42 +303,42 @@ public class ItemRitualDiviner extends EnergyItems public String getCurrentRitual(ItemStack par1ItemStack) { - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - return par1ItemStack.stackTagCompound.getString("ritualID"); + return par1ItemStack.getTagCompound().getString("ritualID"); } public void setCurrentRitual(ItemStack par1ItemStack, String ritualID) { - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - par1ItemStack.stackTagCompound.setString("ritualID", ritualID); + par1ItemStack.getTagCompound().setString("ritualID", ritualID); } public int getMaxRuneDisplacement(ItemStack par1ItemStack) //0 indicates the starting 4 runes, 1 indicates it can use Dusk runes { - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - return par1ItemStack.stackTagCompound.getInteger("maxRuneDisplacement"); + return par1ItemStack.getTagCompound().getInteger("maxRuneDisplacement"); } public void setMaxRuneDisplacement(ItemStack par1ItemStack, int displacement) { - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - par1ItemStack.stackTagCompound.setInteger("maxRuneDisplacement", displacement); + par1ItemStack.getTagCompound().setInteger("maxRuneDisplacement", displacement); } @Override @@ -353,22 +353,22 @@ public class ItemRitualDiviner extends EnergyItems public int getDirection(ItemStack itemStack) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - return itemStack.stackTagCompound.getInteger("direction"); + return itemStack.getTagCompound().getInteger("direction"); } public void setDirection(ItemStack itemStack, int direction) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - itemStack.stackTagCompound.setInteger("direction", direction); + itemStack.getTagCompound().setInteger("direction", direction); } public int cycleDirection(ItemStack itemStack) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/LavaCrystal.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/LavaCrystal.java index 451017d2..9cb58bae 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/LavaCrystal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/LavaCrystal.java @@ -64,9 +64,9 @@ public class LavaCrystal extends EnergyItems par3List.add("Store life to smelt"); par3List.add("stuff in the furnace."); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ReinforcedTelepositionFocus.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ReinforcedTelepositionFocus.java index 235ddf42..f5f25310 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ReinforcedTelepositionFocus.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ReinforcedTelepositionFocus.java @@ -29,13 +29,13 @@ public class ReinforcedTelepositionFocus extends TelepositionFocus par3List.add("A stronger version of the focus,"); par3List.add("using a weak shard"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); - if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } par3List.add("Coords: " + itemTag.getInteger("xCoord") + ", " + itemTag.getInteger("yCoord") + ", " + itemTag.getInteger("zCoord")); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ScribeTool.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ScribeTool.java index 8019a5aa..a23a4bb9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ScribeTool.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ScribeTool.java @@ -26,9 +26,9 @@ public class ScribeTool extends EnergyItems { par3List.add("The writing is on the wall..."); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/TelepositionFocus.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/TelepositionFocus.java index 20e032dc..af6f762d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/TelepositionFocus.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/TelepositionFocus.java @@ -36,13 +36,13 @@ public class TelepositionFocus extends EnergyItems { par3List.add("An Enderpearl imbued with blood"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); - if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } par3List.add("Coords: " + itemTag.getInteger("xCoord") + ", " + itemTag.getInteger("yCoord") + ", " + itemTag.getInteger("zCoord")); @@ -64,12 +64,12 @@ public class TelepositionFocus extends EnergyItems public int getDimensionID(ItemStack itemStack) { - if (itemStack.stackTagCompound == null) + if (itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - return itemStack.stackTagCompound.getInteger("dimensionId"); + return itemStack.getTagCompound().getInteger("dimensionId"); } public World getWorld(ItemStack itemStack) @@ -79,9 +79,9 @@ public class TelepositionFocus extends EnergyItems public int xCoord(ItemStack itemStack) { - if (!(itemStack.stackTagCompound == null)) + if (!(itemStack.getTagCompound() == null)) { - return itemStack.stackTagCompound.getInteger("xCoord"); + return itemStack.getTagCompound().getInteger("xCoord"); } else { return 0; @@ -90,9 +90,9 @@ public class TelepositionFocus extends EnergyItems public int yCoord(ItemStack itemStack) { - if (!(itemStack.stackTagCompound == null)) + if (!(itemStack.getTagCompound() == null)) { - return itemStack.stackTagCompound.getInteger("yCoord"); + return itemStack.getTagCompound().getInteger("yCoord"); } else { return 0; @@ -101,9 +101,9 @@ public class TelepositionFocus extends EnergyItems public int zCoord(ItemStack itemStack) { - if (!(itemStack.stackTagCompound == null)) + if (!(itemStack.getTagCompound() == null)) { - return itemStack.stackTagCompound.getInteger("zCoord"); + return itemStack.getTagCompound().getInteger("zCoord"); } else { return 0; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/BoundArmour.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/BoundArmour.java index 0633d1be..b1a5daa9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/BoundArmour.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/BoundArmour.java @@ -27,8 +27,8 @@ import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; +import WayofTime.alchemicalWizardry.api.items.interfaces.ILPGauge; import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import WayofTime.alchemicalWizardry.common.items.ILPGauge; import WayofTime.alchemicalWizardry.common.items.sigil.DivinationSigil; import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaArmour; import cpw.mods.fml.common.Optional; @@ -278,11 +278,11 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA { par3List.add("Devilish Protection"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } ItemStack[] inv = getInternalInventory(par1ItemStack); @@ -350,7 +350,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA @Override public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { - if (itemStack.stackTagCompound == null) + if (itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } @@ -500,13 +500,13 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA public ItemStack[] getInternalInventory(ItemStack itemStack) { - NBTTagCompound itemTag = itemStack.stackTagCompound; + NBTTagCompound itemTag = itemStack.getTagCompound(); if (itemTag == null) { itemStack.setTagCompound(new NBTTagCompound()); } - itemTag = itemStack.stackTagCompound; + itemTag = itemStack.getTagCompound(); ItemStack[] inv = new ItemStack[9]; NBTTagList tagList = itemTag.getTagList("Inventory", Constants.NBT.TAG_COMPOUND); @@ -532,7 +532,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA public void saveInternalInventory(ItemStack itemStack, ItemStack[] inventory) { - NBTTagCompound itemTag = itemStack.stackTagCompound; + NBTTagCompound itemTag = itemStack.getTagCompound(); if (itemTag == null) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemAttunedCrystal.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemAttunedCrystal.java index cee82d2d..ce765dd1 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemAttunedCrystal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemAttunedCrystal.java @@ -58,7 +58,7 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator par3List.add("A tool to tune alchemy"); par3List.add("reagent transmission"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { Reagent reagent = this.getReagent(par1ItemStack); if (reagent != null) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemTankSegmenter.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemTankSegmenter.java index 97cc4a6a..c29555cd 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemTankSegmenter.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemTankSegmenter.java @@ -51,7 +51,7 @@ public class ItemTankSegmenter extends Item implements IReagentManipulator par3List.add("Used to designate which"); par3List.add("reagents can go into a container"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { Reagent reagent = this.getReagent(par1ItemStack); if (reagent != null) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/forestry/ItemBloodFrame.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/forestry/ItemBloodFrame.java index 8c348659..73368262 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/forestry/ItemBloodFrame.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/forestry/ItemBloodFrame.java @@ -27,9 +27,9 @@ public class ItemBloodFrame extends EnergyItems //implements IHiveFrame { par3List.add("Stirs bees into a frenzy."); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyFlask.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyFlask.java index 8e945e28..c668c718 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyFlask.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyFlask.java @@ -90,7 +90,7 @@ public class AlchemyFlask extends Item public static void setEffects(ItemStack par1ItemStack, List list) { - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null) { @@ -104,7 +104,7 @@ public class AlchemyFlask extends Item nbttaglist.appendTag(AlchemyPotionHelper.setEffectToNBT(aph)); } - par1ItemStack.stackTagCompound.setTag("CustomFlaskEffects", nbttaglist); + par1ItemStack.getTagCompound().setTag("CustomFlaskEffects", nbttaglist); } public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) @@ -378,7 +378,7 @@ public class AlchemyFlask extends Item par1ItemStack.setTagCompound(new NBTTagCompound()); } - par1ItemStack.stackTagCompound.setBoolean("throwable", flag); + par1ItemStack.getTagCompound().setBoolean("throwable", flag); } public EntityPotion getEntityPotion(ItemStack par1ItemStack, World worldObj, EntityLivingBase entityLivingBase) @@ -401,7 +401,7 @@ public class AlchemyFlask extends Item d.setBoolean("Ambient", pe.getIsAmbient()); nbttaglist.appendTag(d); } - potionStack.stackTagCompound.setTag("CustomPotionEffects", nbttaglist); + potionStack.getTagCompound().setTag("CustomPotionEffects", nbttaglist); EntityPotion entityPotion = new EntityPotion(worldObj, entityLivingBase, potionStack); return entityPotion; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/InputRoutingFocus.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/InputRoutingFocus.java new file mode 100644 index 00000000..634c184c --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/InputRoutingFocus.java @@ -0,0 +1,20 @@ +package WayofTime.alchemicalWizardry.common.items.routing; + +import net.minecraft.client.renderer.texture.IIconRegister; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class InputRoutingFocus extends RoutingFocus +{ + public InputRoutingFocus() + { + super(); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:HarvestGoddessSigil_deactivated"); + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/RoutingFocus.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/RoutingFocus.java new file mode 100644 index 00000000..2ba79fd4 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/RoutingFocus.java @@ -0,0 +1,142 @@ +package WayofTime.alchemicalWizardry.common.items.routing; + +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; + +public class RoutingFocus extends Item +{ + public RoutingFocus() + { + super(); + this.maxStackSize = 1; + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) + { + this.cycleDirection(itemStack); + return itemStack; + } + + public void cycleDirection(ItemStack itemStack) + { + ForgeDirection dir = this.getSetDirection(itemStack); + int direction = dir.ordinal(); + direction++; + if(direction >= ForgeDirection.VALID_DIRECTIONS.length) + { + direction = 0; + } + + this.setSetDirection(itemStack, ForgeDirection.getOrientation(direction)); + } + + public ForgeDirection getSetDirection(ItemStack itemStack) + { + if(!itemStack.hasTagCompound()) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = itemStack.getTagCompound(); + + return ForgeDirection.getOrientation(tag.getInteger("direction")); + } + + public void setSetDirection(ItemStack itemStack, ForgeDirection dir) + { + if(!itemStack.hasTagCompound()) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = itemStack.getTagCompound(); + + tag.setInteger("direction", dir.ordinal()); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("An Enderpearl imbued with blood"); + + if (!(par1ItemStack.getTagCompound() == null)) + { + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); + + par3List.add("Coords: " + itemTag.getInteger("xCoord") + ", " + itemTag.getInteger("yCoord") + ", " + itemTag.getInteger("zCoord")); + par3List.add("Direction: " + this.getSetDirection(par1ItemStack)); + } + } + + @Override + public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) + { + TileEntity tile = world.getTileEntity(x, y, z); + if(tile instanceof IInventory) + { + this.setCoordinates(stack, x, y, z); + + return true; + } + + return false; + } + + public void setCoordinates(ItemStack itemStack, int x, int y, int z) + { + if(!itemStack.hasTagCompound()) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = itemStack.getTagCompound(); + + tag.setInteger("xCoord", x); + tag.setInteger("yCoord", y); + tag.setInteger("zCoord", z); + } + + public int xCoord(ItemStack itemStack) + { + if (!(itemStack.getTagCompound() == null)) + { + return itemStack.getTagCompound().getInteger("xCoord"); + } else + { + return 0; + } + } + + public int yCoord(ItemStack itemStack) + { + if (!(itemStack.getTagCompound() == null)) + { + return itemStack.getTagCompound().getInteger("yCoord"); + } else + { + return 0; + } + } + + public int zCoord(ItemStack itemStack) + { + if (!(itemStack.getTagCompound() == null)) + { + return itemStack.getTagCompound().getInteger("zCoord"); + } else + { + return 0; + } + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/AirSigil.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/AirSigil.java index 9150937e..3996c23e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/AirSigil.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/AirSigil.java @@ -32,9 +32,9 @@ public class AirSigil extends EnergyItems implements ArmourUpgrade { par3List.add("I feel lighter already..."); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/DivinationSigil.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/DivinationSigil.java index 38bc3872..6ea66a43 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/DivinationSigil.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/DivinationSigil.java @@ -47,9 +47,9 @@ public class DivinationSigil extends Item implements ArmourUpgrade, IReagentMani par3List.add("Peer into the soul to"); par3List.add("get the current essence"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } @@ -68,7 +68,7 @@ public class DivinationSigil extends Item implements ArmourUpgrade, IReagentMani return par1ItemStack; } - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null || itemTag.getString("ownerName").equals("")) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemBloodLightSigil.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemBloodLightSigil.java index 60d2d94d..d4975b07 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemBloodLightSigil.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemBloodLightSigil.java @@ -32,9 +32,9 @@ public class ItemBloodLightSigil extends EnergyItems implements IHolding { par3List.add("I see a light!"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } @@ -102,7 +102,7 @@ public class ItemBloodLightSigil extends EnergyItems implements IHolding return par1ItemStack; } - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemFluidSigil.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemFluidSigil.java index 451cbef5..03e79bcf 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemFluidSigil.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemFluidSigil.java @@ -46,7 +46,7 @@ public class ItemFluidSigil extends Item implements IFluidContainerItem { par3List.add("A sigil with a lovely affinity for fluids"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { switch (this.getActionState(par1ItemStack)) { @@ -122,22 +122,22 @@ public class ItemFluidSigil extends Item implements IFluidContainerItem public int getActionState(ItemStack item) { - if (item.stackTagCompound == null) + if (item.getTagCompound() == null) { item.setTagCompound(new NBTTagCompound()); } - return item.stackTagCompound.getInteger("actionState"); + return item.getTagCompound().getInteger("actionState"); } public void setActionState(ItemStack item, int actionState) { - if (item.stackTagCompound == null) + if (item.getTagCompound() == null) { item.setTagCompound(new NBTTagCompound()); } - item.stackTagCompound.setInteger("actionState", actionState); + item.getTagCompound().setInteger("actionState", actionState); } public int cycleActionState(ItemStack item) @@ -648,11 +648,11 @@ public class ItemFluidSigil extends Item implements IFluidContainerItem @Override public FluidStack getFluid(ItemStack container) { - if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Fluid")) + if (container.getTagCompound() == null || !container.getTagCompound().hasKey("Fluid")) { return null; } - return FluidStack.loadFluidStackFromNBT(container.stackTagCompound.getCompoundTag("Fluid")); + return FluidStack.loadFluidStackFromNBT(container.getTagCompound().getCompoundTag("Fluid")); } @Override @@ -671,12 +671,12 @@ public class ItemFluidSigil extends Item implements IFluidContainerItem if (!doFill) { - if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Fluid")) + if (container.getTagCompound() == null || !container.getTagCompound().hasKey("Fluid")) { return Math.min(capacity, resource.amount); } - FluidStack stack = FluidStack.loadFluidStackFromNBT(container.stackTagCompound.getCompoundTag("Fluid")); + FluidStack stack = FluidStack.loadFluidStackFromNBT(container.getTagCompound().getCompoundTag("Fluid")); if (stack == null || stack.amount <= 0) { @@ -691,27 +691,27 @@ public class ItemFluidSigil extends Item implements IFluidContainerItem return Math.min(capacity - stack.amount, resource.amount); } - if (container.stackTagCompound == null) + if (container.getTagCompound() == null) { - container.stackTagCompound = new NBTTagCompound(); + container.setTagCompound(new NBTTagCompound()); } - if (!container.stackTagCompound.hasKey("Fluid")) + if (!container.getTagCompound().hasKey("Fluid")) { NBTTagCompound fluidTag = resource.writeToNBT(new NBTTagCompound()); if (capacity < resource.amount) { fluidTag.setInteger("Amount", capacity); - container.stackTagCompound.setTag("Fluid", fluidTag); + container.getTagCompound().setTag("Fluid", fluidTag); return capacity; } - container.stackTagCompound.setTag("Fluid", fluidTag); + container.getTagCompound().setTag("Fluid", fluidTag); return resource.amount; } - NBTTagCompound fluidTag = container.stackTagCompound.getCompoundTag("Fluid"); + NBTTagCompound fluidTag = container.getTagCompound().getCompoundTag("Fluid"); FluidStack stack = FluidStack.loadFluidStackFromNBT(fluidTag); if (stack == null || stack.amount <= 0) @@ -721,11 +721,11 @@ public class ItemFluidSigil extends Item implements IFluidContainerItem if (capacity < resource.amount) { fluidTag1.setInteger("Amount", capacity); - container.stackTagCompound.setTag("Fluid", fluidTag1); + container.getTagCompound().setTag("Fluid", fluidTag1); return capacity; } - container.stackTagCompound.setTag("Fluid", fluidTag1); + container.getTagCompound().setTag("Fluid", fluidTag1); return resource.amount; } @@ -744,19 +744,19 @@ public class ItemFluidSigil extends Item implements IFluidContainerItem stack.amount = capacity; } - container.stackTagCompound.setTag("Fluid", stack.writeToNBT(fluidTag)); + container.getTagCompound().setTag("Fluid", stack.writeToNBT(fluidTag)); return filled; } @Override public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain) { - if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Fluid")) + if (container.getTagCompound() == null || !container.getTagCompound().hasKey("Fluid")) { return null; } - FluidStack stack = FluidStack.loadFluidStackFromNBT(container.stackTagCompound.getCompoundTag("Fluid")); + FluidStack stack = FluidStack.loadFluidStackFromNBT(container.getTagCompound().getCompoundTag("Fluid")); if (stack == null) { return null; @@ -767,18 +767,18 @@ public class ItemFluidSigil extends Item implements IFluidContainerItem { if (maxDrain >= capacity) { - container.stackTagCompound.removeTag("Fluid"); + container.getTagCompound().removeTag("Fluid"); - if (container.stackTagCompound.hasNoTags()) + if (container.getTagCompound().hasNoTags()) { - container.stackTagCompound = null; + container.setTagCompound(null); } return stack; } - NBTTagCompound fluidTag = container.stackTagCompound.getCompoundTag("Fluid"); + NBTTagCompound fluidTag = container.getTagCompound().getCompoundTag("Fluid"); fluidTag.setInteger("Amount", fluidTag.getInteger("Amount") - maxDrain); - container.stackTagCompound.setTag("Fluid", fluidTag); + container.getTagCompound().setTag("Fluid", fluidTag); } return stack; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemHarvestSigil.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemHarvestSigil.java index f253d462..c79b5295 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemHarvestSigil.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemHarvestSigil.java @@ -37,9 +37,9 @@ public class ItemHarvestSigil extends EnergyItems implements IHolding, ArmourUpg { par3List.add("You sow what you reap"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add("Activated"); } else @@ -47,7 +47,7 @@ public class ItemHarvestSigil extends EnergyItems implements IHolding, ArmourUpg par3List.add("Deactivated"); } - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } @@ -63,12 +63,12 @@ public class ItemHarvestSigil extends EnergyItems implements IHolding, ArmourUpg @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - if (stack.stackTagCompound == null) + if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = stack.stackTagCompound; + NBTTagCompound tag = stack.getTagCompound(); if (tag.getBoolean("isActive")) { @@ -102,12 +102,12 @@ public class ItemHarvestSigil extends EnergyItems implements IHolding, ArmourUpg return par1ItemStack; } - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = par1ItemStack.stackTagCompound; + NBTTagCompound tag = par1ItemStack.getTagCompound(); tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); if (tag.getBoolean("isActive")) @@ -145,12 +145,12 @@ public class ItemHarvestSigil extends EnergyItems implements IHolding, ArmourUpg EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { int range = 3; int verticalRange = 1; @@ -169,13 +169,13 @@ public class ItemHarvestSigil extends EnergyItems implements IHolding, ArmourUpg } } } - if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { - par1ItemStack.stackTagCompound.setBoolean("isActive", false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemPackRatSigil.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemPackRatSigil.java index c12ebee8..a905763a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemPackRatSigil.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemPackRatSigil.java @@ -38,9 +38,9 @@ public class ItemPackRatSigil extends EnergyItems implements IHolding, ArmourUpg { par3List.add("Hands of Diamonds"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add("Activated"); } else @@ -48,7 +48,7 @@ public class ItemPackRatSigil extends EnergyItems implements IHolding, ArmourUpg par3List.add("Deactivated"); } - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } @@ -64,12 +64,12 @@ public class ItemPackRatSigil extends EnergyItems implements IHolding, ArmourUpg @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - if (stack.stackTagCompound == null) + if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = stack.stackTagCompound; + NBTTagCompound tag = stack.getTagCompound(); if (tag.getBoolean("isActive")) { @@ -103,12 +103,12 @@ public class ItemPackRatSigil extends EnergyItems implements IHolding, ArmourUpg return par1ItemStack; } - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = par1ItemStack.stackTagCompound; + NBTTagCompound tag = par1ItemStack.getTagCompound(); tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); if (tag.getBoolean("isActive")) @@ -141,12 +141,12 @@ public class ItemPackRatSigil extends EnergyItems implements IHolding, ArmourUpg EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { ItemStack stack = CompressionRegistry.compressInventory(par3EntityPlayer.inventory.mainInventory, par2World); if(stack != null) @@ -155,13 +155,13 @@ public class ItemPackRatSigil extends EnergyItems implements IHolding, ArmourUpg par2World.spawnEntityInWorld(entityItem); } } - if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { - par1ItemStack.stackTagCompound.setBoolean("isActive", false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSeerSigil.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSeerSigil.java index 9e15505e..36f7b626 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSeerSigil.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSeerSigil.java @@ -36,9 +36,9 @@ public class ItemSeerSigil extends Item implements IHolding, ArmourUpgrade { par3List.add("When seeing all is not enough"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } @@ -52,7 +52,7 @@ public class ItemSeerSigil extends Item implements IHolding, ArmourUpgrade return par1ItemStack; } - NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); if (itemTag == null || itemTag.getString("ownerName").equals("")) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSigilOfEnderSeverance.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSigilOfEnderSeverance.java index e04a0fe1..73181667 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSigilOfEnderSeverance.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSigilOfEnderSeverance.java @@ -38,9 +38,9 @@ public class ItemSigilOfEnderSeverance extends EnergyItems implements IHolding { par3List.add("Put those endermen in a Dire situation!"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add("Activated"); } else @@ -48,7 +48,7 @@ public class ItemSigilOfEnderSeverance extends EnergyItems implements IHolding par3List.add("Deactivated"); } - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } @@ -64,12 +64,12 @@ public class ItemSigilOfEnderSeverance extends EnergyItems implements IHolding @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - if (stack.stackTagCompound == null) + if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = stack.stackTagCompound; + NBTTagCompound tag = stack.getTagCompound(); if (tag.getBoolean("isActive")) { @@ -103,12 +103,12 @@ public class ItemSigilOfEnderSeverance extends EnergyItems implements IHolding return par1ItemStack; } - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = par1ItemStack.stackTagCompound; + NBTTagCompound tag = par1ItemStack.getTagCompound(); tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); if (tag.getBoolean("isActive")) @@ -141,12 +141,12 @@ public class ItemSigilOfEnderSeverance extends EnergyItems implements IHolding EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { List list = SpellHelper.getEntitiesInRange(par2World, par3Entity.posX, par3Entity.posY, par3Entity.posZ, 4.5, 4.5); for (Entity entity : list) @@ -157,13 +157,13 @@ public class ItemSigilOfEnderSeverance extends EnergyItems implements IHolding } } } - if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { - par1ItemStack.stackTagCompound.setBoolean("isActive", false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSigilOfSupression.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSigilOfSupression.java index acbae830..d7298dac 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSigilOfSupression.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSigilOfSupression.java @@ -41,9 +41,9 @@ public class ItemSigilOfSupression extends EnergyItems implements ArmourUpgrade { par3List.add("Better than telekinesis"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add("Activated"); } else @@ -51,7 +51,7 @@ public class ItemSigilOfSupression extends EnergyItems implements ArmourUpgrade par3List.add("Deactivated"); } - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } @@ -67,12 +67,12 @@ public class ItemSigilOfSupression extends EnergyItems implements ArmourUpgrade @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - if (stack.stackTagCompound == null) + if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = stack.stackTagCompound; + NBTTagCompound tag = stack.getTagCompound(); if (tag.getBoolean("isActive")) { @@ -111,12 +111,12 @@ public class ItemSigilOfSupression extends EnergyItems implements ArmourUpgrade return par1ItemStack; } - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = par1ItemStack.stackTagCompound; + NBTTagCompound tag = par1ItemStack.getTagCompound(); tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); if (tag.getBoolean("isActive")) @@ -154,12 +154,12 @@ public class ItemSigilOfSupression extends EnergyItems implements ArmourUpgrade EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (par1ItemStack.stackTagCompound.getBoolean("isActive") && (!par2World.isRemote)) + if (par1ItemStack.getTagCompound().getBoolean("isActive") && (!par2World.isRemote)) { Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer); int x = (int) blockVec.xCoord; @@ -200,13 +200,13 @@ public class ItemSigilOfSupression extends EnergyItems implements ArmourUpgrade } } - if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { - par1ItemStack.stackTagCompound.setBoolean("isActive", false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSigilOfTheAssassin.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSigilOfTheAssassin.java index e95973d4..c76a5eb1 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSigilOfTheAssassin.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSigilOfTheAssassin.java @@ -39,7 +39,7 @@ public class ItemSigilOfTheAssassin extends EnergyItems implements ArmourUpgrade @Override public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } @@ -66,9 +66,9 @@ public class ItemSigilOfTheAssassin extends EnergyItems implements ArmourUpgrade { par3List.add("Time to stay stealthy..."); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/LavaSigil.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/LavaSigil.java index a2018dbe..2877c3fb 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/LavaSigil.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/LavaSigil.java @@ -63,9 +63,9 @@ public class LavaSigil extends ItemBucket implements ArmourUpgrade par3List.add("Contact with liquid is"); par3List.add("highly unrecommended."); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfElementalAffinity.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfElementalAffinity.java index 73406a8d..8d141ed7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfElementalAffinity.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfElementalAffinity.java @@ -37,9 +37,9 @@ public class SigilOfElementalAffinity extends EnergyItems par3List.add("Perfect for a fire-breathing fish"); par3List.add("who is afraid of heights!"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add("Activated"); } else @@ -47,7 +47,7 @@ public class SigilOfElementalAffinity extends EnergyItems par3List.add("Deactivated"); } - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } @@ -63,12 +63,12 @@ public class SigilOfElementalAffinity extends EnergyItems @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - if (stack.stackTagCompound == null) + if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = stack.stackTagCompound; + NBTTagCompound tag = stack.getTagCompound(); if (tag.getBoolean("isActive")) { @@ -102,12 +102,12 @@ public class SigilOfElementalAffinity extends EnergyItems return par1ItemStack; } - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = par1ItemStack.stackTagCompound; + NBTTagCompound tag = par1ItemStack.getTagCompound(); tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) @@ -134,25 +134,25 @@ public class SigilOfElementalAffinity extends EnergyItems EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3EntityPlayer.fallDistance = 0; par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true)); par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true)); } - if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { - par1ItemStack.stackTagCompound.setBoolean("isActive", false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfGrowth.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfGrowth.java index d4cf0ed4..c81795c8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfGrowth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfGrowth.java @@ -41,9 +41,9 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade par3List.add("Who needs a green thumb when"); par3List.add("you have a green slate?"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add("Activated"); } else @@ -51,7 +51,7 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade par3List.add("Deactivated"); } - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } @@ -67,12 +67,12 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - if (stack.stackTagCompound == null) + if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = stack.stackTagCompound; + NBTTagCompound tag = stack.getTagCompound(); if (tag.getBoolean("isActive")) { @@ -132,12 +132,12 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade return par1ItemStack; } - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = par1ItemStack.stackTagCompound; + NBTTagCompound tag = par1ItemStack.getTagCompound(); tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) @@ -161,18 +161,18 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade } EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { - if (par2World.getWorldTime() % tickDelay == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer) + if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer) { if(!EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed())) { - par1ItemStack.stackTagCompound.setBoolean("isActive", false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } int range = 3; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHaste.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHaste.java index 171e07d6..c0c43f07 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHaste.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHaste.java @@ -36,9 +36,9 @@ public class SigilOfHaste extends EnergyItems implements ArmourUpgrade { par3List.add("One dose of caffeine later..."); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add("Activated"); } else @@ -46,7 +46,7 @@ public class SigilOfHaste extends EnergyItems implements ArmourUpgrade par3List.add("Deactivated"); } - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } @@ -62,12 +62,12 @@ public class SigilOfHaste extends EnergyItems implements ArmourUpgrade @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - if (stack.stackTagCompound == null) + if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = stack.stackTagCompound; + NBTTagCompound tag = stack.getTagCompound(); if (tag.getBoolean("isActive")) { @@ -101,12 +101,12 @@ public class SigilOfHaste extends EnergyItems implements ArmourUpgrade return par1ItemStack; } - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = par1ItemStack.stackTagCompound; + NBTTagCompound tag = par1ItemStack.getTagCompound(); tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) @@ -132,23 +132,23 @@ public class SigilOfHaste extends EnergyItems implements ArmourUpgrade EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1)); } - if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { - par1ItemStack.stackTagCompound.setBoolean("isActive", false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } } @@ -159,7 +159,7 @@ public class SigilOfHaste extends EnergyItems implements ArmourUpgrade @Override public void onArmourUpdate(World world, EntityPlayer player, ItemStack itemStack) { - if (itemStack.stackTagCompound == null) + if (itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHolding.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHolding.java index 1fd61f76..e8fb7bf6 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHolding.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHolding.java @@ -43,7 +43,7 @@ public class SigilOfHolding extends EnergyItems @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - if (!(stack.stackTagCompound == null)) + if (!(stack.getTagCompound() == null)) { ItemStack[] inv = getInternalInventory(stack); @@ -52,7 +52,7 @@ public class SigilOfHolding extends EnergyItems return this.itemIcon; } - ItemStack item = inv[stack.stackTagCompound.getInteger("selectedSlot")]; + ItemStack item = inv[stack.getTagCompound().getInteger("selectedSlot")]; if (item != null) { @@ -68,9 +68,9 @@ public class SigilOfHolding extends EnergyItems { par3List.add("Used to hold several Sigils!"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); ItemStack[] inv = getInternalInventory(par1ItemStack); if (inv == null) @@ -78,7 +78,7 @@ public class SigilOfHolding extends EnergyItems return; } - ItemStack item = inv[par1ItemStack.stackTagCompound.getInteger("selectedSlot")]; + ItemStack item = inv[par1ItemStack.getTagCompound().getInteger("selectedSlot")]; if (item != null) { @@ -135,7 +135,7 @@ public class SigilOfHolding extends EnergyItems @Override public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { this.tickInternalInventory(par1ItemStack, par2World, par3Entity, par4, par5); } @@ -143,7 +143,7 @@ public class SigilOfHolding extends EnergyItems public ItemStack[] getInternalInventory(ItemStack itemStack) { - NBTTagCompound itemTag = itemStack.stackTagCompound; + NBTTagCompound itemTag = itemStack.getTagCompound(); if (itemTag == null) { @@ -175,7 +175,7 @@ public class SigilOfHolding extends EnergyItems public void saveInternalInventory(ItemStack itemStack, ItemStack[] inventory) { - NBTTagCompound itemTag = itemStack.stackTagCompound; + NBTTagCompound itemTag = itemStack.getTagCompound(); if (itemTag == null) { @@ -222,7 +222,7 @@ public class SigilOfHolding extends EnergyItems public int getSelectedSlot(ItemStack itemStack) { - NBTTagCompound itemTag = itemStack.stackTagCompound; + NBTTagCompound itemTag = itemStack.getTagCompound(); if (itemTag == null) { @@ -248,7 +248,7 @@ public class SigilOfHolding extends EnergyItems } } - NBTTagCompound itemTag = itemStack.stackTagCompound; + NBTTagCompound itemTag = itemStack.getTagCompound(); if (itemTag == null) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfMagnetism.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfMagnetism.java index 69e182d4..79ffcd8d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfMagnetism.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfMagnetism.java @@ -37,9 +37,9 @@ public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade, IHol { par3List.add("I have a very magnetic personality!"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add("Activated"); } else @@ -47,7 +47,7 @@ public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade, IHol par3List.add("Deactivated"); } - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } @@ -63,12 +63,12 @@ public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade, IHol @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - if (stack.stackTagCompound == null) + if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = stack.stackTagCompound; + NBTTagCompound tag = stack.getTagCompound(); if (tag.getBoolean("isActive")) { @@ -102,12 +102,12 @@ public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade, IHol return par1ItemStack; } - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = par1ItemStack.stackTagCompound; + NBTTagCompound tag = par1ItemStack.getTagCompound(); tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) @@ -132,18 +132,18 @@ public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade, IHol EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { - if (par2World.getWorldTime() % tickDelay == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer) + if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer) { if(!EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed())) { - par1ItemStack.stackTagCompound.setBoolean("isActive", false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheBridge.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheBridge.java index e758cf63..557f3b91 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheBridge.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheBridge.java @@ -39,9 +39,9 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade par3List.add("Activate to create a bridge"); par3List.add("beneath your feet."); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add("Activated"); } else @@ -49,7 +49,7 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade par3List.add("Deactivated"); } - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } @@ -65,12 +65,12 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - if (stack.stackTagCompound == null) + if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = stack.stackTagCompound; + NBTTagCompound tag = stack.getTagCompound(); if (tag.getBoolean("isActive")) { @@ -104,12 +104,12 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade return par1ItemStack; } - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = par1ItemStack.stackTagCompound; + NBTTagCompound tag = par1ItemStack.getTagCompound(); tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) @@ -134,21 +134,21 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { - if (par2World.getWorldTime() % tickDelay == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer) + if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer) { if(EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, this.getLPUsed(par1ItemStack))) { this.setLPUsed(par1ItemStack, 0); }else { - par1ItemStack.stackTagCompound.setBoolean("isActive", false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } if (!par3EntityPlayer.onGround && !par3EntityPlayer.isSneaking()) @@ -215,32 +215,32 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade public int getLPUsed(ItemStack par1ItemStack) { - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - return par1ItemStack.stackTagCompound.getInteger("LPUsed"); + return par1ItemStack.getTagCompound().getInteger("LPUsed"); } public void incrimentLPUSed(ItemStack par1ItemStack, int addedLP) { - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - par1ItemStack.stackTagCompound.setInteger("LPUsed", par1ItemStack.stackTagCompound.getInteger("LPUsed") + addedLP); + par1ItemStack.getTagCompound().setInteger("LPUsed", par1ItemStack.getTagCompound().getInteger("LPUsed") + addedLP); } public void setLPUsed(ItemStack par1ItemStack, int newLP) { - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - par1ItemStack.stackTagCompound.setInteger("LPUsed", newLP); + par1ItemStack.getTagCompound().setInteger("LPUsed", newLP); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheFastMiner.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheFastMiner.java index d0b13b97..fa9e24e4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheFastMiner.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheFastMiner.java @@ -37,9 +37,9 @@ public class SigilOfTheFastMiner extends EnergyItems implements ArmourUpgrade { par3List.add("Keep going and going and going..."); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add("Activated"); } else @@ -47,7 +47,7 @@ public class SigilOfTheFastMiner extends EnergyItems implements ArmourUpgrade par3List.add("Deactivated"); } - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } @@ -63,12 +63,12 @@ public class SigilOfTheFastMiner extends EnergyItems implements ArmourUpgrade @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - if (stack.stackTagCompound == null) + if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = stack.stackTagCompound; + NBTTagCompound tag = stack.getTagCompound(); if (tag.getBoolean("isActive")) { @@ -102,12 +102,12 @@ public class SigilOfTheFastMiner extends EnergyItems implements ArmourUpgrade return par1ItemStack; } - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = par1ItemStack.stackTagCompound; + NBTTagCompound tag = par1ItemStack.getTagCompound(); tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) @@ -133,23 +133,23 @@ public class SigilOfTheFastMiner extends EnergyItems implements ArmourUpgrade EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 2, 1, true)); } - if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { - par1ItemStack.stackTagCompound.setBoolean("isActive", false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } } @@ -160,7 +160,7 @@ public class SigilOfTheFastMiner extends EnergyItems implements ArmourUpgrade @Override public void onArmourUpdate(World world, EntityPlayer player, ItemStack itemStack) { - if (itemStack.stackTagCompound == null) + if (itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfWind.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfWind.java index 4533b4c6..f1880da1 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfWind.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfWind.java @@ -36,9 +36,9 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade { par3List.add("Best not to wear a skirt."); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add("Activated"); } else @@ -46,7 +46,7 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade par3List.add("Deactivated"); } - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } @@ -62,12 +62,12 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - if (stack.stackTagCompound == null) + if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = stack.stackTagCompound; + NBTTagCompound tag = stack.getTagCompound(); if (tag.getBoolean("isActive")) { @@ -101,12 +101,12 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade return par1ItemStack; } - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - NBTTagCompound tag = par1ItemStack.stackTagCompound; + NBTTagCompound tag = par1ItemStack.getTagCompound(); tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) @@ -132,23 +132,23 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 1)); } - if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { - par1ItemStack.stackTagCompound.setBoolean("isActive", false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } } @@ -159,7 +159,7 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade @Override public void onArmourUpdate(World world, EntityPlayer player, ItemStack itemStack) { - if (itemStack.stackTagCompound == null) + if (itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/VoidSigil.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/VoidSigil.java index 564a99ae..f788f076 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/VoidSigil.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/VoidSigil.java @@ -47,9 +47,9 @@ public class VoidSigil extends ItemBucket implements ArmourUpgrade { par3List.add("Better than a Swiffer!"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/WaterSigil.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/WaterSigil.java index f47ceb06..a826a58c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/WaterSigil.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/WaterSigil.java @@ -40,7 +40,7 @@ public class WaterSigil extends ItemBucket implements ArmourUpgrade @Override public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (par1ItemStack.stackTagCompound == null) + if (par1ItemStack.getTagCompound() == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } @@ -67,9 +67,9 @@ public class WaterSigil extends ItemBucket implements ArmourUpgrade { par3List.add("Infinite water, anyone?"); - if (!(par1ItemStack.stackTagCompound == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/LocalStorageAlphaPact.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/LocalStorageAlphaPact.java new file mode 100644 index 00000000..648de623 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/LocalStorageAlphaPact.java @@ -0,0 +1,25 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import java.util.HashSet; +import java.util.Set; + +import WayofTime.alchemicalWizardry.api.rituals.LocalRitualStorage; +import WayofTime.alchemicalWizardry.common.Int3; +import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon; + +public class LocalStorageAlphaPact extends LocalRitualStorage +{ + public static Set hoardList = new HashSet(); + + public void thrallDemon(IHoardDemon demon) + { + if(demon instanceof IHoardDemon) + { + boolean enthrall = ((IHoardDemon) demon).thrallDemon(new Int3(this.xCoord, this.yCoord, this.zCoord)); + if(enthrall) + { + this.hoardList.add((IHoardDemon)demon); + } + } + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAlphaPact.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAlphaPact.java index 577eadab..4ce93209 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAlphaPact.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAlphaPact.java @@ -2,15 +2,24 @@ package WayofTime.alchemicalWizardry.common.rituals; import java.util.ArrayList; import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; +import WayofTime.alchemicalWizardry.api.rituals.LocalRitualStorage; import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; +import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGrunt; +import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon; public class RitualEffectAlphaPact extends RitualEffect { + Random rand = new Random(); + @Override public void performEffect(IMasterRitualStone ritualStone) { @@ -26,8 +35,103 @@ public class RitualEffectAlphaPact extends RitualEffect { return; } - - + + LocalRitualStorage stor = ritualStone.getLocalStorage(); + if(stor instanceof LocalStorageAlphaPact) + { + LocalStorageAlphaPact storage = (LocalStorageAlphaPact)stor; + + Object[] demonList = storage.hoardList.toArray(); + + for(Object demon : demonList) + { + if(demon instanceof EntityLivingBase) + { + if(!((EntityLivingBase) demon).isEntityAlive()) + { + System.out.println(storage.hoardList.remove(demon)); + } + } + } + + System.out.println("Hi!"); + + int summons = 0; + + int horizontalRange = 25; + int verticalRange = 20; + + if(storage.hoardList.isEmpty()) + { + IHoardDemon demon = this.getRandomDemonForStage(world, x, y, z, horizontalRange, verticalRange); + if(demon instanceof EntityLivingBase) + { + world.spawnEntityInWorld((EntityLivingBase)demon); + storage.thrallDemon(demon); + } + }else + { + } + } + } + + public IHoardDemon getRandomDemonForStage(World world, int x, int y, int z, int horizontalRange, int verticalRange) + { + EntityLivingBase entityLiving = new EntityMinorDemonGrunt(world); + + boolean isGood = false; + for(int n=0; n<100; n++) + { + double newX = x + (rand.nextInt(horizontalRange) - horizontalRange) + 0.5; + double newY = y + (double) (rand.nextInt((int) verticalRange)); + double newZ = z + (rand.nextInt(horizontalRange) - horizontalRange) + 0.5; + + entityLiving.posX = newX; + entityLiving.posY = newY; + entityLiving.posZ = newZ; + + int i = MathHelper.floor_double(entityLiving.posX); + int j = MathHelper.floor_double(entityLiving.posY); + int k = MathHelper.floor_double(entityLiving.posZ); + Block l; + + if (entityLiving.worldObj.blockExists(i, j, k)) + { + boolean flag1 = false; + + while (!flag1 && j > 0) + { + l = entityLiving.worldObj.getBlock(i, j - 1, k); + + if (l != null && l.getMaterial().blocksMovement()) + { + flag1 = true; + } else + { + --entityLiving.posY; + --j; + } + } + } + + if(entityLiving.worldObj.getCollidingBoundingBoxes(entityLiving, entityLiving.boundingBox).isEmpty() && !entityLiving.worldObj.isAnyLiquid(entityLiving.boundingBox)) + { + entityLiving.setPositionAndUpdate(newX, newY, newZ); + isGood = true; + } + } + + if(isGood = false) + { + return null; + } + + return (IHoardDemon)entityLiving; + } + + public int spawnMoreDemons(LocalStorageAlphaPact storage) + { + return 5; } @Override @@ -35,6 +139,11 @@ public class RitualEffectAlphaPact extends RitualEffect { return 1; } + + public LocalRitualStorage getNewLocalStorage() + { + return new LocalStorageAlphaPact(); + } @Override public List getRitualComponentList() @@ -42,7 +151,7 @@ public class RitualEffectAlphaPact extends RitualEffect ArrayList omegaRitual = new ArrayList(); this.addCornerRunes(omegaRitual, 1, 0, RitualComponent.BLANK); - this.addOffsetRunes(omegaRitual, 2, 1, 0, RitualComponent.DUSK); + this.addOffsetRunes(omegaRitual, 2, 1, 0, RitualComponent.FIRE); this.addParallelRunes(omegaRitual, 4, 0, RitualComponent.WATER); this.addParallelRunes(omegaRitual, 5, 0, RitualComponent.EARTH); this.addCornerRunes(omegaRitual, 4, 0, RitualComponent.AIR); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemRouting.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemRouting.java new file mode 100644 index 00000000..36555e38 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemRouting.java @@ -0,0 +1,95 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import net.minecraft.inventory.IInventory; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; +import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; +import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; +import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; +import WayofTime.alchemicalWizardry.common.Int3; + +public class RitualEffectItemRouting extends RitualEffect +{ + Random rand = new Random(); + + @Override + public void performEffect(IMasterRitualStone ritualStone) + { + String owner = ritualStone.getOwner(); + + int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); + + if (world.getWorldTime() % 20 != 0) + { + return; + } + + int xBufOffset = 0; + int yBufOffset = 1; + int zBufOffset = 0; + + TileEntity bufferTile = world.getTileEntity(x + xBufOffset, y + yBufOffset, z + zBufOffset); + + if(!(bufferTile instanceof IInventory)) + { + return; + } + + IInventory bufferInventory = (IInventory)bufferTile; + + for(int i=0; i<4; i++) + { + Int3 inputChest = this.getInputBufferChestLocation(i); + TileEntity inputFocusInv = world.getTileEntity(x + inputChest.xCoord, y + inputChest.yCoord, z + inputChest.zCoord); + if(inputFocusInv instanceof IInventory) + { + + } + } + } + + public Int3 getInputBufferChestLocation(int number) + { + switch(number) + { + case 0: + return new Int3(1, 0, 0); + case 1: + return new Int3(-1, 0, 0); + case 2: + return new Int3(0, 0, 1); + case 3: + return new Int3(0, 0, -1); + } + return new Int3(0, 0, 0); + } + + @Override + public int getCostPerRefresh() + { + return 0; + } + + @Override + public List getRitualComponentList() + { + ArrayList omegaRitual = new ArrayList(); + + this.addCornerRunes(omegaRitual, 1, 0, RitualComponent.BLANK); + this.addOffsetRunes(omegaRitual, 2, 1, 0, RitualComponent.FIRE); + this.addParallelRunes(omegaRitual, 4, 0, RitualComponent.WATER); + this.addParallelRunes(omegaRitual, 5, 0, RitualComponent.EARTH); + this.addCornerRunes(omegaRitual, 4, 0, RitualComponent.WATER); + + return omegaRitual; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectUnbinding.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectUnbinding.java index 21313a63..0366e089 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectUnbinding.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectUnbinding.java @@ -103,7 +103,7 @@ public class RitualEffectUnbinding extends RitualEffect world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z + 5)); world.addWeatherEffect(new EntityLightningBolt(world, x - 5, y + 1, z)); world.addWeatherEffect(new EntityLightningBolt(world, x + 5, y + 1, z)); - NBTTagCompound itemTag = itemStack.stackTagCompound; + NBTTagCompound itemTag = itemStack.getTagCompound(); ItemStack[] inv = ((BoundArmour) itemStack.getItem()).getInternalInventory(itemStack); if (inv != null) @@ -130,7 +130,7 @@ public class RitualEffectUnbinding extends RitualEffect world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z + 5)); world.addWeatherEffect(new EntityLightningBolt(world, x - 5, y + 1, z)); world.addWeatherEffect(new EntityLightningBolt(world, x + 5, y + 1, z)); - NBTTagCompound itemTag = itemStack.stackTagCompound; + NBTTagCompound itemTag = itemStack.getTagCompound(); ItemStack[] inv = ((SigilOfHolding) itemStack.getItem()).getInternalInventory(itemStack); if (inv != null) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java index 3eba893d..70491a21 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java @@ -38,11 +38,11 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.oredict.OreDictionary; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles; +import WayofTime.alchemicalWizardry.api.items.interfaces.ILPGauge; import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.api.spell.APISpellHelper; import WayofTime.alchemicalWizardry.common.NewPacketHandler; -import WayofTime.alchemicalWizardry.common.items.ILPGauge; import WayofTime.alchemicalWizardry.common.items.sigil.DivinationSigil; import cpw.mods.fml.common.FMLCommonHandler; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/HomSpell.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/HomSpell.java index c803e9ea..30f3849b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/HomSpell.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/HomSpell.java @@ -61,22 +61,22 @@ public abstract class HomSpell implements ISimpleSpell public void setSpellParadigm(ItemStack itemStack, int paradigm) { - if (itemStack.stackTagCompound == null) + if (itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - itemStack.stackTagCompound.setInteger("paradigm", paradigm); + itemStack.getTagCompound().setInteger("paradigm", paradigm); } public int getSpellParadigm(ItemStack itemStack) { - if (itemStack.stackTagCompound == null) + if (itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - return (itemStack.stackTagCompound.getInteger("paradigm")); + return (itemStack.getTagCompound().getInteger("paradigm")); } //@Override @@ -118,11 +118,11 @@ public abstract class HomSpell implements ISimpleSpell // @Override // public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) // { -// if (!(par1ItemStack.stackTagCompound == null)) +// if (!(par1ItemStack.getTagCompound() == null)) // { -// if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) +// if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) // { -// par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); +// par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName")); // } // // par3List.add("Current paradigm: " + this.getSpellParadigm(par1ItemStack)); @@ -131,11 +131,11 @@ public abstract class HomSpell implements ISimpleSpell public int getDimensionID(ItemStack itemStack) { - if (itemStack.stackTagCompound == null) + if (itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - return itemStack.stackTagCompound.getInteger("dimensionId"); + return itemStack.getTagCompound().getInteger("dimensionId"); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java index 28f85c50..0576a524 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java @@ -720,7 +720,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui } IBloodOrb item = (IBloodOrb) (returnedItem.getItem()); - NBTTagCompound itemTag = returnedItem.stackTagCompound; + NBTTagCompound itemTag = returnedItem.getTagCompound(); if (itemTag == null) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMasterStone.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMasterStone.java index 59d8f6dc..4b9b43d0 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMasterStone.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMasterStone.java @@ -4,7 +4,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; -import cpw.mods.fml.common.eventhandler.Event; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -30,7 +29,9 @@ import WayofTime.alchemicalWizardry.api.rituals.LocalRitualStorage; import WayofTime.alchemicalWizardry.api.rituals.RitualBreakMethod; import WayofTime.alchemicalWizardry.api.rituals.Rituals; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; +import WayofTime.alchemicalWizardry.common.Int3; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import cpw.mods.fml.common.eventhandler.Event; public class TEMasterStone extends TileEntity implements IMasterRitualStone { @@ -150,6 +151,9 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone { newStorage.readFromNBT(localStorageTag); storage = newStorage; + storage.xCoord = xCoord; + storage.yCoord = yCoord; + storage.zCoord = zCoord; } } @@ -194,9 +198,14 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone tag.setTag("customRitualTag", customRitualTag); - NBTTagCompound localStorageTag = new NBTTagCompound(); - storage.writeToNBT(localStorageTag); - tag.setTag("localStorage", localStorageTag); + if(storage != null) + { + NBTTagCompound localStorageTag = new NBTTagCompound(); + + storage.writeToNBT(localStorageTag); + tag.setTag("localStorage", localStorageTag); + } + } public void activateRitual(World world, int crystalLevel, ItemStack activationCrystal, EntityPlayer player, String crystalOwner) @@ -282,6 +291,7 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone var1 = 0; currentRitualString = testRitual; storage = Rituals.getLocalStorage(currentRitualString); + storage.setLocation(new Int3(xCoord, yCoord, zCoord)); isActive = true; isRunning = true; direction = Rituals.getDirectionOfRitual(world, xCoord, yCoord, zCoord, testRitual);