Merge branch 'bloodmagic1.8' of https://github.com/WayofTime/BloodMagic into bloodmagic1.8

This commit is contained in:
Arcaratus 2015-07-30 10:24:44 -04:00
commit 2472cad9f1
266 changed files with 2398 additions and 6083 deletions

View file

@ -108,7 +108,7 @@ public class ModBlocks
public static void init() public static void init()
{ {
blockAltar = (BlockAltar) registerBlock(new BlockAltar(), "altar"); blockAltar = (BlockAltar) registerBlock(new BlockAltar(), "altar");
bloodRune = (BlockBloodRune) registerBlock(new BlockBloodRune(), ItemBloodRuneBlock.class, ModBlocks.bloodRune.getUnlocalizedName()); bloodRune = (BlockBloodRune) registerBlock(new BlockBloodRune(), ItemBloodRuneBlock.class, "base_rune");
speedRune = (BlockSpeedRune) registerBlock(new BlockSpeedRune(), "speed_rune"); speedRune = (BlockSpeedRune) registerBlock(new BlockSpeedRune(), "speed_rune");
efficiencyRune = (BlockEfficiencyRune) registerBlock(new BlockEfficiencyRune(), "efficiency_rune"); efficiencyRune = (BlockEfficiencyRune) registerBlock(new BlockEfficiencyRune(), "efficiency_rune");
runeOfSacrifice = (BlockRuneOfSacrifice) registerBlock(new BlockRuneOfSacrifice(), "sacrifice_rune"); runeOfSacrifice = (BlockRuneOfSacrifice) registerBlock(new BlockRuneOfSacrifice(), "sacrifice_rune");

View file

@ -1,6 +1,7 @@
package WayofTime.alchemicalWizardry.api; package WayofTime.alchemicalWizardry.api;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.BlockPos;
public class Int3 public class Int3
@ -9,6 +10,11 @@ public class Int3
public int yCoord; public int yCoord;
public int zCoord; public int zCoord;
public Int3(BlockPos pos)
{
this(pos.getX(), pos.getY(), pos.getZ());
}
public Int3(int xCoord, int yCoord, int zCoord) public Int3(int xCoord, int yCoord, int zCoord)
{ {
this.xCoord = xCoord; this.xCoord = xCoord;

View file

@ -43,12 +43,6 @@ public class ItemSpellMultiTool extends Item
this.setMaxStackSize(1); this.setMaxStackSize(1);
this.setFull3D(); this.setFull3D();
} }
@Override
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundTool");
}
@Override @Override
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)

View file

@ -11,4 +11,9 @@ public class BlockRenderer
{ {
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation("alchemicalwizardry:" + block.getUnlocalizedName().substring(5), "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation("alchemicalwizardry:" + block.getUnlocalizedName().substring(5), "inventory"));
} }
public static void registerBlocks()
{
}
} }

View file

@ -169,7 +169,7 @@ public class ClientProxy extends CommonProxy
MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockSpellEnhancement), new TESpellEnhancementBlockItemRenderer()); MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockSpellEnhancement), new TESpellEnhancementBlockItemRenderer());
MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockSpellParadigm), new TESpellParadigmBlockItemRenderer()); MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockSpellParadigm), new TESpellParadigmBlockItemRenderer());
MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockSpellModifier), new TESpellModifierBlockItemRenderer()); MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockSpellModifier), new TESpellModifierBlockItemRenderer());
MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockAlchemicCalcinator), new TEAlchemicalCalcinatorItemRenderer()); MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockAlchemicalCalcinator), new TEAlchemicalCalcinatorItemRenderer());
MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockCrystalBelljar), new TEBellJarItemRenderer()); MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockCrystalBelljar), new TEBellJarItemRenderer());
ShaderHelper.initShaders(); ShaderHelper.initShaders();
} }

View file

@ -1,25 +1,49 @@
package WayofTime.alchemicalWizardry.common.block; package WayofTime.alchemicalWizardry.common.block;
import WayofTime.alchemicalWizardry.ModBlocks; 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.block.properties.IProperty;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
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.ModBlocks;
import java.util.List;
public class BlockBloodRune extends Block public class BlockBloodRune extends Block
{ {
public static final PropertyInteger INTEGER = PropertyInteger.create("rune", 0, 5);
public BlockBloodRune() public BlockBloodRune()
{ {
super(Material.iron); super(Material.iron);
this.setDefaultState(this.blockState.getBaseState().withProperty(INTEGER, Integer.valueOf(0)));
setHardness(2.0F); setHardness(2.0F);
setResistance(5.0F); setResistance(5.0F);
} }
@Override
protected BlockState createBlockState()
{
return new BlockState(this, new IProperty[] {INTEGER});
}
@Override
public IBlockState getStateFromMeta(int meta)
{
return this.getDefaultState().withProperty(INTEGER, Integer.valueOf(meta));
}
@Override
public int getMetaFromState(IBlockState state)
{
return ((Integer)state.getValue(INTEGER)).intValue();
}
public int getRuneEffect(int metaData) public int getRuneEffect(int metaData)
{ {

View file

@ -8,10 +8,11 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.omega.IEnchantmentGlyph;
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.omega.IEnchantmentGlyph;
public class BlockEnchantmentGlyph extends Block implements IEnchantmentGlyph public class BlockEnchantmentGlyph extends Block implements IEnchantmentGlyph
{ {
@ -23,7 +24,7 @@ public class BlockEnchantmentGlyph extends Block implements IEnchantmentGlyph
} }
@Override @Override
public int getAdditionalStabilityForFaceCount(World world, int x, int y, int z, int meta, int faceCount) public int getAdditionalStabilityForFaceCount(World world, BlockPos pos, int meta, int faceCount)
{ {
switch(meta) switch(meta)
{ {
@ -37,7 +38,7 @@ public class BlockEnchantmentGlyph extends Block implements IEnchantmentGlyph
} }
@Override @Override
public int getEnchantability(World world, int x, int y, int z, int meta) public int getEnchantability(World world, BlockPos pos, int meta)
{ {
switch(meta) switch(meta)
{ {
@ -49,7 +50,7 @@ public class BlockEnchantmentGlyph extends Block implements IEnchantmentGlyph
} }
@Override @Override
public int getEnchantmentLevel(World world, int x, int y, int z, int meta) public int getEnchantmentLevel(World world, BlockPos pos, int meta)
{ {
switch(meta) switch(meta)
{ {

View file

@ -7,10 +7,11 @@ import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.omega.IStabilityGlyph;
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.omega.IStabilityGlyph;
public class BlockStabilityGlyph extends Block implements IStabilityGlyph public class BlockStabilityGlyph extends Block implements IStabilityGlyph
{ {
@ -22,7 +23,7 @@ public class BlockStabilityGlyph extends Block implements IStabilityGlyph
} }
@Override @Override
public int getAdditionalStabilityForFaceCount(World world, int x, int y, int z, int meta, int faceCount) public int getAdditionalStabilityForFaceCount(World world, BlockPos pos, int meta, int faceCount)
{ {
switch(meta) switch(meta)
{ {

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,12 +1,15 @@
package WayofTime.alchemicalWizardry.common.entity.projectile; package WayofTime.alchemicalWizardry.common.entity.projectile;
import WayofTime.alchemicalWizardry.ModBlocks;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.util.BlockPos;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.ModBlocks;
public class EntityBloodLightProjectile extends EnergyBlastProjectile public class EntityBloodLightProjectile extends EnergyBlastProjectile
@ -55,39 +58,12 @@ public class EntityBloodLightProjectile extends EnergyBlastProjectile
this.onImpact(mop.entityHit); this.onImpact(mop.entityHit);
} else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
{ {
int sideHit = mop.sideHit; EnumFacing facing = mop.field_178784_b;
int blockX = mop.blockX; BlockPos position = mop.func_178782_a().offset(facing);
int blockY = mop.blockY;
int blockZ = mop.blockZ; if(this.worldObj.isAirBlock(position))
if (sideHit == 0 && this.worldObj.isAirBlock(blockX, blockY - 1, blockZ))
{ {
this.worldObj.setBlock(blockX, blockY - 1, blockZ, ModBlocks.blockBloodLight); this.worldObj.setBlockState(position, ModBlocks.blockBloodLight.getDefaultState());
}
if (sideHit == 1 && this.worldObj.isAirBlock(blockX, blockY + 1, blockZ))
{
this.worldObj.setBlock(blockX, blockY + 1, blockZ, ModBlocks.blockBloodLight);
}
if (sideHit == 2 && this.worldObj.isAirBlock(blockX, blockY, blockZ - 1))
{
this.worldObj.setBlock(blockX, blockY, blockZ - 1, ModBlocks.blockBloodLight);
}
if (sideHit == 3 && this.worldObj.isAirBlock(blockX, blockY, blockZ + 1))
{
this.worldObj.setBlock(blockX, blockY, blockZ + 1, ModBlocks.blockBloodLight);
}
if (sideHit == 4 && this.worldObj.isAirBlock(blockX - 1, blockY, blockZ))
{
this.worldObj.setBlock(blockX - 1, blockY, blockZ, ModBlocks.blockBloodLight);
}
if (sideHit == 5 && this.worldObj.isAirBlock(blockX + 1, blockY, blockZ))
{
this.worldObj.setBlock(blockX + 1, blockY, blockZ, ModBlocks.blockBloodLight);
} }
} }
@ -110,12 +86,13 @@ public class EntityBloodLightProjectile extends EnergyBlastProjectile
} }
} }
if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ)) BlockPos pos = new BlockPos(this.posX, this.posY, this.posZ);
if (worldObj.isAirBlock(pos))
{ {
worldObj.setBlock((int) this.posX, (int) this.posY, (int) this.posZ, Blocks.fire); worldObj.setBlockState(pos, Blocks.fire.getDefaultState());
} }
spawnHitParticles("magicCrit", 8); spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8);
this.setDead(); this.setDead();
} }
} }

View file

@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.entity.projectile;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -76,7 +77,7 @@ public class EntityEnergyBazookaMainProjectile extends EnergyBlastProjectile
worldObj.createExplosion(this.shootingEntity, this.posX, this.posY, this.posZ, (float) (5.0f), false); worldObj.createExplosion(this.shootingEntity, this.posX, this.posY, this.posZ, (float) (5.0f), false);
} }
spawnHitParticles("magicCrit", 8); spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8);
this.setDead(); this.setDead();
} }

View file

