Refactoring

This commit is contained in:
WayofTime 2015-01-16 10:00:50 -05:00
parent fd330233dd
commit 56ccd3188d
76 changed files with 876 additions and 433 deletions

View file

@ -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"));
}

View file

@ -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");
}
}

View file

@ -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);
}
}

View file

@ -1,4 +1,4 @@
package WayofTime.alchemicalWizardry.common.items;
package WayofTime.alchemicalWizardry.api.items.interfaces;
import net.minecraft.item.ItemStack;

View file

@ -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;
}
}

View file

@ -57,7 +57,7 @@ public abstract class RitualEffect
public LocalRitualStorage getNewLocalStorage()
{
return null;
return new LocalRitualStorage();
}
public void addOffsetRunes(ArrayList<RitualComponent> ritualList, int off1, int off2, int y, int rune)

View file

@ -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");
}
}

View file

@ -34,7 +34,7 @@ public class AlchemicalWizardryFuelHandler implements IFuelHandler
return 200;
} else
{
NBTTagCompound tag = itemStack.stackTagCompound;
NBTTagCompound tag = itemStack.getTagCompound();
if (tag == null)
{

View file

@ -105,7 +105,7 @@ public class ArmourForge extends Block
return false;
}
if (armourPiece.stackTagCompound == null)
if (armourPiece.getTagCompound() == null)
{
armourPiece.setTagCompound(new NBTTagCompound());
}

View file

@ -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);
}

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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

View file

@ -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;
}

View file

@ -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);
}

View file

@ -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);

View file

@ -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"));
}
}

View file

@ -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)
{
}

View file

@ -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");
}
}

View file

@ -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)
{

View file

@ -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)
{

View file

@ -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)
{

View file

@ -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(""))
{

View file

@ -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"));
}
}
}

View file

@ -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"));

View file

@ -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(""))
{

View file

@ -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)
{

View file

@ -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)
{

View file

@ -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)

View file

@ -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"));
}
}
}

View file

@ -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"));

View file

@ -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;
}

View file

@ -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");
}
}

View file

@ -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(""))
{

View file

@ -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<RitualComponent> 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)

View file

@ -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"));
}
}

View file

@ -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"));

View file

@ -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"));
}
}

View file

@ -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;

View file

@ -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)
{

View file

@ -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)

View file

@ -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)

View file

@ -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"));
}
}

View file

@ -90,7 +90,7 @@ public class AlchemyFlask extends Item
public static void setEffects(ItemStack par1ItemStack, List<AlchemyPotionHelper> 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;
}

View file

@ -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");
}
}

View file

@ -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;
}
}
}

View file

@ -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"));
}
}

View file

@ -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(""))
{

View file

@ -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());
}

View file

@ -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;
}

View file

@ -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);
}
}
}

View file

@ -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);
}
}
}

View file

@ -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(""))
{

View file

@ -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<Entity> 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);
}
}
}

View file

@ -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);
}
}
}

View file

@ -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"));
}
}

View file

@ -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"));
}
}

View file

@ -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);
}
}
}

View file

@ -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;

View file

@ -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());
}

View file

@ -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)
{

View file

@ -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);
}
}

View file

@ -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

View file

@ -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());
}

View file

@ -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());
}

View file

@ -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"));
}
}

View file

@ -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"));
}
}

View file

@ -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<IHoardDemon> 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);
}
}
}
}

View file

@ -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<RitualComponent> getRitualComponentList()
@ -42,7 +151,7 @@ public class RitualEffectAlphaPact extends RitualEffect
ArrayList<RitualComponent> 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);

View file

@ -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<RitualComponent> getRitualComponentList()
{
ArrayList<RitualComponent> 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;
}
}

View file

@ -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)

View file

@ -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;

View file

@ -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");
}
}

View file

@ -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)
{

View file

@ -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);