From 20bef6e26d948698398bd16aeab8c9e6b89110e4 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Thu, 22 Aug 2019 20:01:40 -0400 Subject: Format/import cleanup --- .../tileentity/TileEntityBlockShadow.java | 46 +- .../jewelrycraft/tileentity/TileEntityCrystal.java | 10 +- .../tileentity/TileEntityDisplayer.java | 19 +- .../tileentity/TileEntityHandPedestal.java | 30 +- .../tileentity/TileEntityJewelrsCraftingTable.java | 101 ++-- .../tileentity/TileEntityMidasTouch.java | 9 +- .../jewelrycraft/tileentity/TileEntityMolder.java | 58 +-- .../tileentity/TileEntityMoltenMetal.java | 9 +- .../tileentity/TileEntityShadowEye.java | 529 +++++++-------------- .../jewelrycraft/tileentity/TileEntitySmelter.java | 99 ++-- .../renders/TileEntityDisplayerRender.java | 174 ++----- .../renders/TileEntityHandPedestalRender.java | 21 +- .../TileEntityJewelrsCraftingTableRender.java | 109 +---- .../renders/TileEntityMidasTouchRender.java | 20 +- .../tileentity/renders/TileEntityMolderRender.java | 98 +--- .../renders/TileEntityShadowEyeRender.java | 62 +-- .../renders/TileEntityShadowHandRender.java | 6 +- .../renders/TileEntitySmelterRender.java | 73 +-- 18 files changed, 423 insertions(+), 1050 deletions(-) (limited to 'src/main/java/darkknight/jewelrycraft/tileentity') diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java index dc387ff..5e4bf87 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java @@ -43,46 +43,30 @@ public class TileEntityBlockShadow extends TileEntity { public void updateEntity() { super.updateEntity(); int blockLight, realLight; - int lightValue = worldObj.getSavedLightValue( - EnumSkyBlock.Sky, xCoord, yCoord, zCoord) + int lightValue = worldObj.getSavedLightValue(EnumSkyBlock.Sky, xCoord, yCoord, zCoord) - worldObj.skylightSubtracted; - float sunPosAngle = worldObj - .getCelestialAngleRadians(1.0F); + float sunPosAngle = worldObj.getCelestialAngleRadians(1.0F); if (sunPosAngle < (float) Math.PI) sunPosAngle += (0.0F - sunPosAngle) * 0.2F; else - sunPosAngle += ((float) Math.PI * 2F - sunPosAngle) - * 0.2F; - lightValue = Math.round( - lightValue * MathHelper.cos(sunPosAngle)); + sunPosAngle += ((float) Math.PI * 2F - sunPosAngle) * 0.2F; + lightValue = Math.round(lightValue * MathHelper.cos(sunPosAngle)); if (lightValue < 0) lightValue = 0; if (lightValue > 15) lightValue = 15; - blockLight = worldObj - .getChunkFromBlockCoords(xCoord, zCoord) - .getSavedLightValue(EnumSkyBlock.Block, - xCoord & 15, yCoord, - zCoord & 15); - realLight = worldObj - .getChunkFromBlockCoords(xCoord, zCoord) - .getBlockLightValue(xCoord & 15, yCoord, - zCoord & 15, 0); - if (blockLight == 0 - && worldObj.canBlockSeeTheSky(xCoord, - yCoord, zCoord) - || lightValue >= blockLight) + blockLight = worldObj.getChunkFromBlockCoords(xCoord, zCoord).getSavedLightValue(EnumSkyBlock.Block, + xCoord & 15, yCoord, zCoord & 15); + realLight = worldObj.getChunkFromBlockCoords(xCoord, zCoord).getBlockLightValue(xCoord & 15, yCoord, + zCoord & 15, 0); + if (blockLight == 0 && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord) || lightValue >= blockLight) metadata = 15 - lightValue; - else if (!worldObj.canBlockSeeTheSky(xCoord, yCoord, - zCoord)) + else if (!worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord)) metadata = 15 - realLight; else if (lightValue < blockLight) metadata = 15 - blockLight; - worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, - metadata, 2); - worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, - zCoord, - worldObj.getBlock(xCoord, yCoord, zCoord)); + worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, metadata, 2); + worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); } /** @@ -92,8 +76,7 @@ public class TileEntityBlockShadow extends TileEntity { public Packet getDescriptionPacket() { NBTTagCompound nbttagcompound = new NBTTagCompound(); writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, - zCoord, 1, nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); } /** @@ -101,8 +84,7 @@ public class TileEntityBlockShadow extends TileEntity { * @param packet */ @Override - public void onDataPacket(NetworkManager net, - S35PacketUpdateTileEntity packet) { + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { readFromNBT(packet.func_148857_g()); worldObj.func_147479_m(xCoord, yCoord, zCoord); } diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityCrystal.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityCrystal.java index 90fbd99..7b5fdaf 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityCrystal.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityCrystal.java @@ -10,9 +10,9 @@ import net.minecraft.tileentity.TileEntity; * @author Sorin */ public class TileEntityCrystal extends TileEntity { - public int shine = 120; - boolean descent = false; - int timer = 0; + public int shine = 120; + boolean descent = false; + int timer = 0; @Override public void updateEntity() { @@ -28,9 +28,7 @@ public class TileEntityCrystal extends TileEntity { if (shine <= 100) descent = false; } - this.worldObj.markBlockRangeForRenderUpdate( - xCoord, yCoord, zCoord, - xCoord, yCoord, zCoord); + this.worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord); timer = 0; } } diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java index 72fa7c0..ccbedf3 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java @@ -9,12 +9,10 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; public class TileEntityDisplayer extends TileEntity { - public float ringTranslation1, ringTranslation2, - ringTranslation3, rotAngle; - public boolean isDescending1, isDescending2, - isDescending3, isDirty, hasObject; - public ItemStack object; - public int quantity, infoIndex, timer = 0; + public float ringTranslation1, ringTranslation2, ringTranslation3, rotAngle; + public boolean isDescending1, isDescending2, isDescending3, isDirty, hasObject; + public ItemStack object; + public int quantity, infoIndex, timer = 0; /** * @@ -82,8 +80,7 @@ public class TileEntityDisplayer extends TileEntity { public void updateEntity() { super.updateEntity(); if (isDirty) { - worldObj.markBlockForUpdate(xCoord, yCoord, - zCoord); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); isDirty = false; } if (ringTranslation1 >= 0.6) @@ -128,8 +125,7 @@ public class TileEntityDisplayer extends TileEntity { public Packet getDescriptionPacket() { NBTTagCompound nbttagcompound = new NBTTagCompound(); writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, - zCoord, 1, nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); } /** @@ -137,8 +133,7 @@ public class TileEntityDisplayer extends TileEntity { * @param packet */ @Override - public void onDataPacket(NetworkManager net, - S35PacketUpdateTileEntity packet) { + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { readFromNBT(packet.func_148857_g()); worldObj.func_147479_m(xCoord, yCoord, zCoord); } diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java index f6fb323..69841b2 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java @@ -12,16 +12,16 @@ import net.minecraft.tileentity.TileEntity; * @author Paul Fulham (pau101) */ public class TileEntityHandPedestal extends TileEntity { - protected boolean isDirty; - protected ItemStack heldItemStack; + protected boolean isDirty; + protected ItemStack heldItemStack; /** * When the hand is open the grip is 0 and is 20 when closed. */ - private float grip; - private float prevGrip; - private float gripMax; - private float gripScale; - private boolean isHandOpen; + private float grip; + private float prevGrip; + private float gripMax; + private float gripScale; + private boolean isHandOpen; /** * @@ -56,9 +56,7 @@ public class TileEntityHandPedestal extends TileEntity { public void readFromNBT(NBTTagCompound tagCompound) { super.readFromNBT(tagCompound); if (tagCompound.hasKey("object", 10)) - setHeldItemStack(ItemStack.loadItemStackFromNBT( - tagCompound.getCompoundTag( - "object"))); + setHeldItemStack(ItemStack.loadItemStackFromNBT(tagCompound.getCompoundTag("object"))); else removeHeldItemStack(); isHandOpen = tagCompound.getBoolean("isHandOpen"); @@ -72,8 +70,7 @@ public class TileEntityHandPedestal extends TileEntity { super.updateEntity(); updateGrip(); if (isDirty) { - worldObj.markBlockForUpdate(xCoord, yCoord, - zCoord); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); isDirty = false; } } @@ -96,8 +93,7 @@ public class TileEntityHandPedestal extends TileEntity { public Packet getDescriptionPacket() { NBTTagCompound nbttagcompound = new NBTTagCompound(); writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, - zCoord, 0, nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, nbttagcompound); } /** @@ -105,8 +101,7 @@ public class TileEntityHandPedestal extends TileEntity { * @param packet */ @Override - public void onDataPacket(NetworkManager networkManager, - S35PacketUpdateTileEntity packet) { + public void onDataPacket(NetworkManager networkManager, S35PacketUpdateTileEntity packet) { readFromNBT(packet.func_148857_g()); worldObj.func_147479_m(xCoord, yCoord, zCoord); } @@ -131,8 +126,7 @@ public class TileEntityHandPedestal extends TileEntity { * @param heldItemStack */ public void setHeldItemStack(ItemStack heldItemStack) { - if (heldItemStack != null - && heldItemStack.getItem() != null) { + if (heldItemStack != null && heldItemStack.getItem() != null) { heldItemStack.stackSize = 1; this.heldItemStack = heldItemStack; if (heldItemStack.getItem() instanceof ItemBlock) diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java index 66d54b0..992e111 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java @@ -14,11 +14,10 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; public class TileEntityJewelrsCraftingTable extends TileEntity { - public boolean hasJewelry, hasEndItem, isDirty, hasGem, - crafting; - public ItemStack jewelry, endItem, gem; - public int carving, effect; - public float angle; + public boolean hasJewelry, hasEndItem, isDirty, hasGem, crafting; + public ItemStack jewelry, endItem, gem; + public int carving, effect; + public float angle; /** * @@ -89,8 +88,7 @@ public class TileEntityJewelrsCraftingTable extends TileEntity { public void updateEntity() { super.updateEntity(); if (isDirty) { - worldObj.markBlockForUpdate(xCoord, yCoord, - zCoord); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); isDirty = false; } if (angle < 360F) @@ -101,81 +99,42 @@ public class TileEntityJewelrsCraftingTable extends TileEntity { if (carving > 0) carving--; if (crafting) - for (int l = 0; l < ConfigHandler.GEM_PLACEMENT_TIME - / (carving + 2); ++l) { + for (int l = 0; l < ConfigHandler.GEM_PLACEMENT_TIME / (carving + 2); ++l) { if (worldObj.rand.nextInt(10) == 0) - worldObj.playSoundEffect( - xCoord, - yCoord + 0.5F, - zCoord, - "random.orb", - 0.05F, 1F); + worldObj.playSoundEffect(xCoord, yCoord + 0.5F, zCoord, "random.orb", 0.05F, 1F); if (getBlockMetadata() == 0) - worldObj.spawnParticle( - "instantSpell", - xCoord + 0.5F, - (double) yCoord + 0.8F, - zCoord + 0.2F, - 0.0D, 0.0D, - 0.0D); + worldObj.spawnParticle("instantSpell", xCoord + 0.5F, (double) yCoord + 0.8F, zCoord + 0.2F, + 0.0D, 0.0D, 0.0D); if (getBlockMetadata() == 1) - worldObj.spawnParticle( - "instantSpell", - xCoord + 0.8F, - (double) yCoord + 0.8F, - zCoord + 0.5F, - 0.0D, 0.0D, - 0.0D); + worldObj.spawnParticle("instantSpell", xCoord + 0.8F, (double) yCoord + 0.8F, zCoord + 0.5F, + 0.0D, 0.0D, 0.0D); if (getBlockMetadata() == 2) - worldObj.spawnParticle( - "instantSpell", - xCoord + 0.5F, - (double) yCoord + 0.8F, - zCoord + 0.8F, - 0.0D, 0.0D, - 0.0D); + worldObj.spawnParticle("instantSpell", xCoord + 0.5F, (double) yCoord + 0.8F, zCoord + 0.8F, + 0.0D, 0.0D, 0.0D); if (getBlockMetadata() == 3) - worldObj.spawnParticle( - "instantSpell", - xCoord + 0.2F, - (double) yCoord + 0.8F, - zCoord + 0.5F, - 0.0D, 0.0D, - 0.0D); + worldObj.spawnParticle("instantSpell", xCoord + 0.2F, (double) yCoord + 0.8F, zCoord + 0.5F, + 0.0D, 0.0D, 0.0D); } if (carving == 0) { hasEndItem = true; endItem = jewelry.copy(); - if (hasGem && gem != new ItemStack( - Item.getItemById(0), 0, 0)) - if (!JewelryNBT.hasTag(jewelry, - "gem")) { - JewelryNBT.addGem(endItem, - gem); + if (hasGem && gem != new ItemStack(Item.getItemById(0), 0, 0)) + if (!JewelryNBT.hasTag(jewelry, "gem")) { + JewelryNBT.addGem(endItem, gem); hasGem = false; - gem = new ItemStack(Item - .getItemById(0), - 0, 0); + gem = new ItemStack(Item.getItemById(0), 0, 0); } else { - ItemStack aux = JewelryNBT - .gem(jewelry); - JewelryNBT.addGem(endItem, - gem); - if (JewelrycraftUtil.rand - .nextBoolean()) + ItemStack aux = JewelryNBT.gem(jewelry); + JewelryNBT.addGem(endItem, gem); + if (JewelrycraftUtil.rand.nextBoolean()) gem = aux.copy(); else { hasGem = false; - gem = new ItemStack( - Item.getItemById( - 0), - 0, - 0); + gem = new ItemStack(Item.getItemById(0), 0, 0); } } hasJewelry = false; - jewelry = new ItemStack( - Item.getItemById(0), 0, 0); + jewelry = new ItemStack(Item.getItemById(0), 0, 0); carving = -1; crafting = false; isDirty = true; @@ -235,10 +194,8 @@ public class TileEntityJewelrsCraftingTable extends TileEntity { isDirty = true; } - public void dropItem(World world, double x, double y, double z, - ItemStack stack) { - EntityItem entityitem = new EntityItem(world, x + 0.5D, - y + 1D, z + 0.5D, stack); + public void dropItem(World world, double x, double y, double z, ItemStack stack) { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 1D, z + 0.5D, stack); entityitem.motionX = 0; entityitem.motionZ = 0; entityitem.motionY = 0.21000000298023224D; @@ -252,8 +209,7 @@ public class TileEntityJewelrsCraftingTable extends TileEntity { public Packet getDescriptionPacket() { NBTTagCompound nbttagcompound = new NBTTagCompound(); writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, - zCoord, 1, nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); } /** @@ -261,8 +217,7 @@ public class TileEntityJewelrsCraftingTable extends TileEntity { * @param packet */ @Override - public void onDataPacket(NetworkManager net, - S35PacketUpdateTileEntity packet) { + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { readFromNBT(packet.func_148857_g()); worldObj.func_147479_m(xCoord, yCoord, zCoord); } diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMidasTouch.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMidasTouch.java index eab8bfb..3895810 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMidasTouch.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMidasTouch.java @@ -39,8 +39,7 @@ public class TileEntityMidasTouch extends TileEntity { super.readFromNBT(nbt); NBTTagCompound en = (NBTTagCompound) nbt.getTag("entity"); int entityID = nbt.getInteger("entityID"); - EntityLivingBase entity = (EntityLivingBase) EntityList - .createEntityByID(entityID, worldObj); + EntityLivingBase entity = (EntityLivingBase) EntityList.createEntityByID(entityID, worldObj); if (entity != null) { entity.readFromNBT(en); target = entity; @@ -62,8 +61,7 @@ public class TileEntityMidasTouch extends TileEntity { public Packet getDescriptionPacket() { NBTTagCompound nbttagcompound = new NBTTagCompound(); writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, - zCoord, 1, nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); } /** @@ -71,8 +69,7 @@ public class TileEntityMidasTouch extends TileEntity { * @param packet */ @Override - public void onDataPacket(NetworkManager net, - S35PacketUpdateTileEntity packet) { + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { readFromNBT(packet.func_148857_g()); worldObj.func_147479_m(xCoord, yCoord, zCoord); } diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java index c7607a4..3b99fb9 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java @@ -11,11 +11,10 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; public class TileEntityMolder extends TileEntity { - public int cooling; - public boolean hasMoltenMetal, hasJewelBase, hasMold, - isDirty; - public ItemStack mold, jewelBase, moltenMetal, ringMetal; - public float quantity; + public int cooling; + public boolean hasMoltenMetal, hasJewelBase, hasMold, isDirty; + public ItemStack mold, jewelBase, moltenMetal, ringMetal; + public float quantity; /** * @@ -86,24 +85,15 @@ public class TileEntityMolder extends TileEntity { public void updateEntity() { super.updateEntity(); if (isDirty) { - worldObj.markBlockForUpdate(xCoord, yCoord, - zCoord); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); isDirty = false; } - if (hasMoltenMetal - && moltenMetal.getItem() != Item - .getItemById(0) - && quantity > 0f) { + if (hasMoltenMetal && moltenMetal.getItem() != Item.getItemById(0) && quantity > 0f) { if (worldObj.rand.nextInt(20) == 0) - worldObj.playSoundEffect(xCoord, - yCoord + 0.5F, zCoord, - "random.fizz", 0.5F, 1F); + worldObj.playSoundEffect(xCoord, yCoord + 0.5F, zCoord, "random.fizz", 0.5F, 1F); for (int l = 0; l < 2; ++l) - worldObj.spawnParticle("reddust", - xCoord + Math.random(), - (double) yCoord + 0.2F, - zCoord + Math.random(), - 0.0D, 1.0D, 1.0D); + worldObj.spawnParticle("reddust", xCoord + Math.random(), (double) yCoord + 0.2F, + zCoord + Math.random(), 0.0D, 1.0D, 1.0D); } if (hasMoltenMetal && !hasJewelBase && quantity >= 0.1f) { ringMetal = moltenMetal.copy(); @@ -113,29 +103,19 @@ public class TileEntityMolder extends TileEntity { if (mold.getItemDamage() == 0) jewelBase = moltenMetal; else if (mold.getItemDamage() == 1) - jewelBase = new ItemStack( - ItemList.ring); + jewelBase = new ItemStack(ItemList.ring); else if (mold.getItemDamage() == 2) - jewelBase = new ItemStack( - ItemList.necklace); + jewelBase = new ItemStack(ItemList.necklace); else if (mold.getItemDamage() == 3) - jewelBase = new ItemStack( - ItemList.bracelet); + jewelBase = new ItemStack(ItemList.bracelet); else if (mold.getItemDamage() == 4) - jewelBase = new ItemStack( - ItemList.earrings); + jewelBase = new ItemStack(ItemList.earrings); ringMetal.stackSize = 1; jewelBase.stackSize = 1; - if (mold.getItemDamage() != 0 - && jewelBase != new ItemStack( - Item.getItemById( - 0), - 0, 0)) - JewelryNBT.addMetal(jewelBase, - ringMetal); + if (mold.getItemDamage() != 0 && jewelBase != new ItemStack(Item.getItemById(0), 0, 0)) + JewelryNBT.addMetal(jewelBase, ringMetal); hasMoltenMetal = false; - moltenMetal = new ItemStack( - Item.getItemById(0), 0, 0); + moltenMetal = new ItemStack(Item.getItemById(0), 0, 0); hasJewelBase = true; cooling = -1; quantity = 0f; @@ -151,8 +131,7 @@ public class TileEntityMolder extends TileEntity { public Packet getDescriptionPacket() { NBTTagCompound nbttagcompound = new NBTTagCompound(); writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, - zCoord, 1, nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); } /** @@ -160,8 +139,7 @@ public class TileEntityMolder extends TileEntity { * @param packet */ @Override - public void onDataPacket(NetworkManager net, - S35PacketUpdateTileEntity packet) { + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { readFromNBT(packet.func_148857_g()); worldObj.func_147479_m(xCoord, yCoord, zCoord); } diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMoltenMetal.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMoltenMetal.java index 77e06c7..f3a2d7e 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMoltenMetal.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMoltenMetal.java @@ -50,8 +50,7 @@ public class TileEntityMoltenMetal extends TileEntity { public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); if (nbt.hasKey("metal")) - setMetal(ItemStack.loadItemStackFromNBT( - nbt.getCompoundTag("metal"))); + setMetal(ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("metal"))); else metal = null; } @@ -60,13 +59,11 @@ public class TileEntityMoltenMetal extends TileEntity { public Packet getDescriptionPacket() { NBTTagCompound nbttagcompound = new NBTTagCompound(); writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, - zCoord, 0, nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, nbttagcompound); } @Override - public void onDataPacket(NetworkManager net, - S35PacketUpdateTileEntity packet) { + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { readFromNBT(packet.func_148857_g()); worldObj.func_147479_m(xCoord, yCoord, zCoord); } diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java index c5b5aef..65be5cb 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java @@ -27,13 +27,12 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; public class TileEntityShadowEye extends TileEntity { - public int opening, timer, t = 20, soundTimer; - public boolean active, shouldAddData; - public ArrayList pedestalItems = new ArrayList(); - ResourceLocation particleTexture = new ResourceLocation( - Variables.MODID, "textures/particle/shadows.png"); - public EntityPlayer target; - public ModelShadowEye model = new ModelShadowEye(); + public int opening, timer, t = 20, soundTimer; + public boolean active, shouldAddData; + public ArrayList pedestalItems = new ArrayList(); + ResourceLocation particleTexture = new ResourceLocation(Variables.MODID, "textures/particle/shadows.png"); + public EntityPlayer target; + public ModelShadowEye model = new ModelShadowEye(); public TileEntityShadowEye() { opening = 1; @@ -62,27 +61,16 @@ public class TileEntityShadowEye extends TileEntity { @Override public void updateEntity() { super.updateEntity(); - boolean valid = isValidStructure(worldObj, xCoord, yCoord, - zCoord, blockMetadata); + boolean valid = isValidStructure(worldObj, xCoord, yCoord, zCoord, blockMetadata); boolean canStartRitual = valid - && ((TileEntityHandPedestal) worldObj - .getTileEntity(xCoord, - yCoord - 3, - zCoord)).heldItemStack != null - && getNumberOfItems(worldObj, xCoord, - yCoord, zCoord) > 0; + && ((TileEntityHandPedestal) worldObj.getTileEntity(xCoord, yCoord - 3, zCoord)).heldItemStack != null + && getNumberOfItems(worldObj, xCoord, yCoord, zCoord) > 0; if (active) { timer--; - if (canStartRitual && canChangePedestals(worldObj, - xCoord, yCoord, zCoord) - && opening == 4) - changePedestals(worldObj, xCoord, yCoord, - zCoord); + if (canStartRitual && canChangePedestals(worldObj, xCoord, yCoord, zCoord) && opening == 4) + changePedestals(worldObj, xCoord, yCoord, zCoord); } - if (active && target != null - && this.getDistanceFrom(target.posX, - target.posY, - target.posZ) > 27D) { + if (active && target != null && this.getDistanceFrom(target.posX, target.posY, target.posZ) > 27D) { active = false; timer = -1; shouldAddData = false; @@ -98,17 +86,11 @@ public class TileEntityShadowEye extends TileEntity { t = 20; } } - if (opening == 2 && timer <= 0 && t == 10 - && shouldAddData) { + if (opening == 2 && timer <= 0 && t == 10 && shouldAddData) { addData(worldObj, xCoord, yCoord, zCoord); - TileEntityHandPedestal target = (TileEntityHandPedestal) worldObj - .getTileEntity(xCoord, yCoord - 3, - zCoord); - if (target != null && target - .getHeldItemStack() != null) - JewelryNBT.addModifiers( - target.getHeldItemStack(), - pedestalItems); + TileEntityHandPedestal target = (TileEntityHandPedestal) worldObj.getTileEntity(xCoord, yCoord - 3, zCoord); + if (target != null && target.getHeldItemStack() != null) + JewelryNBT.addModifiers(target.getHeldItemStack(), pedestalItems); revertPedestals(worldObj, xCoord, yCoord, zCoord); } if (active && timer <= 0) { @@ -124,38 +106,23 @@ public class TileEntityShadowEye extends TileEntity { active = false; timer = -1; if (!worldObj.isRemote) { - JewelrycraftUtil.addCursePoints( - target, 50); - target.addChatMessage( - new ChatComponentText( - EnumChatFormatting.BLACK - + "The Shadows don't like to be disturbed for no reason!")); - target.addChatMessage( - new ChatComponentText( - EnumChatFormatting.DARK_PURPLE - + "You feel a strange aura encumbering you.")); + JewelrycraftUtil.addCursePoints(target, 50); + target.addChatMessage(new ChatComponentText( + EnumChatFormatting.BLACK + "The Shadows don't like to be disturbed for no reason!")); + target.addChatMessage(new ChatComponentText( + EnumChatFormatting.DARK_PURPLE + "You feel a strange aura encumbering you.")); } } } if (active && opening == 4) { for (int l = 0; l <= 100; l++) worldObj.spawnParticle("depthsuspend", - xCoord + 6.5F - worldObj.rand - .nextInt(12) - - worldObj.rand.nextFloat(), - yCoord - 2F + worldObj.rand - .nextInt(9) - - worldObj.rand.nextFloat(), - zCoord + 6.5F - worldObj.rand - .nextInt(12) - - worldObj.rand.nextFloat(), - 0, 0, 0); + xCoord + 6.5F - worldObj.rand.nextInt(12) - worldObj.rand.nextFloat(), + yCoord - 2F + worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), + zCoord + 6.5F - worldObj.rand.nextInt(12) - worldObj.rand.nextFloat(), 0, 0, 0); if (soundTimer == 0) - worldObj.playSound(xCoord + 0.5D, - yCoord + 0.5D, - zCoord + 0.5D, - "jewelrycraft2:Ritual", - 1.0F, 1.0F, false); + worldObj.playSound(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D, "jewelrycraft2:Ritual", 1.0F, 1.0F, + false); if (soundTimer < 20 * 14) soundTimer++; else @@ -163,346 +130,211 @@ public class TileEntityShadowEye extends TileEntity { } } - public boolean isValidStructure(World world, int x, int y, int z, - int metadata) { - if (world.getBlockMetadata(x, y, z) == 0 - || world.getBlockMetadata(x, y, z) == 2) { + public boolean isValidStructure(World world, int x, int y, int z, int metadata) { + if (world.getBlockMetadata(x, y, z) == 0 || world.getBlockMetadata(x, y, z) == 2) { // Layers from top to bottom // 1st Layer - if (world.getBlock(x, y + 1, - z) != Blocks.stone_slab - || world.getBlockMetadata(x, y + 1, - z) != 5) + if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x + 1, y + 1, - z) != Blocks.stone_slab - || world.getBlockMetadata(x + 1, - y + 1, z) != 5) + if (world.getBlock(x + 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x + 1, y + 1, z) != 5) return false; - if (world.getBlock(x - 1, y + 1, - z) != Blocks.stone_slab - || world.getBlockMetadata(x - 1, - y + 1, z) != 5) + if (world.getBlock(x - 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x - 1, y + 1, z) != 5) return false; // 2nd Layer - if (world.getBlock(x + 2, y, - z) != Blocks.stone_brick_stairs - || world.getBlockMetadata(x + 2, y, - z) != 1) + if (world.getBlock(x + 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 2, y, z) != 1) return false; - if (world.getBlock(x + 1, y, - z) != Blocks.stone_brick_stairs - || world.getBlockMetadata(x + 1, y, - z) != 4) + if (world.getBlock(x + 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 1, y, z) != 4) return false; - if (world.getBlock(x - 1, y, - z) != Blocks.stone_brick_stairs - || world.getBlockMetadata(x - 1, y, - z) != 5) + if (world.getBlock(x - 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 1, y, z) != 5) return false; - if (world.getBlock(x - 2, y, - z) != Blocks.stone_brick_stairs - || world.getBlockMetadata(x - 2, y, - z) != 0) + if (world.getBlock(x - 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 2, y, z) != 0) return false; // 3rd Layer - if (world.getBlock(x + 2, y - 1, - z) != Blocks.stonebrick) + if (world.getBlock(x + 2, y - 1, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 1, - z) != Blocks.stonebrick) + if (world.getBlock(x - 2, y - 1, z) != Blocks.stonebrick) return false; // 4th Layer - if (world.getBlock(x + 2, y - 2, - z) != Blocks.stonebrick) + if (world.getBlock(x + 2, y - 2, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 2, - z) != Blocks.stonebrick) + if (world.getBlock(x - 2, y - 2, z) != Blocks.stonebrick) return false; // 5th Layer - if (world.getBlock(x + 2, y - 3, - z) != Blocks.stonebrick) + if (world.getBlock(x + 2, y - 3, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 3, - z) != Blocks.stonebrick) + if (world.getBlock(x - 2, y - 3, z) != Blocks.stonebrick) return false; - } else if (world.getBlockMetadata(x, y, z) == 1 - || world.getBlockMetadata(x, y, z) == 3) { + } else if (world.getBlockMetadata(x, y, z) == 1 || world.getBlockMetadata(x, y, z) == 3) { // Layers from top to bottom // 1st Layer - if (world.getBlock(x, y + 1, - z) != Blocks.stone_slab - || world.getBlockMetadata(x, y + 1, - z) != 5) + if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x, y + 1, - z + 1) != Blocks.stone_slab - || world.getBlockMetadata(x, y + 1, - z + 1) != 5) + if (world.getBlock(x, y + 1, z + 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z + 1) != 5) return false; - if (world.getBlock(x, y + 1, - z - 1) != Blocks.stone_slab - || world.getBlockMetadata(x, y + 1, - z - 1) != 5) + if (world.getBlock(x, y + 1, z - 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z - 1) != 5) return false; // 2nd Layer - if (world.getBlock(x, y, - z + 2) != Blocks.stone_brick_stairs - || world.getBlockMetadata(x, y, - z + 2) != 3) + if (world.getBlock(x, y, z + 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 2) != 3) return false; - if (world.getBlock(x, y, - z + 1) != Blocks.stone_brick_stairs - || world.getBlockMetadata(x, y, - z + 1) != 6) + if (world.getBlock(x, y, z + 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 1) != 6) return false; - if (world.getBlock(x, y, - z - 1) != Blocks.stone_brick_stairs - || world.getBlockMetadata(x, y, - z - 1) != 7) + if (world.getBlock(x, y, z - 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 1) != 7) return false; - if (world.getBlock(x, y, - z - 2) != Blocks.stone_brick_stairs - || world.getBlockMetadata(x, y, - z - 2) != 2) + if (world.getBlock(x, y, z - 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 2) != 2) return false; // 3rd Layer - if (world.getBlock(x, y - 1, - z + 2) != Blocks.stonebrick) + if (world.getBlock(x, y - 1, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 1, - z - 2) != Blocks.stonebrick) + if (world.getBlock(x, y - 1, z - 2) != Blocks.stonebrick) return false; // 4th Layer - if (world.getBlock(x, y - 2, - z + 2) != Blocks.stonebrick) + if (world.getBlock(x, y - 2, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 2, - z - 2) != Blocks.stonebrick) + if (world.getBlock(x, y - 2, z - 2) != Blocks.stonebrick) return false; // 5th Layer - if (world.getBlock(x, y - 3, - z + 2) != Blocks.stonebrick) + if (world.getBlock(x, y - 3, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 3, - z - 2) != Blocks.stonebrick) + if (world.getBlock(x, y - 3, z - 2) != Blocks.stonebrick) return false; } // 3rd Layer - if (world.getBlock(x - 4, y - 1, - z - 4) != BlockList.shadowBlock) + if (world.getBlock(x - 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x - 4, y - 1, - z + 4) != BlockList.shadowBlock) + if (world.getBlock(x - 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, - z - 4) != BlockList.shadowBlock) + if (world.getBlock(x + 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, - z + 4) != BlockList.shadowBlock) + if (world.getBlock(x + 4, y - 1, z + 4) != BlockList.shadowBlock) return false; // 4th Layer - if (world.getBlock(x - 4, y - 2, - z - 4) != Blocks.stonebrick) + if (world.getBlock(x - 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 2, - z + 4) != Blocks.stonebrick) + if (world.getBlock(x - 4, y - 2, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, - z - 4) != Blocks.stonebrick) + if (world.getBlock(x + 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, - z + 4) != Blocks.stonebrick) + if (world.getBlock(x + 4, y - 2, z + 4) != Blocks.stonebrick) return false; // 5th Layer // Pillars - if (world.getBlock(x - 4, y - 3, - z - 4) != Blocks.stonebrick) + if (world.getBlock(x - 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 3, - z + 4) != Blocks.stonebrick) + if (world.getBlock(x - 4, y - 3, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, - z - 4) != Blocks.stonebrick) + if (world.getBlock(x + 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, - z + 4) != Blocks.stonebrick) + if (world.getBlock(x + 4, y - 3, z + 4) != Blocks.stonebrick) return false; // Pedestals - if (!(world.getBlock(x, y - 3, - z) instanceof BlockHandPedestal)) - return false; - if (world.getBlock(x - 4, y - 3, - z + 2) != BlockList.handPedestal - || world.getBlockMetadata(x - 4, y - 3, - z + 2) != 1) - return false; - if (world.getBlock(x - 5, y - 3, - z) != BlockList.handPedestal - || world.getBlockMetadata(x - 5, y - 3, - z) != 2) - return false; - if (world.getBlock(x - 4, y - 3, - z - 2) != BlockList.handPedestal - || world.getBlockMetadata(x - 4, y - 3, - z - 2) != 3) - return false; - if (world.getBlock(x - 2, y - 3, - z - 4) != BlockList.handPedestal - || world.getBlockMetadata(x - 2, y - 3, - z - 4) != 3) - return false; - if (world.getBlock(x, y - 3, - z - 5) != BlockList.handPedestal - || world.getBlockMetadata(x, y - 3, - z - 5) != 4) - return false; - if (world.getBlock(x + 2, y - 3, - z - 4) != BlockList.handPedestal - || world.getBlockMetadata(x + 2, y - 3, - z - 4) != 5) - return false; - if (world.getBlock(x + 4, y - 3, - z - 2) != BlockList.handPedestal - || world.getBlockMetadata(x + 4, y - 3, - z - 2) != 5) - return false; - if (world.getBlock(x + 5, y - 3, - z) != BlockList.handPedestal - || world.getBlockMetadata(x + 5, y - 3, - z) != 6) - return false; - if (world.getBlock(x + 4, y - 3, - z + 2) != BlockList.handPedestal - || world.getBlockMetadata(x + 4, y - 3, - z + 2) != 7) - return false; - if (world.getBlock(x + 2, y - 3, - z + 4) != BlockList.handPedestal - || world.getBlockMetadata(x + 2, y - 3, - z + 4) != 7) - return false; - if (world.getBlock(x, y - 3, - z + 5) != BlockList.handPedestal - || world.getBlockMetadata(x, y - 3, - z + 5) != 0) - return false; - if (world.getBlock(x - 2, y - 3, - z + 4) != BlockList.handPedestal - || world.getBlockMetadata(x - 2, y - 3, - z + 4) != 1) + if (!(world.getBlock(x, y - 3, z) instanceof BlockHandPedestal)) + return false; + if (world.getBlock(x - 4, y - 3, z + 2) != BlockList.handPedestal + || world.getBlockMetadata(x - 4, y - 3, z + 2) != 1) + return false; + if (world.getBlock(x - 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x - 5, y - 3, z) != 2) + return false; + if (world.getBlock(x - 4, y - 3, z - 2) != BlockList.handPedestal + || world.getBlockMetadata(x - 4, y - 3, z - 2) != 3) + return false; + if (world.getBlock(x - 2, y - 3, z - 4) != BlockList.handPedestal + || world.getBlockMetadata(x - 2, y - 3, z - 4) != 3) + return false; + if (world.getBlock(x, y - 3, z - 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z - 5) != 4) + return false; + if (world.getBlock(x + 2, y - 3, z - 4) != BlockList.handPedestal + || world.getBlockMetadata(x + 2, y - 3, z - 4) != 5) + return false; + if (world.getBlock(x + 4, y - 3, z - 2) != BlockList.handPedestal + || world.getBlockMetadata(x + 4, y - 3, z - 2) != 5) + return false; + if (world.getBlock(x + 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x + 5, y - 3, z) != 6) + return false; + if (world.getBlock(x + 4, y - 3, z + 2) != BlockList.handPedestal + || world.getBlockMetadata(x + 4, y - 3, z + 2) != 7) + return false; + if (world.getBlock(x + 2, y - 3, z + 4) != BlockList.handPedestal + || world.getBlockMetadata(x + 2, y - 3, z + 4) != 7) + return false; + if (world.getBlock(x, y - 3, z + 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z + 5) != 0) + return false; + if (world.getBlock(x - 2, y - 3, z + 4) != BlockList.handPedestal + || world.getBlockMetadata(x - 2, y - 3, z + 4) != 1) return false; return true; } public void addData(World world, int x, int y, int z) { pedestalItems.clear(); - addPedestalInfo((TileEntityHandPedestal) world - .getTileEntity(x + 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal) world - .getTileEntity(x - 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal) world - .getTileEntity(x, y - 3, z - 5)); - addPedestalInfo((TileEntityHandPedestal) world - .getTileEntity(x - 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal) world - .getTileEntity(x - 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal) world - .getTileEntity(x - 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal) world - .getTileEntity(x + 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal) world - .getTileEntity(x + 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal) world - .getTileEntity(x + 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal) world - .getTileEntity(x + 2, y - 3, z + 4)); - addPedestalInfo((TileEntityHandPedestal) world - .getTileEntity(x, y - 3, z + 5)); - addPedestalInfo((TileEntityHandPedestal) world - .getTileEntity(x - 2, y - 3, z + 4)); + addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x + 2, y - 3, z - 4)); + addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x - 4, y - 3, z + 2)); + addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x, y - 3, z - 5)); + addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x - 2, y - 3, z - 4)); + addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x - 4, y - 3, z - 2)); + addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x - 5, y - 3, z)); + addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x + 4, y - 3, z - 2)); + addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x + 5, y - 3, z)); + addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x + 4, y - 3, z + 2)); + addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x + 2, y - 3, z + 4)); + addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x, y - 3, z + 5)); + addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x - 2, y - 3, z + 4)); } public int getNumberOfItems(World world, int x, int y, int z) { int items = 0; - if (((TileEntityHandPedestal) world.getTileEntity(x + 2, - y - 3, z - 4)).heldItemStack != null) + if (((TileEntityHandPedestal) world.getTileEntity(x + 2, y - 3, z - 4)).heldItemStack != null) items++; - if (((TileEntityHandPedestal) world.getTileEntity(x - 4, - y - 3, z + 2)).heldItemStack != null) + if (((TileEntityHandPedestal) world.getTileEntity(x - 4, y - 3, z + 2)).heldItemStack != null) items++; - if (((TileEntityHandPedestal) world.getTileEntity(x, y - 3, - z - 5)).heldItemStack != null) + if (((TileEntityHandPedestal) world.getTileEntity(x, y - 3, z - 5)).heldItemStack != null) items++; - if (((TileEntityHandPedestal) world.getTileEntity(x - 2, - y - 3, z - 4)).heldItemStack != null) + if (((TileEntityHandPedestal) world.getTileEntity(x - 2, y - 3, z - 4)).heldItemStack != null) items++; - if (((TileEntityHandPedestal) world.getTileEntity(x - 4, - y - 3, z - 2)).heldItemStack != null) + if (((TileEntityHandPedestal) world.getTileEntity(x - 4, y - 3, z - 2)).heldItemStack != null) items++; - if (((TileEntityHandPedestal) world.getTileEntity(x - 5, - y - 3, z)).heldItemStack != null) + if (((TileEntityHandPedestal) world.getTileEntity(x - 5, y - 3, z)).heldItemStack != null) items++; - if (((TileEntityHandPedestal) world.getTileEntity(x + 4, - y - 3, z - 2)).heldItemStack != null) + if (((TileEntityHandPedestal) world.getTileEntity(x + 4, y - 3, z - 2)).heldItemStack != null) items++; - if (((TileEntityHandPedestal) world.getTileEntity(x + 5, - y - 3, z)).heldItemStack != null) + if (((TileEntityHandPedestal) world.getTileEntity(x + 5, y - 3, z)).heldItemStack != null) items++; - if (((TileEntityHandPedestal) world.getTileEntity(x + 4, - y - 3, z + 2)).heldItemStack != null) + if (((TileEntityHandPedestal) world.getTileEntity(x + 4, y - 3, z + 2)).heldItemStack != null) items++; - if (((TileEntityHandPedestal) world.getTileEntity(x + 2, - y - 3, z + 4)).heldItemStack != null) + if (((TileEntityHandPedestal) world.getTileEntity(x + 2, y - 3, z + 4)).heldItemStack != null) items++; - if (((TileEntityHandPedestal) world.getTileEntity(x, y - 3, - z + 5)).heldItemStack != null) + if (((TileEntityHandPedestal) world.getTileEntity(x, y - 3, z + 5)).heldItemStack != null) items++; - if (((TileEntityHandPedestal) world.getTileEntity(x - 2, - y - 3, z + 4)).heldItemStack != null) + if (((TileEntityHandPedestal) world.getTileEntity(x - 2, y - 3, z + 4)).heldItemStack != null) items++; return items; } - public boolean canChangePedestals(World world, int x, int y, - int z) { + public boolean canChangePedestals(World world, int x, int y, int z) { if (world.getBlock(x, y - 3, z) != BlockList.handPedestal) return false; - if (world.getBlock(x + 2, y - 3, - z - 4) != BlockList.handPedestal) + if (world.getBlock(x + 2, y - 3, z - 4) != BlockList.handPedestal) return false; - if (world.getBlock(x - 4, y - 3, - z + 2) != BlockList.handPedestal) + if (world.getBlock(x - 4, y - 3, z + 2) != BlockList.handPedestal) return false; - if (world.getBlock(x, y - 3, - z - 5) != BlockList.handPedestal) + if (world.getBlock(x, y - 3, z - 5) != BlockList.handPedestal) return false; - if (world.getBlock(x - 2, y - 3, - z - 4) != BlockList.handPedestal) + if (world.getBlock(x - 2, y - 3, z - 4) != BlockList.handPedestal) return false; - if (world.getBlock(x - 4, y - 3, - z - 2) != BlockList.handPedestal) + if (world.getBlock(x - 4, y - 3, z - 2) != BlockList.handPedestal) return false; - if (world.getBlock(x - 5, y - 3, - z) != BlockList.handPedestal) + if (world.getBlock(x - 5, y - 3, z) != BlockList.handPedestal) return false; - if (world.getBlock(x + 4, y - 3, - z - 2) != BlockList.handPedestal) + if (world.getBlock(x + 4, y - 3, z - 2) != BlockList.handPedestal) return false; - if (world.getBlock(x + 5, y - 3, - z) != BlockList.handPedestal) + if (world.getBlock(x + 5, y - 3, z) != BlockList.handPedestal) return false; - if (world.getBlock(x + 4, y - 3, - z + 2) != BlockList.handPedestal) + if (world.getBlock(x + 4, y - 3, z + 2) != BlockList.handPedestal) return false; - if (world.getBlock(x + 2, y - 3, - z + 4) != BlockList.handPedestal) + if (world.getBlock(x + 2, y - 3, z + 4) != BlockList.handPedestal) return false; - if (world.getBlock(x, y - 3, - z + 5) != BlockList.handPedestal) + if (world.getBlock(x, y - 3, z + 5) != BlockList.handPedestal) return false; - if (world.getBlock(x - 2, y - 3, - z + 4) != BlockList.handPedestal) + if (world.getBlock(x - 2, y - 3, z + 4) != BlockList.handPedestal) return false; return true; } @@ -525,25 +357,15 @@ public class TileEntityShadowEye extends TileEntity { public void changeHand(World world, int x, int y, int z) { int l = world.getBlockMetadata(x, y, z); - world.playAuxSFX(2001, x, y, z, Block - .getIdFromBlock(world.getBlock(x, y, z))); + world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(world.getBlock(x, y, z))); TileEntityShadowHand tile = new TileEntityShadowHand(); - if (world.getTileEntity(x, y, - z) instanceof TileEntityHandPedestal) { - if (((TileEntityHandPedestal) world.getTileEntity( - x, y, z)).heldItemStack != null) - tile.setHeldItemStack( - ((TileEntityHandPedestal) world - .getTileEntity(x, - y, - z)).heldItemStack - .copy()); + if (world.getTileEntity(x, y, z) instanceof TileEntityHandPedestal) { + if (((TileEntityHandPedestal) world.getTileEntity(x, y, z)).heldItemStack != null) + tile.setHeldItemStack(((TileEntityHandPedestal) world.getTileEntity(x, y, z)).heldItemStack.copy()); if (tile.heldItemStack != null) tile.closeHand(); - ((TileEntityHandPedestal) world.getTileEntity(x, y, - z)).removeHeldItemStack(); - world.setBlock(x, y, z, BlockList.shadowHand, l, - 2); + ((TileEntityHandPedestal) world.getTileEntity(x, y, z)).removeHeldItemStack(); + world.setBlock(x, y, z, BlockList.shadowHand, l, 2); world.setTileEntity(x, y, z, tile); } } @@ -566,66 +388,39 @@ public class TileEntityShadowEye extends TileEntity { public void revertHand(World world, int x, int y, int z) { int l = world.getBlockMetadata(x, y, z); - world.playAuxSFX(2001, x, y, z, Block - .getIdFromBlock(BlockList.handPedestal)); + world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(BlockList.handPedestal)); world.playSoundEffect(x, y + 0.5F, z, "step.wood", 1F, 1F); TileEntityHandPedestal tile = new TileEntityHandPedestal(); - if (world.getTileEntity(x, y, - z) instanceof TileEntityShadowHand) { - if (((TileEntityShadowHand) world.getTileEntity(x, - y, z)).heldItemStack != null) - tile.setHeldItemStack( - ((TileEntityShadowHand) world - .getTileEntity(x, - y, - z)).heldItemStack - .copy()); - ((TileEntityShadowHand) world.getTileEntity(x, y, - z)).removeHeldItemStack(); - world.setBlock(x, y, z, BlockList.handPedestal, l, - 2); + if (world.getTileEntity(x, y, z) instanceof TileEntityShadowHand) { + if (((TileEntityShadowHand) world.getTileEntity(x, y, z)).heldItemStack != null) + tile.setHeldItemStack(((TileEntityShadowHand) world.getTileEntity(x, y, z)).heldItemStack.copy()); + ((TileEntityShadowHand) world.getTileEntity(x, y, z)).removeHeldItemStack(); + world.setBlock(x, y, z, BlockList.handPedestal, l, 2); world.setTileEntity(x, y, z, tile); } } public void addPedestalInfo(TileEntityHandPedestal pedestal) { ItemStack heldItemStack; - if (pedestal != null && (heldItemStack = pedestal - .getHeldItemStack()) != null) { + if (pedestal != null && (heldItemStack = pedestal.getHeldItemStack()) != null) { if (pedestalItems.isEmpty()) pedestalItems.add(heldItemStack.copy()); else { boolean hasItem = false; int index = 0; - for (int ind = 0; ind < pedestalItems - .size() && !hasItem; ind++) - if (heldItemStack.getItem().equals( - pedestalItems.get( - ind) - .getItem()) - && heldItemStack.getItemDamage() == pedestalItems - .get(ind) - .getItemDamage()) { + for (int ind = 0; ind < pedestalItems.size() && !hasItem; ind++) + if (heldItemStack.getItem().equals(pedestalItems.get(ind).getItem()) + && heldItemStack.getItemDamage() == pedestalItems.get(ind).getItemDamage()) { index = ind; hasItem = true; - if (heldItemStack - .hasTagCompound() - && pedestalItems.get( - ind) - .hasTagCompound() - && !heldItemStack - .getTagCompound() - .equals(pedestalItems - .get(ind) - .getTagCompound())) + if (heldItemStack.hasTagCompound() && pedestalItems.get(ind).hasTagCompound() + && !heldItemStack.getTagCompound().equals(pedestalItems.get(ind).getTagCompound())) hasItem = false; } if (!hasItem) - pedestalItems.add(heldItemStack - .copy()); + pedestalItems.add(heldItemStack.copy()); else { - ItemStack object = pedestalItems - .get(index).copy(); + ItemStack object = pedestalItems.get(index).copy(); object.stackSize++; pedestalItems.set(index, object); } @@ -639,9 +434,7 @@ public class TileEntityShadowEye extends TileEntity { @Override @SideOnly(Side.CLIENT) public AxisAlignedBB getRenderBoundingBox() { - AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( - xCoord - 5.5D, yCoord - 5.5D, - zCoord - 5.5D, xCoord + 5.5D, + AxisAlignedBB bb = AxisAlignedBB.getBoundingBox(xCoord - 5.5D, yCoord - 5.5D, zCoord - 5.5D, xCoord + 5.5D, yCoord + 5.5D, zCoord + 5.5D); return bb; } @@ -650,13 +443,11 @@ public class TileEntityShadowEye extends TileEntity { public Packet getDescriptionPacket() { NBTTagCompound nbttagcompound = new NBTTagCompound(); writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, - zCoord, 1, nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); } @Override - public void onDataPacket(NetworkManager net, - S35PacketUpdateTileEntity packet) { + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { readFromNBT(packet.func_148857_g()); worldObj.func_147479_m(xCoord, yCoord, zCoord); } diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java index dd73951..6982888 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java @@ -14,10 +14,10 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; public class TileEntitySmelter extends TileEntity { - public int melting, flow, n = 0, p = 0; - public boolean hasMetal, hasMoltenMetal, isDirty, pouring; - public ItemStack metal, moltenMetal; - public float quantity, pouredQuantity = 0.1f; + public int melting, flow, n = 0, p = 0; + public boolean hasMetal, hasMoltenMetal, isDirty, pouring; + public ItemStack metal, moltenMetal; + public float quantity, pouredQuantity = 0.1f; /** * @@ -78,8 +78,7 @@ public class TileEntitySmelter extends TileEntity { super.updateEntity(); Random rand = new Random(); if (isDirty) { - worldObj.markBlockForUpdate(xCoord, yCoord, - zCoord); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); isDirty = false; } if (p > 0) @@ -98,19 +97,14 @@ public class TileEntitySmelter extends TileEntity { } if (hasMetal) for (int l = 0; l < 2; ++l) - worldObj.spawnParticle("flame", - xCoord + rand.nextFloat(), - (double) yCoord + 0.3F, - zCoord + rand.nextFloat(), - 0.0D, 0.0D, 0.0D); + worldObj.spawnParticle("flame", xCoord + rand.nextFloat(), (double) yCoord + 0.3F, + zCoord + rand.nextFloat(), 0.0D, 0.0D, 0.0D); if (rand.nextInt(65) == 0) { double d5 = xCoord + rand.nextFloat(); double d7 = yCoord; double d6 = zCoord + rand.nextFloat(); - worldObj.playSound(d5, d7, d6, "liquid.lavapop", - 0.2F + rand.nextFloat() * 0.2F, - 0.9F + rand.nextFloat() * 0.15F, - false); + worldObj.playSound(d5, d7, d6, "liquid.lavapop", 0.2F + rand.nextFloat() * 0.2F, + 0.9F + rand.nextFloat() * 0.15F, false); } if (hasMetal && !hasMoltenMetal) { boolean isOre = JewelrycraftUtil.isOre(metal); @@ -119,16 +113,12 @@ public class TileEntitySmelter extends TileEntity { if (melting == 0) { hasMetal = false; if (!isOre) { - if (JewelryNBT.ingot( - metal) == null) + if (JewelryNBT.ingot(metal) == null) moltenMetal = metal; else - moltenMetal = JewelryNBT - .ingot(metal); + moltenMetal = JewelryNBT.ingot(metal); } else { - moltenMetal = JewelrycraftUtil - .getIngotFromOre( - metal); + moltenMetal = JewelrycraftUtil.getIngotFromOre(metal); moltenMetal.stackSize *= 2; } hasMoltenMetal = true; @@ -136,8 +126,7 @@ public class TileEntitySmelter extends TileEntity { quantity = 0.1f * metal.stackSize; else quantity = 0.2f * metal.stackSize; - metal = new ItemStack(Item.getItemById(0), - 0, 0); + metal = new ItemStack(Item.getItemById(0), 0, 0); melting = -1; isDirty = true; } @@ -150,52 +139,33 @@ public class TileEntitySmelter extends TileEntity { if (!isOre) moltenMetal.stackSize += metal.stackSize; else - moltenMetal.stackSize += metal.stackSize - * 2; + moltenMetal.stackSize += metal.stackSize * 2; if (!isOre) quantity += 0.1f * metal.stackSize; else quantity += 0.2f * metal.stackSize; - metal = new ItemStack(Item.getItemById(0), - 0, 0); + metal = new ItemStack(Item.getItemById(0), 0, 0); melting = -1; isDirty = true; } } TileEntityMolder me = null; if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 0 - && worldObj.getTileEntity(xCoord, yCoord, - zCoord - 1) != null - && worldObj.getTileEntity(xCoord, yCoord, - zCoord - 1) instanceof TileEntityMolder) - me = (TileEntityMolder) worldObj.getTileEntity( - xCoord, yCoord, zCoord - 1); - else if (worldObj.getBlockMetadata(xCoord, yCoord, - zCoord) == 1 - && worldObj.getTileEntity(xCoord + 1, - yCoord, zCoord) != null - && worldObj.getTileEntity(xCoord + 1, - yCoord, - zCoord) instanceof TileEntityMolder) - me = (TileEntityMolder) worldObj.getTileEntity( - xCoord + 1, yCoord, zCoord); - else if (worldObj.getBlockMetadata(xCoord, yCoord, - zCoord) == 2 - && worldObj.getTileEntity(xCoord, yCoord, - zCoord + 1) != null - && worldObj.getTileEntity(xCoord, yCoord, - zCoord + 1) instanceof TileEntityMolder) - me = (TileEntityMolder) worldObj.getTileEntity( - xCoord, yCoord, zCoord + 1); - else if (worldObj.getBlockMetadata(xCoord, yCoord, - zCoord) == 3 - && worldObj.getTileEntity(xCoord - 1, - yCoord, zCoord) != null - && worldObj.getTileEntity(xCoord - 1, - yCoord, - zCoord) instanceof TileEntityMolder) - me = (TileEntityMolder) worldObj.getTileEntity( - xCoord - 1, yCoord, zCoord); + && worldObj.getTileEntity(xCoord, yCoord, zCoord - 1) != null + && worldObj.getTileEntity(xCoord, yCoord, zCoord - 1) instanceof TileEntityMolder) + me = (TileEntityMolder) worldObj.getTileEntity(xCoord, yCoord, zCoord - 1); + else if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 1 + && worldObj.getTileEntity(xCoord + 1, yCoord, zCoord) != null + && worldObj.getTileEntity(xCoord + 1, yCoord, zCoord) instanceof TileEntityMolder) + me = (TileEntityMolder) worldObj.getTileEntity(xCoord + 1, yCoord, zCoord); + else if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 2 + && worldObj.getTileEntity(xCoord, yCoord, zCoord + 1) != null + && worldObj.getTileEntity(xCoord, yCoord, zCoord + 1) instanceof TileEntityMolder) + me = (TileEntityMolder) worldObj.getTileEntity(xCoord, yCoord, zCoord + 1); + else if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 3 + && worldObj.getTileEntity(xCoord - 1, yCoord, zCoord) != null + && worldObj.getTileEntity(xCoord - 1, yCoord, zCoord) instanceof TileEntityMolder) + me = (TileEntityMolder) worldObj.getTileEntity(xCoord - 1, yCoord, zCoord); if (pouring && pouredQuantity > 0f) { quantity -= 0.01f; pouredQuantity -= 0.01f; @@ -212,8 +182,7 @@ public class TileEntitySmelter extends TileEntity { if (quantity <= 0f) { quantity = 0f; hasMoltenMetal = false; - moltenMetal = new ItemStack( - Item.getItemById(0), 0, 0); + moltenMetal = new ItemStack(Item.getItemById(0), 0, 0); me.cooling = ConfigHandler.INGOT_COOLING_TIME; } me.isDirty = true; @@ -227,8 +196,7 @@ public class TileEntitySmelter extends TileEntity { public Packet getDescriptionPacket() { NBTTagCompound nbttagcompound = new NBTTagCompound(); writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, - zCoord, 1, nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); } /** @@ -236,8 +204,7 @@ public class TileEntitySmelter extends TileEntity { * @param packet */ @Override - public void onDataPacket(NetworkManager net, - S35PacketUpdateTileEntity packet) { + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { readFromNBT(packet.func_148857_g()); worldObj.func_147479_m(xCoord, yCoord, zCoord); } diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityDisplayerRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityDisplayerRender.java index aaf4613..360c027 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityDisplayerRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityDisplayerRender.java @@ -26,8 +26,7 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; public class TileEntityDisplayerRender extends TileEntitySpecialRenderer { - private final class ChatColorMap - extends HashMap { + private final class ChatColorMap extends HashMap { private static final long serialVersionUID = -6532830760345687407L; { put(EnumChatFormatting.AQUA, 5636095); @@ -49,155 +48,84 @@ public class TileEntityDisplayerRender extends TileEntitySpecialRenderer { } } - ModelDisplayer displayer = new ModelDisplayer(); - String texture = "textures/tileentities/Displayer.png"; - HashMap colors = new ChatColorMap(); + ModelDisplayer displayer = new ModelDisplayer(); + String texture = "textures/tileentities/Displayer.png"; + HashMap colors = new ChatColorMap(); @Override - public void renderTileEntityAt(TileEntity te, double x, double y, - double z, float scale) { + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) { GL11.glPushMatrix(); - GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, - (float) z + 0.5F); + GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); TileEntityDisplayer disp = (TileEntityDisplayer) te; - ResourceLocation blockTexture = new ResourceLocation( - Variables.MODID, texture); - Minecraft.getMinecraft().renderEngine - .bindTexture(blockTexture); + ResourceLocation blockTexture = new ResourceLocation(Variables.MODID, texture); + Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - displayer.render((Entity) null, disp.ringTranslation1, - disp.ringTranslation2, - disp.ringTranslation3, 0.0F, 0.0F, + displayer.render((Entity) null, disp.ringTranslation1, disp.ringTranslation2, disp.ringTranslation3, 0.0F, 0.0F, 0.0625F); try { int block = disp.getBlockMetadata(); - if (disp != null && disp.hasObject - && disp.object != null - && disp.object.getItem() != null - && disp.object != new ItemStack( - Item.getItemById( - 0), - 0, 0)) { + if (disp != null && disp.hasObject && disp.object != null && disp.object.getItem() != null + && disp.object != new ItemStack(Item.getItemById(0), 0, 0)) { int ind = -3; GL11.glPushMatrix(); - EntityItem entityitem = new EntityItem( - te.getWorldObj(), 0.0D, - 0.0D, 0.0D, disp.object); + EntityItem entityitem = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, disp.object); entityitem.hoverStart = 0.0F; disp.object.stackSize = 1; GL11.glRotatef(180F, 1F, 0F, 0F); - GL11.glTranslatef(0.0F, -0.6F - + disp.ringTranslation1 - / 5, - 0F); + GL11.glTranslatef(0.0F, -0.6F + disp.ringTranslation1 / 5, 0F); GL11.glRotatef(disp.rotAngle, 0F, 1F, 0F); GL11.glColor4f(1F, 1F, 1F, 1F); if (RenderManager.instance.options.fancyGraphics) - RenderManager.instance - .renderEntityWithPosYaw( - entityitem, - 0.0D, - 0.0D, - 0.0D, - 0.0F, - 0.0F); + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); else { GL11.glRotatef(180F, 0F, 1F, 0F); RenderManager.instance.options.fancyGraphics = true; int i = 15728880; int j = i % 65536; int k = i / 65536; - OpenGlHelper.setLightmapTextureCoords( - OpenGlHelper.lightmapTexUnit, - j / 1.0F, - k / 1.0F); - RenderManager.instance - .renderEntityWithPosYaw( - entityitem, - 0.0D, - 0.0D, - 0.0D, - 0.0F, - 0.0F); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j / 1.0F, k / 1.0F); + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); RenderManager.instance.options.fancyGraphics = false; } - EntityPlayer player = te.getWorldObj() - .getClosestPlayer( - te.xCoord, - te.yCoord, - te.zCoord, - 5D); + EntityPlayer player = te.getWorldObj().getClosestPlayer(te.xCoord, te.yCoord, te.zCoord, 5D); GL11.glPopMatrix(); GL11.glPushMatrix(); if (player != null) - renderLabel(disp.object - .getDisplayName(), - 0F, -0.171F * ind, - 0F, block, disp, - colors.get(disp.object - .getRarity().rarityColor)); + renderLabel(disp.object.getDisplayName(), 0F, -0.171F * ind, 0F, block, disp, + colors.get(disp.object.getRarity().rarityColor)); GL11.glPopMatrix(); ind++; if (player != null && disp.quantity > 1) { GL11.glPushMatrix(); - renderLabel("x" + Integer.toString( - disp.quantity), 0F, - -0.171F * ind, 0F, - block, disp, + renderLabel("x" + Integer.toString(disp.quantity), 0F, -0.171F * ind, 0F, block, disp, Color.GRAY.getRGB()); GL11.glPopMatrix(); ind++; } - if (disp.object.getItem() != Items.map - && player != null - && disp.object.getTooltip( - player, - true) != null) { - List tooltips = disp.object - .getTooltip(player, - true); - if (disp.infoIndex + 5 > tooltips - .size()) + if (disp.object.getItem() != Items.map && player != null + && disp.object.getTooltip(player, true) != null) { + List tooltips = disp.object.getTooltip(player, true); + if (disp.infoIndex + 5 > tooltips.size()) disp.infoIndex = 1; if (tooltips.size() < 5) - for (int i = 1; i < tooltips - .size(); i++) { - String tooltip = tooltips - .get(i) - .toString(); - RenderManager.instance - .getFontRenderer(); + for (int i = 1; i < tooltips.size(); i++) { + String tooltip = tooltips.get(i).toString(); + RenderManager.instance.getFontRenderer(); if (tooltip != "") { GL11.glPushMatrix(); - renderLabel(tooltip, - 0F, - -0.171F * ind, - 0F, - block, - disp, - Color.GRAY.getRGB()); + renderLabel(tooltip, 0F, -0.171F * ind, 0F, block, disp, Color.GRAY.getRGB()); GL11.glPopMatrix(); ind++; } } else - for (int i = disp.infoIndex; i < disp.infoIndex - + 5; i++) { - String tooltip = tooltips - .get(i) - .toString(); - RenderManager.instance - .getFontRenderer(); + for (int i = disp.infoIndex; i < disp.infoIndex + 5; i++) { + String tooltip = tooltips.get(i).toString(); + RenderManager.instance.getFontRenderer(); if (tooltip != "") { GL11.glPushMatrix(); - renderLabel(tooltip, - 0F, - -0.171F * ind, - 0F, - block, - disp, - Color.GRAY.getRGB()); + renderLabel(tooltip, 0F, -0.171F * ind, 0F, block, disp, Color.GRAY.getRGB()); GL11.glPopMatrix(); ind++; } @@ -210,10 +138,8 @@ public class TileEntityDisplayerRender extends TileEntitySpecialRenderer { GL11.glPopMatrix(); } - protected void renderLabel(String text, double x, double y, - double z, int metadata, TileEntity te, int color) { - FontRenderer fontrenderer = RenderManager.instance - .getFontRenderer(); + protected void renderLabel(String text, double x, double y, double z, int metadata, TileEntity te, int color) { + FontRenderer fontrenderer = RenderManager.instance.getFontRenderer(); float width = 0.015F, height = 1F; GL11.glRotatef(180F, 0F, 0F, 1F); GL11.glRotatef(360 - metadata * 90F, 0F, 1F, 0F); @@ -233,35 +159,19 @@ public class TileEntityDisplayerRender extends TileEntitySpecialRenderer { tessellator.draw(); if (fontrenderer.getStringWidth(text) / 2 > 20) { width = 0.9F / fontrenderer.getStringWidth(text); - height = 1F - fontrenderer.getStringWidth(text) - / 20 * 0.06F; + height = 1F - fontrenderer.getStringWidth(text) / 20 * 0.06F; } - GL11.glTranslatef((float) x + 1f, (float) y + 1f, - (float) z); + GL11.glTranslatef((float) x + 1f, (float) y + 1f, (float) z); GL11.glPushMatrix(); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glScalef(width * 70F, height, 0F); - fontrenderer.drawString( - text.replaceFirst("�0", "�r") - .replaceFirst("�1", "�r") - .replaceFirst("�2", "�r") - .replaceFirst("�3", "�r") - .replaceFirst("�4", "�r") - .replaceFirst("�5", "�r") - .replaceFirst("�6", "�r") - .replaceFirst("�7", "�r") - .replaceFirst("�8", "�r") - .replaceFirst("�9", "�r") - .replaceFirst("�a", "�r") - .replaceFirst("�b", "�r") - .replaceFirst("�c", "�r") - .replaceFirst("�d", "�r") - .replaceFirst("�e", "�r") - .replaceFirst("�f", "�r"), - -j, 0, 1973790); + fontrenderer.drawString(text.replaceFirst("�0", "�r").replaceFirst("�1", "�r").replaceFirst("�2", "�r") + .replaceFirst("�3", "�r").replaceFirst("�4", "�r").replaceFirst("�5", "�r").replaceFirst("�6", "�r") + .replaceFirst("�7", "�r").replaceFirst("�8", "�r").replaceFirst("�9", "�r").replaceFirst("�a", "�r") + .replaceFirst("�b", "�r").replaceFirst("�c", "�r").replaceFirst("�d", "�r").replaceFirst("�e", "�r") + .replaceFirst("�f", "�r"), -j, 0, 1973790); GL11.glPopMatrix(); - GL11.glTranslatef((float) x - 0.5f, (float) y - 0.5f, - (float) z - 0.5F); + GL11.glTranslatef((float) x - 0.5f, (float) y - 0.5f, (float) z - 0.5F); GL11.glScalef(width * 70F, height, 0F); fontrenderer.drawString(text, -j, 0, color); GL11.glEnable(GL11.GL_LIGHTING); diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityHandPedestalRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityHandPedestalRender.java index da8fa58..d3ff955 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityHandPedestalRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityHandPedestalRender.java @@ -11,17 +11,15 @@ import net.minecraft.util.ResourceLocation; /** * @author Paul Fulham (pau101) */ -public class TileEntityHandPedestalRender - extends TileEntitySpecialRenderer { - private ModelHandPedestal model; - private ResourceLocation texture; +public class TileEntityHandPedestalRender extends TileEntitySpecialRenderer { + private ModelHandPedestal model; + private ResourceLocation texture; /** * @param model * @param texture */ - public TileEntityHandPedestalRender(ModelHandPedestal model, - ResourceLocation texture) { + public TileEntityHandPedestalRender(ModelHandPedestal model, ResourceLocation texture) { this.model = model; this.texture = texture; } @@ -34,18 +32,13 @@ public class TileEntityHandPedestalRender * @param partialRenderTicks */ @Override - public void renderTileEntityAt(TileEntity te, double x, double y, - double z, float partialRenderTicks) { + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialRenderTicks) { GL11.glPushMatrix(); - GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, - (float) z + 0.5F); + GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); TileEntityHandPedestal pedestal = (TileEntityHandPedestal) te; bindTexture(texture); GL11.glRotatef(180, 0, 0, 1); - GL11.glRotatef(pedestal.getWorldObj() == null ? 180 - : pedestal.getBlockMetadata() % 8 / 8F - * 360, - 0, 1, 0); + GL11.glRotatef(pedestal.getWorldObj() == null ? 180 : pedestal.getBlockMetadata() % 8 / 8F * 360, 0, 1, 0); model.render(pedestal, partialRenderTicks, 0.0625F); GL11.glPopMatrix(); } diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityJewelrsCraftingTableRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityJewelrsCraftingTableRender.java index fbe3db6..8612eb7 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityJewelrsCraftingTableRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityJewelrsCraftingTableRender.java @@ -17,10 +17,9 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; -public class TileEntityJewelrsCraftingTableRender - extends TileEntitySpecialRenderer { - ModelJewlersCraftingBench modelTable = new ModelJewlersCraftingBench(); - String texture = "textures/tileentities/JewelrsCraftingBench.png"; +public class TileEntityJewelrsCraftingTableRender extends TileEntitySpecialRenderer { + ModelJewlersCraftingBench modelTable = new ModelJewlersCraftingBench(); + String texture = "textures/tileentities/JewelrsCraftingBench.png"; /** * @param te @@ -30,15 +29,11 @@ public class TileEntityJewelrsCraftingTableRender * @param scale */ @Override - public void renderTileEntityAt(TileEntity te, double x, double y, - double z, float scale) { + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) { GL11.glPushMatrix(); - GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, - (float) z + 0.5F); - ResourceLocation blockTexture = new ResourceLocation( - Variables.MODID, texture); - Minecraft.getMinecraft().renderEngine - .bindTexture(blockTexture); + GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); + ResourceLocation blockTexture = new ResourceLocation(Variables.MODID, texture); + Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture); TileEntityJewelrsCraftingTable jt = (TileEntityJewelrsCraftingTable) te; GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); @@ -55,18 +50,12 @@ public class TileEntityJewelrsCraftingTableRender } } catch (Exception e) { } - modelTable.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, - 0.0F, 0.0625F); + modelTable.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); if (jt != null) { - if (jt.hasJewelry && jt.jewelry - .getIconIndex() != null - && jt.jewelry.getIconIndex() - .getIconName() != "") { + if (jt.hasJewelry && jt.jewelry.getIconIndex() != null && jt.jewelry.getIconIndex().getIconName() != "") { GL11.glPushMatrix(); GL11.glDisable(GL11.GL_LIGHTING); - EntityItem entityitem = new EntityItem( - te.getWorldObj(), 0.0D, - 0.0D, 0.0D, jt.jewelry); + EntityItem entityitem = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, jt.jewelry); entityitem.getEntityItem().stackSize = 1; entityitem.hoverStart = 0.0F; GL11.glRotatef(180F, 1F, 0F, 0F); @@ -74,37 +63,20 @@ public class TileEntityJewelrsCraftingTableRender GL11.glTranslatef(0.55F, -1.5F, -0.45F); GL11.glRotatef(jt.angle, 0F, 1F, 0F); if (RenderManager.instance.options.fancyGraphics) - RenderManager.instance - .renderEntityWithPosYaw( - entityitem, - 0.0D, - 0.0D, - 0.0D, - 0.0F, - 0.0F); + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); else { GL11.glRotatef(180F, 0F, 1F, 0F); RenderManager.instance.options.fancyGraphics = true; - RenderManager.instance - .renderEntityWithPosYaw( - entityitem, - 0.0D, - 0.0D, - 0.0D, - 0.0F, - 0.0F); + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); RenderManager.instance.options.fancyGraphics = false; } GL11.glEnable(GL11.GL_LIGHTING); GL11.glPopMatrix(); } - if (jt.hasEndItem && jt.endItem.getIconIndex() - .getIconName() != "") { + if (jt.hasEndItem && jt.endItem.getIconIndex().getIconName() != "") { GL11.glPushMatrix(); GL11.glDisable(GL11.GL_LIGHTING); - EntityItem entityitem = new EntityItem( - te.getWorldObj(), 0.0D, - 0.0D, 0.0D, jt.endItem); + EntityItem entityitem = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, jt.endItem); entityitem.getEntityItem().stackSize = 1; entityitem.hoverStart = 0.0F; GL11.glRotatef(180F, 1F, 0F, 0F); @@ -112,37 +84,20 @@ public class TileEntityJewelrsCraftingTableRender GL11.glTranslatef(0.0F, -1.6F, 0.6F); GL11.glRotatef(jt.angle, 0F, 1F, 0F); if (RenderManager.instance.options.fancyGraphics) - RenderManager.instance - .renderEntityWithPosYaw( - entityitem, - 0.0D, - 0.0D, - 0.0D, - 0.0F, - 0.0F); + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); else { GL11.glRotatef(180F, 0F, 1F, 0F); RenderManager.instance.options.fancyGraphics = true; - RenderManager.instance - .renderEntityWithPosYaw( - entityitem, - 0.0D, - 0.0D, - 0.0D, - 0.0F, - 0.0F); + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); RenderManager.instance.options.fancyGraphics = false; } GL11.glEnable(GL11.GL_LIGHTING); GL11.glPopMatrix(); } - if (jt.hasGem && jt.gem.getIconIndex() - .getIconName() != "") { + if (jt.hasGem && jt.gem.getIconIndex().getIconName() != "") { GL11.glPushMatrix(); GL11.glDisable(GL11.GL_LIGHTING); - EntityItem entityitem = new EntityItem( - te.getWorldObj(), 0.0D, - 0.0D, 0.0D, jt.gem); + EntityItem entityitem = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, jt.gem); entityitem.getEntityItem().stackSize = 1; entityitem.hoverStart = 0.0F; GL11.glRotatef(180F, 1F, 0F, 0F); @@ -150,25 +105,11 @@ public class TileEntityJewelrsCraftingTableRender GL11.glTranslatef(-0.55F, -1.5F, -0.45F); GL11.glRotatef(jt.angle, 0F, 1F, 0F); if (RenderManager.instance.options.fancyGraphics) - RenderManager.instance - .renderEntityWithPosYaw( - entityitem, - 0.0D, - 0.0D, - 0.0D, - 0.0F, - 0.0F); + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); else { GL11.glRotatef(180F, 0F, 1F, 0F); RenderManager.instance.options.fancyGraphics = true; - RenderManager.instance - .renderEntityWithPosYaw( - entityitem, - 0.0D, - 0.0D, - 0.0D, - 0.0F, - 0.0F); + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); RenderManager.instance.options.fancyGraphics = false; } GL11.glEnable(GL11.GL_LIGHTING); @@ -186,17 +127,13 @@ public class TileEntityJewelrsCraftingTableRender * @param k * @param block */ - public void adjustLightFixture(World world, int i, int j, int k, - Block block) { + public void adjustLightFixture(World world, int i, int j, int k, Block block) { Tessellator tess = Tessellator.instance; float brightness = block.getLightOpacity(world, i, j, k); - int skyLight = world.getLightBrightnessForSkyBlocks(i, j, - k, 0); + int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0); int modulousModifier = skyLight % 65536; int divModifier = skyLight / 65536; tess.setColorOpaque_F(brightness, brightness, brightness); - OpenGlHelper.setLightmapTextureCoords( - OpenGlHelper.lightmapTexUnit, - modulousModifier, divModifier); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, modulousModifier, divModifier); } } diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMidasTouchRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMidasTouchRender.java index f423bc8..e4b1a93 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMidasTouchRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMidasTouchRender.java @@ -11,8 +11,7 @@ import net.minecraft.tileentity.TileEntity; public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer { @Override - public void renderTileEntityAt(TileEntity te, double x, double y, - double z, float scale) { + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) { GL11.glPushMatrix(); TileEntityMidasTouch midas = (TileEntityMidasTouch) te; if (midas.target != null) { @@ -20,21 +19,14 @@ public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer { target.hurtTime = 0; GL11.glTranslatef(0.5F, 0.0F, 0.5F); GL11.glColor3f(1.0F, 1.0F, 0.0F); - RenderManager.instance.renderEntityWithPosYaw( - target, - midas.xCoord - RenderManager.renderPosX, - midas.yCoord - RenderManager.renderPosY, - midas.zCoord - RenderManager.renderPosZ, - 0F, 1F); + RenderManager.instance.renderEntityWithPosYaw(target, midas.xCoord - RenderManager.renderPosX, + midas.yCoord - RenderManager.renderPosY, midas.zCoord - RenderManager.renderPosZ, 0F, 1F); } else { GL11.glTranslatef(0.5F, 0.0F, 0.5F); GL11.glColor3f(1.0F, 1.0F, 0.0F); - RenderManager.instance.renderEntityWithPosYaw( - new EntityPig(te.getWorldObj()), - midas.xCoord - RenderManager.renderPosX, - midas.yCoord - RenderManager.renderPosY, - midas.zCoord - RenderManager.renderPosZ, - 0F, 1F); + RenderManager.instance.renderEntityWithPosYaw(new EntityPig(te.getWorldObj()), + midas.xCoord - RenderManager.renderPosX, midas.yCoord - RenderManager.renderPosY, + midas.zCoord - RenderManager.renderPosZ, 0F, 1F); } GL11.glPopMatrix(); } diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMolderRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMolderRender.java index c93a09b..269d475 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMolderRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMolderRender.java @@ -35,17 +35,13 @@ public class TileEntityMolderRender extends TileEntitySpecialRenderer { * @param scale */ @Override - public void renderTileEntityAt(TileEntity te, double x, double y, - double z, float scale) { + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) { GL11.glPushMatrix(); - GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, - (float) z + 0.5F); + GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); TileEntityMolder me = (TileEntityMolder) te; String texture = "textures/tileentities/Molder.png"; - ResourceLocation blockTexture = new ResourceLocation( - Variables.MODID, texture); - Minecraft.getMinecraft().renderEngine - .bindTexture(blockTexture); + ResourceLocation blockTexture = new ResourceLocation(Variables.MODID, texture); + Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); try { @@ -61,16 +57,12 @@ public class TileEntityMolderRender extends TileEntitySpecialRenderer { } } catch (Exception e) { } - modelMolder.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, - 0.0F, 0.0625F); - boolean fancyGraphics = Minecraft - .getMinecraft().gameSettings.fancyGraphics; + modelMolder.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); + boolean fancyGraphics = Minecraft.getMinecraft().gameSettings.fancyGraphics; if (me != null) { if (me.hasMold) { GL11.glPushMatrix(); - EntityItem entityitem = new EntityItem( - te.getWorldObj(), 0.0D, - 0.0D, 0.0D, me.mold); + EntityItem entityitem = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, me.mold); entityitem.getEntityItem().stackSize = 1; entityitem.hoverStart = 0.0F; GL11.glTranslatef(0F, 1.43F, -0.28F); @@ -78,37 +70,16 @@ public class TileEntityMolderRender extends TileEntitySpecialRenderer { GL11.glRotatef(90F, 1F, 0F, 0f); Minecraft.getMinecraft().gameSettings.fancyGraphics = true; if (entityitem != null) { - RenderManager.instance - .renderEntityWithPosYaw( - entityitem, - 0.0D, - 0.0D, - 0.0D, - 0.0F, - 0.0F); - RenderManager.instance - .renderEntityWithPosYaw( - entityitem, - 0.0D, - 0.0D, - 0.03D, - 0.0F, - 0.0F); + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.03D, 0.0F, 0.0F); } Minecraft.getMinecraft().gameSettings.fancyGraphics = fancyGraphics; GL11.glPopMatrix(); } - if (me.hasJewelBase && me.jewelBase != null - && me.jewelBase.getItem() != Item - .getItemFromBlock( - Blocks.air) - && me.jewelBase.getIconIndex() != null - && me.jewelBase.getIconIndex() - .getIconName() != "") { + if (me.hasJewelBase && me.jewelBase != null && me.jewelBase.getItem() != Item.getItemFromBlock(Blocks.air) + && me.jewelBase.getIconIndex() != null && me.jewelBase.getIconIndex().getIconName() != "") { GL11.glPushMatrix(); - EntityItem entityitem = new EntityItem( - te.getWorldObj(), 0.0D, - 0.0D, 0.0D, me.jewelBase); + EntityItem entityitem = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, me.jewelBase); entityitem.getEntityItem().stackSize = 1; entityitem.hoverStart = 0.0F; GL11.glTranslatef(0F, 1.4F, -0.28F); @@ -116,51 +87,30 @@ public class TileEntityMolderRender extends TileEntitySpecialRenderer { GL11.glRotatef(90F, 1F, 0F, 0f); Minecraft.getMinecraft().gameSettings.fancyGraphics = true; if (entityitem != null) - RenderManager.instance - .renderEntityWithPosYaw( - entityitem, - 0.0D, - 0.0D, - 0.01D, - 0.0F, - 0.0F); + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.01D, 0.0F, 0.0F); Minecraft.getMinecraft().gameSettings.fancyGraphics = fancyGraphics; GL11.glColor4f(1, 1F, 1F, 1.0F); GL11.glPopMatrix(); } if (me.hasMoltenMetal && me.moltenMetal != null - && me.moltenMetal != new ItemStack( - Item.getItemById( - 0), - 0, 0)) { + && me.moltenMetal != new ItemStack(Item.getItemById(0), 0, 0)) { GL11.glPushMatrix(); GL11.glDisable(GL11.GL_LIGHTING); if (JewelrycraftMod.fancyRender) { GL11.glEnable(GL11.GL_BLEND); - OpenGlHelper.glBlendFunc(1, 1, 0, - 0); + OpenGlHelper.glBlendFunc(1, 1, 0, 0); } - ItemStack metal = new ItemStack( - ItemList.metal); + ItemStack metal = new ItemStack(ItemList.metal); ItemStack ingot = me.moltenMetal.copy(); JewelryNBT.addMetal(metal, ingot); - EntityItem moltenMetal = new EntityItem( - te.getWorldObj(), 0.0D, - 0.0D, 0.0D, metal); + EntityItem moltenMetal = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, metal); moltenMetal.getEntityItem().stackSize = 1; moltenMetal.hoverStart = 0.0F; - GL11.glTranslatef(-0F, 1.4f - - 0.005f * me.quantity, - -0.29F); + GL11.glTranslatef(-0F, 1.4f - 0.005f * me.quantity, -0.29F); GL11.glScalef(1.2F, 1.0F, 1.4F); GL11.glRotatef(90F, 1F, 0F, 0f); RenderItem.renderInFrame = true; - RenderManager.instance - .renderEntityWithPosYaw( - moltenMetal, - 0.0D, 0.0D, - 0.0D, 0.0F, - 0.0F); + RenderManager.instance.renderEntityWithPosYaw(moltenMetal, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); RenderItem.renderInFrame = false; if (JewelrycraftMod.fancyRender) GL11.glDisable(GL11.GL_BLEND); @@ -179,17 +129,13 @@ public class TileEntityMolderRender extends TileEntitySpecialRenderer { * @param k * @param block */ - public void adjustLightFixture(World world, int i, int j, int k, - Block block) { + public void adjustLightFixture(World world, int i, int j, int k, Block block) { Tessellator tess = Tessellator.instance; float brightness = block.getLightOpacity(world, i, j, k); - int skyLight = world.getLightBrightnessForSkyBlocks(i, j, - k, 0); + int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0); int modulousModifier = skyLight % 65536; int divModifier = skyLight / 65536; tess.setColorOpaque_F(brightness, brightness, brightness); - OpenGlHelper.setLightmapTextureCoords( - OpenGlHelper.lightmapTexUnit, - modulousModifier, divModifier); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, modulousModifier, divModifier); } } diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowEyeRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowEyeRender.java index 5e191ec..67e20a5 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowEyeRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowEyeRender.java @@ -19,8 +19,8 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; public class TileEntityShadowEyeRender extends TileEntitySpecialRenderer { - ModelShadowEye eye = new ModelShadowEye(); - Sphere shadow = new Sphere(); + ModelShadowEye eye = new ModelShadowEye(); + Sphere shadow = new Sphere(); /** * @param te @@ -30,18 +30,13 @@ public class TileEntityShadowEyeRender extends TileEntitySpecialRenderer { * @param scale */ @Override - public void renderTileEntityAt(TileEntity te, double x, double y, - double z, float scale) { + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) { GL11.glPushMatrix(); - GL11.glTranslatef((float) x + 0.5F, (float) y + 1.6F, - (float) z + 0.5F); + GL11.glTranslatef((float) x + 0.5F, (float) y + 1.6F, (float) z + 0.5F); TileEntityShadowEye eyeS = (TileEntityShadowEye) te; - String texture = "textures/tileentities/ShadowEye" - + eyeS.opening + ".png"; - ResourceLocation blockTexture = new ResourceLocation( - Variables.MODID, texture); - Minecraft.getMinecraft().renderEngine - .bindTexture(blockTexture); + String texture = "textures/tileentities/ShadowEye" + eyeS.opening + ".png"; + ResourceLocation blockTexture = new ResourceLocation(Variables.MODID, texture); + Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); try { @@ -55,39 +50,24 @@ public class TileEntityShadowEyeRender extends TileEntitySpecialRenderer { } catch (Exception e) { } if (te != null && te.getWorldObj() != null) { - EntityPlayer player = te.getWorldObj() - .getClosestPlayer(te.xCoord, - te.yCoord, - te.zCoord, 16D); + EntityPlayer player = te.getWorldObj().getClosestPlayer(te.xCoord, te.yCoord, te.zCoord, 16D); if (player != null) { - float x1 = (float) (te.xCoord - - player.posX) + 0.5F; - float y1 = (float) (te.yCoord - - player.posY) + 0.5F; - float z1 = (float) (te.zCoord - - player.posZ) + 0.5F; - eyeS.model.render(player, 0, - (float) (x1 >= 0 ? Math - .atan(z1 / x1) - : Math.PI + Math.atan( - z1 / x1)), - (float) (y1 >= 0 ? Math - .atan(y1 / x1) - : Math.atan(y1 / x1)), - te.blockMetadata, - eyeS.opening, 0.0625F); + float x1 = (float) (te.xCoord - player.posX) + 0.5F; + float y1 = (float) (te.yCoord - player.posY) + 0.5F; + float z1 = (float) (te.zCoord - player.posZ) + 0.5F; + eyeS.model.render(player, 0, (float) (x1 >= 0 ? Math.atan(z1 / x1) : Math.PI + Math.atan(z1 / x1)), + (float) (y1 >= 0 ? Math.atan(y1 / x1) : Math.atan(y1 / x1)), te.blockMetadata, eyeS.opening, + 0.0625F); } } else - eyeS.model.render((Entity) null, 0.0F, 0.0F, 0.0F, - 0.0F, 0.0F, 0.0625F); + eyeS.model.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); if (eyeS.opening == 4) { GL11.glPushMatrix(); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_ONE_MINUS_SRC_ALPHA, - GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glBlendFunc(GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(0.0F, 0.0F, 0.0F, 1F); GL11.glRotatef(eyeS.timer * 10F, 0, 1, 0); GL11.glRotatef(90.0F, 1, 0, 0); @@ -110,17 +90,13 @@ public class TileEntityShadowEyeRender extends TileEntitySpecialRenderer { * @param k * @param block */ - public void adjustLightFixture(World world, int i, int j, int k, - Block block) { + public void adjustLightFixture(World world, int i, int j, int k, Block block) { Tessellator tess = Tessellator.instance; float brightness = block.getLightOpacity(world, i, j, k); - int skyLight = world.getLightBrightnessForSkyBlocks(i, j, - k, 0); + int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0); int modulousModifier = skyLight % 65536; int divModifier = skyLight / 65536; tess.setColorOpaque_F(brightness, brightness, brightness); - OpenGlHelper.setLightmapTextureCoords( - OpenGlHelper.lightmapTexUnit, - modulousModifier, divModifier); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, modulousModifier, divModifier); } } diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowHandRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowHandRender.java index dd960d0..e4d73e9 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowHandRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowHandRender.java @@ -6,15 +6,13 @@ import net.minecraft.util.ResourceLocation; /** * @author Paul Fulham (pau101) */ -public class TileEntityShadowHandRender - extends TileEntityHandPedestalRender { +public class TileEntityShadowHandRender extends TileEntityHandPedestalRender { /** * @param model * @param texture */ - public TileEntityShadowHandRender(ModelHandPedestal model, - ResourceLocation texture) { + public TileEntityShadowHandRender(ModelHandPedestal model, ResourceLocation texture) { super(model, texture); } } \ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntitySmelterRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntitySmelterRender.java index b694afa..bc49008 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntitySmelterRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntitySmelterRender.java @@ -21,9 +21,8 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; public class TileEntitySmelterRender extends TileEntitySpecialRenderer { - ModelSmelter modelSmelter = new ModelSmelter(); - public static final float p = 1 / 16, - p3 = 3 * p, p13 = 13 * p, p15 = 15 * p; + ModelSmelter modelSmelter = new ModelSmelter(); + public static final float p = 1 / 16, p3 = 3 * p, p13 = 13 * p, p15 = 15 * p; /** * @param te @@ -33,16 +32,12 @@ public class TileEntitySmelterRender extends TileEntitySpecialRenderer { * @param scale */ @Override - public void renderTileEntityAt(TileEntity te, double x, double y, - double z, float scale) { + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) { GL11.glPushMatrix(); - GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, - (float) z + 0.5F); + GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); String texture = "textures/tileentities/Smelter.png"; - ResourceLocation blockTexture = new ResourceLocation( - Variables.MODID, texture); - Minecraft.getMinecraft().renderEngine - .bindTexture(blockTexture); + ResourceLocation blockTexture = new ResourceLocation(Variables.MODID, texture); + Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture); TileEntitySmelter st = (TileEntitySmelter) te; GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); try { @@ -58,10 +53,8 @@ public class TileEntitySmelterRender extends TileEntitySpecialRenderer { } } catch (Exception e) { } - boolean fancyGraphics = Minecraft - .getMinecraft().gameSettings.fancyGraphics; - modelSmelter.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, - 0.0F, 0.0625F); + boolean fancyGraphics = Minecraft.getMinecraft().gameSettings.fancyGraphics; + modelSmelter.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); if (scale != 0) { GL11.glPushMatrix(); GL11.glDisable(GL11.GL_LIGHTING); @@ -69,8 +62,7 @@ public class TileEntitySmelterRender extends TileEntitySpecialRenderer { GL11.glEnable(GL11.GL_BLEND); OpenGlHelper.glBlendFunc(1, 1, 0, 0); } - EntityItem entityitem = new EntityItem( - te.getWorldObj(), 0.0D, 0.0D, 0.0D, + EntityItem entityitem = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, new ItemStack(Blocks.lava, 1, 1)); entityitem.hoverStart = 0.0F; GL11.glTranslatef(-0F, 1.25F, -0.345F); @@ -80,12 +72,8 @@ public class TileEntitySmelterRender extends TileEntitySpecialRenderer { int i = 15728880; int j = i % 65536; int k = i / 65536; - OpenGlHelper.setLightmapTextureCoords( - OpenGlHelper.lightmapTexUnit, - j / 1.0F, k / 1.0F); - RenderManager.instance.renderEntityWithPosYaw( - entityitem, 0.0D, 0.0D, 0.0D, 0.0F, - 0.0F); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j / 1.0F, k / 1.0F); + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); RenderItem.renderInFrame = false; if (JewelrycraftMod.fancyRender) GL11.glDisable(GL11.GL_BLEND); @@ -93,12 +81,9 @@ public class TileEntitySmelterRender extends TileEntitySpecialRenderer { GL11.glPopMatrix(); } if (st != null) { - if (st.hasMetal && st.metal != null - && st.metal.getItem() != null) { + if (st.hasMetal && st.metal != null && st.metal.getItem() != null) { GL11.glPushMatrix(); - EntityItem metal = new EntityItem( - te.getWorldObj(), 0.0D, - 0.0D, 0.0D, st.metal); + EntityItem metal = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, st.metal); metal.getEntityItem().stackSize = 1; metal.hoverStart = 0.0F; GL11.glRotatef(-50F, 1F, 0F, 0F); @@ -107,46 +92,28 @@ public class TileEntitySmelterRender extends TileEntitySpecialRenderer { GL11.glScalef(0.5F, 0.5F, 0.5F); GL11.glTranslatef(-0.9F, -0.9F, -1.6F); Minecraft.getMinecraft().gameSettings.fancyGraphics = true; - RenderManager.instance - .renderEntityWithPosYaw( - metal, - 0.0D, 0.0D, - 0.0D, 0.0F, - 0.0F); + RenderManager.instance.renderEntityWithPosYaw(metal, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); Minecraft.getMinecraft().gameSettings.fancyGraphics = fancyGraphics; GL11.glPopMatrix(); } - if (st.hasMoltenMetal && st.moltenMetal != null - && st.moltenMetal - .getItem() != null) { + if (st.hasMoltenMetal && st.moltenMetal != null && st.moltenMetal.getItem() != null) { GL11.glPushMatrix(); GL11.glDisable(GL11.GL_LIGHTING); if (JewelrycraftMod.fancyRender) { GL11.glEnable(GL11.GL_BLEND); - OpenGlHelper.glBlendFunc(1, 1, 0, - 0); + OpenGlHelper.glBlendFunc(1, 1, 0, 0); } - ItemStack metal = new ItemStack( - ItemList.metal); + ItemStack metal = new ItemStack(ItemList.metal); ItemStack ingot = st.moltenMetal.copy(); JewelryNBT.addMetal(metal, ingot); - EntityItem moltenMetal = new EntityItem( - te.getWorldObj(), 0.0D, - 0.0D, 0.0D, metal); + EntityItem moltenMetal = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, metal); moltenMetal.getEntityItem().stackSize = 1; moltenMetal.hoverStart = 0.0F; - GL11.glTranslatef(-0F, - 1.00f - .4F * st.quantity, - -0.14F); + GL11.glTranslatef(-0F, 1.00f - .4F * st.quantity, -0.14F); GL11.glScalef(0.71F, 1F, 0.84F); GL11.glRotatef(90F, 1F, 0F, 0f); RenderItem.renderInFrame = true; - RenderManager.instance - .renderEntityWithPosYaw( - moltenMetal, - 0.0D, 0.0D, - 0.0D, 0.0F, - 0.0F); + RenderManager.instance.renderEntityWithPosYaw(moltenMetal, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); RenderItem.renderInFrame = false; if (JewelrycraftMod.fancyRender) GL11.glDisable(GL11.GL_BLEND); -- cgit v1.2.3