Fixed non-armour and non-sigil items

This commit is contained in:
WayofTime 2015-07-30 08:44:01 -04:00
parent 8241c3cbd1
commit 9e2c0e6e74
72 changed files with 483 additions and 1411 deletions

View file

@ -4,6 +4,7 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IProjectile; import net.minecraft.entity.IProjectile;
@ -12,7 +13,9 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
@ -20,7 +23,6 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.IThrowableEntity; import net.minecraftforge.fml.common.registry.IThrowableEntity;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
//Shamelessly ripped off from x3n0ph0b3 //Shamelessly ripped off from x3n0ph0b3
public class EnergyBlastProjectile extends Entity implements IProjectile, IThrowableEntity public class EnergyBlastProjectile extends Entity implements IProjectile, IThrowableEntity
@ -53,7 +55,6 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow
super(par1World); super(par1World);
this.setSize(0.5F, 0.5F); this.setSize(0.5F, 0.5F);
this.setPosition(par2, par4, par6); this.setPosition(par2, par4, par6);
yOffset = 0.0F;
this.maxTicksInAir = 600; this.maxTicksInAir = 600;
} }
@ -68,7 +69,6 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow
posY -= 0.2D; posY -= 0.2D;
posZ -= MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * 0.16F; posZ -= MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * 0.16F;
this.setPosition(posX, posY, posZ); this.setPosition(posX, posY, posZ);
yOffset = 0.0F;
motionX = -MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI); motionX = -MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI);
motionZ = MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI); motionZ = MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI);
motionY = -MathHelper.sin(rotationPitch / 180.0F * (float) Math.PI); motionY = -MathHelper.sin(rotationPitch / 180.0F * (float) Math.PI);
@ -88,7 +88,6 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow
posY -= 0.2D; posY -= 0.2D;
posZ -= MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * 0.16F; posZ -= MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * 0.16F;
this.setPosition(posX, posY, posZ); this.setPosition(posX, posY, posZ);
yOffset = 0.0F;
motionX = -MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI); motionX = -MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI);
motionZ = MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI); motionZ = MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI);
motionY = -MathHelper.sin(rotationPitch / 180.0F * (float) Math.PI); motionY = -MathHelper.sin(rotationPitch / 180.0F * (float) Math.PI);
@ -104,7 +103,7 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow
this.shootingEntity = par2EntityLivingBase; this.shootingEntity = par2EntityLivingBase;
this.posY = par2EntityLivingBase.posY + (double) par2EntityLivingBase.getEyeHeight() - 0.10000000149011612D; this.posY = par2EntityLivingBase.posY + (double) par2EntityLivingBase.getEyeHeight() - 0.10000000149011612D;
double d0 = par3EntityLivingBase.posX - par2EntityLivingBase.posX; double d0 = par3EntityLivingBase.posX - par2EntityLivingBase.posX;
double d1 = par3EntityLivingBase.boundingBox.minY + (double) (par3EntityLivingBase.height / 1.5F) - this.posY; double d1 = par3EntityLivingBase.getBoundingBox().minY + (double) (par3EntityLivingBase.height / 1.5F) - this.posY;
double d2 = par3EntityLivingBase.posZ - par2EntityLivingBase.posZ; double d2 = par3EntityLivingBase.posZ - par2EntityLivingBase.posZ;
double d3 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2); double d3 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2);
@ -115,7 +114,6 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow
double d4 = d0 / d3; double d4 = d0 / d3;
double d5 = d2 / d3; double d5 = d2 / d3;
this.setLocationAndAngles(par2EntityLivingBase.posX + d4, this.posY, par2EntityLivingBase.posZ + d5, f2, f3); this.setLocationAndAngles(par2EntityLivingBase.posX + d4, this.posY, par2EntityLivingBase.posZ + d5, f2, f3);
this.yOffset = 0.0F;
float f4 = (float) d3 * 0.2F; float f4 = (float) d3 * 0.2F;
this.setThrowableHeading(d0, d1, d2, par4, par5); this.setThrowableHeading(d0, d1, d2, par4, par5);
} }
@ -155,18 +153,6 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow
prevRotationPitch = rotationPitch = (float) (Math.atan2(var3, var10) * 180.0D / Math.PI); prevRotationPitch = rotationPitch = (float) (Math.atan2(var3, var10) * 180.0D / Math.PI);
} }
@Override
@SideOnly(Side.CLIENT)
/**
* Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX,
* posY, posZ, yaw, pitch
*/
public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9)
{
this.setPosition(par1, par3, par5);
this.setRotation(par7, par8);
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
/** /**
@ -233,28 +219,21 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow
prevRotationPitch = rotationPitch = (float) (Math.atan2(motionY, var1) * 180.0D / Math.PI); prevRotationPitch = rotationPitch = (float) (Math.atan2(motionY, var1) * 180.0D / Math.PI);
} }
Block var16 = worldObj.getBlock(xTile, yTile, zTile); IBlockState state = worldObj.getBlockState(new BlockPos(xTile, yTile, zTile));
Block var16 = state.getBlock();
if (var16 != null) if (var16 != null)
{ {
var16.setBlockBoundsBasedOnState(worldObj, xTile, yTile, zTile); var16.setBlockBoundsBasedOnState(worldObj, new BlockPos(xTile, yTile, zTile));
AxisAlignedBB var2 = var16.getCollisionBoundingBoxFromPool(worldObj, xTile, yTile, zTile); AxisAlignedBB var2 = var16.getCollisionBoundingBox(worldObj, new BlockPos(xTile, yTile, zTile), state);
if (var2 != null && var2.isVecInside(SpellHelper.createVec3(posX, posY, posZ))) if (var2 != null && var2.isVecInside(new Vec3(posX, posY, posZ)))
{ {
inGround = true; inGround = true;
} }
} }
if (inGround) if (!inGround)
{
Block var18 = worldObj.getBlock(xTile, yTile, zTile);
int var19 = worldObj.getBlockMetadata(xTile, yTile, zTile);
if (var18.equals(Block.getBlockById(inTile)) && var19 == inData)
{
}
} else
{ {
++ticksInAir; ++ticksInAir;
@ -266,19 +245,19 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow
} }
} }
Vec3 var17 = SpellHelper.createVec3(posX, posY, posZ); Vec3 var17 = new Vec3(posX, posY, posZ);
Vec3 var3 = SpellHelper.createVec3(posX + motionX, posY + motionY, posZ + motionZ); Vec3 var3 = new Vec3(posX + motionX, posY + motionY, posZ + motionZ);
MovingObjectPosition var4 = worldObj.func_147447_a(var17, var3, true, false, false); MovingObjectPosition var4 = worldObj.rayTraceBlocks(var17, var3, true, false, false);
var17 = SpellHelper.createVec3(posX, posY, posZ); var17 = new Vec3(posX, posY, posZ);
var3 = SpellHelper.createVec3(posX + motionX, posY + motionY, posZ + motionZ); var3 = new Vec3(posX + motionX, posY + motionY, posZ + motionZ);
if (var4 != null) if (var4 != null)
{ {
var3 = SpellHelper.createVec3(var4.hitVec.xCoord, var4.hitVec.yCoord, var4.hitVec.zCoord); var3 = new Vec3(var4.hitVec.xCoord, var4.hitVec.yCoord, var4.hitVec.zCoord);
} }
Entity var5 = null; Entity var5 = null;
List var6 = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D)); List var6 = worldObj.getEntitiesWithinAABBExcludingEntity(this, getBoundingBox().addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D));
double var7 = 0.0D; double var7 = 0.0D;
Iterator var9 = var6.iterator(); Iterator var9 = var6.iterator();
float var11; float var11;
@ -290,7 +269,7 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow
if (var10.canBeCollidedWith() && (var10 != shootingEntity || ticksInAir >= 5)) if (var10.canBeCollidedWith() && (var10 != shootingEntity || ticksInAir >= 5))
{ {
var11 = 0.3F; var11 = 0.3F;
AxisAlignedBB var12 = var10.boundingBox.expand(var11, var11, var11); AxisAlignedBB var12 = var10.getBoundingBox().expand(var11, var11, var11);
MovingObjectPosition var13 = var12.calculateIntercept(var17, var3); MovingObjectPosition var13 = var12.calculateIntercept(var17, var3);
if (var13 != null) if (var13 != null)
@ -331,8 +310,8 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow
public void doFiringParticles() public void doFiringParticles()
{ {
worldObj.spawnParticle("mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); worldObj.spawnParticle(EnumParticleTypes.SPELL_MOB_AMBIENT, posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D);
worldObj.spawnParticle("flame", posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); worldObj.spawnParticle(EnumParticleTypes.FLAME, posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ));
} }
/** /**
@ -379,13 +358,6 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow
return false; return false;
} }
@Override
@SideOnly(Side.CLIENT)
public float getShadowSize()
{
return 0.0F;
}
/** /**
* Sets the amount of knockback the arrow applies when it hits a mob. * Sets the amount of knockback the arrow applies when it hits a mob.
*/ */
@ -462,20 +434,15 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow
worldObj.createExplosion(shootingEntity, this.posX, this.posY, this.posZ, (float) (0.1), true); worldObj.createExplosion(shootingEntity, this.posX, this.posY, this.posZ, (float) (0.1), true);
} }
spawnHitParticles("magicCrit", 8); spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8);
this.setDead(); this.setDead();
} }
private int d6() protected void spawnHitParticles(EnumParticleTypes type, int i)
{
return rand.nextInt(6) + 1;
}
protected void spawnHitParticles(String string, int i)
{ {
for (int particles = 0; particles < i; particles++) for (int particles = 0; particles < i; particles++)
{ {
worldObj.spawnParticle(string, posX, posY - (string == "portal" ? 1 : 0), posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); worldObj.spawnParticle(type, posX, posY - (type == EnumParticleTypes.PORTAL ? 1 : 0), posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ));
} }
} }

View file

