diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/items/ItemSpellMultiTool.java b/src/main/java/WayofTime/alchemicalWizardry/api/items/ItemSpellMultiTool.java index c734d12b..4d5b1fd2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/items/ItemSpellMultiTool.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/items/ItemSpellMultiTool.java @@ -43,12 +43,6 @@ public class ItemSpellMultiTool extends Item this.setMaxStackSize(1); this.setFull3D(); } - - @Override - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundTool"); - } @Override public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java index c0490bd8..0cc5adf7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java @@ -1,12 +1,15 @@ package WayofTime.alchemicalWizardry.common.entity.projectile; -import WayofTime.alchemicalWizardry.ModBlocks; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.ModBlocks; public class EntityBloodLightProjectile extends EnergyBlastProjectile @@ -55,39 +58,12 @@ public class EntityBloodLightProjectile extends EnergyBlastProjectile this.onImpact(mop.entityHit); } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - int sideHit = mop.sideHit; - int blockX = mop.blockX; - int blockY = mop.blockY; - int blockZ = mop.blockZ; - - if (sideHit == 0 && this.worldObj.isAirBlock(blockX, blockY - 1, blockZ)) + EnumFacing facing = mop.field_178784_b; + BlockPos position = mop.func_178782_a().offset(facing); + + if(this.worldObj.isAirBlock(position)) { - this.worldObj.setBlock(blockX, blockY - 1, blockZ, ModBlocks.blockBloodLight); - } - - 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); + this.worldObj.setBlockState(position, ModBlocks.blockBloodLight.getDefaultState()); } } @@ -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(); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaMainProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaMainProjectile.java index fbc3fa57..11617db3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaMainProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaMainProjectile.java @@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.entity.projectile; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; 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); } - spawnHitParticles("magicCrit", 8); + spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); this.setDead(); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaSecondaryProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaSecondaryProjectile.java index 8ab1b0dc..992b733d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaSecondaryProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaSecondaryProjectile.java @@ -4,20 +4,23 @@ import java.util.Iterator; import java.util.List; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IProjectile; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectile implements IProjectile { @@ -48,7 +51,6 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil super(par1World); this.setSize(0.5F, 0.5F); this.setPosition(par2, par4, par6); - yOffset = 0.0F; this.damage = damage; } @@ -63,7 +65,6 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil posY -= 0.2D; posZ -= MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * 0.16F; 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); 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); @@ -102,18 +103,6 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil 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 @SideOnly(Side.CLIENT) /** @@ -180,28 +169,21 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil 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) { - var16.setBlockBoundsBasedOnState(worldObj, xTile, yTile, zTile); - AxisAlignedBB var2 = var16.getCollisionBoundingBoxFromPool(worldObj, xTile, yTile, zTile); + var16.setBlockBoundsBasedOnState(worldObj, new BlockPos(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; } } - 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 + if (!inGround) { ++ticksInAir; @@ -213,19 +195,19 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil } } - Vec3 var17 = SpellHelper.createVec3(posX, posY, posZ); - Vec3 var3 = SpellHelper.createVec3(posX + motionX, posY + motionY, posZ + motionZ); - MovingObjectPosition var4 = worldObj.func_147447_a(var17, var3, true, false, false); - var17 = SpellHelper.createVec3(posX, posY, posZ); - var3 = SpellHelper.createVec3(posX + motionX, posY + motionY, posZ + motionZ); + Vec3 var17 = new Vec3(posX, posY, posZ); + Vec3 var3 = new Vec3(posX + motionX, posY + motionY, posZ + motionZ); + MovingObjectPosition var4 = worldObj.rayTraceBlocks(var17, var3, true, false, false); + var17 = new Vec3(posX, posY, posZ); + var3 = new Vec3(posX + motionX, posY + motionY, posZ + motionZ); 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; - 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; Iterator var9 = var6.iterator(); float var11; @@ -237,7 +219,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil if (var10.canBeCollidedWith() && (var10 != shootingEntity || ticksInAir >= 5)) { 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); if (var13 != null) @@ -278,8 +260,8 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil 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("flame", posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); + 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(EnumParticleTypes.FLAME, posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); } /** @@ -320,13 +302,6 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil 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. */ @@ -382,7 +357,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil this.onImpact(mop.entityHit); } 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); } } @@ -399,7 +374,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil worldObj.createExplosion(shootingEntity, posX, posY, posZ, 2, false); } - spawnHitParticles("magicCrit", 8); + spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); this.setDead(); } @@ -408,11 +383,11 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil 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++) { - 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); } - public void groundImpact(int sideHit) + public void groundImpact(EnumFacing sideHit) { this.ricochet(sideHit); } @@ -441,27 +416,21 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil return d + d * ((rand.nextFloat() - 0.5D) / 4); } - private void ricochet(int sideHit) - { - switch (sideHit) + private void ricochet(EnumFacing sideHit) + { + if(sideHit.getFrontOffsetX() != 0) { - case 0: - case 1: - // topHit, bottomHit, reflect Y - motionY = motionY * -1; - break; - - case 2: - case 3: - // westHit, eastHit, reflect Z - motionZ = motionZ * -1; - break; - - case 4: - case 5: - // southHit, northHit, reflect X - motionX = motionX * -1; - break; + motionX *= -1; + } + + if(sideHit.getFrontOffsetY() != 0) + { + motionY *= -1; + } + + if(sideHit.getFrontOffsetZ() != 0) + { + motionZ *= -1; } ricochetCounter++; @@ -472,32 +441,33 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil for (int particles = 0; particles < 4; particles++) { - switch (sideHit) - { - case 0: - 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)); - break; - - case 2: - 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)); - break; - - case 4: - 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)); - break; - } + 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)); +// break; +// +// case 1: +// 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)); +// break; +// +// case 3: +// 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)); +// break; +// +// case 5: +// worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); +// break; +// } } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityMeteor.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityMeteor.java index 2307236c..9b234851 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityMeteor.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityMeteor.java @@ -74,7 +74,7 @@ public class EntityMeteor extends EnergyBlastProjectile this.onImpact(mop.entityHit); } 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(); @@ -83,7 +83,7 @@ public class EntityMeteor extends EnergyBlastProjectile @Override 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(); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityParticleBeam.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityParticleBeam.java index 88c92ad2..e2a0ba8e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityParticleBeam.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityParticleBeam.java @@ -1,18 +1,17 @@ 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.EntityLivingBase; import net.minecraft.entity.IProjectile; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; 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 public class EntityParticleBeam extends Entity implements IProjectile, IThrowableEntity @@ -51,7 +50,6 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl super(par1World); this.setSize(0.5F, 0.5F); this.setPosition(par2, par4, par6); - yOffset = 0.0F; this.maxTicksInAir = 600; } @@ -66,7 +64,6 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl posY -= 0.2D; posZ -= MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * 0.16F; 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); 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); @@ -86,7 +83,6 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl posY -= 0.2D; posZ -= MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * 0.16F; 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); 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); @@ -102,7 +98,7 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl this.shootingEntity = par2EntityLivingBase; this.posY = par2EntityLivingBase.posY + (double) par2EntityLivingBase.getEyeHeight() - 0.10000000149011612D; 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 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 d5 = d2 / d3; this.setLocationAndAngles(par2EntityLivingBase.posX + d4, this.posY, par2EntityLivingBase.posZ + d5, f2, f3); - this.yOffset = 0.0F; float f4 = (float) d3 * 0.2F; 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); } - @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 @SideOnly(Side.CLIENT) /** @@ -225,9 +208,11 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl { 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())); - FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle); + + 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); +// 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; } - @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() { return DamageSource.causeMobDamage(shootingEntity); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/ExplosionProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/ExplosionProjectile.java index 24c6af9b..6ab68863 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/ExplosionProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/ExplosionProjectile.java @@ -4,6 +4,7 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -81,15 +82,15 @@ public class ExplosionProjectile extends EnergyBlastProjectile } } - spawnHitParticles("magicCrit", 8); + spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); this.setDead(); } @Override 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("explode", posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); + 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(EnumParticleTypes.EXPLOSION_LARGE, posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/FireProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/FireProjectile.java index ba8f3041..f01f4812 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/FireProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/FireProjectile.java @@ -4,7 +4,9 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.init.Blocks; import net.minecraft.potion.Potion; +import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -60,9 +62,10 @@ public class FireProjectile extends EnergyBlastProjectile { 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(); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/HolyProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/HolyProjectile.java index 2497c43e..24fb77fa 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/HolyProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/HolyProjectile.java @@ -4,6 +4,7 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -79,14 +80,14 @@ public class HolyProjectile extends EnergyBlastProjectile } } - spawnHitParticles("magicCrit", 8); + spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); this.setDead(); } @Override 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(), "mobSpell", posX, posY, posZ, 1.0F, 1.0F, 1.0F); + 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(), EnumParticleTypes.SPELL_MOB, posX, posY, posZ, 1.0F, 1.0F, 1.0F); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/IceProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/IceProjectile.java index 247a6dd3..29d44965 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/IceProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/IceProjectile.java @@ -5,6 +5,7 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; 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)) - { - //worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ,Block.fire.blockID); - } - - spawnHitParticles("magicCrit", 8); + spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); this.setDead(); } @Override 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(), "explode", posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); + 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(), EnumParticleTypes.EXPLOSION_LARGE, posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/LightningBoltProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/LightningBoltProjectile.java index 3273cf11..f936106f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/LightningBoltProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/LightningBoltProjectile.java @@ -6,6 +6,7 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -83,15 +84,15 @@ public class LightningBoltProjectile extends EnergyBlastProjectile } } - spawnHitParticles("magicCrit", 8); + spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); this.setDead(); } @Override 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(), "mobSpell", posX, posY, posZ, 1.0F, 1.0F, 1.0F); + 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(), EnumParticleTypes.SPELL_MOB, posX, posY, posZ, 1.0F, 1.0F, 1.0F); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/MudProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/MudProjectile.java index 3d6ba693..938a94c8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/MudProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/MudProjectile.java @@ -7,6 +7,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -87,15 +88,15 @@ public class MudProjectile extends EnergyBlastProjectile } } - spawnHitParticles("magicCrit", 8); + spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); this.setDead(); } @Override 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(), "mobSpell", posX, posY, posZ, 0.5F, 0.297F, 0.0664F); + 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(), EnumParticleTypes.SPELL_MOB, posX, posY, posZ, 0.5F, 0.297F, 0.0664F); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/TeleportProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/TeleportProjectile.java index 5e6a0d77..6ed6d1a2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/TeleportProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/TeleportProjectile.java @@ -7,6 +7,7 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; @@ -131,15 +132,15 @@ public class TeleportProjectile extends EnergyBlastProjectile } } - spawnHitParticles("magicCrit", 8); + spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); this.setDead(); } @Override 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(), "portal", posX, posY, posZ, -motionX, -motionY, -motionZ); + 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(), EnumParticleTypes.PORTAL, posX, posY, posZ, -motionX, -motionY, -motionZ); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WaterProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WaterProjectile.java index aa5c24f0..d76b227b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WaterProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WaterProjectile.java @@ -6,6 +6,7 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -77,14 +78,14 @@ public class WaterProjectile extends EnergyBlastProjectile } } - spawnHitParticles("magicCrit", 8); + spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); this.setDead(); } @Override 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(), "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.PORTAL, posX, posY, posZ, -motionX, -motionY, -motionZ); + 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); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WindGustProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WindGustProjectile.java index d04c27c2..59562027 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WindGustProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WindGustProjectile.java @@ -4,6 +4,7 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -74,14 +75,14 @@ public class WindGustProjectile extends EnergyBlastProjectile } } - spawnHitParticles("magicCrit", 8); + spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); this.setDead(); } @Override 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(), "mobSpell", posX, posY, posZ, 1.0F, 1.0F, 1.0F); + 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(), EnumParticleTypes.SPELL_MOB, posX, posY, posZ, 1.0F, 1.0F, 1.0F); } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/BoundArmour.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/BoundArmour.java index c6c1f305..23bcef7b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/BoundArmour.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/BoundArmour.java @@ -3,26 +3,24 @@ package WayofTime.alchemicalWizardry.common.items.armour; import java.util.List; import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; -import net.minecraft.item.Item; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.potion.Potion; import net.minecraft.util.DamageSource; -import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.ISpecialArmor; import net.minecraftforge.common.util.Constants; -import thaumcraft.api.IGoggles; -import thaumcraft.api.IRunicArmor; -import thaumcraft.api.nodes.IRevealer; +import net.minecraftforge.fml.common.Optional; +import net.minecraftforge.fml.common.Optional.Interface; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.ModItems; 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.sigil.SigilDivination; 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")}) -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; @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; @@ -109,10 +96,10 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA if (((EntityPlayer) entityLiving).getItemInUseDuration() > 0) { EnumAction enumaction = ((EntityPlayer) entityLiving).getItemInUse().getItemUseAction(); - if (enumaction == EnumAction.block) + if (enumaction == EnumAction.BLOCK) { this.model.heldItemRight = 3; - } else if (enumaction == EnumAction.bow) + } else if (enumaction == EnumAction.BOW) { 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 public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { @@ -594,66 +543,66 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA return false; } - @Optional.Method(modid = "Thaumcraft") - public boolean hasIRevealer(ItemStack itemStack) - { - ItemStack[] inv = getInternalInventory(itemStack); - - if (inv == null) - { - return false; - } - - for (ItemStack item : inv) - { - if (item == null) - { - continue; - } - - if (item.getItem() instanceof IRevealer) - { - return true; - } - } - - return false; - } - - @Optional.Method(modid = "Thaumcraft") - public boolean hasIGoggles(ItemStack itemStack) - { - ItemStack[] inv = getInternalInventory(itemStack); - - if (inv == null) - { - return false; - } - - int blood = getMaxBloodShardLevel(itemStack); - - for (ItemStack item : inv) - { - if (item == null) - { - continue; - } - if (item.getItem() instanceof ArmourUpgrade && blood > 0) - { - if (item.getItem() instanceof IGoggles) - { - return true; - } - - if(((ArmourUpgrade)item.getItem()).isUpgrade()) - { - blood--; - } - } - } - - return false; - } +// @Optional.Method(modid = "Thaumcraft") +// public boolean hasIRevealer(ItemStack itemStack) +// { +// ItemStack[] inv = getInternalInventory(itemStack); +// +// if (inv == null) +// { +// return false; +// } +// +// for (ItemStack item : inv) +// { +// if (item == null) +// { +// continue; +// } +// +// if (item.getItem() instanceof IRevealer) +// { +// return true; +// } +// } +// +// return false; +// } +// +// @Optional.Method(modid = "Thaumcraft") +// public boolean hasIGoggles(ItemStack itemStack) +// { +// ItemStack[] inv = getInternalInventory(itemStack); +// +// if (inv == null) +// { +// return false; +// } +// +// int blood = getMaxBloodShardLevel(itemStack); +// +// for (ItemStack item : inv) +// { +// if (item == null) +// { +// continue; +// } +// if (item.getItem() instanceof ArmourUpgrade && blood > 0) +// { +// if (item.getItem() instanceof IGoggles) +// { +// return true; +// } +// +// if(((ArmourUpgrade)item.getItem()).isUpgrade()) +// { +// blood--; +// } +// } +// } +// +// return false; +// } @Override public boolean canSeeLPBar(ItemStack itemStack) @@ -783,75 +732,75 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA tag.setBoolean("invisible", invisible); } - @Override - @Optional.Method(modid = "Thaumcraft") - public boolean showNodes(ItemStack itemstack, EntityLivingBase player) - { - return this.hasIRevealer(itemstack); - } - - @Override - @Optional.Method(modid = "Thaumcraft") - public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) - { - return this.hasIGoggles(itemstack); - } - - @Override - @Optional.Method(modid = "Thaumcraft") - public int getRunicCharge(ItemStack itemstack) - { - ItemStack[] inv = this.getInternalInventory(itemstack); - int shardLevel = this.getMaxBloodShardLevel(itemstack); - int count = 0; - int harden = 0; - - if (inv == null) - { - return 0; - } - - for (ItemStack stack : inv) - { - if (count >= shardLevel) - { - break; - } - - if (stack == null || !(stack.getItem() instanceof ArmourUpgrade)) - { - continue; - } - - if (stack.getItem() instanceof ItemArmor && ((ItemArmor) stack.getItem()).armorType != this.armorType) - { - continue; - } - - if (stack.hasTagCompound()) - { - NBTTagCompound tag = stack.getTagCompound(); - - int enchLvl = tag.getByte("RS.HARDEN"); - - if (stack.getItem() instanceof IRunicArmor) - { - enchLvl += ((IRunicArmor) stack.getItem()).getRunicCharge(stack); - } - - if (enchLvl > 0) - { - harden += enchLvl; - if (((ArmourUpgrade) stack.getItem()).isUpgrade()) - { - count += 1; - } - } - } - } - - return harden; - } +// @Override +// @Optional.Method(modid = "Thaumcraft") +// public boolean showNodes(ItemStack itemstack, EntityLivingBase player) +// { +// return this.hasIRevealer(itemstack); +// } +// +// @Override +// @Optional.Method(modid = "Thaumcraft") +// public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) +// { +// return this.hasIGoggles(itemstack); +// } +// +// @Override +// @Optional.Method(modid = "Thaumcraft") +// public int getRunicCharge(ItemStack itemstack) +// { +// ItemStack[] inv = this.getInternalInventory(itemstack); +// int shardLevel = this.getMaxBloodShardLevel(itemstack); +// int count = 0; +// int harden = 0; +// +// if (inv == null) +// { +// return 0; +// } +// +// for (ItemStack stack : inv) +// { +// if (count >= shardLevel) +// { +// break; +// } +// +// if (stack == null || !(stack.getItem() instanceof ArmourUpgrade)) +// { +// continue; +// } +// +// if (stack.getItem() instanceof ItemArmor && ((ItemArmor) stack.getItem()).armorType != this.armorType) +// { +// continue; +// } +// +// if (stack.hasTagCompound()) +// { +// NBTTagCompound tag = stack.getTagCompound(); +// +// int enchLvl = tag.getByte("RS.HARDEN"); +// +// if (stack.getItem() instanceof IRunicArmor) +// { +// enchLvl += ((IRunicArmor) stack.getItem()).getRunicCharge(stack); +// } +// +// if (enchLvl > 0) +// { +// harden += enchLvl; +// if (((ArmourUpgrade) stack.getItem()).isUpgrade()) +// { +// count += 1; +// } +// } +// } +// } +// +// return harden; +// } @Override public boolean showIngameHUD(World world, ItemStack stack, EntityPlayer player) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmour.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmour.java index ca292038..fb8bdc9c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmour.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmour.java @@ -20,15 +20,16 @@ import net.minecraft.item.EnumAction; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; import net.minecraft.world.World; 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.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.api.spell.APISpellHelper; import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public abstract class OmegaArmour extends BoundArmour { @@ -90,10 +91,9 @@ public abstract class OmegaArmour extends BoundArmour { if(this.storeBiomeID()) { - int xCoord = (int) Math.floor(player.posX); - int zCoord = (int) Math.floor(player.posZ); + BlockPos pos = player.getPosition(); - BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord); + BiomeGenBase biome = world.getBiomeGenForCoords(pos); if(biome != null) { this.setBiomeIDStored(itemStack, biome.biomeID); @@ -376,10 +376,10 @@ public abstract class OmegaArmour extends BoundArmour if (((EntityPlayer) entityLiving).getItemInUseDuration() > 0) { EnumAction enumaction = ((EntityPlayer) entityLiving).getItemInUse().getItemUseAction(); - if (enumaction == EnumAction.block) + if (enumaction == EnumAction.BLOCK) { this.model.heldItemRight = 3; - } else if (enumaction == EnumAction.bow) + } else if (enumaction == EnumAction.BOW) { this.model.aimedBow = true; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourEarth.java index a60bd254..41545359 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourEarth.java @@ -3,32 +3,19 @@ package WayofTime.alchemicalWizardry.common.items.armour; import java.util.UUID; import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import WayofTime.alchemicalWizardry.ModItems; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaEarth; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - 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) { super(armorType); @@ -55,44 +42,6 @@ public class OmegaArmourEarth extends OmegaArmour 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 public Multimap getAttributeModifiers(ItemStack stack) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourFire.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourFire.java index 2f9d6825..eabc089b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourFire.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourFire.java @@ -2,34 +2,22 @@ package WayofTime.alchemicalWizardry.common.items.armour; 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.renderer.texture.IIconRegister; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; 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 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 -{ - @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) { super(armorType); @@ -57,44 +45,6 @@ public class OmegaArmourFire extends OmegaArmour 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 public Multimap getAttributeModifiers(ItemStack stack) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWater.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWater.java index 6afb527a..0ef14b4f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWater.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWater.java @@ -2,33 +2,21 @@ package WayofTime.alchemicalWizardry.common.items.armour; 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.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; 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 com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; + 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) { super(armorType); @@ -55,44 +43,6 @@ public class OmegaArmourWater extends OmegaArmour 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 public Multimap getAttributeModifiers(ItemStack stack) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWind.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWind.java index 1048d1c4..47408e50 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWind.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWind.java @@ -3,32 +3,19 @@ package WayofTime.alchemicalWizardry.common.items.armour; import java.util.UUID; import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import WayofTime.alchemicalWizardry.ModItems; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaWind; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - 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) { super(armorType); @@ -55,44 +42,6 @@ public class OmegaArmourWind extends OmegaArmour 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 public Multimap getAttributeModifiers(ItemStack stack) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemAttunedCrystal.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemAttunedCrystal.java index 87729e2a..fed941e1 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemAttunedCrystal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemAttunedCrystal.java @@ -1,36 +1,34 @@ package WayofTime.alchemicalWizardry.common.items.energy; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.Int3; -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 java.util.LinkedList; +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.tileentity.TileEntity; +import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -import java.util.LinkedList; -import java.util.List; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.Int3; +import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler; +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 static final int maxDistance = 6; - - public IIcon crystalBody; - public IIcon crystalLabel; - + public ItemAttunedCrystal() { 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 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) { - int x = movingobjectposition.blockX; - int y = movingobjectposition.blockY; - int z = movingobjectposition.blockZ; + BlockPos pos = movingobjectposition.func_178782_a(); - TileEntity tile = world.getTileEntity(x, y, z); + TileEntity tile = world.getTileEntity(pos); if (!(tile instanceof IReagentHandler)) { @@ -172,7 +112,7 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator if (player.isSneaking()) { - ReagentContainerInfo[] infos = relay.getContainerInfo(ForgeDirection.UNKNOWN); + ReagentContainerInfo[] infos = relay.getContainerInfo(EnumFacing.UP); if (infos != null) { List reagentList = new LinkedList(); @@ -223,13 +163,13 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator 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")); 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)) { player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.cannotfind")); @@ -247,10 +187,10 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator if (player.isSneaking()) { - pastRelay.removeReagentDestinationViaActual(reagent, x, y, z); + pastRelay.removeReagentDestinationViaActual(reagent, pos); } else { - if (pastRelay.addReagentDestinationViaActual(reagent, x, y, z)) + if (pastRelay.addReagentDestinationViaActual(reagent, pos)) { player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.attunedcrystal.linked") + " " + reagent.name)); } else @@ -258,13 +198,13 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator 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 { int dimension = world.provider.getDimensionId(); 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")); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemDestinationClearer.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemDestinationClearer.java index d4642a7f..5ea4e85c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemDestinationClearer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemDestinationClearer.java @@ -1,21 +1,19 @@ package WayofTime.alchemicalWizardry.common.items.energy; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -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 java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.StatCollector; import net.minecraft.world.World; - -import java.util.List; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator; +import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit; public class ItemDestinationClearer extends Item implements IReagentManipulator { @@ -26,13 +24,6 @@ public class ItemDestinationClearer extends Item implements IReagentManipulator this.maxStackSize = 1; } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:TankClearer"); - } - @Override 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) { - int x = movingobjectposition.blockX; - int y = movingobjectposition.blockY; - int z = movingobjectposition.blockZ; + BlockPos pos = movingobjectposition.func_178782_a(); - TileEntity tile = world.getTileEntity(x, y, z); + TileEntity tile = world.getTileEntity(pos); if (!(tile instanceof TEReagentConduit)) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemTankSegmenter.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemTankSegmenter.java index 83bbbd6b..19e02a18 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemTankSegmenter.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemTankSegmenter.java @@ -1,33 +1,29 @@ package WayofTime.alchemicalWizardry.common.items.energy; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.alchemy.energy.*; -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 java.util.LinkedList; +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.tileentity.TileEntity; +import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -import java.util.LinkedList; -import java.util.List; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.alchemy.energy.ISegmentedReagentHandler; +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; public class ItemTankSegmenter extends Item implements IReagentManipulator { - @SideOnly(Side.CLIENT) - public IIcon crystalBody; - @SideOnly(Side.CLIENT) - public IIcon crystalLabel; - public ItemTankSegmenter() { 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 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) { - int x = movingobjectposition.blockX; - int y = movingobjectposition.blockY; - int z = movingobjectposition.blockZ; - TileEntity tile = world.getTileEntity(x, y, z); + BlockPos pos = movingobjectposition.func_178782_a(); + TileEntity tile = world.getTileEntity(pos); if (!(tile instanceof ISegmentedReagentHandler)) { return itemStack; @@ -148,7 +86,7 @@ public class ItemTankSegmenter extends Item implements IReagentManipulator if (player.isSneaking()) { - ReagentContainerInfo[] infos = reagentHandler.getContainerInfo(ForgeDirection.UNKNOWN); + ReagentContainerInfo[] infos = reagentHandler.getContainerInfo(EnumFacing.UP); if (infos != null) { List reagentList = new LinkedList(); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyFlask.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyFlask.java index 27ac77f7..520db9fd 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyFlask.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyFlask.java @@ -1,11 +1,11 @@ package WayofTime.alchemicalWizardry.common.items.potion; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.alchemy.AlchemyPotionHelper; -import com.google.common.collect.HashMultimap; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.renderer.texture.IIconRegister; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.ai.attributes.IAttribute; @@ -23,12 +23,10 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.alchemy.AlchemyPotionHelper; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; +import com.google.common.collect.HashMultimap; public class AlchemyFlask extends Item { @@ -40,13 +38,6 @@ public class AlchemyFlask extends Item setCreativeTab(AlchemicalWizardry.tabBloodMagic); } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:PotionFlask"); - } - public static ArrayList getEffects(ItemStack par1ItemStack) { if (par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("CustomFlaskEffects")) @@ -149,10 +140,10 @@ public class AlchemyFlask extends Item { 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(); String s = StatCollector.translateToLocal(potioneffect.getEffectName()).trim(); Potion potion = Potion.potionTypes[potioneffect.getPotionID()]; - Map map = potion.func_111186_k(); + Map map = potion.getAttributeModifierMap(); if (map != null && map.size() > 0) { @@ -293,7 +284,7 @@ public class AlchemyFlask extends Item { Entry entry = (Entry) iterator1.next(); 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); } } @@ -345,11 +336,11 @@ public class AlchemyFlask extends Item 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) { 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())})); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyReagent.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyReagent.java index 4f7caa72..4b856a08 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyReagent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyReagent.java @@ -1,19 +1,17 @@ package WayofTime.alchemicalWizardry.common.items.potion; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -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 java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; + import org.lwjgl.input.Keyboard; -import java.util.List; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; public class AlchemyReagent extends Item { @@ -24,61 +22,6 @@ public class AlchemyReagent extends Item 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 public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AverageLengtheningCatalyst.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AverageLengtheningCatalyst.java index eb7885dd..168c4897 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AverageLengtheningCatalyst.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AverageLengtheningCatalyst.java @@ -1,8 +1,5 @@ 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 { @@ -10,11 +7,4 @@ public class AverageLengtheningCatalyst extends LengtheningCatalyst { super(2); } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AverageLengtheningCatalyst"); - } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AveragePowerCatalyst.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AveragePowerCatalyst.java index 1fb50aec..7ec8f7d6 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AveragePowerCatalyst.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AveragePowerCatalyst.java @@ -1,8 +1,5 @@ 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 { @@ -10,11 +7,4 @@ public class AveragePowerCatalyst extends PowerCatalyst { super(2); } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AveragePowerCatalyst"); - } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/CombinationalCatalyst.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/CombinationalCatalyst.java index 071d7c9b..543b313f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/CombinationalCatalyst.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/CombinationalCatalyst.java @@ -1,11 +1,8 @@ package WayofTime.alchemicalWizardry.common.items.potion; +import net.minecraft.item.Item; import WayofTime.alchemicalWizardry.AlchemicalWizardry; 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 { @@ -15,10 +12,4 @@ public class CombinationalCatalyst extends Item implements ICombinationalCatalys this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:CombinationalCatalyst"); - } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/EnhancedFillingAgent.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/EnhancedFillingAgent.java index b4026634..8d02cf07 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/EnhancedFillingAgent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/EnhancedFillingAgent.java @@ -1,9 +1,6 @@ package WayofTime.alchemicalWizardry.common.items.potion; 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 { @@ -41,11 +38,4 @@ public class EnhancedFillingAgent extends WeakFillingAgent } return 0; } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnhancedFillingAgent"); - } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterLengtheningCatalyst.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterLengtheningCatalyst.java index 32d0e599..ccafc906 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterLengtheningCatalyst.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterLengtheningCatalyst.java @@ -1,8 +1,5 @@ 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 { @@ -10,11 +7,4 @@ public class GreaterLengtheningCatalyst extends LengtheningCatalyst { super(3); } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:GreaterLengtheningCatalyst"); - } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterPowerCatalyst.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterPowerCatalyst.java index 56dbe73f..c1967cb2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterPowerCatalyst.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterPowerCatalyst.java @@ -1,8 +1,5 @@ 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 { @@ -10,11 +7,4 @@ public class GreaterPowerCatalyst extends PowerCatalyst { super(3); } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:GreaterPowerCatalyst"); - } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundaneLengtheningCatalyst.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundaneLengtheningCatalyst.java index 581a4575..ddfe0d02 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundaneLengtheningCatalyst.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundaneLengtheningCatalyst.java @@ -1,8 +1,5 @@ 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 { @@ -10,11 +7,4 @@ public class MundaneLengtheningCatalyst extends LengtheningCatalyst { super(1); } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MundaneLengtheningCatalyst"); - } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundanePowerCatalyst.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundanePowerCatalyst.java index 0a85efbe..e25e8878 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundanePowerCatalyst.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundanePowerCatalyst.java @@ -1,8 +1,5 @@ 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 { @@ -10,11 +7,4 @@ public class MundanePowerCatalyst extends PowerCatalyst { super(1); } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MundanePowerCatalyst"); - } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardBindingAgent.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardBindingAgent.java index 8c963024..d3953953 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardBindingAgent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardBindingAgent.java @@ -1,19 +1,18 @@ package WayofTime.alchemicalWizardry.common.items.potion; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -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 java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; + 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 { @@ -29,13 +28,6 @@ public class StandardBindingAgent extends Item implements IBindingAgent return (float) Math.pow(0.65, potions); } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:StandardBindingAgent"); - } - @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardFillingAgent.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardFillingAgent.java index c0a93be4..44d8bc4a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardFillingAgent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardFillingAgent.java @@ -1,9 +1,6 @@ package WayofTime.alchemicalWizardry.common.items.potion; 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 { @@ -28,11 +25,4 @@ public class StandardFillingAgent extends WeakFillingAgent return 0; } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:StandardFillingAgent"); - } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakBindingAgent.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakBindingAgent.java index 86c941e5..b95591c6 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakBindingAgent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakBindingAgent.java @@ -1,8 +1,5 @@ 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 { @@ -16,11 +13,4 @@ public class WeakBindingAgent extends StandardBindingAgent { return (float) Math.pow(0.4, potions); } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WeakBindingAgent"); - } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakFillingAgent.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakFillingAgent.java index d65b9e1c..04155e3a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakFillingAgent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakFillingAgent.java @@ -1,20 +1,19 @@ package WayofTime.alchemicalWizardry.common.items.potion; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; -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 java.util.List; +import java.util.Random; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; + import org.lwjgl.input.Keyboard; -import java.util.List; -import java.util.Random; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; +import WayofTime.alchemicalWizardry.common.IFillingAgent; public class WeakFillingAgent extends Item implements IFillingAgent { @@ -48,13 +47,6 @@ public class WeakFillingAgent extends Item implements IFillingAgent return 0; } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WeakFillingAgent"); - } - @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/InputRoutingFocus.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/InputRoutingFocus.java index eb0ce04e..96ee3421 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/InputRoutingFocus.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/InputRoutingFocus.java @@ -1,8 +1,5 @@ package WayofTime.alchemicalWizardry.common.items.routing; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import codechicken.lib.render.TextureUtils.IIconRegister; public class InputRoutingFocus extends RoutingFocus { @@ -10,11 +7,4 @@ public class InputRoutingFocus extends RoutingFocus { super(); } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:InputRoutingFocus"); - } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/OutputRoutingFocus.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/OutputRoutingFocus.java index 22965e3d..4c2e323f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/OutputRoutingFocus.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/OutputRoutingFocus.java @@ -2,30 +2,23 @@ package WayofTime.alchemicalWizardry.common.items.routing; import java.util.List; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.IIcon; 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.common.routing.RoutingFocusLogicLimitDefault; import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitGlobal; import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitIgnMeta; import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitMatchNBT; 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 -{ - IIcon modItemIcon; - IIcon ignMetaIcon; - IIcon matchNBTIcon; - IIcon globalIcon; - +{ public OutputRoutingFocus() { 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 public String getUnlocalizedName(ItemStack itemStack) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/SigilOfHolding.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/SigilOfHolding.java index d01f7316..b512434d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/SigilOfHolding.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/SigilOfHolding.java @@ -7,14 +7,13 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import codechicken.lib.render.TextureUtils.IIconRegister; public class SigilOfHolding extends EnergyItems { @@ -30,51 +29,21 @@ public class SigilOfHolding extends EnergyItems } @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfHolding"); - } - - @Override - public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) - { - if (!(stack.getTagCompound() == null)) - { - ItemStack[] inv = getInternalInventory(stack); - - if (inv == null) - { - return this.itemIcon; - } - - ItemStack item = getCurrentSigil(stack); - - if (item != null) - { - return item.getIconIndex(); - } - } - - return this.itemIcon; - } - - @Override - public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + public void addInformation(ItemStack stack, EntityPlayer player, List par3List, boolean par4) { par3List.add(StatCollector.translateToLocal("tooltip.sigilofholding.desc")); - if (!(par1ItemStack.getTagCompound() == null)) + if (!(stack.getTagCompound() == null)) { - par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName")); - ItemStack[] inv = getInternalInventory(par1ItemStack); + par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + stack.getTagCompound().getString("ownerName")); + ItemStack[] inv = getInternalInventory(stack); if (inv == null) { return; } - int currentSlot = getCurrentItem(par1ItemStack); + int currentSlot = getCurrentItem(stack); ItemStack item = inv[currentSlot]; if (item != null) @@ -93,12 +62,12 @@ public class SigilOfHolding extends EnergyItems } @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, 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 (checkAndSetItemOwner(par1ItemStack, par2EntityPlayer)) + if (checkAndSetItemOwner(stack, player)) { - int currentSlot = getCurrentItem(par1ItemStack); - ItemStack[] inv = getInternalInventory(par1ItemStack); + int currentSlot = getCurrentItem(stack); + ItemStack[] inv = getInternalInventory(stack); if (inv == null) { @@ -112,9 +81,9 @@ public class SigilOfHolding extends EnergyItems return false; } - boolean bool = itemUsed.getItem().onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10); + boolean bool = itemUsed.getItem().onItemUse(stack, player, world, pos, side, hitX, hitY, hitZ); - saveInventory(par1ItemStack, inv); + saveInventory(stack, inv); return bool; } @@ -123,36 +92,36 @@ public class SigilOfHolding extends EnergyItems } @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + public ItemStack onItemRightClick(ItemStack stack, World par2World, EntityPlayer par3EntityPlayer) { - if (checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) + if (checkAndSetItemOwner(stack, par3EntityPlayer)) { if (par3EntityPlayer.isSneaking()) { - InventoryHolding.setUUID(par1ItemStack); + InventoryHolding.setUUID(stack); par3EntityPlayer.openGui(AlchemicalWizardry.instance, 3, par3EntityPlayer.worldObj, (int) par3EntityPlayer.posX, (int) par3EntityPlayer.posY, (int) par3EntityPlayer.posZ); - return par1ItemStack; + return stack; } - int currentSlot = getCurrentItem(par1ItemStack); - ItemStack[] inv = getInternalInventory(par1ItemStack); + int currentSlot = getCurrentItem(stack); + ItemStack[] inv = getInternalInventory(stack); if (inv == null) { - return par1ItemStack; + return stack; } ItemStack itemUsed = inv[currentSlot]; if (itemUsed == null) { - return par1ItemStack; + return stack; } itemUsed.getItem().onItemRightClick(itemUsed, par2World, par3EntityPlayer); - saveInventory(par1ItemStack, inv); + saveInventory(stack, inv); } - return par1ItemStack; + return stack; } public static int next(int mode) @@ -183,7 +152,7 @@ public class SigilOfHolding extends EnergyItems { if (itemStack.getTagCompound() == null) { - itemStack.getTagCompound() = new NBTTagCompound(); + itemStack.setTagCompound(new NBTTagCompound()); itemStack.getTagCompound().setInteger(NBT_CURRENT_SIGIL, invSize); } } @@ -283,17 +252,17 @@ public class SigilOfHolding extends EnergyItems } @Override - public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) + public void onUpdate(ItemStack stack, World par2World, Entity par3Entity, int par4, boolean par5) { - if (!(par1ItemStack.getTagCompound() == null)) + if (!(stack.getTagCompound() == null)) { - this.tickInternalInventory(par1ItemStack, par2World, par3Entity, par4, par5); + this.tickInternalInventory(stack, par2World, par3Entity, par4, par5); } } - public void tickInternalInventory(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) + public void tickInternalInventory(ItemStack stack, World par2World, Entity par3Entity, int par4, boolean par5) { - ItemStack[] inv = getInternalInventory(par1ItemStack); + ItemStack[] inv = getInternalInventory(stack); if (inv == null) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java b/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java index 1d8aabd1..65423c95 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java @@ -38,10 +38,8 @@ public class MeteorParadigm } } - public void createMeteorImpact(World world, int x, int y, int z, boolean[] flags) - { - BlockPos pos = new BlockPos(x, y, z); - + public void createMeteorImpact(World world, BlockPos pos, boolean[] flags) + { boolean hasTerrae = false; boolean hasOrbisTerrae = false; boolean hasCrystallos = false; @@ -70,7 +68,7 @@ public class MeteorParadigm chance += 100; } - world.createExplosion(null, x, y, z, newRadius * 4, AlchemicalWizardry.doMeteorsDestroyBlocks); + world.createExplosion(null, pos.getX(), pos.getY(), pos.getZ(), newRadius * 4, AlchemicalWizardry.doMeteorsDestroyBlocks); float iceChance = hasCrystallos ? 1 : 0; float soulChance = hasIncendium ? 1 : 0; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorRegistry.java index 7deedd38..1ed03f73 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorRegistry.java @@ -1,12 +1,13 @@ package WayofTime.alchemicalWizardry.common.summoning.meteor; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.oredict.OreDictionary; - import java.util.ArrayList; import java.util.List; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; + public class MeteorRegistry { public static List paradigmList = new ArrayList(); @@ -26,11 +27,11 @@ public class MeteorRegistry } } - public static void createMeteorImpact(World world, int x, int y, int z, int paradigmID, boolean[] flags) + public static void createMeteorImpact(World world, BlockPos pos, int paradigmID, boolean[] flags) { if (paradigmID < paradigmList.size()) { - paradigmList.get(paradigmID).createMeteorImpact(world, x, y, z, flags); + paradigmList.get(paradigmID).createMeteorImpact(world, pos, flags); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEReagentConduit.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEReagentConduit.java index 7cabc726..6b74b1e9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEReagentConduit.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEReagentConduit.java @@ -542,4 +542,14 @@ public class TEReagentConduit extends TileSegmentedReagentHandler implements IUp return super.drain(from, resource, doDrain); } + + public void removeReagentDestinationViaActual(Reagent reagent, BlockPos pos) + { + this.removeReagentDestinationViaActual(reagent, pos.getX(), pos.getY(), pos.getZ()); + } + + public boolean addReagentDestinationViaActual(Reagent reagent, BlockPos pos) + { + return addReagentDestinationViaActual(reagent, pos.getX(), pos.getY(), pos.getZ()); + } } \ No newline at end of file