@ -4,20 +4,23 @@ 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;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
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.EnumFacing;
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;
import net.minecraft.world.World; import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraftforge.fml.relauncher.Side;
import cpw.mods.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly;
import cpw.mods.fml.relauncher.SideOnly;
public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectile implements IProjectile public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectile implements IProjectile
{ {
@ -48,7 +51,6 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
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.damage = damage; this.damage = damage;
} }
@ -63,7 +65,6 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
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);
@ -102,18 +103,6 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
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)
/** /**
@ -180,28 +169,21 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
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;
@ -213,19 +195,19 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
} }
} }
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;
@ -237,7 +219,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
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)
@ -278,8 +260,8 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
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));
} }
/** /**
@ -320,13 +302,6 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
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.
*/ */
@ -382,7 +357,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
this.onImpact(mop.entityHit); this.onImpact(mop.entityHit);
} else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
{ {
this.groundImpact(mop.sideHit); this.groundImpact(mop.field_178784_b);
worldObj.createExplosion(shootingEntity, posX, posY, posZ, 2, false); worldObj.createExplosion(shootingEntity, posX, posY, posZ, 2, false);
} }
} }
@ -399,7 +374,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
worldObj.createExplosion(shootingEntity, posX, posY, posZ, 2, false); worldObj.createExplosion(shootingEntity, posX, posY, posZ, 2, false);
} }
spawnHitParticles("magicCrit", 8); spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8);
this.setDead(); this.setDead();
} }
@ -408,11 +383,11 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
return rand.nextInt(6) + 1; return rand.nextInt(6) + 1;
} }
public void spawnHitParticles(String string, int i) protected void spawnHitParticles(EnumParticleTypes type, 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));
} }
} }
@ -426,7 +401,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
return DamageSource.causeMobDamage(shootingEntity); return DamageSource.causeMobDamage(shootingEntity);
} }
public void groundImpact(int sideHit) public void groundImpact(EnumFacing sideHit)
{ {
this.ricochet(sideHit); this.ricochet(sideHit);
} }
@ -441,27 +416,21 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
return d + d * ((rand.nextFloat() - 0.5D) / 4); return d + d * ((rand.nextFloat() - 0.5D) / 4);
} }
private void ricochet(int sideHit) private void ricochet(EnumFacing sideHit)
{ {
switch (sideHit) if(sideHit.getFrontOffsetX() != 0)
{ {
case 0: motionX *= -1;
case 1: }
// topHit, bottomHit, reflect Y
motionY = motionY * -1; if(sideHit.getFrontOffsetY() != 0)
break; {
motionY *= -1;
case 2: }
case 3:
// westHit, eastHit, reflect Z if(sideHit.getFrontOffsetZ() != 0)
motionZ = motionZ * -1; {
break; motionZ *= -1;
case 4:
case 5:
// southHit, northHit, reflect X
motionX = motionX * -1;
break;
} }
ricochetCounter++; ricochetCounter++;
@ -472,32 +441,33 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
for (int particles = 0; particles < 4; particles++) for (int particles = 0; particles < 4; particles++)
{ {
switch (sideHit) worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D));
{ // switch (sideHit)
case 0: // {
worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), -gaussian(0.1D), gaussian(0.1D)); // case 0:
break; // worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), -gaussian(0.1D), gaussian(0.1D));
// break;
case 1: //
worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); // case 1:
break; // worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D));
// break;
case 2: //
worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), -gaussian(0.1D)); // case 2:
break; // worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), -gaussian(0.1D));
// break;
case 3: //
worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); // case 3:
break; // worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D));
// break;
case 4: //
worldObj.spawnParticle("smoke", posX, posY, posZ, -gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); // case 4:
break; // worldObj.spawnParticle("smoke", posX, posY, posZ, -gaussian(0.1D), gaussian(0.1D), gaussian(0.1D));
// break;
case 5: //
worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); // case 5:
break; // worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D));
} // break;
// }
} }
} }
} }

View file

@ -74,7 +74,7 @@ public class EntityMeteor extends EnergyBlastProjectile
this.onImpact(mop.entityHit); this.onImpact(mop.entityHit);
} else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
{ {
MeteorRegistry.createMeteorImpact(worldObj, mop.blockX, mop.blockY, mop.blockZ, this.meteorID, new boolean[]{hasTerrae, hasOrbisTerrae, hasCrystallos, hasIncendium, hasTennebrae}); MeteorRegistry.createMeteorImpact(worldObj, mop.func_178782_a(), this.meteorID, new boolean[]{hasTerrae, hasOrbisTerrae, hasCrystallos, hasIncendium, hasTennebrae});
} }
this.setDead(); this.setDead();
@ -83,7 +83,7 @@ public class EntityMeteor extends EnergyBlastProjectile
@Override @Override
public void onImpact(Entity mop) public void onImpact(Entity mop)
{ {
MeteorRegistry.createMeteorImpact(worldObj, (int) this.posX, (int) this.posY, (int) this.posZ, meteorID, new boolean[]{hasTerrae, hasOrbisTerrae, hasCrystallos, hasIncendium, hasTennebrae}); MeteorRegistry.createMeteorImpact(worldObj, this.getPosition(), meteorID, new boolean[]{hasTerrae, hasOrbisTerrae, hasCrystallos, hasIncendium, hasTennebrae});
this.setDead(); this.setDead();
} }

View file