@ -1,14 +1,12 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import java.util.List;
import WayofTime.alchemicalWizardry.ModItems;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import java.util.List;
public class AWBaseItems extends Item public class AWBaseItems extends Item
{ {
@ -19,23 +17,6 @@ public class AWBaseItems extends Item
setCreativeTab(AlchemicalWizardry.tabBloodMagic); setCreativeTab(AlchemicalWizardry.tabBloodMagic);
} }
public void registerIcons(IIconRegister iconRegister)
{
if (this.equals(ModItems.blankSlate))
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BlankSlate");
} else if (this.equals(ModItems.reinforcedSlate))
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ReinforcedSlate");
} else if (this.equals(ModItems.imbuedSlate))
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:InfusedSlate");
} else if (this.equals(ModItems.demonicSlate))
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DemonSlate");
}
}
@Override @Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{ {

View file

@ -1,30 +1,27 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import java.util.List;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import java.util.List; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
public class ActivationCrystal extends EnergyItems public class ActivationCrystal extends EnergyItems
{ {
private static final String[] ACTIVATION_CRYSTAL_NAMES = new String[]{"Weak", "Awakened", "Creative"}; private static final String[] ACTIVATION_CRYSTAL_NAMES = new String[]{"Weak", "Awakened", "Creative"};
@SideOnly(Side.CLIENT)
private IIcon[] icons;
public ActivationCrystal() public ActivationCrystal()
{ {
super(); super();
@ -34,18 +31,6 @@ public class ActivationCrystal extends EnergyItems
this.hasSubtypes = true; this.hasSubtypes = true;
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
icons = new IIcon[ACTIVATION_CRYSTAL_NAMES.length];
for (int i = 0; i < ACTIVATION_CRYSTAL_NAMES.length; ++i)
{
icons[i] = iconRegister.registerIcon("AlchemicalWizardry:" + "activationCrystal" + ACTIVATION_CRYSTAL_NAMES[i]);
}
}
@Override @Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{ {
@ -119,14 +104,6 @@ public class ActivationCrystal extends EnergyItems
return ("" + "item.activationCrystal" + ACTIVATION_CRYSTAL_NAMES[meta]); return ("" + "item.activationCrystal" + ACTIVATION_CRYSTAL_NAMES[meta]);
} }
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int meta)
{
int j = MathHelper.clamp_int(meta, 0, ACTIVATION_CRYSTAL_NAMES.length - 1);
return icons[j];
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubItems(Item id, CreativeTabs creativeTab, List list) public void getSubItems(Item id, CreativeTabs creativeTab, List list)

View file

@ -1,8 +1,5 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
public class AirScribeTool extends ScribeTool public class AirScribeTool extends ScribeTool
{ {
@ -10,11 +7,4 @@ public class AirScribeTool extends ScribeTool
{ {
super(4); super(4);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AirScribeTool");
}
} }

View file

@ -1,8 +1,5 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
public class ApprenticeBloodOrb extends EnergyBattery public class ApprenticeBloodOrb extends EnergyBattery
{ {
@ -11,11 +8,4 @@ public class ApprenticeBloodOrb extends EnergyBattery
super(damage); super(damage);
orbLevel = 2; orbLevel = 2;
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ApprenticeBloodOrb");
}
} }

View file

@ -1,8 +1,5 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
public class ArchmageBloodOrb extends EnergyBattery public class ArchmageBloodOrb extends EnergyBattery
{ {
@ -11,11 +8,4 @@ public class ArchmageBloodOrb extends EnergyBattery
super(damage); super(damage);
orbLevel = 5; orbLevel = 5;
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ArchmageBloodOrb");
}
} }

View file

@ -1,26 +1,18 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import java.util.List;
public class ArmourInhibitor extends EnergyItems public class ArmourInhibitor extends EnergyItems
{ {
@SideOnly(Side.CLIENT)
private IIcon activeIcon;
@SideOnly(Side.CLIENT)
private IIcon passiveIcon;
private int tickDelay = 200; private int tickDelay = 200;
public ArmourInhibitor() public ArmourInhibitor()
@ -32,117 +24,76 @@ public class ArmourInhibitor extends EnergyItems
} }
@Override @Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
{ {
par3List.add(StatCollector.translateToLocal("tooltip.armorinhibitor.desc1")); list.add(StatCollector.translateToLocal("tooltip.armorinhibitor.desc1"));
par3List.add(StatCollector.translateToLocal("tooltip.armorinhibitor.desc2")); list.add(StatCollector.translateToLocal("tooltip.armorinhibitor.desc2"));
if (!(par1ItemStack.getTagCompound() == null)) if (!(stack.getTagCompound() == null))
{ {
if (par1ItemStack.getTagCompound().getBoolean("isActive")) if (stack.getTagCompound().getBoolean("isActive"))
{ {
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated")); list.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
} else } else
{ {
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated")); list.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
} }
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName")); list.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + stack.getTagCompound().getString("ownerName"));
} }
} }
@Override @Override
@SideOnly(Side.CLIENT) public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
public void registerIcons(IIconRegister iconRegister)
{ {
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ArmourInhibitor_deactivated"); if (!EnergyItems.checkAndSetItemOwner(stack, player) || player.isSneaking())
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:ArmourInhibitor_activated"); {
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:ArmourInhibitor_deactivated"); return stack;
} }
@Override
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
{
if (stack.getTagCompound() == null) if (stack.getTagCompound() == null)
{ {
stack.setTagCompound(new NBTTagCompound()); stack.setTagCompound(new NBTTagCompound());
} }
NBTTagCompound tag = stack.getTagCompound(); NBTTagCompound tag = stack.getTagCompound();
if (tag.getBoolean("isActive"))
{
return this.activeIcon;
} else
{
return this.passiveIcon;
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1)
{
if (par1 == 1)
{
return this.activeIcon;
} else
{
return this.passiveIcon;
}
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
{
return par1ItemStack;
}
if (par1ItemStack.getTagCompound() == null)
{
par1ItemStack.setTagCompound(new NBTTagCompound());
}
NBTTagCompound tag = par1ItemStack.getTagCompound();
tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
if (tag.getBoolean("isActive")) if (tag.getBoolean("isActive"))
{ {
par1ItemStack.setItemDamage(1); stack.setItemDamage(1);
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay); tag.setInteger("worldTimeDelay", (int) (world.getWorldTime() - 1) % tickDelay);
} else } else
{ {
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage()); stack.setItemDamage(stack.getMaxDamage());
} }
return par1ItemStack; return stack;
} }
@Override @Override
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5)
{ {
if (!(par3Entity instanceof EntityPlayer)) if (!(entity instanceof EntityPlayer))
{ {
return; return;
} }
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; EntityPlayer player = (EntityPlayer) entity;
if (par1ItemStack.getTagCompound() == null) if (stack.getTagCompound() == null)
{ {
par1ItemStack.setTagCompound(new NBTTagCompound()); stack.setTagCompound(new NBTTagCompound());
} }
if (par1ItemStack.getTagCompound().getBoolean("isActive")) if (stack.getTagCompound().getBoolean("isActive"))
{ {
if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay")) if (world.getWorldTime() % tickDelay == stack.getTagCompound().getInteger("worldTimeDelay"))
{ {
} }
//TODO Do stuff //TODO Do stuff
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 2, 0)); player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 2, 0, true, false));
} }
} }
} }

View file

@ -1,19 +1,17 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import java.util.List;
import WayofTime.alchemicalWizardry.common.tileEntity.TEHomHeart;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.DimensionManager;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import java.util.List; import WayofTime.alchemicalWizardry.common.tileEntity.TEHomHeart;
public class BlankSpell extends EnergyItems public class BlankSpell extends EnergyItems
{ {
@ -25,76 +23,69 @@ public class BlankSpell extends EnergyItems
} }
@Override @Override
@SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
public void registerIcons(IIconRegister iconRegister)
{ {
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BlankSpell"); list.add(StatCollector.translateToLocal("tooltip.blankspell.desc"));
}
@Override if (!(stack.getTagCompound() == null))
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
par3List.add(StatCollector.translateToLocal("tooltip.blankspell.desc"));
if (!(par1ItemStack.getTagCompound() == null))
{ {
NBTTagCompound itemTag = par1ItemStack.getTagCompound(); NBTTagCompound itemTag = stack.getTagCompound();
if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) if (!stack.getTagCompound().getString("ownerName").equals(""))
{ {
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName")); list.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + stack.getTagCompound().getString("ownerName"));
} }
par3List.add(StatCollector.translateToLocal("tooltip.alchemy.coords") + " " + itemTag.getInteger("xCoord") + ", " + itemTag.getInteger("yCoord") + ", " + itemTag.getInteger("zCoord")); list.add(StatCollector.translateToLocal("tooltip.alchemy.coords") + " " + itemTag.getInteger("xCoord") + ", " + itemTag.getInteger("yCoord") + ", " + itemTag.getInteger("zCoord"));
par3List.add(StatCollector.translateToLocal("tooltip.alchemy.dimension") + " " + getDimensionID(par1ItemStack)); list.add(StatCollector.translateToLocal("tooltip.alchemy.dimension") + " " + getDimensionID(stack));
} }
} }
@Override @Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
{ {
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) if (!EnergyItems.checkAndSetItemOwner(stack, player) || player.isSneaking())
{ {
return par1ItemStack; return stack;
} }
if (!par2World.isRemote) if (!world.isRemote)
{ {
World world = DimensionManager.getWorld(getDimensionID(par1ItemStack)); World newWorld = DimensionManager.getWorld(getDimensionID(stack));
if (world != null) if (newWorld != null)
{ {
NBTTagCompound itemTag = par1ItemStack.getTagCompound(); NBTTagCompound itemTag = stack.getTagCompound();
TileEntity tileEntity = world.getTileEntity(itemTag.getInteger("xCoord"), itemTag.getInteger("yCoord"), itemTag.getInteger("zCoord")); TileEntity tileEntity = newWorld.getTileEntity(new BlockPos(itemTag.getInteger("xCoord"), itemTag.getInteger("yCoord"), itemTag.getInteger("zCoord")));
if (tileEntity instanceof TEHomHeart) if (tileEntity instanceof TEHomHeart)
{ {
TEHomHeart homHeart = (TEHomHeart) tileEntity; TEHomHeart homHeart = (TEHomHeart) tileEntity;
if (homHeart.canCastSpell(par1ItemStack, par2World, par3EntityPlayer)) if (homHeart.canCastSpell(stack, world, player))
{ {
if(EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, homHeart.getCostForSpell())) if(EnergyItems.syphonBatteries(stack, player, homHeart.getCostForSpell()))
{ {
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, homHeart.castSpell(par1ItemStack, par2World, par3EntityPlayer)); EnergyItems.syphonBatteries(stack, player, homHeart.castSpell(stack, world, player));
} }
} else } else
{ {
return par1ItemStack; return stack;
} }
} else } else
{ {
return par1ItemStack; return stack;
} }
} else } else
{ {
return par1ItemStack; return stack;
} }
} else } else
{ {
return par1ItemStack; return stack;
} }
par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); world.playSoundAtEntity(player, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
return par1ItemStack; return stack;
} }
public int getDimensionID(ItemStack itemStack) public int getDimensionID(ItemStack itemStack)

View file

@ -1,15 +1,12 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
public class BloodShard extends Item implements ArmourUpgrade public class BloodShard extends Item implements ArmourUpgrade
{ {
@ -20,22 +17,6 @@ public class BloodShard extends Item implements ArmourUpgrade
setCreativeTab(AlchemicalWizardry.tabBloodMagic); setCreativeTab(AlchemicalWizardry.tabBloodMagic);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
if (this.equals(ModItems.weakBloodShard))
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WeakBloodShard");
return;
}
if (this.equals(ModItems.demonBloodShard))
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DemonBloodShard");
}
}
public int getBloodShardLevel() public int getBloodShardLevel()
{ {
if (this.equals(ModItems.weakBloodShard)) if (this.equals(ModItems.weakBloodShard))

View file

@ -1,11 +1,10 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockLeavesBase; import net.minecraft.block.BlockLeavesBase;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.block.state.IBlockState;
import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@ -13,11 +12,11 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemAxe; import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon; import net.minecraft.util.BlockPos;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.util.Vec3;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.common.ItemType; import WayofTime.alchemicalWizardry.common.ItemType;
@ -25,17 +24,10 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import com.google.common.collect.HashMultiset; import com.google.common.collect.HashMultiset;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BoundAxe extends ItemAxe implements IBindable public class BoundAxe extends ItemAxe implements IBindable
{ {
public float efficiencyOnProperMaterial = 12.0F; public float efficiencyOnProperMaterial = 12.0F;
public float damageVsEntity; public float damageVsEntity;
@SideOnly(Side.CLIENT)
private IIcon activeIcon;
@SideOnly(Side.CLIENT)
private IIcon passiveIcon;
private int energyUsed; private int energyUsed;
public BoundAxe() public BoundAxe()
@ -81,49 +73,21 @@ public class BoundAxe extends ItemAxe implements IBindable
} }
@Override @Override
@SideOnly(Side.CLIENT) public ItemStack onItemRightClick(ItemStack par1ItemStack, World world, EntityPlayer par3EntityPlayer)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundAxe_activated");
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundAxe_activated");
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
}
@Override
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
{
if (stack.getTagCompound() == null)
{
stack.setTagCompound(new NBTTagCompound());
}
NBTTagCompound tag = stack.getTagCompound();
if (tag.getBoolean("isActive"))
{
return this.activeIcon;
} else
{
return this.passiveIcon;
}
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{ {
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
{ {
this.setActivated(par1ItemStack, !getActivated(par1ItemStack)); this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (world.getWorldTime() - 1) % 200);
return par1ItemStack; return par1ItemStack;
} }
if (par2World.isRemote) if (world.isRemote)
{ {
return par1ItemStack; return par1ItemStack;
} }
if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(world, par3EntityPlayer))
{ {
return par1ItemStack; return par1ItemStack;
} }
@ -138,10 +102,7 @@ public class BoundAxe extends ItemAxe implements IBindable
return par1ItemStack; return par1ItemStack;
} }
Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer); BlockPos pos = par3EntityPlayer.getPosition();
int posX = (int) (blockVec.xCoord);
int posY = (int) (blockVec.yCoord);
int posZ = (int) (blockVec.zCoord);
boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer); boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer);
int fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer); int fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer);
@ -153,21 +114,22 @@ public class BoundAxe extends ItemAxe implements IBindable
{ {
for (int k = -5; k <= 5; k++) for (int k = -5; k <= 5; k++)
{ {
Block block = par2World.getBlock(posX + i, posY + j, posZ + k); BlockPos newPos = pos.add(i, j, k);
int meta = par2World.getBlockMetadata(posX + i, posY + j, posZ + k); IBlockState state = world.getBlockState(newPos);
Block block = state.getBlock();
if (block != null) if (block != null)
{ {
float str = func_150893_a(par1ItemStack, block); float str = getStrVsBlock(par1ItemStack, block);
if (str > 1.1f || block instanceof BlockLeavesBase && par2World.canMineBlock(par3EntityPlayer, posX + i, posY + j, posZ + k)) if (str > 1.1f || block instanceof BlockLeavesBase && world.canMineBlockBody(par3EntityPlayer, newPos))
{ {
if (silkTouch && block.canSilkHarvest(par2World, par3EntityPlayer, posX + i, posY + j, posZ + k, meta)) if (silkTouch && block.canSilkHarvest(world, newPos, state, par3EntityPlayer))
{ {
dropMultiset.add(new ItemType(block, meta)); dropMultiset.add(new ItemType(block, block.getMetaFromState(state)));
} else } else
{ {
ArrayList<ItemStack> itemDropList = block.getDrops(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl); List<ItemStack> itemDropList = block.getDrops(world, newPos, state, fortuneLvl);
if (itemDropList != null) if (itemDropList != null)
{ {
@ -176,20 +138,20 @@ public class BoundAxe extends ItemAxe implements IBindable
} }
} }
par2World.setBlockToAir(posX + i, posY + j, posZ + k); world.setBlockToAir(newPos);
} }
} }
} }
} }
} }
BoundPickaxe.dropMultisetStacks(dropMultiset, par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ); BoundPickaxe.dropMultisetStacks(dropMultiset, world, pos.getX(), pos.getY() + par3EntityPlayer.getEyeHeight(), pos.getZ());
return par1ItemStack; return par1ItemStack;
} }
@Override @Override
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5)
{ {
if (!(par3Entity instanceof EntityPlayer)) if (!(par3Entity instanceof EntityPlayer))
{ {
@ -202,7 +164,7 @@ public class BoundAxe extends ItemAxe implements IBindable
{ {
par1ItemStack.setTagCompound(new NBTTagCompound()); par1ItemStack.setTagCompound(new NBTTagCompound());
} }
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) if (world.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
{ {
if (!par3EntityPlayer.capabilities.isCreativeMode) if (!par3EntityPlayer.capabilities.isCreativeMode)
{ {
@ -216,28 +178,14 @@ public class BoundAxe extends ItemAxe implements IBindable
par1ItemStack.setItemDamage(0); par1ItemStack.setItemDamage(0);
} }
public void setActivated(ItemStack par1ItemStack, boolean newActivated) public void setActivated(ItemStack stack, boolean newActivated)
{ {
NBTTagCompound itemTag = par1ItemStack.getTagCompound(); stack.setItemDamage(newActivated ? 1 : 0);
if (itemTag == null)
{
par1ItemStack.setTagCompound(new NBTTagCompound());
}
itemTag.setBoolean("isActive", newActivated);
} }
public boolean getActivated(ItemStack par1ItemStack) public boolean getActivated(ItemStack stack)
{ {
if (!par1ItemStack.hasTagCompound()) return stack.getItemDamage() == 1;
{
par1ItemStack.setTagCompound(new NBTTagCompound());
}
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
return itemTag.getBoolean("isActive");
} }
/** /**
@ -245,14 +193,14 @@ public class BoundAxe extends ItemAxe implements IBindable
* sword * sword
*/ */
@Override @Override
public float func_150893_a(ItemStack par1ItemStack, Block par2Block) public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{ {
if (!getActivated(par1ItemStack)) if (!getActivated(par1ItemStack))
{ {
return 0.0F; return 0.0F;
} }
return super.func_150893_a(par1ItemStack, par2Block); return super.getStrVsBlock(par1ItemStack, par2Block);
} }
/** /**
@ -264,7 +212,7 @@ public class BoundAxe extends ItemAxe implements IBindable
return getActivated(par1ItemStack); return getActivated(par1ItemStack);
} }
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) public boolean onBlockDestroyed(ItemStack par1ItemStack, World world, Block par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
{ {
return true; return true;
} }
@ -292,19 +240,19 @@ public class BoundAxe extends ItemAxe implements IBindable
* FORGE: Overridden to allow custom tool effectiveness * FORGE: Overridden to allow custom tool effectiveness
*/ */
@Override @Override
public float getDigSpeed(ItemStack stack, Block block, int meta) public float getDigSpeed(ItemStack stack, IBlockState state)
{ {
if (!getActivated(stack)) if (!getActivated(stack))
{ {
return 0.0F; return 0.0F;
} }
if (ForgeHooks.isToolEffective(stack, block, meta)) for (String type : getToolClasses(stack))
{ {
return efficiencyOnProperMaterial; if (state.getBlock().isToolEffective(type, state))
return efficiencyOnProperMaterial;
} }
return super.getDigSpeed(stack, state);
return func_150893_a(stack, block);
} }
@Override @Override

View file

@ -1,10 +1,9 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.block.state.IBlockState;
import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@ -13,11 +12,11 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon; import net.minecraft.util.BlockPos;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.util.Vec3;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.common.ItemType; import WayofTime.alchemicalWizardry.common.ItemType;
@ -26,17 +25,10 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import com.google.common.collect.HashMultiset; import com.google.common.collect.HashMultiset;
import com.google.common.collect.Multiset; import com.google.common.collect.Multiset;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BoundPickaxe extends ItemPickaxe implements IBindable public class BoundPickaxe extends ItemPickaxe implements IBindable
{ {
public float efficiencyOnProperMaterial = 12.0F; public float efficiencyOnProperMaterial = 12.0F;
public float damageVsEntity; public float damageVsEntity;
@SideOnly(Side.CLIENT)
private IIcon activeIcon;
@SideOnly(Side.CLIENT)
private IIcon passiveIcon;
private int energyUsed; private int energyUsed;
@ -61,14 +53,14 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
} }
@Override @Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{ {
par3List.add(StatCollector.translateToLocal("tooltip.boundpickaxe.desc1")); par3List.add(StatCollector.translateToLocal("tooltip.boundpickaxe.desc1"));
par3List.add(StatCollector.translateToLocal("tooltip.boundpickaxe.desc2")); par3List.add(StatCollector.translateToLocal("tooltip.boundpickaxe.desc2"));
if (!(par1ItemStack.getTagCompound() == null)) if (!(stack.getTagCompound() == null))
{ {
if (par1ItemStack.getTagCompound().getBoolean("isActive")) if (stack.getTagCompound().getBoolean("isActive"))
{ {
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated")); par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
} else } else
@ -76,75 +68,44 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated")); par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
} }
if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) if (!stack.getTagCompound().getString("ownerName").equals(""))
{ {
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName")); par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + stack.getTagCompound().getString("ownerName"));
} }
} }
} }
@Override @Override
@SideOnly(Side.CLIENT) public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer par3EntityPlayer)
public void registerIcons(IIconRegister iconRegister)
{ {
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundPickaxe_activated"); if (!EnergyItems.checkAndSetItemOwner(stack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundPickaxe_activated");
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
}
@Override
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
{
if (stack.getTagCompound() == null)
{ {
stack.setTagCompound(new NBTTagCompound()); this.setActivated(stack, !getActivated(stack));
} stack.getTagCompound().setInteger("worldTimeDelay", (int) (world.getWorldTime() - 1) % 200);
return stack;
NBTTagCompound tag = stack.getTagCompound();
if (tag.getBoolean("isActive"))
{
return this.activeIcon;
} else
{
return this.passiveIcon;
}
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
{
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
return par1ItemStack;
} }
if (par2World.isRemote) if (world.isRemote)
{ {
return par1ItemStack; return stack;
} }
if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) if (!getActivated(stack) || SpellHelper.isFakePlayer(world, par3EntityPlayer))
{ {
return par1ItemStack; return stack;
} }
if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionInhibit)) if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionInhibit))
{ {
return par1ItemStack; return stack;
} }
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 10000)) if(!EnergyItems.syphonBatteries(stack, par3EntityPlayer, 10000))
{ {
return par1ItemStack; return stack;
} }
Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer); BlockPos pos = par3EntityPlayer.getPosition();
int posX = (int) (blockVec.xCoord);
int posY = (int) (blockVec.yCoord);
int posZ = (int) (blockVec.zCoord);
boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer); boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer);
int fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer); int fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer);
@ -152,43 +113,44 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
for (int i = -5; i <= 5; i++) for (int i = -5; i <= 5; i++)
{ {
for (int j = -5; j <= 5; j++) for (int j = 0; j <= 10; j++)
{ {
for (int k = -5; k <= 5; k++) for (int k = -5; k <= 5; k++)
{ {
Block block = par2World.getBlock(posX + i, posY + j, posZ + k); BlockPos newPos = pos.add(i, j, k);
int meta = par2World.getBlockMetadata(posX + i, posY + j, posZ + k); IBlockState state = world.getBlockState(newPos);
Block block = state.getBlock();
if (block != null && block.getBlockHardness(par2World, posX + i, posY + j, posZ + k) != -1) if (block != null)
{ {
float str = func_150893_a(par1ItemStack, block); float str = getStrVsBlock(stack, block);
if (str > 1.1f && par2World.canMineBlock(par3EntityPlayer, posX + i, posY + j, posZ + k)) if (str > 1.1f && world.canMineBlockBody(par3EntityPlayer, newPos))
{ {
if (silkTouch && block.canSilkHarvest(par2World, par3EntityPlayer, posX + i, posY + j, posZ + k, meta)) if (silkTouch && block.canSilkHarvest(world, newPos, state, par3EntityPlayer))
{ {
dropMultiset.add(new ItemType(block, meta)); dropMultiset.add(new ItemType(block, block.getMetaFromState(state)));
} else } else
{ {
ArrayList<ItemStack> itemDropList = block.getDrops(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl); List<ItemStack> itemDropList = block.getDrops(world, newPos, state, fortuneLvl);
if (itemDropList != null) if (itemDropList != null)
{ {
for (ItemStack stack : itemDropList) for (ItemStack stacky : itemDropList)
dropMultiset.add(ItemType.fromStack(stack), stack.stackSize); dropMultiset.add(ItemType.fromStack(stacky), stacky.stackSize);
} }
} }
par2World.setBlockToAir(posX + i, posY + j, posZ + k); world.setBlockToAir(newPos);
} }
} }
} }
} }
} }
dropMultisetStacks(dropMultiset, par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ); BoundPickaxe.dropMultisetStacks(dropMultiset, world, pos.getX(), pos.getY() + par3EntityPlayer.getEyeHeight(), pos.getZ());
return par1ItemStack; return stack;
} }
public static void dropMultisetStacks(Multiset<ItemType> dropMultiset, World world, double x, double y, double z) public static void dropMultisetStacks(Multiset<ItemType> dropMultiset, World world, double x, double y, double z)
@ -212,7 +174,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
} }
@Override @Override
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) public void onUpdate(ItemStack stack, World world, Entity par3Entity, int par4, boolean par5)
{ {
if (!(par3Entity instanceof EntityPlayer)) if (!(par3Entity instanceof EntityPlayer))
{ {
@ -221,47 +183,33 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;
if (par1ItemStack.getTagCompound() == null) if (stack.getTagCompound() == null)
{ {
par1ItemStack.setTagCompound(new NBTTagCompound()); stack.setTagCompound(new NBTTagCompound());
} }
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) if (world.getWorldTime() % 200 == stack.getTagCompound().getInteger("worldTimeDelay") && stack.getTagCompound().getBoolean("isActive"))
{ {
if (!par3EntityPlayer.capabilities.isCreativeMode) if (!par3EntityPlayer.capabilities.isCreativeMode)
{ {
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 20)) if(!EnergyItems.syphonBatteries(stack, par3EntityPlayer, 20))
{ {
this.setActivated(par1ItemStack, false); this.setActivated(stack, false);
} }
} }
} }
par1ItemStack.setItemDamage(0); stack.setItemDamage(0);
} }
public void setActivated(ItemStack par1ItemStack, boolean newActivated) public void setActivated(ItemStack stack, boolean newActivated)
{ {
NBTTagCompound itemTag = par1ItemStack.getTagCompound(); stack.setItemDamage(newActivated ? 1 : 0);
if (itemTag == null)
{
par1ItemStack.setTagCompound(new NBTTagCompound());
}
itemTag.setBoolean("isActive", newActivated);
} }
public boolean getActivated(ItemStack par1ItemStack) public boolean getActivated(ItemStack stack)
{ {
if (!par1ItemStack.hasTagCompound()) return stack.getItemDamage() == 1;
{
par1ItemStack.setTagCompound(new NBTTagCompound());
}
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
return itemTag.getBoolean("isActive");
} }
/** /**
@ -269,34 +217,23 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
* sword * sword
*/ */
@Override @Override
public float func_150893_a(ItemStack par1ItemStack, Block par2Block) //getStrVsBlock public float getStrVsBlock(ItemStack stack, Block par2Block) //getStrVsBlock
{ {
if (!getActivated(par1ItemStack)) if (!getActivated(stack))
{ {
return 0.0F; return 0.0F;
} }
return super.func_150893_a(par1ItemStack, par2Block); return super.getStrVsBlock(stack, par2Block);
} }
/** /**
* Current implementations of this method in child classes do not use the entry argument beside ev. They just raise * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
* the damage on the stack. * the damage on the stack.
*/ */
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) public boolean hitEntity(ItemStack stack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)
{ {
return getActivated(par1ItemStack); return getActivated(stack);
}
@Override
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
{
if (par7EntityLivingBase instanceof EntityPlayer)
{
EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par7EntityLivingBase, getEnergyUsed());
}
return true;
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@ -322,19 +259,19 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
* FORGE: Overridden to allow custom tool effectiveness * FORGE: Overridden to allow custom tool effectiveness
*/ */
@Override @Override
public float getDigSpeed(ItemStack stack, Block block, int meta) public float getDigSpeed(ItemStack stack, IBlockState state)
{ {
if (!getActivated(stack)) if (!getActivated(stack))
{ {
return 0.0F; return 0.0F;
} }
if (ForgeHooks.isToolEffective(stack, block, meta)) for (String type : getToolClasses(stack))
{ {
return efficiencyOnProperMaterial; if (state.getBlock().isToolEffective(type, state))
return efficiencyOnProperMaterial;
} }
return super.getDigSpeed(stack, state);
return func_150893_a(stack, block);
} }
@Override @Override

View file

@ -1,45 +1,33 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.block.state.IBlockState;
import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemSpade; import net.minecraft.item.ItemSpade;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon; import net.minecraft.util.BlockPos;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.util.Vec3;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.common.ItemType; import WayofTime.alchemicalWizardry.common.ItemType;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import com.google.common.collect.HashMultiset; import com.google.common.collect.HashMultiset;
import com.google.common.collect.Multimap;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BoundShovel extends ItemSpade implements IBindable public class BoundShovel extends ItemSpade implements IBindable
{ {
public float efficiencyOnProperMaterial = 12.0F; public float efficiencyOnProperMaterial = 12.0F;
public float damageVsEntity; public float damageVsEntity;
@SideOnly(Side.CLIENT)
private IIcon activeIcon;
@SideOnly(Side.CLIENT)
private IIcon passiveIcon;
private int energyUsed; private int energyUsed;
public BoundShovel() public BoundShovel()
@ -85,67 +73,36 @@ public class BoundShovel extends ItemSpade implements IBindable
} }
@Override @Override
@SideOnly(Side.CLIENT) public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer par3EntityPlayer)
public void registerIcons(IIconRegister iconRegister)
{ {
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundShovel_activated"); if (!EnergyItems.checkAndSetItemOwner(stack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundShovel_activated");
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
}
@Override
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
{
if (stack.getTagCompound() == null)
{ {
stack.setTagCompound(new NBTTagCompound()); this.setActivated(stack, !getActivated(stack));
} stack.getTagCompound().setInteger("worldTimeDelay", (int) (world.getWorldTime() - 1) % 200);
return stack;
NBTTagCompound tag = stack.getTagCompound();
if (tag.getBoolean("isActive"))
{
return this.activeIcon;
} else
{
return this.passiveIcon;
}
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
{
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
return par1ItemStack;
} }
if (par2World.isRemote) if (world.isRemote)
{ {
return par1ItemStack; return stack;
} }
if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) if (!getActivated(stack) || SpellHelper.isFakePlayer(world, par3EntityPlayer))
{ {
return par1ItemStack; return stack;
} }
if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionInhibit)) if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionInhibit))
{ {
return par1ItemStack; return stack;
} }
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 10000)) if(!EnergyItems.syphonBatteries(stack, par3EntityPlayer, 10000))
{ {
return par1ItemStack; return stack;
} }
Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer); BlockPos pos = par3EntityPlayer.getPosition();
int posX = (int) (blockVec.xCoord);
int posY = (int) (blockVec.yCoord);
int posZ = (int) (blockVec.zCoord);
boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer); boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer);
int fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer); int fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer);
@ -157,39 +114,40 @@ public class BoundShovel extends ItemSpade implements IBindable
{ {
for (int k = -5; k <= 5; k++) for (int k = -5; k <= 5; k++)
{ {
Block block = par2World.getBlock(posX + i, posY + j, posZ + k); BlockPos newPos = pos.add(i, j, k);
int meta = par2World.getBlockMetadata(posX + i, posY + j, posZ + k); IBlockState state = world.getBlockState(newPos);
Block block = state.getBlock();
if (block != null) if (block != null)
{ {
float str = func_150893_a(par1ItemStack, block); float str = getStrVsBlock(stack, block);
if (str > 1.1f && par2World.canMineBlock(par3EntityPlayer, posX + i, posY + j, posZ + k)) if (str > 1.1f && world.canMineBlockBody(par3EntityPlayer, newPos))
{ {
if (silkTouch && block.canSilkHarvest(par2World, par3EntityPlayer, posX + i, posY + j, posZ + k, meta)) if (silkTouch && block.canSilkHarvest(world, newPos, state, par3EntityPlayer))
{ {
dropMultiset.add(new ItemType(block, meta)); dropMultiset.add(new ItemType(block, block.getMetaFromState(state)));
} else } else
{ {
ArrayList<ItemStack> itemDropList = block.getDrops(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl); List<ItemStack> itemDropList = block.getDrops(world, newPos, state, fortuneLvl);
if (itemDropList != null) if (itemDropList != null)
{ {
for (ItemStack stack : itemDropList) for (ItemStack stacky : itemDropList)
dropMultiset.add(ItemType.fromStack(stack), stack.stackSize); dropMultiset.add(ItemType.fromStack(stacky), stacky.stackSize);
} }
} }
par2World.setBlockToAir(posX + i, posY + j, posZ + k); world.setBlockToAir(newPos);
} }
} }
} }
} }
} }
BoundPickaxe.dropMultisetStacks(dropMultiset, par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ); BoundPickaxe.dropMultisetStacks(dropMultiset, world, pos.getX(), pos.getY() + par3EntityPlayer.getEyeHeight(), pos.getZ());
return par1ItemStack; return stack;
} }
@Override @Override
@ -220,28 +178,14 @@ public class BoundShovel extends ItemSpade implements IBindable
par1ItemStack.setItemDamage(0); par1ItemStack.setItemDamage(0);
} }
public void setActivated(ItemStack par1ItemStack, boolean newActivated) public void setActivated(ItemStack stack, boolean newActivated)
{ {
NBTTagCompound itemTag = par1ItemStack.getTagCompound(); stack.setItemDamage(newActivated ? 1 : 0);
if (itemTag == null)
{
par1ItemStack.setTagCompound(new NBTTagCompound());
}
itemTag.setBoolean("isActive", newActivated);
} }
public boolean getActivated(ItemStack par1ItemStack) public boolean getActivated(ItemStack stack)
{ {
if (!par1ItemStack.hasTagCompound()) return stack.getItemDamage() == 1;
{
par1ItemStack.setTagCompound(new NBTTagCompound());
}
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
return itemTag.getBoolean("isActive");
} }
/** /**
@ -249,14 +193,14 @@ public class BoundShovel extends ItemSpade implements IBindable
* sword * sword
*/ */
@Override @Override
public float func_150893_a(ItemStack par1ItemStack, Block par2Block) public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{ {
if (!getActivated(par1ItemStack)) if (!getActivated(par1ItemStack))
{ {
return 0.0F; return 0.0F;
} }
return super.func_150893_a(par1ItemStack, par2Block); return super.getStrVsBlock(par1ItemStack, par2Block);
} }
/** /**
@ -291,31 +235,23 @@ public class BoundShovel extends ItemSpade implements IBindable
return 30; return 30;
} }
@Override
public Multimap getItemAttributeModifiers()
{
Multimap multimap = super.getItemAttributeModifiers();
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", (double) this.damageVsEntity, 0));
return multimap;
}
/** /**
* FORGE: Overridden to allow custom tool effectiveness * FORGE: Overridden to allow custom tool effectiveness
*/ */
@Override @Override
public float getDigSpeed(ItemStack stack, Block block, int meta) public float getDigSpeed(ItemStack stack, IBlockState state)
{ {
if (!getActivated(stack)) if (!getActivated(stack))
{ {
return 0.0F; return 0.0F;
} }
if (ForgeHooks.isToolEffective(stack, block, meta)) for (String type : getToolClasses(stack))
{ {
return efficiencyOnProperMaterial; if (state.getBlock().isToolEffective(type, state))
return efficiencyOnProperMaterial;
} }
return super.getDigSpeed(stack, state);
return func_150893_a(stack, block);
} }
@Override @Override