@ -1,18 +1,17 @@
package WayofTime.alchemicalWizardry.common.entity.projectile; package WayofTime.alchemicalWizardry.common.entity.projectile;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.registry.IThrowableEntity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.particle.EntityCloudFX;
import net.minecraft.client.particle.EntityFX;
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;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
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.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.IThrowableEntity;
import net.minecraftforge.fml.relauncher.Side;
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 EntityParticleBeam extends Entity implements IProjectile, IThrowableEntity public class EntityParticleBeam extends Entity implements IProjectile, IThrowableEntity
@ -51,7 +50,6 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl
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;
} }
@ -66,7 +64,6 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl
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);
@ -86,7 +83,6 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl
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);
@ -102,7 +98,7 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl
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);
@ -113,7 +109,6 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl
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);
} }
@ -153,18 +148,6 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl
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)
/** /**
@ -225,9 +208,11 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl
{ {
return; return;
} }
EntityFX particle = new EntityCloudFX(worldObj, posX, posY, posZ, 0, 0, 0);
particle.setRBGColorF(colourRed + 0.15f * (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()), colourGreen + 0.15f * (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()), colourBlue + 0.15f * (worldObj.rand.nextFloat() - worldObj.rand.nextFloat())); SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB_AMBIENT, posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D);
FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle); // EntityFX particle = new EntityCloudFX(worldObj, posX, posY, posZ, 0, 0, 0);
// particle.setRBGColorF(colourRed + 0.15f * (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()), colourGreen + 0.15f * (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()), colourBlue + 0.15f * (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()));
// FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle);
} }
/** /**
@ -282,21 +267,6 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl
return false; return false;
} }
@Override
@SideOnly(Side.CLIENT)
public float getShadowSize()
{
return 0.0F;
}
protected void spawnHitParticles(String string, int i)
{
for (int particles = 0; particles < i; particles++)
{
worldObj.spawnParticle(string, posX, posY - (string == "portal" ? 1 : 0), posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ));
}
}
public DamageSource getDamageSource() public DamageSource getDamageSource()
{ {
return DamageSource.causeMobDamage(shootingEntity); return DamageSource.causeMobDamage(shootingEntity);

View file

@ -4,6 +4,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -81,15 +82,15 @@ public class ExplosionProjectile extends EnergyBlastProjectile
} }
} }
spawnHitParticles("magicCrit", 8); spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8);
this.setDead(); this.setDead();
} }
@Override @Override
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("explode", posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ));
} }
@Override @Override

View file

@ -4,7 +4,9 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.util.BlockPos;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -60,9 +62,10 @@ public class FireProjectile extends EnergyBlastProjectile
{ {
for (int k = -1; k <= 1; k++) for (int k = -1; k <= 1; k++)
{ {
if (worldObj.isAirBlock((int) this.posX + i, (int) this.posY + j, (int) this.posZ + k)) BlockPos newPos = new BlockPos(this.posX + i, this.posY + j, this.posZ + k);
if (worldObj.isAirBlock(newPos))
{ {
worldObj.setBlock((int) this.posX + i, (int) this.posY + j, (int) this.posZ + k, Blocks.fire); worldObj.setBlockState(newPos, Blocks.fire.getDefaultState());
} }
} }
} }
@ -97,12 +100,13 @@ public class FireProjectile extends EnergyBlastProjectile
} }
} }
if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ)) BlockPos newPos = new BlockPos(this.posX, this.posY, this.posZ);
if (worldObj.isAirBlock(newPos))
{ {
worldObj.setBlock((int) this.posX, (int) this.posY, (int) this.posZ, Blocks.fire); worldObj.setBlockState(newPos, Blocks.fire.getDefaultState());
} }
spawnHitParticles("magicCrit", 8); spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8);
this.setDead(); this.setDead();
} }
} }

View file

@ -4,6 +4,7 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -79,14 +80,14 @@ public class HolyProjectile extends EnergyBlastProjectile
} }
} }
spawnHitParticles("magicCrit", 8); spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8);
this.setDead(); this.setDead();
} }
@Override @Override
public void doFiringParticles() public void doFiringParticles()
{ {
SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), "mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB_AMBIENT, posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D);
SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), "mobSpell", posX, posY, posZ, 1.0F, 1.0F, 1.0F); SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB, posX, posY, posZ, 1.0F, 1.0F, 1.0F);
} }
} }

View file

@ -5,6 +5,7 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
@ -82,19 +83,14 @@ public class IceProjectile extends EnergyBlastProjectile
} }
} }
if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ)) spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8);
{
//worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ,Block.fire.blockID);
}
spawnHitParticles("magicCrit", 8);
this.setDead(); this.setDead();
} }
@Override @Override
public void doFiringParticles() public void doFiringParticles()
{ {
SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), "mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB_AMBIENT, posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D);
SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), "explode", posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.EXPLOSION_LARGE, posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ));
} }
} }

View file

@ -6,6 +6,7 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -83,15 +84,15 @@ public class LightningBoltProjectile extends EnergyBlastProjectile
} }
} }
spawnHitParticles("magicCrit", 8); spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8);
this.setDead(); this.setDead();
} }
@Override @Override
public void doFiringParticles() public void doFiringParticles()
{ {
SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), "mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB_AMBIENT, posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D);
SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), "mobSpell", posX, posY, posZ, 1.0F, 1.0F, 1.0F); SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB, posX, posY, posZ, 1.0F, 1.0F, 1.0F);
} }
@Override @Override

View file

@ -7,6 +7,7 @@ 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.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -87,15 +88,15 @@ public class MudProjectile extends EnergyBlastProjectile
} }
} }
spawnHitParticles("magicCrit", 8); spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8);
this.setDead(); this.setDead();
} }
@Override @Override
public void doFiringParticles() public void doFiringParticles()
{ {
SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), "mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB_AMBIENT, posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D);
SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), "mobSpell", posX, posY, posZ, 0.5F, 0.297F, 0.0664F); SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB, posX, posY, posZ, 0.5F, 0.297F, 0.0664F);
} }
@Override @Override

View file

@ -7,6 +7,7 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
@ -131,15 +132,15 @@ public class TeleportProjectile extends EnergyBlastProjectile
} }
} }
spawnHitParticles("magicCrit", 8); spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8);
this.setDead(); this.setDead();
} }
@Override @Override
public void doFiringParticles() public void doFiringParticles()
{ {
SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), "mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB_AMBIENT, posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D);
SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), "portal", posX, posY, posZ, -motionX, -motionY, -motionZ); SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.PORTAL, posX, posY, posZ, -motionX, -motionY, -motionZ);
} }
@Override @Override

View file

@ -6,6 +6,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -77,14 +78,14 @@ public class WaterProjectile extends EnergyBlastProjectile
} }
} }
spawnHitParticles("magicCrit", 8); spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8);
this.setDead(); this.setDead();
} }
@Override @Override
public void doFiringParticles() public void doFiringParticles()
{ {
SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), "portal", posX, posY, posZ, -motionX, -motionY, -motionZ); SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.PORTAL, posX, posY, posZ, -motionX, -motionY, -motionZ);
SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), "mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB_AMBIENT, posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D);
} }
} }

View file

@ -4,6 +4,7 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -74,14 +75,14 @@ public class WindGustProjectile extends EnergyBlastProjectile
} }
} }
spawnHitParticles("magicCrit", 8); spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8);
this.setDead(); this.setDead();
} }
@Override @Override
public void doFiringParticles() public void doFiringParticles()
{ {
SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), "mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB_AMBIENT, posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D);
SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), "mobSpell", posX, posY, posZ, 1.0F, 1.0F, 1.0F); SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB, posX, posY, posZ, 1.0F, 1.0F, 1.0F);
} }
} }

View file

@ -155,7 +155,7 @@ public class RecipeHolder
arcanePlinthRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockPlinth)); arcanePlinthRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockPlinth));
arcanePedestalRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockPedestal)); arcanePedestalRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockPedestal));
spellTableRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockHomHeart)); spellTableRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockSpellTable));
alchemySetRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockWritingTable)); alchemySetRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockWritingTable));
crucibleRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockCrucible)); crucibleRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockCrucible));
@ -168,7 +168,7 @@ public class RecipeHolder
routerRecipe = getRecipeForItemStack(new ItemStack(ModItems.itemAttunedCrystal)); routerRecipe = getRecipeForItemStack(new ItemStack(ModItems.itemAttunedCrystal));
segmenterRecipe = getRecipeForItemStack(new ItemStack(ModItems.itemTankSegmenter)); segmenterRecipe = getRecipeForItemStack(new ItemStack(ModItems.itemTankSegmenter));
cleanserRecipe = getRecipeForItemStack(new ItemStack(ModItems.itemDestinationClearer)); cleanserRecipe = getRecipeForItemStack(new ItemStack(ModItems.itemDestinationClearer));
calcinatorRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockAlchemicCalcinator)); calcinatorRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockAlchemicalCalcinator));
belljarRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockCrystalBelljar)); belljarRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockCrystalBelljar));
relayRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockReagentConduit)); relayRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockReagentConduit));

View file

@ -1,69 +1,69 @@
package WayofTime.alchemicalWizardry.common.harvest; //package WayofTime.alchemicalWizardry.common.harvest;
//
import net.minecraft.block.Block; //import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState; //import net.minecraft.block.state.IBlockState;
import net.minecraft.item.Item; //import net.minecraft.item.Item;
import net.minecraft.util.BlockPos; //import net.minecraft.util.BlockPos;
import net.minecraft.world.World; //import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; //import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler;
import cpw.mods.fml.common.registry.GameRegistry; //import cpw.mods.fml.common.registry.GameRegistry;
//
public class GenericPamSeedlessFruitHarvestHandler implements IHarvestHandler //public class GenericPamSeedlessFruitHarvestHandler implements IHarvestHandler
{ //{
public Block harvestBlock; // public Block harvestBlock;
public int harvestMeta; // public int harvestMeta;
public int resetMeta; // public int resetMeta;
//
public GenericPamSeedlessFruitHarvestHandler(String block, int harvestMeta, int resetMeta) // public GenericPamSeedlessFruitHarvestHandler(String block, int harvestMeta, int resetMeta)
{ // {
this.harvestBlock = getBlockForString(block); // this.harvestBlock = getBlockForString(block);
this.harvestMeta = harvestMeta; // this.harvestMeta = harvestMeta;
this.resetMeta = resetMeta; // this.resetMeta = resetMeta;
} // }
//
public boolean isHarvesterValid() // public boolean isHarvesterValid()
{ // {
return harvestBlock != null; // return harvestBlock != null;
} // }
//
public static Block getBlockForString(String str) // public static Block getBlockForString(String str)
{ // {
String[] parts = str.split(":"); // String[] parts = str.split(":");
String modId = parts[0]; // String modId = parts[0];
String name = parts[1]; // String name = parts[1];
return GameRegistry.findBlock(modId, name); // return GameRegistry.findBlock(modId, name);
} // }
//
public static Item getItemForString(String str) // public static Item getItemForString(String str)
{ // {
String[] parts = str.split(":"); // String[] parts = str.split(":");
String modId = parts[0]; // String modId = parts[0];
String name = parts[1]; // String name = parts[1];
return GameRegistry.findItem(modId, name); // return GameRegistry.findItem(modId, name);
} // }
//
public boolean canHandleBlock(Block block) // public boolean canHandleBlock(Block block)
{ // {
return block == harvestBlock; // return block == harvestBlock;
} // }
//
public int getHarvestMeta() // public int getHarvestMeta()
{ // {
return harvestMeta; // return harvestMeta;
} // }
//
@Override // @Override
public boolean harvestAndPlant(World world, BlockPos pos, Block block, IBlockState state) // public boolean harvestAndPlant(World world, BlockPos pos, Block block, IBlockState state)
{ // {
if (!this.canHandleBlock(block) || block.getMetaFromState(state) != this.getHarvestMeta()) // if (!this.canHandleBlock(block) || block.getMetaFromState(state) != this.getHarvestMeta())
{ // {
return false; // return false;
} // }
//
world.destroyBlock(pos, true); // world.destroyBlock(pos, true);
//
world.setBlockState(pos, harvestBlock.getStateFromMeta(resetMeta), 3); // world.setBlockState(pos, harvestBlock.getStateFromMeta(resetMeta), 3);
//
return true; // return true;
} // }
} //}

View file

@ -1,138 +1,138 @@
package WayofTime.alchemicalWizardry.common.harvest; //package WayofTime.alchemicalWizardry.common.harvest;
//
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.block.state.IBlockState;
import net.minecraft.entity.item.EntityItem; //import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.Item; //import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; //import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos; //import net.minecraft.util.BlockPos;
import net.minecraft.world.World; //import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable; //import net.minecraftforge.common.IPlantable;
import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; //import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler;
import cpw.mods.fml.common.registry.GameRegistry; //import cpw.mods.fml.common.registry.GameRegistry;
//
public class GenericSeededHarvestHandler implements IHarvestHandler //public class GenericSeededHarvestHandler implements IHarvestHandler
{ //{
public Block harvestBlock; // public Block harvestBlock;
public int harvestMeta; // public int harvestMeta;
public IPlantable harvestSeed; // public IPlantable harvestSeed;
//
public GenericSeededHarvestHandler(String block, int meta, String seed) // public GenericSeededHarvestHandler(String block, int meta, String seed)
{ // {
harvestBlock = getBlockForString(block); // harvestBlock = getBlockForString(block);
harvestMeta = meta; // harvestMeta = meta;
Item testSeed = getItemForString(seed); // Item testSeed = getItemForString(seed);
if (testSeed instanceof IPlantable) // if (testSeed instanceof IPlantable)
{ // {
harvestSeed = (IPlantable) testSeed; // harvestSeed = (IPlantable) testSeed;
} else // } else
{ // {
harvestSeed = null; // harvestSeed = null;
} // }
} // }
//
public boolean isHarvesterValid() // public boolean isHarvesterValid()
{ // {
return harvestBlock != null && harvestSeed != null; // return harvestBlock != null && harvestSeed != null;
} // }
//
public static Block getBlockForString(String str) // public static Block getBlockForString(String str)
{ // {
String[] parts = str.split(":"); // String[] parts = str.split(":");
String modId = parts[0]; // String modId = parts[0];
String name = parts[1]; // String name = parts[1];
return GameRegistry.findBlock(modId, name); // return GameRegistry.findBlock(modId, name);
} // }
//
public static Item getItemForString(String str) // public static Item getItemForString(String str)
{ // {
String[] parts = str.split(":"); // String[] parts = str.split(":");
String modId = parts[0]; // String modId = parts[0];
String name = parts[1]; // String name = parts[1];
return GameRegistry.findItem(modId, name); // return GameRegistry.findItem(modId, name);
} // }
//
public boolean canHandleBlock(Block block) // public boolean canHandleBlock(Block block)
{ // {
return block == harvestBlock; // return block == harvestBlock;
} // }
//
public int getHarvestMeta() // public int getHarvestMeta()
{ // {
return harvestMeta; // return harvestMeta;
} // }
//
@Override // @Override
public boolean harvestAndPlant(World world, BlockPos pos, Block block, IBlockState state) // public boolean harvestAndPlant(World world, BlockPos pos, Block block, IBlockState state)
{ // {
if (!this.canHandleBlock(block) || block.getMetaFromState(state) != this.getHarvestMeta()) // if (!this.canHandleBlock(block) || block.getMetaFromState(state) != this.getHarvestMeta())
{ // {
return false; // return false;
} // }
//
IPlantable seed = this.getSeedItem(block); // IPlantable seed = this.getSeedItem(block);
//
if (seed == null) // if (seed == null)
{ // {
world.destroyBlock(pos, true); // world.destroyBlock(pos, true);
//
return true; // return true;
} else // } else
{ // {
int fortune = 0; // int fortune = 0;
//
List<ItemStack> list = block.getDrops(world, pos, state, fortune); // List<ItemStack> list = block.getDrops(world, pos, state, fortune);
boolean foundAndRemovedSeed = false; // boolean foundAndRemovedSeed = false;
//
for (ItemStack stack : list) // for (ItemStack stack : list)
{ // {
if (stack == null) // if (stack == null)
{ // {
continue; // continue;
} // }
//
Item item = stack.getItem(); // Item item = stack.getItem();
if (item == seed) // if (item == seed)
{ // {
int itemSize = stack.stackSize; // int itemSize = stack.stackSize;
if (itemSize > 1) // if (itemSize > 1)
{ // {
stack.stackSize--; // stack.stackSize--;
foundAndRemovedSeed = true; // foundAndRemovedSeed = true;
break; // break;
} else if (itemSize == 1) // } else if (itemSize == 1)
{ // {
list.remove(stack); // list.remove(stack);
foundAndRemovedSeed = true; // foundAndRemovedSeed = true;
break; // break;
} // }
} // }
} // }
//
if (foundAndRemovedSeed) // if (foundAndRemovedSeed)
{ // {
IBlockState plantState = seed.getPlant(world, pos); // IBlockState plantState = seed.getPlant(world, pos);
//
world.destroyBlock(pos, false); // world.destroyBlock(pos, false);
//
world.setBlockState(pos, plantState, 3); // world.setBlockState(pos, plantState, 3);
//
for (ItemStack stack : list) // for (ItemStack stack : list)
{ // {
EntityItem itemEnt = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, stack); // EntityItem itemEnt = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, stack);
//
world.spawnEntityInWorld(itemEnt); // world.spawnEntityInWorld(itemEnt);
} // }
} // }
//
return false; // return false;
} // }
} // }
//
public IPlantable getSeedItem(Block block) // public IPlantable getSeedItem(Block block)
{ // {
return harvestSeed; // return harvestSeed;
} // }
} //}

View file

@ -1,125 +1,125 @@
package WayofTime.alchemicalWizardry.common.harvest; //package WayofTime.alchemicalWizardry.common.harvest;
//
import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry; //import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry;
//
public class PamHarvestCompatRegistry //public class PamHarvestCompatRegistry
{ //{
public static void registerPamHandlers() // public static void registerPamHandlers()
{ // {
registerSeededHandler("blackberry", 7); // registerSeededHandler("blackberry", 7);
registerSeededHandler("blueberry", 7); // registerSeededHandler("blueberry", 7);
registerSeededHandler("candleberry", 7); // registerSeededHandler("candleberry", 7);
registerSeededHandler("raspberry", 7); // registerSeededHandler("raspberry", 7);
registerSeededHandler("strawberry", 7); // registerSeededHandler("strawberry", 7);
registerSeededHandler("cactusfruit", 7); // registerSeededHandler("cactusfruit", 7);
registerSeededHandler("asparagus", 7); // registerSeededHandler("asparagus", 7);
registerSeededHandler("barley", 7); // registerSeededHandler("barley", 7);
registerSeededHandler("oats", 7); // registerSeededHandler("oats", 7);
registerSeededHandler("rye", 7); // registerSeededHandler("rye", 7);
registerSeededHandler("corn", 7); // registerSeededHandler("corn", 7);
registerSeededHandler("bambooshoot", 7); // registerSeededHandler("bambooshoot", 7);
registerSeededHandler("cantaloupe", 7); // registerSeededHandler("cantaloupe", 7);
registerSeededHandler("cucumber", 7); // registerSeededHandler("cucumber", 7);
registerSeededHandler("windersquash", 7); // registerSeededHandler("windersquash", 7);
registerSeededHandler("zucchini", 7); // registerSeededHandler("zucchini", 7);
registerSeededHandler("beat", 7); // registerSeededHandler("beat", 7);
registerSeededHandler("onion", 7); // registerSeededHandler("onion", 7);
registerSeededHandler("parsnip", 7); // registerSeededHandler("parsnip", 7);
registerSeededHandler("peanut", 7); // registerSeededHandler("peanut", 7);
registerSeededHandler("radish", 7); // registerSeededHandler("radish", 7);
registerSeededHandler("rutabaga", 7); // registerSeededHandler("rutabaga", 7);
registerSeededHandler("sweetpotato", 7); // registerSeededHandler("sweetpotato", 7);
registerSeededHandler("turnip", 7); // registerSeededHandler("turnip", 7);
registerSeededHandler("rhubarb", 7); // registerSeededHandler("rhubarb", 7);
registerSeededHandler("celery", 7); // registerSeededHandler("celery", 7);
registerSeededHandler("garlic", 7); // registerSeededHandler("garlic", 7);
registerSeededHandler("ginger", 7); // registerSeededHandler("ginger", 7);
registerSeededHandler("spiceleaf", 7); // registerSeededHandler("spiceleaf", 7);
registerSeededHandler("tealeaf", 7); // registerSeededHandler("tealeaf", 7);
registerSeededHandler("coffeebean", 7); // registerSeededHandler("coffeebean", 7);
registerSeededHandler("mustardseeds", 7); // registerSeededHandler("mustardseeds", 7);
registerSeededHandler("brocolli", 7); // registerSeededHandler("brocolli", 7);
registerSeededHandler("cauliflower", 7); // registerSeededHandler("cauliflower", 7);
registerSeededHandler("leek", 7); // registerSeededHandler("leek", 7);
registerSeededHandler("lettuce", 7); // registerSeededHandler("lettuce", 7);
registerSeededHandler("scallion", 7); // registerSeededHandler("scallion", 7);
registerSeededHandler("artichoke", 7); // registerSeededHandler("artichoke", 7);
registerSeededHandler("brusselsprout", 7); // registerSeededHandler("brusselsprout", 7);
registerSeededHandler("cabbage", 7); // registerSeededHandler("cabbage", 7);
registerSeededHandler("whitemushroom", 7); // registerSeededHandler("whitemushroom", 7);
registerSeededHandler("bean", 7); // registerSeededHandler("bean", 7);
registerSeededHandler("soybean", 7); // registerSeededHandler("soybean", 7);
registerSeededHandler("bellpepper", 7); // registerSeededHandler("bellpepper", 7);
registerSeededHandler("chili", 7); // registerSeededHandler("chili", 7);
registerSeededHandler("eggplant", 7); // registerSeededHandler("eggplant", 7);
registerSeededHandler("pamokra", 7); // registerSeededHandler("pamokra", 7);
registerSeededHandler("peas", 7); // registerSeededHandler("peas", 7);
registerSeededHandler("tomato", 7); // registerSeededHandler("tomato", 7);
registerSeededHandler("cotton", 7); // registerSeededHandler("cotton", 7);
registerSeededHandler("pineapple", 7); // registerSeededHandler("pineapple", 7);
registerSeededHandler("grape", 7); // registerSeededHandler("grape", 7);
registerSeededHandler("kiwi", 7); // registerSeededHandler("kiwi", 7);
registerSeededHandler("cranberry", 7); // registerSeededHandler("cranberry", 7);
registerSeededHandler("rice", 7); // registerSeededHandler("rice", 7);
registerSeededHandler("seaweed", 7); // registerSeededHandler("seaweed", 7);
//
registerFruitHandler("apple", 7, 0); // registerFruitHandler("apple", 7, 0);
registerFruitHandler("Almond", 7, 0); // registerFruitHandler("Almond", 7, 0);
registerFruitHandler("Apricot", 7, 0); // registerFruitHandler("Apricot", 7, 0);
registerFruitHandler("Avocado", 7, 0); // registerFruitHandler("Avocado", 7, 0);
registerFruitHandler("Banana", 7, 0); // registerFruitHandler("Banana", 7, 0);
registerFruitHandler("Cashew", 7, 0); // registerFruitHandler("Cashew", 7, 0);
registerFruitHandler("Cherry", 7, 0); // registerFruitHandler("Cherry", 7, 0);
registerFruitHandler("Chestnut", 7, 0); // registerFruitHandler("Chestnut", 7, 0);
registerFruitHandler("Cinnamon", 7, 0); // registerFruitHandler("Cinnamon", 7, 0);
registerFruitHandler("Coconut", 7, 0); // registerFruitHandler("Coconut", 7, 0);
registerFruitHandler("Date", 7, 0); // registerFruitHandler("Date", 7, 0);
registerFruitHandler("Dragonfruit", 7, 0); // registerFruitHandler("Dragonfruit", 7, 0);
registerFruitHandler("Durian", 7, 0); // registerFruitHandler("Durian", 7, 0);
registerFruitHandler("Fig", 7, 0); // registerFruitHandler("Fig", 7, 0);
registerFruitHandler("Grapefruit", 7, 0); // registerFruitHandler("Grapefruit", 7, 0);
registerFruitHandler("Lemon", 7, 0); // registerFruitHandler("Lemon", 7, 0);
registerFruitHandler("Lime", 7, 0); // registerFruitHandler("Lime", 7, 0);
registerFruitHandler("Maple", 7, 0); // registerFruitHandler("Maple", 7, 0);
registerFruitHandler("Mango", 7, 0); // registerFruitHandler("Mango", 7, 0);
registerFruitHandler("Nutmeg", 7, 0); // registerFruitHandler("Nutmeg", 7, 0);
registerFruitHandler("Olive", 7, 0); // registerFruitHandler("Olive", 7, 0);
registerFruitHandler("Orange", 7, 0); // registerFruitHandler("Orange", 7, 0);
registerFruitHandler("Papaya", 7, 0); // registerFruitHandler("Papaya", 7, 0);
registerFruitHandler("Paperbark", 7, 0); // registerFruitHandler("Paperbark", 7, 0);
registerFruitHandler("Peach", 7, 0); // registerFruitHandler("Peach", 7, 0);
registerFruitHandler("Pear", 7, 0); // registerFruitHandler("Pear", 7, 0);
registerFruitHandler("Pecan", 7, 0); // registerFruitHandler("Pecan", 7, 0);
registerFruitHandler("Peppercorn", 7, 0); // registerFruitHandler("Peppercorn", 7, 0);
registerFruitHandler("Persimmon", 7, 0); // registerFruitHandler("Persimmon", 7, 0);
registerFruitHandler("Pistachio", 7, 0); // registerFruitHandler("Pistachio", 7, 0);
registerFruitHandler("Plum", 7, 0); // registerFruitHandler("Plum", 7, 0);
registerFruitHandler("Pomegranate", 7, 0); // registerFruitHandler("Pomegranate", 7, 0);
registerFruitHandler("Starfruit", 7, 0); // registerFruitHandler("Starfruit", 7, 0);
registerFruitHandler("Vanillabean", 7, 0); // registerFruitHandler("Vanillabean", 7, 0);
registerFruitHandler("Walnut", 7, 0); // registerFruitHandler("Walnut", 7, 0);
} // }
//
public static void registerSeededHandler(String name, int meta) // public static void registerSeededHandler(String name, int meta)
{ // {
String block = "harvestcraft:pam" + name + "Crop"; // String block = "harvestcraft:pam" + name + "Crop";
String seed = "harvestcraft:" + name + "Item"; // String seed = "harvestcraft:" + name + "Item";
//
GenericSeededHarvestHandler handler = new GenericSeededHarvestHandler(block, meta, seed); // GenericSeededHarvestHandler handler = new GenericSeededHarvestHandler(block, meta, seed);
if (handler.isHarvesterValid()) // if (handler.isHarvesterValid())
{ // {
HarvestRegistry.registerHarvestHandler(handler); // HarvestRegistry.registerHarvestHandler(handler);
} // }
} // }
//
public static void registerFruitHandler(String name, int harvestMeta, int resetMeta) // public static void registerFruitHandler(String name, int harvestMeta, int resetMeta)
{ // {
String block = "harvestcraft:pam" + name; // String block = "harvestcraft:pam" + name;
//
GenericPamSeedlessFruitHarvestHandler handler = new GenericPamSeedlessFruitHarvestHandler(block, harvestMeta, resetMeta); // GenericPamSeedlessFruitHarvestHandler handler = new GenericPamSeedlessFruitHarvestHandler(block, harvestMeta, resetMeta);
if (handler.isHarvesterValid()) // if (handler.isHarvesterValid())
{ // {
HarvestRegistry.registerHarvestHandler(handler); // HarvestRegistry.registerHarvestHandler(handler);
} // }
} // }
} //}

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,7 +1,7 @@
package WayofTime.alchemicalWizardry.common.items; package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import java.util.List;
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellTable;
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;
@ -10,8 +10,8 @@ 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
{ {
@ -23,69 +23,69 @@ public class BlankSpell 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.blankspell.desc")); list.add(StatCollector.translateToLocal("tooltip.blankspell.desc"));
if (!(par1ItemStack.getTagCompound() == null)) if (!(stack.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(new BlockPos(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 TESpellTable) if (tileEntity instanceof TEHomHeart)
{ {
TESpellTable homHeart = (TESpellTable) tileEntity; TEHomHeart homHeart = (TEHomHeart) tileEntity;
if (homHeart.canCastSpell()) 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

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

@ -3,26 +3,24 @@ package WayofTime.alchemicalWizardry.common.items.armour;
import java.util.List; import java.util.List;
import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelBiped;
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;
import net.minecraft.item.EnumAction; import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
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.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
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 net.minecraftforge.common.ISpecialArmor; import net.minecraftforge.common.ISpecialArmor;
import net.minecraftforge.common.util.Constants; import net.minecraftforge.common.util.Constants;
import thaumcraft.api.IGoggles; import net.minecraftforge.fml.common.Optional;
import thaumcraft.api.IRunicArmor; import net.minecraftforge.fml.common.Optional.Interface;
import thaumcraft.api.nodes.IRevealer; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles; import WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles;
@ -32,23 +30,12 @@ import WayofTime.alchemicalWizardry.api.items.interfaces.ILPGauge;
import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilDivination; import WayofTime.alchemicalWizardry.common.items.sigil.SigilDivination;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaArmour; import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaArmour;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.Optional.Interface;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@Optional.InterfaceList(value = {@Interface(iface = "thaumcraft.api.nodes.IRevealer", modid = "Thaumcraft"), @Interface(iface = "thaumcraft.api.IGoggles", modid = "Thaumcraft"), @Interface(iface = "thaumcraft.api.IRunicArmor", modid = "Thaumcraft")}) @Optional.InterfaceList(value = {@Interface(iface = "thaumcraft.api.nodes.IRevealer", modid = "Thaumcraft"), @Interface(iface = "thaumcraft.api.IGoggles", modid = "Thaumcraft"), @Interface(iface = "thaumcraft.api.IRunicArmor", modid = "Thaumcraft")})
public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialArmor, IBindable, IRevealer, IGoggles, IRunicArmor, ILPGauge public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialArmor, IBindable, ILPGauge//, IRevealer, IGoggles, IRunicArmor
{ {
private static int invSize = 9; private static int invSize = 9;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
private IIcon helmetIcon;
@SideOnly(Side.CLIENT)
private IIcon plateIcon;
@SideOnly(Side.CLIENT)
private IIcon leggingsIcon;
@SideOnly(Side.CLIENT)
private IIcon bootsIcon;
public static boolean tryComplexRendering = true; public static boolean tryComplexRendering = true;
@ -109,10 +96,10 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
if (((EntityPlayer) entityLiving).getItemInUseDuration() > 0) if (((EntityPlayer) entityLiving).getItemInUseDuration() > 0)
{ {
EnumAction enumaction = ((EntityPlayer) entityLiving).getItemInUse().getItemUseAction(); EnumAction enumaction = ((EntityPlayer) entityLiving).getItemInUse().getItemUseAction();
if (enumaction == EnumAction.block) if (enumaction == EnumAction.BLOCK)
{ {
this.model.heldItemRight = 3; this.model.heldItemRight = 3;
} else if (enumaction == EnumAction.bow) } else if (enumaction == EnumAction.BOW)
{ {
this.model.aimedBow = true; this.model.aimedBow = true;
} }
@ -128,44 +115,6 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
} }
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundHelmet");
this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundPlate");
this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundLeggings");
this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundBoots");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1)
{
if (this.equals(ModItems.boundHelmet))
{
return this.helmetIcon;
}
if (this.equals(ModItems.boundPlate))
{
return this.plateIcon;
}
if (this.equals(ModItems.boundLeggings))
{
return this.leggingsIcon;
}
if (this.equals(ModItems.boundBoots))
{
return this.bootsIcon;
}
return this.itemIcon;
}
@Override @Override
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{ {
@ -594,66 +543,66 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
return false; return false;
} }
@Optional.Method(modid = "Thaumcraft") // @Optional.Method(modid = "Thaumcraft")
public boolean hasIRevealer(ItemStack itemStack) // public boolean hasIRevealer(ItemStack itemStack)
{ // {
ItemStack[] inv = getInternalInventory(itemStack); // ItemStack[] inv = getInternalInventory(itemStack);
//
if (inv == null) // if (inv == null)
{ // {
return false; // return false;
} // }
//
for (ItemStack item : inv) // for (ItemStack item : inv)
{ // {
if (item == null) // if (item == null)
{ // {
continue; // continue;
} // }
//
if (item.getItem() instanceof IRevealer) // if (item.getItem() instanceof IRevealer)
{ // {
return true; // return true;
} // }
} // }
//
return false; // return false;
} // }
//
@Optional.Method(modid = "Thaumcraft") // @Optional.Method(modid = "Thaumcraft")
public boolean hasIGoggles(ItemStack itemStack) // public boolean hasIGoggles(ItemStack itemStack)
{ // {
ItemStack[] inv = getInternalInventory(itemStack); // ItemStack[] inv = getInternalInventory(itemStack);
//
if (inv == null) // if (inv == null)
{ // {
return false; // return false;
} // }
//
int blood = getMaxBloodShardLevel(itemStack); // int blood = getMaxBloodShardLevel(itemStack);
//
for (ItemStack item : inv) // for (ItemStack item : inv)
{ // {
if (item == null) // if (item == null)
{ // {
continue; // continue;
} // }
if (item.getItem() instanceof ArmourUpgrade && blood > 0) // if (item.getItem() instanceof ArmourUpgrade && blood > 0)
{ // {
if (item.getItem() instanceof IGoggles) // if (item.getItem() instanceof IGoggles)
{ // {
return true; // return true;
} // }
//
if(((ArmourUpgrade)item.getItem()).isUpgrade()) // if(((ArmourUpgrade)item.getItem()).isUpgrade())
{ // {
blood--; // blood--;
} // }
} // }
} // }
//
return false; // return false;
} // }
@Override @Override
public boolean canSeeLPBar(ItemStack itemStack) public boolean canSeeLPBar(ItemStack itemStack)
@ -783,75 +732,75 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
tag.setBoolean("invisible", invisible); tag.setBoolean("invisible", invisible);
} }
@Override // @Override
@Optional.Method(modid = "Thaumcraft") // @Optional.Method(modid = "Thaumcraft")
public boolean showNodes(ItemStack itemstack, EntityLivingBase player) // public boolean showNodes(ItemStack itemstack, EntityLivingBase player)
{ // {
return this.hasIRevealer(itemstack); // return this.hasIRevealer(itemstack);
} // }
//
@Override // @Override
@Optional.Method(modid = "Thaumcraft") // @Optional.Method(modid = "Thaumcraft")
public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) // public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player)
{ // {
return this.hasIGoggles(itemstack); // return this.hasIGoggles(itemstack);
} // }
//
@Override // @Override
@Optional.Method(modid = "Thaumcraft") // @Optional.Method(modid = "Thaumcraft")
public int getRunicCharge(ItemStack itemstack) // public int getRunicCharge(ItemStack itemstack)
{ // {
ItemStack[] inv = this.getInternalInventory(itemstack); // ItemStack[] inv = this.getInternalInventory(itemstack);
int shardLevel = this.getMaxBloodShardLevel(itemstack); // int shardLevel = this.getMaxBloodShardLevel(itemstack);
int count = 0; // int count = 0;
int harden = 0; // int harden = 0;
//
if (inv == null) // if (inv == null)
{ // {
return 0; // return 0;
} // }
//
for (ItemStack stack : inv) // for (ItemStack stack : inv)
{ // {
if (count >= shardLevel) // if (count >= shardLevel)
{ // {
break; // break;
} // }
//
if (stack == null || !(stack.getItem() instanceof ArmourUpgrade)) // if (stack == null || !(stack.getItem() instanceof ArmourUpgrade))
{ // {
continue; // continue;
} // }
//
if (stack.getItem() instanceof ItemArmor && ((ItemArmor) stack.getItem()).armorType != this.armorType) // if (stack.getItem() instanceof ItemArmor && ((ItemArmor) stack.getItem()).armorType != this.armorType)
{ // {
continue; // continue;
} // }
//
if (stack.hasTagCompound()) // if (stack.hasTagCompound())
{ // {
NBTTagCompound tag = stack.getTagCompound(); // NBTTagCompound tag = stack.getTagCompound();
//
int enchLvl = tag.getByte("RS.HARDEN"); // int enchLvl = tag.getByte("RS.HARDEN");
//
if (stack.getItem() instanceof IRunicArmor) // if (stack.getItem() instanceof IRunicArmor)
{ // {
enchLvl += ((IRunicArmor) stack.getItem()).getRunicCharge(stack); // enchLvl += ((IRunicArmor) stack.getItem()).getRunicCharge(stack);
} // }
//
if (enchLvl > 0) // if (enchLvl > 0)
{ // {
harden += enchLvl; // harden += enchLvl;
if (((ArmourUpgrade) stack.getItem()).isUpgrade()) // if (((ArmourUpgrade) stack.getItem()).isUpgrade())
{ // {
count += 1; // count += 1;
} // }
} // }
} // }
} // }
//
return harden; // return harden;
} // }
@Override @Override
public boolean showIngameHUD(World world, ItemStack stack, EntityPlayer player) public boolean showIngameHUD(World world, ItemStack stack, EntityPlayer player)

View file

@ -20,15 +20,16 @@ import net.minecraft.item.EnumAction;
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.util.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.api.spell.APISpellHelper; import WayofTime.alchemicalWizardry.api.spell.APISpellHelper;
import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm; import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public abstract class OmegaArmour extends BoundArmour public abstract class OmegaArmour extends BoundArmour
{ {
@ -90,10 +91,9 @@ public abstract class OmegaArmour extends BoundArmour
{ {
if(this.storeBiomeID()) if(this.storeBiomeID())
{ {
int xCoord = (int) Math.floor(player.posX); BlockPos pos = player.getPosition();
int zCoord = (int) Math.floor(player.posZ);
BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord); BiomeGenBase biome = world.getBiomeGenForCoords(pos);
if(biome != null) if(biome != null)
{ {
this.setBiomeIDStored(itemStack, biome.biomeID); this.setBiomeIDStored(itemStack, biome.biomeID);
@ -376,10 +376,10 @@ public abstract class OmegaArmour extends BoundArmour
if (((EntityPlayer) entityLiving).getItemInUseDuration() > 0) if (((EntityPlayer) entityLiving).getItemInUseDuration() > 0)
{ {
EnumAction enumaction = ((EntityPlayer) entityLiving).getItemInUse().getItemUseAction(); EnumAction enumaction = ((EntityPlayer) entityLiving).getItemInUse().getItemUseAction();
if (enumaction == EnumAction.block) if (enumaction == EnumAction.BLOCK)
{ {
this.model.heldItemRight = 3; this.model.heldItemRight = 3;
} else if (enumaction == EnumAction.bow) } else if (enumaction == EnumAction.BOW)
{ {
this.model.aimedBow = true; this.model.aimedBow = true;
} }

View file

@ -3,32 +3,19 @@ package WayofTime.alchemicalWizardry.common.items.armour;
import java.util.UUID; import java.util.UUID;
import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon; import net.minecraftforge.fml.relauncher.Side;
import WayofTime.alchemicalWizardry.ModItems; import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaEarth; import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaEarth;
import com.google.common.collect.HashMultimap; import com.google.common.collect.HashMultimap;
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 OmegaArmourEarth extends OmegaArmour public class OmegaArmourEarth extends OmegaArmour
{ {
@SideOnly(Side.CLIENT)
private IIcon helmetIcon;
@SideOnly(Side.CLIENT)
private IIcon plateIcon;
@SideOnly(Side.CLIENT)
private IIcon leggingsIcon;
@SideOnly(Side.CLIENT)
private IIcon bootsIcon;
public OmegaArmourEarth(int armorType) public OmegaArmourEarth(int armorType)
{ {
super(armorType); super(armorType);
@ -55,44 +42,6 @@ public class OmegaArmourEarth extends OmegaArmour
return new ModelOmegaEarth(0.5f, false, false, true, false); return new ModelOmegaEarth(0.5f, false, false, true, false);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaHelmet_earth");
this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaPlate_earth");
this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaLeggings_earth");
this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaBoots_earth");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1)
{
if (this.equals(ModItems.boundHelmetEarth))
{
return this.helmetIcon;
}
if (this.equals(ModItems.boundPlateEarth))
{
return this.plateIcon;
}
if (this.equals(ModItems.boundLeggingsEarth))
{
return this.leggingsIcon;
}
if (this.equals(ModItems.boundBootsEarth))
{
return this.bootsIcon;
}
return this.itemIcon;
}
@Override @Override
public Multimap getAttributeModifiers(ItemStack stack) public Multimap getAttributeModifiers(ItemStack stack)
{ {

View file

@ -2,34 +2,22 @@ package WayofTime.alchemicalWizardry.common.items.armour;
import java.util.UUID; import java.util.UUID;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import WayofTime.alchemicalWizardry.ModItems; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaFire; import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaFire;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
public class OmegaArmourFire extends OmegaArmour public class OmegaArmourFire extends OmegaArmour
{ {
@SideOnly(Side.CLIENT)
private IIcon helmetIcon;
@SideOnly(Side.CLIENT)
private IIcon plateIcon;
@SideOnly(Side.CLIENT)
private IIcon leggingsIcon;
@SideOnly(Side.CLIENT)
private IIcon bootsIcon;
public OmegaArmourFire(int armorType) public OmegaArmourFire(int armorType)
{ {
super(armorType); super(armorType);
@ -57,44 +45,6 @@ public class OmegaArmourFire extends OmegaArmour
return new ModelOmegaFire(0.5f, false, false, true, false); return new ModelOmegaFire(0.5f, false, false, true, false);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaHelmet_fire");
this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaPlate_fire");
this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaLeggings_fire");
this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaBoots_fire");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1)
{
if (this.equals(ModItems.boundHelmetFire))
{
return this.helmetIcon;
}
if (this.equals(ModItems.boundPlateFire))
{
return this.plateIcon;
}
if (this.equals(ModItems.boundLeggingsFire))
{
return this.leggingsIcon;
}
if (this.equals(ModItems.boundBootsFire))
{
return this.bootsIcon;
}
return this.itemIcon;
}
@Override @Override
public Multimap getAttributeModifiers(ItemStack stack) public Multimap getAttributeModifiers(ItemStack stack)
{ {

View file

@ -2,33 +2,21 @@ package WayofTime.alchemicalWizardry.common.items.armour;
import java.util.UUID; import java.util.UUID;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import WayofTime.alchemicalWizardry.ModItems; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaWater; import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaWater;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
public class OmegaArmourWater extends OmegaArmour public class OmegaArmourWater extends OmegaArmour
{ {
@SideOnly(Side.CLIENT)
private IIcon helmetIcon;
@SideOnly(Side.CLIENT)
private IIcon plateIcon;
@SideOnly(Side.CLIENT)
private IIcon leggingsIcon;
@SideOnly(Side.CLIENT)
private IIcon bootsIcon;
public OmegaArmourWater(int armorType) public OmegaArmourWater(int armorType)
{ {
super(armorType); super(armorType);
@ -55,44 +43,6 @@ public class OmegaArmourWater extends OmegaArmour
return new ModelOmegaWater(0.5f, false, false, true, false); return new ModelOmegaWater(0.5f, false, false, true, false);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaHelmet_water");
this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaPlate_water");
this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaLeggings_water");
this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaBoots_water");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1)
{
if (this.equals(ModItems.boundHelmetWater))
{
return this.helmetIcon;
}
if (this.equals(ModItems.boundPlateWater))
{
return this.plateIcon;
}
if (this.equals(ModItems.boundLeggingsWater))
{
return this.leggingsIcon;
}
if (this.equals(ModItems.boundBootsWater))
{
return this.bootsIcon;
}
return this.itemIcon;
}
@Override @Override
public Multimap getAttributeModifiers(ItemStack stack) public Multimap getAttributeModifiers(ItemStack stack)
{ {

View file

@ -3,32 +3,19 @@ package WayofTime.alchemicalWizardry.common.items.armour;
import java.util.UUID; import java.util.UUID;
import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon; import net.minecraftforge.fml.relauncher.Side;
import WayofTime.alchemicalWizardry.ModItems; import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaWind; import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaWind;
import com.google.common.collect.HashMultimap; import com.google.common.collect.HashMultimap;
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 OmegaArmourWind extends OmegaArmour public class OmegaArmourWind extends OmegaArmour
{ {
@SideOnly(Side.CLIENT)
private IIcon helmetIcon;
@SideOnly(Side.CLIENT)
private IIcon plateIcon;
@SideOnly(Side.CLIENT)
private IIcon leggingsIcon;
@SideOnly(Side.CLIENT)
private IIcon bootsIcon;
public OmegaArmourWind(int armorType) public OmegaArmourWind(int armorType)
{ {
super(armorType); super(armorType);
@ -55,44 +42,6 @@ public class OmegaArmourWind extends OmegaArmour
return new ModelOmegaWind(0.5f, false, false, true, false); return new ModelOmegaWind(0.5f, false, false, true, false);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaHelmet_wind");
this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaPlate_wind");
this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaLeggings_wind");
this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaBoots_wind");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1)
{
if (this.equals(ModItems.boundHelmetWind))
{
return this.helmetIcon;
}
if (this.equals(ModItems.boundPlateWind))
{
return this.plateIcon;
}
if (this.equals(ModItems.boundLeggingsWind))
{
return this.leggingsIcon;
}
if (this.equals(ModItems.boundBootsWind))
{
return this.bootsIcon;
}
return this.itemIcon;
}
@Override @Override
public Multimap getAttributeModifiers(ItemStack stack) public Multimap getAttributeModifiers(ItemStack stack)
{ {

View file

@ -1,36 +1,34 @@
package WayofTime.alchemicalWizardry.common.items.energy; package WayofTime.alchemicalWizardry.common.items.energy;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import java.util.LinkedList;
import WayofTime.alchemicalWizardry.api.Int3; import java.util.List;
import WayofTime.alchemicalWizardry.api.alchemy.energy.*;
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
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.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.ChatComponentTranslation; import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.IIcon; import net.minecraft.util.EnumFacing;
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;
import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.Int3;
import java.util.LinkedList; import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler;
import java.util.List; import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack;
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
public class ItemAttunedCrystal extends Item implements IReagentManipulator public class ItemAttunedCrystal extends Item implements IReagentManipulator
{ {
public static final int maxDistance = 6; public static final int maxDistance = 6;
public IIcon crystalBody;
public IIcon crystalLabel;
public ItemAttunedCrystal() public ItemAttunedCrystal()
{ {
super(); super();
@ -78,62 +76,6 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
} }
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.crystalBody = iconRegister.registerIcon("AlchemicalWizardry:AttunedCrystal1");
this.crystalLabel = iconRegister.registerIcon("AlchemicalWizardry:AttunedCrystal2");
}
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack stack, int pass)
{
switch (pass)
{
case 0:
return 256 * (256 * 255 + 255) + 255;
case 1:
Reagent reagent = this.getReagent(stack);
if (reagent != null)
{
return (reagent.getColourRed() * 256 * 256 + reagent.getColourGreen() * 256 + reagent.getColourBlue());
}
break;
}
return 256 * (256 * 255 + 255) + 255;
}
@Override
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses()
{
return true;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderPasses(int meta)
{
return 2;
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(ItemStack stack, int pass)
{
switch (pass)
{
case 0:
return this.crystalBody;
case 1:
return this.crystalLabel;
}
return this.itemIcon;
}
@Override @Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
{ {
@ -157,11 +99,9 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
{ {
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 IReagentHandler)) if (!(tile instanceof IReagentHandler))
{ {
@ -172,7 +112,7 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
if (player.isSneaking()) if (player.isSneaking())
{ {
ReagentContainerInfo[] infos = relay.getContainerInfo(ForgeDirection.UNKNOWN); ReagentContainerInfo[] infos = relay.getContainerInfo(EnumFacing.UP);
if (infos != null) if (infos != null)
{ {
List<Reagent> reagentList = new LinkedList(); List<Reagent> reagentList = new LinkedList();
@ -223,13 +163,13 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
return itemStack; return itemStack;
} }
if (dimension != world.provider.getDimensionId() || Math.abs(coords.xCoord - x) > maxDistance || Math.abs(coords.yCoord - y) > maxDistance || Math.abs(coords.zCoord - z) > maxDistance) if (dimension != world.provider.getDimensionId() || Math.abs(coords.xCoord - pos.getX()) > maxDistance || Math.abs(coords.yCoord - pos.getY()) > maxDistance || Math.abs(coords.zCoord - pos.getZ()) > maxDistance)
{ {
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.toofar")); player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.toofar"));
return itemStack; return itemStack;
} }
TileEntity pastTile = world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord); TileEntity pastTile = world.getTileEntity(new BlockPos(coords.xCoord, coords.yCoord, coords.zCoord));
if (!(pastTile instanceof TEReagentConduit)) if (!(pastTile instanceof TEReagentConduit))
{ {
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.cannotfind")); player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.cannotfind"));
@ -247,10 +187,10 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
if (player.isSneaking()) if (player.isSneaking())
{ {
pastRelay.removeReagentDestinationViaActual(reagent, x, y, z); pastRelay.removeReagentDestinationViaActual(reagent, pos);
} else } else
{ {
if (pastRelay.addReagentDestinationViaActual(reagent, x, y, z)) if (pastRelay.addReagentDestinationViaActual(reagent, pos))
{ {
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.attunedcrystal.linked") + " " + reagent.name)); player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.attunedcrystal.linked") + " " + reagent.name));
} else } else
@ -258,13 +198,13 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.noconnections")); player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.noconnections"));
} }
} }
world.markBlockForUpdate(coords.xCoord, coords.yCoord, coords.zCoord); world.markBlockForUpdate(new BlockPos(coords.xCoord, coords.yCoord, coords.zCoord));
} else } else
{ {
int dimension = world.provider.getDimensionId(); int dimension = world.provider.getDimensionId();
this.setDimension(itemStack, dimension); this.setDimension(itemStack, dimension);
this.setCoordinates(itemStack, new Int3(x, y, z)); this.setCoordinates(itemStack, new Int3(pos));
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.linking")); player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.linking"));
} }

View file

@ -1,21 +1,19 @@
package WayofTime.alchemicalWizardry.common.items.energy; package WayofTime.alchemicalWizardry.common.items.energy;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import java.util.List;
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
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.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.ChatComponentTranslation;
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;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import java.util.List; import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
public class ItemDestinationClearer extends Item implements IReagentManipulator public class ItemDestinationClearer extends Item implements IReagentManipulator
{ {
@ -26,13 +24,6 @@ public class ItemDestinationClearer extends Item implements IReagentManipulator
this.maxStackSize = 1; this.maxStackSize = 1;
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:TankClearer");
}
@Override @Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{ {
@ -57,11 +48,9 @@ public class ItemDestinationClearer extends Item implements IReagentManipulator
{ {
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 TEReagentConduit)) if (!(tile instanceof TEReagentConduit))
{ {

View file

@ -1,33 +1,29 @@
package WayofTime.alchemicalWizardry.common.items.energy; package WayofTime.alchemicalWizardry.common.items.energy;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import java.util.LinkedList;
import WayofTime.alchemicalWizardry.api.alchemy.energy.*; import java.util.List;
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
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.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.IIcon; import net.minecraft.util.EnumFacing;
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;
import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ISegmentedReagentHandler;
import java.util.LinkedList; import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
import java.util.List; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack;
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
public class ItemTankSegmenter extends Item implements IReagentManipulator public class ItemTankSegmenter extends Item implements IReagentManipulator
{ {
@SideOnly(Side.CLIENT)
public IIcon crystalBody;
@SideOnly(Side.CLIENT)
public IIcon crystalLabel;
public ItemTankSegmenter() public ItemTankSegmenter()
{ {
super(); super();
@ -64,62 +60,6 @@ public class ItemTankSegmenter extends Item implements IReagentManipulator
} }
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.crystalBody = iconRegister.registerIcon("AlchemicalWizardry:TankSegmenter1");
this.crystalLabel = iconRegister.registerIcon("AlchemicalWizardry:TankSegmenter2");
}
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack stack, int pass)
{
switch (pass)
{
case 0:
return 256 * (256 * 255 + 255) + 255;
case 1:
Reagent reagent = this.getReagent(stack);
if (reagent != null)
{
return (reagent.getColourRed() * 256 * 256 + reagent.getColourGreen() * 256 + reagent.getColourBlue());
}
break;
}
return 256 * (256 * 255 + 255) + 255;
}
@Override
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses()
{
return true;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderPasses(int meta)
{
return 2;
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(ItemStack stack, int pass)
{
switch (pass)
{
case 0:
return this.crystalBody;
case 1:
return this.crystalLabel;
}
return this.itemIcon;
}
@Override @Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
{ {
@ -136,10 +76,8 @@ public class ItemTankSegmenter extends Item implements IReagentManipulator
{ {
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; TileEntity tile = world.getTileEntity(pos);
int z = movingobjectposition.blockZ;
TileEntity tile = world.getTileEntity(x, y, z);
if (!(tile instanceof ISegmentedReagentHandler)) if (!(tile instanceof ISegmentedReagentHandler))
{ {
return itemStack; return itemStack;
@ -148,7 +86,7 @@ public class ItemTankSegmenter extends Item implements IReagentManipulator
if (player.isSneaking()) if (player.isSneaking())
{ {
ReagentContainerInfo[] infos = reagentHandler.getContainerInfo(ForgeDirection.UNKNOWN); ReagentContainerInfo[] infos = reagentHandler.getContainerInfo(EnumFacing.UP);
if (infos != null) if (infos != null)
{ {
List<Reagent> reagentList = new LinkedList(); List<Reagent> reagentList = new LinkedList();

View file

@ -1,11 +1,11 @@
package WayofTime.alchemicalWizardry.common.items.potion; package WayofTime.alchemicalWizardry.common.items.potion;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import java.util.ArrayList;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyPotionHelper; import java.util.Iterator;
import com.google.common.collect.HashMultimap; import java.util.List;
import cpw.mods.fml.relauncher.Side; import java.util.Map;
import cpw.mods.fml.relauncher.SideOnly; import java.util.Map.Entry;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.ai.attributes.IAttribute; import net.minecraft.entity.ai.attributes.IAttribute;
@ -23,12 +23,10 @@ import net.minecraft.util.EnumChatFormatting;
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;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyPotionHelper;
import java.util.ArrayList; import com.google.common.collect.HashMultimap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
public class AlchemyFlask extends Item public class AlchemyFlask extends Item
{ {
@ -40,13 +38,6 @@ public class AlchemyFlask extends Item
setCreativeTab(AlchemicalWizardry.tabBloodMagic); setCreativeTab(AlchemicalWizardry.tabBloodMagic);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:PotionFlask");
}
public static ArrayList<AlchemyPotionHelper> getEffects(ItemStack par1ItemStack) public static ArrayList<AlchemyPotionHelper> getEffects(ItemStack par1ItemStack)
{ {
if (par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("CustomFlaskEffects")) if (par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("CustomFlaskEffects"))
@ -149,10 +140,10 @@ public class AlchemyFlask extends Item
{ {
if (this.isPotionThrowable(par1ItemStack)) if (this.isPotionThrowable(par1ItemStack))
{ {
return EnumAction.none; return EnumAction.NONE;
} }
return EnumAction.drink; return EnumAction.DRINK;
} }
/** /**
@ -283,7 +274,7 @@ public class AlchemyFlask extends Item
PotionEffect potioneffect = (PotionEffect) iterator.next(); PotionEffect potioneffect = (PotionEffect) iterator.next();
String s = StatCollector.translateToLocal(potioneffect.getEffectName()).trim(); String s = StatCollector.translateToLocal(potioneffect.getEffectName()).trim();
Potion potion = Potion.potionTypes[potioneffect.getPotionID()]; Potion potion = Potion.potionTypes[potioneffect.getPotionID()];
Map map = potion.func_111186_k(); Map map = potion.getAttributeModifierMap();
if (map != null && map.size() > 0) if (map != null && map.size() > 0)
{ {
@ -293,7 +284,7 @@ public class AlchemyFlask extends Item
{ {
Entry entry = (Entry) iterator1.next(); Entry entry = (Entry) iterator1.next();
AttributeModifier attributemodifier = (AttributeModifier) entry.getValue(); AttributeModifier attributemodifier = (AttributeModifier) entry.getValue();
AttributeModifier attributemodifier1 = new AttributeModifier(attributemodifier.getName(), potion.func_111183_a(potioneffect.getAmplifier(), attributemodifier), attributemodifier.getOperation()); AttributeModifier attributemodifier1 = new AttributeModifier(attributemodifier.getName(), potion.getAttributeModifierAmount(potioneffect.getAmplifier(), attributemodifier), attributemodifier.getOperation());
hashmultimap.put(((IAttribute) entry.getKey()).getAttributeUnlocalizedName(), attributemodifier1); hashmultimap.put(((IAttribute) entry.getKey()).getAttributeUnlocalizedName(), attributemodifier1);
} }
} }
@ -345,11 +336,11 @@ public class AlchemyFlask extends Item
if (d0 > 0.0D) if (d0 > 0.0D)
{ {
par3List.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + attributemodifier2.getOperation(), new Object[]{ItemStack.field_111284_a.format(d1), StatCollector.translateToLocal("attribute.name." + (String) entry1.getKey())})); par3List.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + attributemodifier2.getOperation(), new Object[]{ItemStack.DECIMALFORMAT.format(d1), StatCollector.translateToLocal("attribute.name." + (String) entry1.getKey())}));
} else if (d0 < 0.0D) } else if (d0 < 0.0D)
{ {
d1 *= -1.0D; d1 *= -1.0D;
par3List.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + attributemodifier2.getOperation(), new Object[]{ItemStack.field_111284_a.format(d1), StatCollector.translateToLocal("attribute.name." + (String) entry1.getKey())})); par3List.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + attributemodifier2.getOperation(), new Object[]{ItemStack.DECIMALFORMAT.format(d1), StatCollector.translateToLocal("attribute.name." + (String) entry1.getKey())}));
} }
} }
} }

View file

@ -1,19 +1,17 @@
package WayofTime.alchemicalWizardry.common.items.potion; package WayofTime.alchemicalWizardry.common.items.potion;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import java.util.List;
import WayofTime.alchemicalWizardry.ModItems;
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.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.StatCollector; import net.minecraft.util.StatCollector;
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 AlchemyReagent extends Item public class AlchemyReagent extends Item
{ {
@ -24,61 +22,6 @@ public class AlchemyReagent extends Item
this.setMaxStackSize(64); this.setMaxStackSize(64);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
if (this == ModItems.incendium)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Incendium");
return;
}
if (this == ModItems.magicales)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Magicales");
return;
}
if (this == ModItems.sanctus)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Sanctus");
return;
}
if (this == ModItems.aether)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Aether");
return;
}
if (this == ModItems.simpleCatalyst)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SimpleCatalyst");
return;
}
if (this == ModItems.crepitous)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Crepitous");
return;
}
if (this == ModItems.crystallos)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Crystallos");
return;
}
if (this == ModItems.terrae)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Terrae");
return;
}
if (this == ModItems.aquasalus)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Aquasalus");
return;
}
if (this == ModItems.tennebrae)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Tennebrae");
}
}
@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.potion; package WayofTime.alchemicalWizardry.common.items.potion;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
public class AverageLengtheningCatalyst extends LengtheningCatalyst public class AverageLengtheningCatalyst extends LengtheningCatalyst
{ {
@ -10,11 +7,4 @@ public class AverageLengtheningCatalyst extends LengtheningCatalyst
{ {
super(2); super(2);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AverageLengtheningCatalyst");
}
} }

View file

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

View file

@ -1,11 +1,8 @@
package WayofTime.alchemicalWizardry.common.items.potion; package WayofTime.alchemicalWizardry.common.items.potion;
import net.minecraft.item.Item;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.alchemy.ICombinationalCatalyst; import WayofTime.alchemicalWizardry.common.alchemy.ICombinationalCatalyst;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
public class CombinationalCatalyst extends Item implements ICombinationalCatalyst public class CombinationalCatalyst extends Item implements ICombinationalCatalyst
{ {
@ -15,10 +12,4 @@ public class CombinationalCatalyst extends Item implements ICombinationalCatalys
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:CombinationalCatalyst");
}
} }

View file

@ -1,9 +1,6 @@
package WayofTime.alchemicalWizardry.common.items.potion; package WayofTime.alchemicalWizardry.common.items.potion;
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 EnhancedFillingAgent extends WeakFillingAgent public class EnhancedFillingAgent extends WeakFillingAgent
{ {
@ -41,11 +38,4 @@ public class EnhancedFillingAgent extends WeakFillingAgent
} }
return 0; return 0;
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnhancedFillingAgent");
}
} }

View file

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

View file

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

View file

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

View file

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

View file

@ -1,19 +1,18 @@
package WayofTime.alchemicalWizardry.common.items.potion; package WayofTime.alchemicalWizardry.common.items.potion;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import java.util.List;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
import WayofTime.alchemicalWizardry.common.IBindingAgent;
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.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import java.util.List; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
import WayofTime.alchemicalWizardry.common.IBindingAgent;
public class StandardBindingAgent extends Item implements IBindingAgent public class StandardBindingAgent extends Item implements IBindingAgent
{ {
@ -29,13 +28,6 @@ public class StandardBindingAgent extends Item implements IBindingAgent
return (float) Math.pow(0.65, potions); return (float) Math.pow(0.65, potions);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:StandardBindingAgent");
}
@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,9 +1,6 @@
package WayofTime.alchemicalWizardry.common.items.potion; package WayofTime.alchemicalWizardry.common.items.potion;
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 StandardFillingAgent extends WeakFillingAgent public class StandardFillingAgent extends WeakFillingAgent
{ {
@ -28,11 +25,4 @@ public class StandardFillingAgent extends WeakFillingAgent
return 0; return 0;
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:StandardFillingAgent");
}
} }

View file

@ -1,8 +1,5 @@
package WayofTime.alchemicalWizardry.common.items.potion; package WayofTime.alchemicalWizardry.common.items.potion;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
public class WeakBindingAgent extends StandardBindingAgent public class WeakBindingAgent extends StandardBindingAgent
{ {
@ -16,11 +13,4 @@ public class WeakBindingAgent extends StandardBindingAgent
{ {
return (float) Math.pow(0.4, potions); return (float) Math.pow(0.4, potions);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WeakBindingAgent");
}
} }

View file

@ -1,20 +1,19 @@
package WayofTime.alchemicalWizardry.common.items.potion; package WayofTime.alchemicalWizardry.common.items.potion;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import java.util.List;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; import java.util.Random;
import WayofTime.alchemicalWizardry.common.IFillingAgent;
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.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import java.util.List; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import java.util.Random; import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
import WayofTime.alchemicalWizardry.common.IFillingAgent;
public class WeakFillingAgent extends Item implements IFillingAgent public class WeakFillingAgent extends Item implements IFillingAgent
{ {
@ -48,13 +47,6 @@ public class WeakFillingAgent extends Item implements IFillingAgent
return 0; return 0;
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WeakFillingAgent");
}
@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.routing; package WayofTime.alchemicalWizardry.common.items.routing;
import net.minecraft.client.renderer.texture.IIconRegister;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class InputRoutingFocus extends RoutingFocus public class InputRoutingFocus extends RoutingFocus
{ {
@ -10,11 +7,4 @@ public class InputRoutingFocus extends RoutingFocus
{ {
super(); super();
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:InputRoutingFocus");
}
} }

View file

@ -2,30 +2,23 @@ package WayofTime.alchemicalWizardry.common.items.routing;
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.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.IIcon;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.alchemicalWizardry.api.RoutingFocusLogic; import WayofTime.alchemicalWizardry.api.RoutingFocusLogic;
import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitDefault; import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitDefault;
import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitGlobal; import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitGlobal;
import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitIgnMeta; import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitIgnMeta;
import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitMatchNBT; import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitMatchNBT;
import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitModItems; import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitModItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class OutputRoutingFocus extends RoutingFocus implements ILimitedRoutingFocus public class OutputRoutingFocus extends RoutingFocus implements ILimitedRoutingFocus
{ {
IIcon modItemIcon;
IIcon ignMetaIcon;
IIcon matchNBTIcon;
IIcon globalIcon;
public OutputRoutingFocus() public OutputRoutingFocus()
{ {
super(); super();
@ -46,36 +39,6 @@ public class OutputRoutingFocus extends RoutingFocus implements ILimitedRoutingF
} }
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocus");
this.modItemIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocusModItems");
this.ignMetaIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocusIgnMeta");
this.matchNBTIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocusMatchNBT");
this.globalIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocusGlobal");
}
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int damage)
{
switch(damage)
{
case 0:
return this.itemIcon;
case 1:
return this.modItemIcon;
case 2:
return this.ignMetaIcon;
case 3:
return this.matchNBTIcon;
case 4:
return this.globalIcon;
}
return this.itemIcon;
}
@Override @Override
public String getUnlocalizedName(ItemStack itemStack) public String getUnlocalizedName(ItemStack itemStack)
{ {

View file

@ -8,10 +8,11 @@ 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.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.ForgeDirection;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.Int3; import WayofTime.alchemicalWizardry.api.Int3;
import WayofTime.alchemicalWizardry.api.RoutingFocusLogic; import WayofTime.alchemicalWizardry.api.RoutingFocusLogic;
@ -41,18 +42,18 @@ public class RoutingFocus extends Item
// //
// public void cycleDirection(ItemStack itemStack) // public void cycleDirection(ItemStack itemStack)
// { // {
// ForgeDirection dir = this.getSetDirection(itemStack); // EnumFacing dir = this.getSetDirection(itemStack);
// int direction = dir.ordinal(); // int direction = dir.ordinal();
// direction++; // direction++;
// if(direction >= ForgeDirection.VALID_DIRECTIONS.length) // if(direction >= EnumFacing.VALID_DIRECTIONS.length)
// { // {
// direction = 0; // direction = 0;
// } // }
// //
// this.setSetDirection(itemStack, ForgeDirection.getOrientation(direction)); // this.setSetDirection(itemStack, EnumFacing.getOrientation(direction));
// } // }
public ForgeDirection getSetDirection(ItemStack itemStack) public EnumFacing getSetDirection(ItemStack itemStack)
{ {
if(!itemStack.hasTagCompound()) if(!itemStack.hasTagCompound())
{ {
@ -61,10 +62,10 @@ public class RoutingFocus extends Item
NBTTagCompound tag = itemStack.getTagCompound(); NBTTagCompound tag = itemStack.getTagCompound();
return ForgeDirection.getOrientation(tag.getInteger("direction")); return EnumFacing.getFront(tag.getInteger("direction"));
} }
public void setSetDirection(ItemStack itemStack, ForgeDirection dir) public void setSetDirection(ItemStack itemStack, EnumFacing dir)
{ {
if(!itemStack.hasTagCompound()) if(!itemStack.hasTagCompound())
{ {
@ -96,14 +97,14 @@ public class RoutingFocus extends Item
} }
@Override @Override
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
{ {
if(world.isRemote) if(world.isRemote)
{ {
return false; return false;
} }
TileEntity tile = world.getTileEntity(x, y, z); TileEntity tile = world.getTileEntity(pos);
if(tile instanceof IInventory) if(tile instanceof IInventory)
{ {
if(player.isSneaking()) if(player.isSneaking())
@ -111,7 +112,7 @@ public class RoutingFocus extends Item
if(this instanceof ILimitedRoutingFocus) if(this instanceof ILimitedRoutingFocus)
{ {
int pastAmount = ((ILimitedRoutingFocus)this).getRoutingFocusLimit(stack); int pastAmount = ((ILimitedRoutingFocus)this).getRoutingFocusLimit(stack);
int amount = SpellHelper.getNumberOfItemsInInventory((IInventory)tile, ForgeDirection.getOrientation(side)); int amount = SpellHelper.getNumberOfItemsInInventory((IInventory)tile, side);
if(amount != pastAmount) if(amount != pastAmount)
{ {
((ILimitedRoutingFocus)this).setRoutingFocusLimit(stack, amount); ((ILimitedRoutingFocus)this).setRoutingFocusLimit(stack, amount);
@ -120,8 +121,8 @@ public class RoutingFocus extends Item
} }
} }
this.setCoordinates(stack, x, y, z); this.setCoordinates(stack, pos);
this.setSetDirection(stack, ForgeDirection.getOrientation(side)); this.setSetDirection(stack, side);
return true; return true;
} }
@ -129,7 +130,7 @@ public class RoutingFocus extends Item
return true; return true;
} }
public void setCoordinates(ItemStack itemStack, int x, int y, int z) public void setCoordinates(ItemStack itemStack, BlockPos pos)
{ {
if(!itemStack.hasTagCompound()) if(!itemStack.hasTagCompound())
{ {
@ -138,9 +139,9 @@ public class RoutingFocus extends Item
NBTTagCompound tag = itemStack.getTagCompound(); NBTTagCompound tag = itemStack.getTagCompound();
tag.setInteger("xCoord", x); tag.setInteger("xCoord", pos.getX());
tag.setInteger("yCoord", y); tag.setInteger("yCoord", pos.getY());
tag.setInteger("zCoord", z); tag.setInteger("zCoord", pos.getZ());
} }
public int xCoord(ItemStack itemStack) public int xCoord(ItemStack itemStack)

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,30 +1,21 @@
package WayofTime.alchemicalWizardry.common.items.sigil; package WayofTime.alchemicalWizardry.common.items.sigil;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import java.util.List;
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
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 WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import java.util.List; public class SigilOfWind extends SigilToggleable implements ArmourUpgrade, ISigil
public class SigilOfWind extends EnergyItems implements ArmourUpgrade, ISigil
{ {
@SideOnly(Side.CLIENT)
private IIcon activeIcon;
@SideOnly(Side.CLIENT)
private IIcon passiveIcon;
public SigilOfWind() public SigilOfWind()
{ {
super(); super();
@ -40,7 +31,7 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade, ISigil
if (!(par1ItemStack.getTagCompound() == null)) if (!(par1ItemStack.getTagCompound() == null))
{ {
if (par1ItemStack.getTagCompound().getBoolean("isActive")) if (this.getActivated(par1ItemStack))
{ {
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated")); par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
} else } else
@ -52,47 +43,6 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade, ISigil
} }
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WindSigil_deactivated");
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:WindSigil_activated");
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:WindSigil_deactivated");
}
@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
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1)
{
if (par1 == 1)
{
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)
{ {
@ -107,13 +57,13 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade, ISigil
} }
NBTTagCompound tag = par1ItemStack.getTagCompound(); NBTTagCompound tag = par1ItemStack.getTagCompound();
tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack)));
if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) if (this.getActivated(par1ItemStack) && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
{ {
par1ItemStack.setItemDamage(1); par1ItemStack.setItemDamage(1);
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 1)); par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 1, true, false));
} else } else
{ {
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage()); par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
@ -148,7 +98,7 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade, ISigil
{ {
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
{ {
par1ItemStack.getTagCompound().setBoolean("isActive", false); this.setActivated(par1ItemStack, false);
} }
} }
} }

Some files were not shown because too many files have changed in this diff Show more