View file

@ -1,24 +1,21 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import java.util.List;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
import net.minecraft.util.DamageSource; import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.common.util.FakePlayer;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import java.util.List; import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
public class CheatyItem extends Item implements IBindable public class CheatyItem extends Item implements IBindable
{ {
@ -29,13 +26,6 @@ public class CheatyItem extends Item implements IBindable
setCreativeTab(AlchemicalWizardry.tabBloodMagic); setCreativeTab(AlchemicalWizardry.tabBloodMagic);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBattery");
}
@Override @Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{ {
@ -119,7 +109,7 @@ public class CheatyItem extends Item implements IBindable
for (int l = 0; l < 8; ++l) for (int l = 0; l < 8; ++l)
{ {
world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); world.spawnParticle(EnumParticleTypes.REDSTONE, posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
} }
} }
@ -176,10 +166,4 @@ public class CheatyItem extends Item implements IBindable
int currentEssence = data.currentEssence; int currentEssence = data.currentEssence;
return (currentEssence); return (currentEssence);
} }
@Override
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack)
{
return false;
}
} }

View file

@ -1,17 +1,19 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.api.event.SacrificeKnifeUsedEvent;
import WayofTime.alchemicalWizardry.api.sacrifice.PlayerSacrificeHandler;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.common.util.FakePlayer;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.event.SacrificeKnifeUsedEvent;
import WayofTime.alchemicalWizardry.api.sacrifice.PlayerSacrificeHandler;
import WayofTime.alchemicalWizardry.api.tile.IBloodAltar; import WayofTime.alchemicalWizardry.api.tile.IBloodAltar;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
@ -20,7 +22,6 @@ public class CreativeDagger extends Item
public CreativeDagger() public CreativeDagger()
{ {
super(); super();
setTextureName("AlchemicalWizardry:SacrificialDagger");
setMaxStackSize(1); setMaxStackSize(1);
setCreativeTab(AlchemicalWizardry.tabBloodMagic); setCreativeTab(AlchemicalWizardry.tabBloodMagic);
setFull3D(); setFull3D();
@ -69,7 +70,7 @@ public class CreativeDagger extends Item
for (int l = 0; l < 8; ++l) for (int l = 0; l < 8; ++l)
{ {
world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); world.spawnParticle(EnumParticleTypes.REDSTONE, posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
} }
if (!world.isRemote && SpellHelper.isFakePlayer(world, player)) if (!world.isRemote && SpellHelper.isFakePlayer(world, player))
@ -83,10 +84,8 @@ public class CreativeDagger extends Item
public void findAndFillAltar(World world, EntityPlayer player, int amount) public void findAndFillAltar(World world, EntityPlayer player, int amount)
{ {
int posX = (int) Math.round(player.posX - 0.5f); BlockPos pos = player.getPosition();
int posY = (int) player.posY; IBloodAltar altarEntity = getAltar(world, pos);
int posZ = (int) Math.round(player.posZ - 0.5f);
IBloodAltar altarEntity = getAltar(world, posX, posY, posZ);
if (altarEntity == null) if (altarEntity == null)
{ {
@ -97,7 +96,7 @@ public class CreativeDagger extends Item
altarEntity.startCycle(); altarEntity.startCycle();
} }
public IBloodAltar getAltar(World world, int x, int y, int z) public IBloodAltar getAltar(World world, BlockPos pos)
{ {
TileEntity tileEntity; TileEntity tileEntity;
@ -107,7 +106,8 @@ public class CreativeDagger extends Item
{ {
for (int k = -2; k <= 1; k++) for (int k = -2; k <= 1; k++)
{ {
tileEntity = world.getTileEntity(i + x, k + y, j + z); BlockPos newPos = pos.add(i, j, k);
tileEntity = world.getTileEntity(newPos);
if(tileEntity instanceof IBloodAltar) if(tileEntity instanceof IBloodAltar)
{ {

View file

@ -1,10 +1,10 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import java.util.List; import java.util.List;
import java.util.UUID;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.ai.attributes.AttributeModifier;
@ -17,20 +17,18 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.tile.IBloodAltar;
import WayofTime.alchemicalWizardry.common.IDemon; import WayofTime.alchemicalWizardry.common.IDemon;
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon; import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.api.tile.IBloodAltar;
import com.google.common.collect.Multimap; import com.google.common.collect.Multimap;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class DaggerOfSacrifice extends EnergyItems public class DaggerOfSacrifice extends EnergyItems
{ {
public DaggerOfSacrifice() public DaggerOfSacrifice()
@ -43,13 +41,6 @@ public class DaggerOfSacrifice extends EnergyItems
setMaxDamage(100); setMaxDamage(100);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DaggerOfSacrifice");
}
@Override @Override
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)
{ {
@ -118,7 +109,7 @@ public class DaggerOfSacrifice extends EnergyItems
} }
@Override @Override
public float func_150893_a(ItemStack par1ItemStack, Block par2Block) public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{ {
if (par2Block == Blocks.web) if (par2Block == Blocks.web)
{ {
@ -140,16 +131,14 @@ public class DaggerOfSacrifice extends EnergyItems
public Multimap getItemAttributeModifiers() public Multimap getItemAttributeModifiers()
{ {
Multimap multimap = super.getItemAttributeModifiers(); Multimap multimap = super.getItemAttributeModifiers();
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", 1.0d, 0)); multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(4186465, 46565), "Tool modifier", 1.0d, 0));
return multimap; return multimap;
} }
public boolean findAndNotifyAltarOfDemon(World world, EntityLivingBase sacrifice) public boolean findAndNotifyAltarOfDemon(World world, EntityLivingBase sacrifice)
{ {
int posX = (int) Math.round(sacrifice.posX - 0.5f); BlockPos pos = sacrifice.getPosition();
int posY = (int) sacrifice.posY; IBloodAltar altarEntity = this.getAltar(world, pos);
int posZ = (int) Math.round(sacrifice.posZ - 0.5f);
IBloodAltar altarEntity = this.getAltar(world, posX, posY, posZ);
if (altarEntity == null) if (altarEntity == null)
{ {
@ -163,10 +152,8 @@ public class DaggerOfSacrifice extends EnergyItems
public boolean findAndFillAltar(World world, EntityLivingBase sacrifice, int amount) public boolean findAndFillAltar(World world, EntityLivingBase sacrifice, int amount)
{ {
int posX = (int) Math.round(sacrifice.posX - 0.5f); BlockPos pos = sacrifice.getPosition();
int posY = (int) sacrifice.posY; IBloodAltar altarEntity = this.getAltar(world, pos);
int posZ = (int) Math.round(sacrifice.posZ - 0.5f);
IBloodAltar altarEntity = this.getAltar(world, posX, posY, posZ);
if (altarEntity == null) if (altarEntity == null)
{ {
@ -178,7 +165,7 @@ public class DaggerOfSacrifice extends EnergyItems
return true; return true;
} }
public IBloodAltar getAltar(World world, int x, int y, int z) public IBloodAltar getAltar(World world, BlockPos pos)
{ {
TileEntity tileEntity; TileEntity tileEntity;
@ -188,7 +175,8 @@ public class DaggerOfSacrifice extends EnergyItems
{ {
for (int k = -2; k <= 1; k++) for (int k = -2; k <= 1; k++)
{ {
tileEntity = world.getTileEntity(i + x, k + y, j + z); BlockPos newPos = pos.add(i, j, k);
tileEntity = world.getTileEntity(newPos);
if ((tileEntity instanceof IBloodAltar)) if ((tileEntity instanceof IBloodAltar))
{ {

View file

@ -1,8 +1,5 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
public class DawnScribeTool extends ScribeTool public class DawnScribeTool extends ScribeTool
{ {
@ -10,11 +7,4 @@ public class DawnScribeTool extends ScribeTool
{ {
super(6); super(6);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DawnScribeTool");
}
} }

View file

@ -1,29 +1,24 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistry; import java.util.List;
import WayofTime.alchemicalWizardry.common.entity.mob.EntityDemon;
import cpw.mods.fml.relauncher.Side; import net.minecraft.block.BlockFence;
import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.state.IBlockState;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityList.EntityEggInfo;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.Facing; import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistry;
import java.util.List; import WayofTime.alchemicalWizardry.common.entity.mob.EntityDemon;
public class DemonPlacer extends Item public class DemonPlacer extends Item
{ {
@ -35,48 +30,45 @@ public class DemonPlacer extends Item
this.maxStackSize = 1; this.maxStackSize = 1;
} }
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack par1ItemStack, int par2)
{
EntityEggInfo entityegginfo = (EntityEggInfo) EntityList.entityEggs.get(Integer.valueOf(par1ItemStack.getItemDamage()));
return entityegginfo != null ? (par2 == 0 ? entityegginfo.primaryColor : entityegginfo.secondaryColor) : 16777215;
}
/** /**
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS
*/ */
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) @Override
public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
{ {
if (par3World.isRemote) if (world.isRemote)
{ {
return true; return true;
} else }
else if (!playerIn.func_175151_a(pos.offset(side), side, stack))
{ {
Block i1 = par3World.getBlock(par4, par5, par6); return false;
par4 += Facing.offsetsXForSide[par7]; }
par5 += Facing.offsetsYForSide[par7]; else
par6 += Facing.offsetsZForSide[par7]; {
IBlockState iblockstate = world.getBlockState(pos);
pos = pos.offset(side);
double d0 = 0.0D; double d0 = 0.0D;
if (par7 == 1 && i1 != null && i1.getRenderType() == 11) if (side == EnumFacing.UP && iblockstate instanceof BlockFence)
{ {
d0 = 0.5D; d0 = 0.5D;
} }
String demonName = DemonPlacer.getDemonString(par1ItemStack); String demonName = DemonPlacer.getDemonString(stack);
Entity entity = spawnCreature(par3World, demonName, (double) par4 + 0.5D, (double) par5 + d0, (double) par6 + 0.5D, par1ItemStack); Entity entity = spawnCreature(world, demonName, (double)pos.getX() + 0.5D, (double)pos.getY() + d0, (double)pos.getZ() + 0.5D, stack);
if (entity != null) if (entity != null)
{ {
if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName()) if (entity instanceof EntityLivingBase && stack.hasDisplayName())
{ {
((EntityLiving) entity).setCustomNameTag(par1ItemStack.getDisplayName()); entity.setCustomNameTag(stack.getDisplayName());
} }
if (!par2EntityPlayer.capabilities.isCreativeMode) if (!playerIn.capabilities.isCreativeMode)
{ {
--par1ItemStack.stackSize; --stack.stackSize;
} }
} }
@ -84,64 +76,6 @@ public class DemonPlacer extends Item
} }
} }
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (par2World.isRemote)
{
return par1ItemStack;
} else
{
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true);
if (movingobjectposition == null)
{
return par1ItemStack;
} else
{
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
{
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
if (!par2World.canMineBlock(par3EntityPlayer, i, j, k))
{
return par1ItemStack;
}
if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack))
{
return par1ItemStack;
}
if (par2World.getBlock(i, j, k).getMaterial() == Material.water)
{
String demonName = DemonPlacer.getDemonString(par1ItemStack);
Entity entity = spawnCreature(par2World, demonName, (double) i, (double) j, (double) k, par1ItemStack);
if (entity != null)
{
if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName())
{
((EntityLiving) entity).setCustomNameTag(par1ItemStack.getDisplayName());
}
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
--par1ItemStack.stackSize;
}
}
}
}
return par1ItemStack;
}
}
}
/** /**
* Spawns the creature specified by the egg's type in the location specified by the last three parameters. * Spawns the creature specified by the egg's type in the location specified by the last three parameters.
* Parameters: world, entityID, x, y, z. * Parameters: world, entityID, x, y, z.
@ -230,11 +164,4 @@ public class DemonPlacer extends Item
} }
} }
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DemonPlacer");
}
} }

View file

@ -1,15 +1,12 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import cpw.mods.fml.relauncher.Side; import java.util.List;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import java.util.List;
public class DemonicTelepositionFocus extends TelepositionFocus public class DemonicTelepositionFocus extends TelepositionFocus
{ {
public DemonicTelepositionFocus() public DemonicTelepositionFocus()
@ -17,13 +14,6 @@ public class DemonicTelepositionFocus extends TelepositionFocus
super(4); super(4);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DemonicTeleposerFocus");
}
@Override @Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{ {

View file

@ -1,8 +1,5 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
public class DuskScribeTool extends ScribeTool public class DuskScribeTool extends ScribeTool
{ {
@ -10,11 +7,4 @@ public class DuskScribeTool extends ScribeTool
{ {
super(5); super(5);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DuskScribeTool");
}
} }

View file

@ -1,8 +1,5 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
public class EarthScribeTool extends ScribeTool public class EarthScribeTool extends ScribeTool
{ {
@ -10,11 +7,4 @@ public class EarthScribeTool extends ScribeTool
{ {
super(3); super(3);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EarthScribeTool");
}
} }

View file

@ -1,5 +1,15 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
@ -7,18 +17,6 @@ import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import java.util.List;
public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBloodOrb public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBloodOrb
{ {
@ -34,13 +32,6 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl
orbLevel = 1; orbLevel = 1;
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBattery");
}
@Override @Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{ {
@ -125,7 +116,7 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl
for (int l = 0; l < 8; ++l) for (int l = 0; l < 8; ++l)
{ {
world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); world.spawnParticle(EnumParticleTypes.REDSTONE, posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
} }
} }
@ -210,10 +201,4 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl
return data.currentEssence; return data.currentEssence;
} }
@Override
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack)
{
return false;
}
} }

View file

@ -1,27 +1,19 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import java.util.List;
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaMainProjectile;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
import net.minecraft.world.World; import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import java.util.List; import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaMainProjectile;
public class EnergyBazooka extends EnergyItems public class EnergyBazooka extends EnergyItems
{ {
@SideOnly(Side.CLIENT)
private IIcon activeIcon;
@SideOnly(Side.CLIENT)
private IIcon passiveIcon;
private int damage; private int damage;
public EnergyBazooka() public EnergyBazooka()
@ -35,34 +27,6 @@ public class EnergyBazooka extends EnergyItems
damage = 12; damage = 12;
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBazooka_activated");
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBazooka_activated");
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
}
@Override
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
{
if (stack.getTagCompound() == null)
{
stack.setTagCompound(new NBTTagCompound());
}
NBTTagCompound tag = stack.getTagCompound();
if (tag.getBoolean("isActive"))
{
return this.activeIcon;
} else
{
return this.passiveIcon;
}
}
@Override @Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{ {
@ -168,28 +132,14 @@ public class EnergyBazooka extends EnergyItems
} }
} }
public void setActivated(ItemStack par1ItemStack, boolean newActivated) public void setActivated(ItemStack stack, boolean newActivated)
{ {
NBTTagCompound itemTag = par1ItemStack.getTagCompound(); stack.setItemDamage(newActivated ? 1 : 0);
if (itemTag == null)
{
par1ItemStack.setTagCompound(new NBTTagCompound());
}
itemTag.setBoolean("isActive", newActivated);
} }
public boolean getActivated(ItemStack par1ItemStack) public boolean getActivated(ItemStack stack)
{ {
NBTTagCompound itemTag = par1ItemStack.getTagCompound(); return stack.getItemDamage() == 1;
if (itemTag == null)
{
par1ItemStack.setTagCompound(new NBTTagCompound());
}
return itemTag.getBoolean("isActive");
} }
public void setDelay(ItemStack par1ItemStack, int newDelay) public void setDelay(ItemStack par1ItemStack, int newDelay)

View file

@ -1,26 +1,18 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import java.util.List;
import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import java.util.List; import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile;
public class EnergyBlast extends EnergyItems public class EnergyBlast extends EnergyItems
{ {
@SideOnly(Side.CLIENT)
private IIcon activeIcon;
@SideOnly(Side.CLIENT)
private IIcon passiveIcon;
private int damage; private int damage;
public EnergyBlast() public EnergyBlast()
@ -35,34 +27,6 @@ public class EnergyBlast extends EnergyItems
damage = 12; damage = 12;
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBlaster_activated");
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBlaster_activated");
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
}
@Override
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
{
if (stack.getTagCompound() == null)
{
stack.setTagCompound(new NBTTagCompound());
}
NBTTagCompound tag = stack.getTagCompound();
if (tag.getBoolean("isActive"))
{
return this.activeIcon;
} else
{
return this.passiveIcon;
}
}
@Override @Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{ {
@ -162,28 +126,14 @@ public class EnergyBlast extends EnergyItems
} }
} }
public void setActivated(ItemStack par1ItemStack, boolean newActivated) public void setActivated(ItemStack stack, boolean newActivated)
{ {
NBTTagCompound itemTag = par1ItemStack.getTagCompound(); stack.setItemDamage(newActivated ? 1 : 0);
if (itemTag == null)
{
par1ItemStack.setTagCompound(new NBTTagCompound());
}
itemTag.setBoolean("isActive", newActivated);
} }
public boolean getActivated(ItemStack par1ItemStack) public boolean getActivated(ItemStack stack)
{ {
NBTTagCompound itemTag = par1ItemStack.getTagCompound(); return stack.getItemDamage() == 1;
if (itemTag == null)
{
par1ItemStack.setTagCompound(new NBTTagCompound());
}
return itemTag.getBoolean("isActive");
} }
public void setDelay(ItemStack par1ItemStack, int newDelay) public void setDelay(ItemStack par1ItemStack, int newDelay)

View file

@ -11,6 +11,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.world.World; import net.minecraft.world.World;
public class EnergyItems extends Item implements IBindable public class EnergyItems extends Item implements IBindable
@ -47,7 +48,7 @@ public class EnergyItems extends Item implements IBindable
float f3 = f * f * 0.6F - 0.7F; float f3 = f * f * 0.6F - 0.7F;
for (int l = 0; l < 8; ++l) for (int l = 0; l < 8; ++l)
{ {
world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); world.spawnParticle(EnumParticleTypes.REDSTONE, posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
} }
} }
for (int i = 0; i < damage; i++) for (int i = 0; i < damage; i++)

View file

@ -4,7 +4,6 @@ import java.util.List;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -14,21 +13,14 @@ import net.minecraft.item.ItemSword;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm; import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm;
import WayofTime.alchemicalWizardry.common.omega.OmegaRegistry; import WayofTime.alchemicalWizardry.common.omega.OmegaRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class EnergySword extends ItemSword public class EnergySword extends ItemSword
{ {
@SideOnly(Side.CLIENT)
private IIcon activeIcon;
@SideOnly(Side.CLIENT)
private IIcon passiveIcon;
private int energyUsed; private int energyUsed;
public EnergySword() public EnergySword()
@ -50,34 +42,6 @@ public class EnergySword extends ItemSword
{ {
return this.energyUsed; return this.energyUsed;
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundSword_activated");
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundSword_activated");
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
}
@Override
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
{
if (stack.getTagCompound() == null)
{
stack.setTagCompound(new NBTTagCompound());
}
NBTTagCompound tag = stack.getTagCompound();
if (tag.getBoolean("isActive"))
{
return this.activeIcon;
} else
{
return this.passiveIcon;
}
}
private OmegaParadigm getOmegaParadigmOfWeilder(EntityPlayer player) private OmegaParadigm getOmegaParadigmOfWeilder(EntityPlayer player)
{ {
@ -171,28 +135,14 @@ public class EnergySword extends ItemSword
par1ItemStack.setItemDamage(0); par1ItemStack.setItemDamage(0);
} }
public void setActivated(ItemStack par1ItemStack, boolean newActivated) public void setActivated(ItemStack stack, boolean newActivated)
{ {
NBTTagCompound itemTag = par1ItemStack.getTagCompound(); stack.setItemDamage(newActivated ? 1 : 0);
if (itemTag == null)
{
par1ItemStack.setTagCompound(new NBTTagCompound());
}
itemTag.setBoolean("isActive", newActivated);
} }
public boolean getActivated(ItemStack par1ItemStack) public boolean getActivated(ItemStack stack)
{ {
NBTTagCompound itemTag = par1ItemStack.getTagCompound(); return stack.getItemDamage() == 1;
if (itemTag == null)
{
par1ItemStack.setTagCompound(new NBTTagCompound());
}
return itemTag.getBoolean("isActive");
} }
public float func_82803_g() public float func_82803_g()
@ -224,7 +174,7 @@ public class EnergySword extends ItemSword
} }
@Override @Override
public float func_150893_a(ItemStack par1ItemStack, Block par2Block) public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{ {
if (par2Block == Blocks.web) if (par2Block == Blocks.web)
{ {

View file

@ -1,15 +1,12 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import cpw.mods.fml.relauncher.Side; import java.util.List;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import java.util.List;
public class EnhancedTelepositionFocus extends TelepositionFocus public class EnhancedTelepositionFocus extends TelepositionFocus
{ {
public EnhancedTelepositionFocus() public EnhancedTelepositionFocus()
@ -17,13 +14,6 @@ public class EnhancedTelepositionFocus extends TelepositionFocus
super(2); super(2);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnhancedTeleposerFocus");
}
@Override @Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{ {

View file

@ -1,8 +1,5 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
public class FireScribeTool extends ScribeTool public class FireScribeTool extends ScribeTool
{ {
@ -10,11 +7,4 @@ public class FireScribeTool extends ScribeTool
{ {
super(2); super(2);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:FireScribeTool");
}
} }

View file

@ -1,30 +1,27 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import java.util.List;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import java.util.List; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
public class ItemAlchemyBase extends Item public class ItemAlchemyBase extends Item
{ {
private static final String[] ITEM_NAMES = new String[]{"Offensa", "Praesidium", "OrbisTerrae", "StrengthenedCatalyst", "ConcentratedCatalyst", "FracturedBone", "Virtus", "Reductus", "Potentia"}; private static final String[] ITEM_NAMES = new String[]{"Offensa", "Praesidium", "OrbisTerrae", "StrengthenedCatalyst", "ConcentratedCatalyst", "FracturedBone", "Virtus", "Reductus", "Potentia"};
@SideOnly(Side.CLIENT)
private IIcon[] icons;
public ItemAlchemyBase() public ItemAlchemyBase()
{ {
super(); super();
@ -33,18 +30,6 @@ public class ItemAlchemyBase extends Item
this.hasSubtypes = true; this.hasSubtypes = true;
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
icons = new IIcon[ITEM_NAMES.length];
for (int i = 0; i < ITEM_NAMES.length; ++i)
{
icons[i] = iconRegister.registerIcon("AlchemicalWizardry:" + "baseAlchemyItem" + ITEM_NAMES[i]);
}
}
@Override @Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{ {
@ -85,14 +70,6 @@ public class ItemAlchemyBase extends Item
return ("" + "item.bloodMagicAlchemyItem." + ITEM_NAMES[meta]); return ("" + "item.bloodMagicAlchemyItem." + ITEM_NAMES[meta]);
} }
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int meta)
{
int j = MathHelper.clamp_int(meta, 0, ITEM_NAMES.length - 1);
return icons[j];
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubItems(Item id, CreativeTabs creativeTab, List list) public void getSubItems(Item id, CreativeTabs creativeTab, List list)

View file

@ -3,11 +3,14 @@ package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainer; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainer;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.Constants; import net.minecraftforge.common.util.Constants;
@ -77,17 +80,14 @@ public class ItemBlockCrystalBelljar extends ItemBlock
} }
@Override @Override
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState)
{ {
if (!world.setBlock(x, y, z, field_150939_a, metadata, 3)) if (!world.setBlockState(pos, newState, 3)) return false;
{
return false;
}
if (world.getBlock(x, y, z) == field_150939_a) IBlockState state = world.getBlockState(pos);
if (state.getBlock() == this.block)
{ {
field_150939_a.onBlockPlacedBy(world, x, y, z, player, stack); this.block.onBlockPlacedBy(world, pos, state, player, stack);
field_150939_a.onPostBlockPlaced(world, x, y, z, metadata);
} }
return true; return true;

View file

@ -2,14 +2,13 @@ package WayofTime.alchemicalWizardry.common.items;
import java.util.List; import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon; import net.minecraft.util.BlockPos;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -18,14 +17,9 @@ import WayofTime.alchemicalWizardry.api.items.IAltarManipulator;
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAltarManipulator public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAltarManipulator
{ {
@SideOnly(Side.CLIENT)
private IIcon plateIcon;
public int conversionRate = 100; //LP / half heart public int conversionRate = 100; //LP / half heart
public float activationPoint = 0.5f; public float activationPoint = 0.5f;
public int tickRate = 20; public int tickRate = 20;
@ -37,13 +31,6 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl
setCreativeTab(AlchemicalWizardry.tabBloodMagic); setCreativeTab(AlchemicalWizardry.tabBloodMagic);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodPack");
}
@Override @Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{ {
@ -54,12 +41,6 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl
par3List.add(StatCollector.translateToLocal("tooltip.lp.storedlp") + " " + this.getStoredLP(par1ItemStack)); par3List.add(StatCollector.translateToLocal("tooltip.lp.storedlp") + " " + this.getStoredLP(par1ItemStack));
} }
} }
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1)
{
return this.plateIcon;
}
@Override @Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
@ -84,11 +65,9 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl
{ {
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
{ {
int x = movingobjectposition.blockX; BlockPos pos = movingobjectposition.func_178782_a();
int y = movingobjectposition.blockY;
int z = movingobjectposition.blockZ;
TileEntity tile = world.getTileEntity(x, y, z); TileEntity tile = world.getTileEntity(pos);
if (!(tile instanceof TEAltar)) if (!(tile instanceof TEAltar))
{ {
@ -106,7 +85,7 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl
amount -= filledAmount; amount -= filledAmount;
this.setStoredLP(itemStack, amount); this.setStoredLP(itemStack, amount);
world.markBlockForUpdate(x, y, z); world.markBlockForUpdate(pos);
} }
} }
} }

View file

@ -1,19 +1,17 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import java.util.List;
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.DimensionManager;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import java.util.List; import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock;
public class ItemComplexSpellCrystal extends EnergyItems public class ItemComplexSpellCrystal extends EnergyItems
{ {
@ -24,13 +22,6 @@ public class ItemComplexSpellCrystal extends EnergyItems
setCreativeTab(AlchemicalWizardry.tabBloodMagic); setCreativeTab(AlchemicalWizardry.tabBloodMagic);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ComplexCrystal");
}
@Override @Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{ {
@ -65,7 +56,7 @@ public class ItemComplexSpellCrystal extends EnergyItems
if (world != null) if (world != null)
{ {
NBTTagCompound itemTag = par1ItemStack.getTagCompound(); NBTTagCompound itemTag = par1ItemStack.getTagCompound();
TileEntity tileEntity = world.getTileEntity(itemTag.getInteger("xCoord"), itemTag.getInteger("yCoord"), itemTag.getInteger("zCoord")); TileEntity tileEntity = world.getTileEntity(new BlockPos(itemTag.getInteger("xCoord"), itemTag.getInteger("yCoord"), itemTag.getInteger("zCoord")));
if (tileEntity instanceof TESpellParadigmBlock) if (tileEntity instanceof TESpellParadigmBlock)
{ {

View file

@ -1,26 +1,21 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import java.util.List; import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
public class ItemComponents extends Item public class ItemComponents extends Item
{ {
private static final String[] ITEM_NAMES = new String[]{"QuartzRod", "EmptyCore", "MagicalesCable", "WoodBrace", "StoneBrace", "ProjectileCore", "SelfCore", "MeleeCore", "ParadigmBackPlate", "OutputCable", "FlameCore", "IcyCore", "GustCore", "EarthenCore", "InputCable", "CrackedRunicPlate", "RunicPlate", "ScribedRunicPlate", "DefaultCore", "OffensiveCore", "DefensiveCore", "EnvironmentalCore", "PowerCore", "CostCore", "PotencyCore", "ObsidianBrace", "ToolCore", "EtherealSlate", "LifeShard", "SoulShard", "SoulRunicPlate", "LifeBrace", "EnderShard"}; private static final String[] ITEM_NAMES = new String[]{"QuartzRod", "EmptyCore", "MagicalesCable", "WoodBrace", "StoneBrace", "ProjectileCore", "SelfCore", "MeleeCore", "ParadigmBackPlate", "OutputCable", "FlameCore", "IcyCore", "GustCore", "EarthenCore", "InputCable", "CrackedRunicPlate", "RunicPlate", "ScribedRunicPlate", "DefaultCore", "OffensiveCore", "DefensiveCore", "EnvironmentalCore", "PowerCore", "CostCore", "PotencyCore", "ObsidianBrace", "ToolCore", "EtherealSlate", "LifeShard", "SoulShard", "SoulRunicPlate", "LifeBrace", "EnderShard"};
@SideOnly(Side.CLIENT)
private IIcon[] icons;
public ItemComponents() public ItemComponents()
{ {
super(); super();
@ -29,18 +24,6 @@ public class ItemComponents extends Item
this.hasSubtypes = true; this.hasSubtypes = true;
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
icons = new IIcon[ITEM_NAMES.length];
for (int i = 0; i < ITEM_NAMES.length; ++i)
{
icons[i] = iconRegister.registerIcon("AlchemicalWizardry:" + "baseItem" + ITEM_NAMES[i]);
}
}
@Override @Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{ {
@ -55,14 +38,6 @@ public class ItemComponents extends Item
return ("" + "item.bloodMagicBaseItem." + ITEM_NAMES[meta]); return ("" + "item.bloodMagicBaseItem." + ITEM_NAMES[meta]);
} }
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int meta)
{
int j = MathHelper.clamp_int(meta, 0, ITEM_NAMES.length - 1);
return icons[j];
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubItems(Item id, CreativeTabs creativeTab, List list) public void getSubItems(Item id, CreativeTabs creativeTab, List list)

View file

@ -1,12 +1,7 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import java.util.List;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
@ -16,8 +11,12 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.fml.relauncher.Side;
import java.util.List; import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
public class ItemDiabloKey extends EnergyItems public class ItemDiabloKey extends EnergyItems
{ {
@ -30,13 +29,6 @@ public class ItemDiabloKey extends EnergyItems
this.hasSubtypes = true; this.hasSubtypes = true;
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DiabloKey");
}
@Override @Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{ {

View file

@ -2,32 +2,27 @@ package WayofTime.alchemicalWizardry.common.items;
import java.util.List; import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.items.ShapelessBloodOrbRecipe; import WayofTime.alchemicalWizardry.api.items.ShapelessBloodOrbRecipe;
import WayofTime.alchemicalWizardry.api.sacrifice.IIncense; import WayofTime.alchemicalWizardry.api.sacrifice.IIncense;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemIncense extends Item implements IIncense public class ItemIncense extends Item implements IIncense
{ {
private static final String[] ITEM_NAMES = new String[]{"Woodash", "Byrrus", "Livens", "Viridis", "Purpura"}; private static final String[] ITEM_NAMES = new String[]{"Woodash", "Byrrus", "Livens", "Viridis", "Purpura"};
@SideOnly(Side.CLIENT)
private IIcon[] icons;
public ItemIncense() public ItemIncense()
{ {
super(); super();
@ -36,26 +31,6 @@ public class ItemIncense extends Item implements IIncense
this.hasSubtypes = true; this.hasSubtypes = true;
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
icons = new IIcon[ITEM_NAMES.length];
IIcon baseIcon = iconRegister.registerIcon("AlchemicalWizardry:" + "baseIncenseItem");
for (int i = 0; i < ITEM_NAMES.length; ++i)
{
if(this.doesIncenseHaveUniqueTexture(i))
{
icons[i] = iconRegister.registerIcon("AlchemicalWizardry:" + "baseIncenseItem" + ITEM_NAMES[i]);
}else
{
icons[i] = baseIcon;
}
}
}
@Override @Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
{ {
@ -69,14 +44,6 @@ public class ItemIncense extends Item implements IIncense
return ("" + "item.bloodMagicIncenseItem." + ITEM_NAMES[meta]); return ("" + "item.bloodMagicIncenseItem." + ITEM_NAMES[meta]);
} }
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int meta)
{
int j = MathHelper.clamp_int(meta, 0, ITEM_NAMES.length - 1);
return icons[j];
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubItems(Item id, CreativeTabs creativeTab, List list) public void getSubItems(Item id, CreativeTabs creativeTab, List list)

View file

@ -1,14 +1,11 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.entity.mob.MailOrderEntityItem; import WayofTime.alchemicalWizardry.common.entity.mob.MailOrderEntityItem;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemMailOrderCatalogue extends Item public class ItemMailOrderCatalogue extends Item
{ {
@ -18,13 +15,6 @@ public class ItemMailOrderCatalogue extends Item
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MailOrder");
}
@Override @Override
public boolean hasCustomEntity(ItemStack stack) public boolean hasCustomEntity(ItemStack stack)
{ {

View file

@ -1,21 +1,20 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.ModBlocks;
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
import WayofTime.alchemicalWizardry.api.rituals.Rituals; import WayofTime.alchemicalWizardry.api.rituals.Rituals;
import WayofTime.alchemicalWizardry.common.block.BlockRitualStone; import WayofTime.alchemicalWizardry.common.block.BlockRitualStone;
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import java.util.List;
public class ItemRitualDismantler extends EnergyItems public class ItemRitualDismantler extends EnergyItems
{ {
@ -26,13 +25,6 @@ public class ItemRitualDismantler extends EnergyItems
setCreativeTab(AlchemicalWizardry.tabBloodMagic); setCreativeTab(AlchemicalWizardry.tabBloodMagic);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ritual_dismantler");
}
@Override @Override
public void addInformation(ItemStack stack, EntityPlayer player, List par3List, boolean x) public void addInformation(ItemStack stack, EntityPlayer player, List par3List, boolean x)
{ {
@ -42,15 +34,15 @@ public class ItemRitualDismantler extends EnergyItems
} }
@Override @Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
{ {
return EnergyItems.checkAndSetItemOwner(stack, player) && breakRitualStoneAtMasterStone(stack, player, world, x, y, z); return EnergyItems.checkAndSetItemOwner(stack, player) && breakRitualStoneAtMasterStone(stack, player, world, pos);
} }
public boolean breakRitualStoneAtMasterStone(ItemStack stack, EntityPlayer player, World world, int x, int y, int z) public boolean breakRitualStoneAtMasterStone(ItemStack stack, EntityPlayer player, World world, BlockPos pos)
{ {
ItemStack[] playerInventory = player.inventory.mainInventory; ItemStack[] playerInventory = player.inventory.mainInventory;
TileEntity tileEntity = world.getTileEntity(x, y, z); TileEntity tileEntity = world.getTileEntity(pos);
if (tileEntity instanceof TEMasterStone) if (tileEntity instanceof TEMasterStone)
{ {
@ -75,17 +67,18 @@ public class ItemRitualDismantler extends EnergyItems
for (RitualComponent rc : ritualList) for (RitualComponent rc : ritualList)
{ {
if (!world.isAirBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction)) && world.getBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction)) instanceof BlockRitualStone) BlockPos newPos = pos.add(rc.getX(direction), rc.getY(), rc.getZ(direction));
if (!world.isAirBlock(newPos) && world.getBlockState(newPos).getBlock() instanceof BlockRitualStone)
{ {
if (freeSpace >= 0) if (freeSpace >= 0)
{ {
if (EnergyItems.syphonBatteries(stack, player, getEnergyUsed()) || player.capabilities.isCreativeMode) if (EnergyItems.syphonBatteries(stack, player, getEnergyUsed()) || player.capabilities.isCreativeMode)
{ {
world.setBlockToAir(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction)); world.setBlockToAir(newPos);
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.ritualStone)); player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.ritualStone));
if (world.isRemote) if (world.isRemote)
{ {
world.playAuxSFX(2005, x, y + 1, z, 0); world.playAuxSFX(2005, pos.offsetUp(), 0);
return true; return true;
} }

View file

@ -3,7 +3,7 @@ package WayofTime.alchemicalWizardry.common.items;
import java.util.List; import java.util.List;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@ -12,11 +12,15 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.IChatComponent; import net.minecraft.util.IChatComponent;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
@ -29,8 +33,6 @@ import WayofTime.alchemicalWizardry.api.rituals.IRitualStone;
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
import WayofTime.alchemicalWizardry.api.rituals.Rituals; import WayofTime.alchemicalWizardry.api.rituals.Rituals;
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
{ {
@ -46,13 +48,6 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
this.hasSubtypes = true; this.hasSubtypes = true;
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:RitualDiviner");
}
@Override @Override
public void addInformation(ItemStack stack, EntityPlayer player, List par3List, boolean x) public void addInformation(ItemStack stack, EntityPlayer player, List par3List, boolean x)
{ {
@ -166,15 +161,15 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
} }
@Override @Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
{ {
if (!EnergyItems.checkAndSetItemOwner(stack, player)) return false; if (!EnergyItems.checkAndSetItemOwner(stack, player)) return false;
if(placeRitualStoneAtMasterStone(stack, player, world, x, y, z)) if(placeRitualStoneAtMasterStone(stack, player, world, pos))
{ {
this.setStoredLocation(stack, new Int3(x, y, z)); this.setStoredLocation(stack, new Int3(pos));
return true; return true;
}else if(!(world.getBlock(x, y, z) instanceof IRitualStone || world.getBlock(x, y, z) instanceof IMasterRitualStone) && !player.isSneaking()) }else if(!(world.getBlockState(pos).getBlock() instanceof IRitualStone || world.getBlockState(pos).getBlock() instanceof IMasterRitualStone) && !player.isSneaking())
{ {
if(world.isRemote) if(world.isRemote)
{ {
@ -188,12 +183,12 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
return false; return false;
} }
public boolean placeRitualStoneAtMasterStone(ItemStack stack, EntityPlayer player, World world, int x, int y, int z) public boolean placeRitualStoneAtMasterStone(ItemStack stack, EntityPlayer player, World world, BlockPos pos)
{ {
int direction = this.getDirection(stack); int direction = this.getDirection(stack);
ItemStack[] playerInventory = player.inventory.mainInventory; ItemStack[] playerInventory = player.inventory.mainInventory;
TileEntity tileEntity = world.getTileEntity(x, y, z); TileEntity tileEntity = world.getTileEntity(pos);
if (tileEntity instanceof TEMasterStone) if (tileEntity instanceof TEMasterStone)
{ {
@ -221,13 +216,15 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
for (RitualComponent rc : ritualList) for (RitualComponent rc : ritualList)
{ {
if (world.isAirBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction))) BlockPos newPos = pos.add(rc.getX(direction), rc.getY(), rc.getZ(direction));
if (world.isAirBlock(newPos))
{ {
if (playerInvRitualStoneLocation >= 0 || player.capabilities.isCreativeMode) if (playerInvRitualStoneLocation >= 0 || player.capabilities.isCreativeMode)
{ {
if (rc.getStoneType() > this.maxMetaData + this.getMaxRuneDisplacement(stack)) if (rc.getStoneType() > this.maxMetaData + this.getMaxRuneDisplacement(stack))
{ {
world.playAuxSFX(200, x, y + 1, z, 0); world.playAuxSFX(200, newPos.offsetUp(), 0);
return true; return true;
} }
@ -238,11 +235,11 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
if(EnergyItems.syphonBatteries(stack, player, getEnergyUsed())) if(EnergyItems.syphonBatteries(stack, player, getEnergyUsed()))
{ {
world.setBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction), ModBlocks.ritualStone, rc.getStoneType(), 3); world.setBlockState(newPos, ModBlocks.ritualStone.getStateFromMeta(rc.getStoneType()), 3);
if (world.isRemote) if (world.isRemote)
{ {
world.playAuxSFX(2005, x, y + 1, z, 0); world.playAuxSFX(2005, newPos.offsetUp(), 0);
return true; return true;
} }
@ -252,29 +249,29 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
} }
} else } else
{ {
Block block = world.getBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction)); IBlockState state = world.getBlockState(newPos);
Block block = state.getBlock();
if (block == ModBlocks.ritualStone) if (block == ModBlocks.ritualStone)
{ {
int metadata = world.getBlockMetadata(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction)); int metadata = block.getMetaFromState(state);
if (metadata != rc.getStoneType()) if (metadata != rc.getStoneType())
{ {
if(EnergyItems.syphonBatteries(stack, player, getEnergyUsed())) if(EnergyItems.syphonBatteries(stack, player, getEnergyUsed()))
{ {
if (rc.getStoneType() > this.maxMetaData + this.getMaxRuneDisplacement(stack)) if (rc.getStoneType() > this.maxMetaData + this.getMaxRuneDisplacement(stack))
{ {
world.playAuxSFX(200, x, y + 1, z, 0); world.playAuxSFX(200, newPos.offsetUp(), 0);
return true; return true;
} }
world.setBlockMetadataWithNotify(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction), rc.getStoneType(), 3); world.setBlockState(newPos, ModBlocks.ritualStone.getStateFromMeta(rc.getStoneType()), 3);
return true; return true;
} }
} }
} else } else
{ {
world.playAuxSFX(0, x, y + 1, z, 0); world.playAuxSFX(0, newPos.offsetUp(), 0);
return true; return true;
} }
} }
@ -295,7 +292,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
int y = loc.yCoord; int y = loc.yCoord;
int z = loc.zCoord; int z = loc.zCoord;
if(!this.placeRitualStoneAtMasterStone(stack, (EntityPlayer)entity, world, x, y, z)) if(!this.placeRitualStoneAtMasterStone(stack, (EntityPlayer)entity, world, new BlockPos(x, y, z)))
{ {
this.voidStoredLocation(stack); this.voidStoredLocation(stack);
} }

View file

@ -2,18 +2,13 @@ package WayofTime.alchemicalWizardry.common.items;
import java.util.List; import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.WorldProvider;
import net.minecraftforge.common.DimensionManager;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class LavaCrystal extends EnergyItems public class LavaCrystal extends EnergyItems
{ {
@ -26,13 +21,6 @@ public class LavaCrystal extends EnergyItems
setEnergyUsed(25); setEnergyUsed(25);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:LavaCrystal");
}
/* /*
* Used to have the item contain itself. * Used to have the item contain itself.
*/ */
@ -83,22 +71,7 @@ public class LavaCrystal extends EnergyItems
return false; return false;
} }
// World world = MinecraftServer.getServer().worldServers[0]; if (SoulNetworkHandler.getCurrentEssence(ownerName) >= this.getEnergyUsed())
WorldProvider provider = DimensionManager.getProvider(0);
if(provider == null || provider.worldObj == null)
{
return false;
}
World world = provider.worldObj;
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
if (data == null)
{
data = new LifeEssenceNetwork(ownerName);
world.setItemData(ownerName, data);
}
if (data.currentEssence >= this.getEnergyUsed())
{ {
return true; return true;
} }

View file

@ -1,9 +1,6 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemBucket; import net.minecraft.item.ItemBucket;
public class LifeBucket extends ItemBucket public class LifeBucket extends ItemBucket
@ -12,11 +9,4 @@ public class LifeBucket extends ItemBucket
{ {
super(block); super(block);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:LifeBucket");
}
} }

View file

@ -1,8 +1,5 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
public class MagicianBloodOrb extends EnergyBattery public class MagicianBloodOrb extends EnergyBattery
{ {
@ -11,11 +8,4 @@ public class MagicianBloodOrb extends EnergyBattery
super(damage); super(damage);
orbLevel = 3; orbLevel = 3;
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MagicianBloodOrb");
}
} }

View file

@ -1,8 +1,5 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
public class MasterBloodOrb extends EnergyBattery public class MasterBloodOrb extends EnergyBattery
{ {
@ -11,11 +8,4 @@ public class MasterBloodOrb extends EnergyBattery
super(damage); super(damage);
orbLevel = 4; orbLevel = 4;
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MasterBloodOrb");
}
} }

View file

@ -1,8 +1,5 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -21,13 +18,6 @@ public class OrbOfTesting extends EnergyItems
this.setEnergyUsed(100); this.setEnergyUsed(100);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Untitled");
}
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{ {
if (!par3EntityPlayer.shouldHeal()) if (!par3EntityPlayer.shouldHeal())

View file

@ -1,15 +1,12 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import cpw.mods.fml.relauncher.Side; import java.util.List;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import java.util.List;
public class ReinforcedTelepositionFocus extends TelepositionFocus public class ReinforcedTelepositionFocus extends TelepositionFocus
{ {
public ReinforcedTelepositionFocus() public ReinforcedTelepositionFocus()
@ -17,13 +14,6 @@ public class ReinforcedTelepositionFocus extends TelepositionFocus
super(3); super(3);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ReinforcedTeleposerFocus");
}
@Override @Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{ {

View file

@ -2,7 +2,6 @@ package WayofTime.alchemicalWizardry.common.items;
import java.util.List; import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction; import net.minecraft.item.EnumAction;
@ -10,18 +9,20 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.event.SacrificeKnifeUsedEvent; import WayofTime.alchemicalWizardry.api.event.SacrificeKnifeUsedEvent;
import WayofTime.alchemicalWizardry.api.sacrifice.PlayerSacrificeHandler; import WayofTime.alchemicalWizardry.api.sacrifice.PlayerSacrificeHandler;
import WayofTime.alchemicalWizardry.api.tile.IBloodAltar; import WayofTime.alchemicalWizardry.api.tile.IBloodAltar;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class SacrificialDagger extends Item public class SacrificialDagger extends Item
{ {
@ -33,19 +34,6 @@ public class SacrificialDagger extends Item
setFull3D(); setFull3D();
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
if (AlchemicalWizardry.wimpySettings)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
} else
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SacrificialDagger");
}
}
@Override @Override
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{ {
@ -85,7 +73,7 @@ public class SacrificialDagger extends Item
@Override @Override
public EnumAction getItemUseAction(ItemStack stack) public EnumAction getItemUseAction(ItemStack stack)
{ {
return EnumAction.bow; return EnumAction.BOW;
} }
@Override @Override
@ -132,7 +120,7 @@ public class SacrificialDagger extends Item
for (int l = 0; l < 8; ++l) for (int l = 0; l < 8; ++l)
{ {
world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); world.spawnParticle(EnumParticleTypes.REDSTONE, posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
} }
if (!world.isRemote && SpellHelper.isFakePlayer(world, player)) if (!world.isRemote && SpellHelper.isFakePlayer(world, player))
@ -158,10 +146,8 @@ public class SacrificialDagger extends Item
public void findAndFillAltar(World world, EntityPlayer player, int amount) public void findAndFillAltar(World world, EntityPlayer player, int amount)
{ {
int posX = (int) Math.round(player.posX - 0.5f); BlockPos pos = player.getPosition();
int posY = (int) player.posY; IBloodAltar altarEntity = getAltar(world, pos);
int posZ = (int) Math.round(player.posZ - 0.5f);
IBloodAltar altarEntity = getAltar(world, posX, posY, posZ);
if (altarEntity == null) if (altarEntity == null)
{ {
@ -172,7 +158,7 @@ public class SacrificialDagger extends Item
altarEntity.startCycle(); altarEntity.startCycle();
} }
public IBloodAltar getAltar(World world, int x, int y, int z) public IBloodAltar getAltar(World world, BlockPos pos)
{ {
TileEntity tileEntity; TileEntity tileEntity;
@ -182,7 +168,8 @@ public class SacrificialDagger extends Item
{ {
for (int k = -2; k <= 1; k++) for (int k = -2; k <= 1; k++)
{ {
tileEntity = world.getTileEntity(i + x, k + y, j + z); BlockPos newPos = pos.add(i, j, k);
tileEntity = world.getTileEntity(newPos);
if(tileEntity instanceof IBloodAltar) if(tileEntity instanceof IBloodAltar)
{ {
@ -240,8 +227,8 @@ public class SacrificialDagger extends Item
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack stack, int pass) public boolean hasEffect(ItemStack stack)
{ {
return this.canUseForSacrifice(stack) || super.hasEffect(stack, pass); return this.canUseForSacrifice(stack) || super.hasEffect(stack);
} }
} }

View file

@ -2,7 +2,6 @@ package WayofTime.alchemicalWizardry.common.items;
import java.util.List; import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
@ -11,8 +10,6 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.DimensionManager;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class TelepositionFocus extends EnergyItems public class TelepositionFocus extends EnergyItems
{ {
@ -26,13 +23,6 @@ public class TelepositionFocus extends EnergyItems
this.focusLevel = focusLevel; this.focusLevel = focusLevel;
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:TeleposerFocus");
}
@Override @Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{ {

View file

@ -1,8 +1,5 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
public class TranscendentBloodOrb extends EnergyBattery public class TranscendentBloodOrb extends EnergyBattery
{ {
@ -11,11 +8,4 @@ public class TranscendentBloodOrb extends EnergyBattery
super(damage); super(damage);
orbLevel = 6; orbLevel = 6;
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:TranscendentBloodOrb");
}
} }

View file

@ -1,9 +1,6 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
public class WaterScribeTool extends ScribeTool public class WaterScribeTool extends ScribeTool
{ {
@ -12,11 +9,4 @@ public class WaterScribeTool extends ScribeTool
super(1); super(1);
setCreativeTab(AlchemicalWizardry.tabBloodMagic); setCreativeTab(AlchemicalWizardry.tabBloodMagic);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WaterScribeTool");
}
} }

View file

@ -2,19 +2,19 @@ package WayofTime.alchemicalWizardry.common.items.sigil;
import java.util.List; import java.util.List;
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import cpw.mods.fml.relauncher.Side; import codechicken.lib.render.TextureUtils.IIconRegister;
import cpw.mods.fml.relauncher.SideOnly;
public class SigilAir extends EnergyItems implements ArmourUpgrade, ISigil public class SigilAir extends EnergyItems implements ArmourUpgrade, ISigil
{ {

View file

@ -1,12 +1,12 @@
package WayofTime.alchemicalWizardry.common.items.sigil.holding; package WayofTime.alchemicalWizardry.common.items.sigil.holding;
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
import cpw.mods.fml.common.FMLCommonHandler;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container; import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot; import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.FMLCommonHandler;
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
public class ContainerHolding extends Container public class ContainerHolding extends Container
{ {

View file

@ -1,10 +1,11 @@
package WayofTime.alchemicalWizardry.common.items.sigil.holding; package WayofTime.alchemicalWizardry.common.items.sigil.holding;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)

View file

@ -1,8 +1,8 @@
package WayofTime.alchemicalWizardry.common.items.sigil.holding; package WayofTime.alchemicalWizardry.common.items.sigil.holding;
import cpw.mods.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import cpw.mods.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
public class HoldingPacketHandler public class HoldingPacketHandler
{ {

View file

@ -1,10 +1,10 @@
package WayofTime.alchemicalWizardry.common.items.sigil.holding; package WayofTime.alchemicalWizardry.common.items.sigil.holding;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
public class HoldingPacketProcessor implements IMessage, IMessageHandler<HoldingPacketProcessor, IMessage> public class HoldingPacketProcessor implements IMessage, IMessageHandler<HoldingPacketProcessor, IMessage>
{ {

View file

@ -6,9 +6,9 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.client.event.MouseEvent; import net.minecraftforge.client.event.MouseEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class ScrollHelper public class ScrollHelper

View file

@ -2,20 +2,19 @@ package WayofTime.alchemicalWizardry.common.items.sigil.holding;
import java.util.List; import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import cpw.mods.fml.relauncher.Side; import codechicken.lib.render.TextureUtils.IIconRegister;
import cpw.mods.fml.relauncher.SideOnly;
public class SigilOfHolding extends EnergyItems public class SigilOfHolding extends EnergyItems
{ {

View file

@ -1,12 +1,13 @@
package WayofTime.alchemicalWizardry.common.potion; package WayofTime.alchemicalWizardry.common.potion;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
public class PotionAmphibian extends Potion public class PotionAmphibian extends Potion
{ {
public PotionAmphibian(int par1, boolean par2, int par3) public PotionAmphibian(int par1, boolean par2, int par3)
{ {
super(par1, par2, par3); super(par1, new ResourceLocation("speed"), par2, par3);
} }
@Override @Override

View file

@ -1,12 +1,13 @@
package WayofTime.alchemicalWizardry.common.potion; package WayofTime.alchemicalWizardry.common.potion;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
public class PotionBoost extends Potion public class PotionBoost extends Potion
{ {
public PotionBoost(int par1, boolean par2, int par3) public PotionBoost(int par1, boolean par2, int par3)
{ {
super(par1, par2, par3); super(par1, new ResourceLocation("speed"),par2, par3);
} }
@Override @Override

View file

@ -1,12 +1,13 @@
package WayofTime.alchemicalWizardry.common.potion; package WayofTime.alchemicalWizardry.common.potion;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
public class PotionDeaf extends Potion public class PotionDeaf extends Potion
{ {
public PotionDeaf(int par1, boolean par2, int par3) public PotionDeaf(int par1, boolean par2, int par3)
{ {
super(par1, par2, par3); super(par1, new ResourceLocation("speed"),par2, par3);
} }
@Override @Override

View file

@ -1,12 +1,13 @@
package WayofTime.alchemicalWizardry.common.potion; package WayofTime.alchemicalWizardry.common.potion;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
public class PotionDemonCloak extends Potion public class PotionDemonCloak extends Potion
{ {
public PotionDemonCloak(int par1, boolean par2, int par3) public PotionDemonCloak(int par1, boolean par2, int par3)
{ {
super(par1, par2, par3); super(par1, new ResourceLocation("speed"),par2, par3);
} }
@Override @Override

View file

@ -1,12 +1,13 @@
package WayofTime.alchemicalWizardry.common.potion; package WayofTime.alchemicalWizardry.common.potion;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
public class PotionDrowning extends Potion public class PotionDrowning extends Potion
{ {
public PotionDrowning(int par1, boolean par2, int par3) public PotionDrowning(int par1, boolean par2, int par3)
{ {
super(par1, par2, par3); super(par1, new ResourceLocation("speed"),par2, par3);
} }
@Override @Override

View file

@ -1,12 +1,13 @@
package WayofTime.alchemicalWizardry.common.potion; package WayofTime.alchemicalWizardry.common.potion;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
public class PotionFeatherFall extends Potion public class PotionFeatherFall extends Potion
{ {
public PotionFeatherFall(int par1, boolean par2, int par3) public PotionFeatherFall(int par1, boolean par2, int par3)
{ {
super(par1, par2, par3); super(par1, new ResourceLocation("speed"),par2, par3);
} }
@Override @Override

View file

@ -1,12 +1,13 @@
package WayofTime.alchemicalWizardry.common.potion; package WayofTime.alchemicalWizardry.common.potion;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
public class PotionFireFuse extends Potion public class PotionFireFuse extends Potion
{ {
public PotionFireFuse(int par1, boolean par2, int par3) public PotionFireFuse(int par1, boolean par2, int par3)
{ {
super(par1, par2, par3); super(par1, new ResourceLocation("speed"),par2, par3);
} }
@Override @Override

View file

@ -1,12 +1,13 @@
package WayofTime.alchemicalWizardry.common.potion; package WayofTime.alchemicalWizardry.common.potion;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
public class PotionFlameCloak extends Potion public class PotionFlameCloak extends Potion
{ {
public PotionFlameCloak(int par1, boolean par2, int par3) public PotionFlameCloak(int par1, boolean par2, int par3)
{ {
super(par1, par2, par3); super(par1, new ResourceLocation("speed"),par2, par3);
} }
@Override @Override

View file

@ -1,12 +1,13 @@
package WayofTime.alchemicalWizardry.common.potion; package WayofTime.alchemicalWizardry.common.potion;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
public class PotionFlight extends Potion public class PotionFlight extends Potion
{ {
public PotionFlight(int par1, boolean par2, int par3) public PotionFlight(int par1, boolean par2, int par3)
{ {
super(par1, par2, par3); super(par1, new ResourceLocation("speed"),par2, par3);
} }
@Override @Override

View file

@ -1,12 +1,13 @@
package WayofTime.alchemicalWizardry.common.potion; package WayofTime.alchemicalWizardry.common.potion;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
public class PotionHeavyHeart extends Potion public class PotionHeavyHeart extends Potion
{ {
public PotionHeavyHeart(int par1, boolean par2, int par3) public PotionHeavyHeart(int par1, boolean par2, int par3)
{ {
super(par1, par2, par3); super(par1, new ResourceLocation("speed"),par2, par3);
} }
@Override @Override

View file

@ -1,12 +1,13 @@
package WayofTime.alchemicalWizardry.common.potion; package WayofTime.alchemicalWizardry.common.potion;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
public class PotionIceCloak extends Potion public class PotionIceCloak extends Potion
{ {
public PotionIceCloak(int par1, boolean par2, int par3) public PotionIceCloak(int par1, boolean par2, int par3)
{ {
super(par1, par2, par3); super(par1, new ResourceLocation("speed"),par2, par3);
} }
@Override @Override

View file

@ -1,12 +1,13 @@
package WayofTime.alchemicalWizardry.common.potion; package WayofTime.alchemicalWizardry.common.potion;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
public class PotionInhibit extends Potion public class PotionInhibit extends Potion
{ {
public PotionInhibit(int par1, boolean par2, int par3) public PotionInhibit(int par1, boolean par2, int par3)
{ {
super(par1, par2, par3); super(par1, new ResourceLocation("speed"),par2, par3);
} }
@Override @Override

View file

@ -1,12 +1,13 @@
package WayofTime.alchemicalWizardry.common.potion; package WayofTime.alchemicalWizardry.common.potion;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
public class PotionPlanarBinding extends Potion public class PotionPlanarBinding extends Potion
{ {
public PotionPlanarBinding(int par1, boolean par2, int par3) public PotionPlanarBinding(int par1, boolean par2, int par3)
{ {
super(par1, par2, par3); super(par1, new ResourceLocation("speed"),par2, par3);
} }
@Override @Override

View file

@ -1,12 +1,13 @@
package WayofTime.alchemicalWizardry.common.potion; package WayofTime.alchemicalWizardry.common.potion;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
public class PotionProjectileProtect extends Potion public class PotionProjectileProtect extends Potion
{ {
public PotionProjectileProtect(int par1, boolean par2, int par3) public PotionProjectileProtect(int par1, boolean par2, int par3)
{ {
super(par1, par2, par3); super(par1, new ResourceLocation("speed"),par2, par3);
} }
@Override @Override

View file

@ -1,12 +1,13 @@
package WayofTime.alchemicalWizardry.common.potion; package WayofTime.alchemicalWizardry.common.potion;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
public class PotionReciprocation extends Potion public class PotionReciprocation extends Potion
{ {
public PotionReciprocation(int par1, boolean par2, int par3) public PotionReciprocation(int par1, boolean par2, int par3)
{ {
super(par1, par2, par3); super(par1, new ResourceLocation("speed"),par2, par3);
} }
@Override @Override

View file

@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.potion;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
import java.util.ArrayList; import java.util.ArrayList;
@ -10,7 +11,7 @@ public class PotionSoulFray extends Potion
{ {
public PotionSoulFray(int par1, boolean par2, int par3) public PotionSoulFray(int par1, boolean par2, int par3)
{ {
super(par1, par2, par3); super(par1, new ResourceLocation("speed"),par2, par3);
} }
@Override @Override

View file

@ -1,12 +1,13 @@
package WayofTime.alchemicalWizardry.common.potion; package WayofTime.alchemicalWizardry.common.potion;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
public class PotionSoulHarden extends Potion public class PotionSoulHarden extends Potion
{ {
public PotionSoulHarden(int par1, boolean par2, int par3) public PotionSoulHarden(int par1, boolean par2, int par3)
{ {
super(par1, par2, par3); super(par1, new ResourceLocation("speed"),par2, par3);
} }
@Override @Override

View file

@ -17,16 +17,16 @@ public class ModelBloodAltar extends ModelBase
{ {
private static final ResourceLocation altar_texture = new ResourceLocation("alchemicalwizardry:textures/models/altar.png"); private static final ResourceLocation altar_texture = new ResourceLocation("alchemicalwizardry:textures/models/altar.png");
private IModelCustom modelBloodAltar; // private IModelCustom modelBloodAltar;
public ModelBloodAltar() public ModelBloodAltar()
{ {
modelBloodAltar = AdvancedModelLoader.loadModel(new ResourceLocation("alchemicalwizardry:models/bloodaltar-fixeUV.obj")); // modelBloodAltar = AdvancedModelLoader.loadModel(new ResourceLocation("alchemicalwizardry:models/bloodaltar-fixeUV.obj"));
} }
public void renderBloodAltar() public void renderBloodAltar()
{ {
modelBloodAltar.renderAll(); // modelBloodAltar.renderAll();
} }
public void renderBloodAltar(TEAltar altar, double x, double y, double z) public void renderBloodAltar(TEAltar altar, double x, double y, double z)