summaryrefslogtreecommitdiff
path: root/java/darkknight/jewelrycraft/tileentity
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-02-21 21:31:16 +0000
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-02-21 21:31:16 +0000
commit420faddca46e70e3a70def168fb4e452ef193b0d (patch)
tree247e334012e4bf9e4fa6d42718bf601ce6bd42d9 /java/darkknight/jewelrycraft/tileentity
parent3f4c717de5ebc9b942d65ae45ac87c43bdf8a31b (diff)
Added just a butt ton of stuff, also thanks to pau101 for helping me with the Hand Pedestal animation :)
Diffstat (limited to 'java/darkknight/jewelrycraft/tileentity')
-rw-r--r--java/darkknight/jewelrycraft/tileentity/TileEntityAltar.java145
-rw-r--r--java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java42
-rw-r--r--java/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java83
-rw-r--r--java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java164
-rw-r--r--java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java153
-rw-r--r--java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java116
-rw-r--r--java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java175
-rw-r--r--java/darkknight/jewelrycraft/tileentity/TileEntityShadowHand.java77
-rw-r--r--java/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java167
-rw-r--r--java/darkknight/jewelrycraft/tileentity/renders/ItemRender.java65
-rw-r--r--java/darkknight/jewelrycraft/tileentity/renders/MaskRender.java63
-rw-r--r--java/darkknight/jewelrycraft/tileentity/renders/TileEntityDisplayerRender.java262
-rw-r--r--java/darkknight/jewelrycraft/tileentity/renders/TileEntityHandPedestalRender.java47
-rw-r--r--java/darkknight/jewelrycraft/tileentity/renders/TileEntityJewelrsCraftingTableRender.java136
-rw-r--r--java/darkknight/jewelrycraft/tileentity/renders/TileEntityMolderRender.java138
-rw-r--r--java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowEyeRender.java79
-rw-r--r--java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowHandRender.java20
-rw-r--r--java/darkknight/jewelrycraft/tileentity/renders/TileEntitySmelterRender.java125
18 files changed, 1502 insertions, 555 deletions
diff --git a/java/darkknight/jewelrycraft/tileentity/TileEntityAltar.java b/java/darkknight/jewelrycraft/tileentity/TileEntityAltar.java
index 6a43cb3..f490456 100644
--- a/java/darkknight/jewelrycraft/tileentity/TileEntityAltar.java
+++ b/java/darkknight/jewelrycraft/tileentity/TileEntityAltar.java
@@ -1,11 +1,5 @@
package darkknight.jewelrycraft.tileentity;
-import java.util.List;
-
-import net.minecraft.block.Block;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -13,8 +7,6 @@ import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.AxisAlignedBB;
-import darkknight.jewelrycraft.util.JewelryNBT;
public class TileEntityAltar extends TileEntity
{
@@ -22,144 +14,73 @@ public class TileEntityAltar extends TileEntity
public boolean isDirty, hasObject;
public String playerName;
+ /**
+ *
+ */
public TileEntityAltar()
{
- this.hasObject = false;
- this.object = new ItemStack(Item.getItemById(0), 0, 0);
- this.isDirty = false;
- this.playerName = "";
+ hasObject = false;
+ object = new ItemStack(Item.getItemById(0), 0, 0);
+ isDirty = false;
+ playerName = "";
}
+ /**
+ * @param nbt
+ */
@Override
public void writeToNBT(NBTTagCompound nbt)
{
super.writeToNBT(nbt);
NBTTagCompound tag = new NBTTagCompound();
- this.object.writeToNBT(tag);
+ object.writeToNBT(tag);
nbt.setTag("object", tag);
nbt.setBoolean("hasObject", hasObject);
nbt.setString("playerName", playerName);
}
+ /**
+ * @param nbt
+ */
@Override
public void readFromNBT(NBTTagCompound nbt)
{
super.readFromNBT(nbt);
- this.object = new ItemStack(Item.getItemById(0), 0, 0);
- this.object.readFromNBT(nbt.getCompoundTag("object"));
- this.hasObject = nbt.getBoolean("hasObject");
- this.playerName = nbt.getString("playerName");
+ object = new ItemStack(Item.getItemById(0), 0, 0);
+ object.readFromNBT(nbt.getCompoundTag("object"));
+ hasObject = nbt.getBoolean("hasObject");
+ playerName = nbt.getString("playerName");
}
- @SuppressWarnings("rawtypes")
+ /**
+ *
+ */
+ @SuppressWarnings ("rawtypes")
@Override
public void updateEntity()
{
super.updateEntity();
-
- if (isDirty)
- {
+ if (isDirty){
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
isDirty = false;
}
- if (hasObject && playerName != "")
- {
- // int playerPosX = (int)player.posX, playerPosY = (int)player.posY,
- // playerPosZ = (int)player.posZ;
- List entitiesR = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1D, zCoord, xCoord + 0.5D, yCoord + 2D, zCoord + 0.5D));
- List entitiesN = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(xCoord - 0.5D, yCoord + 1D, zCoord - 0.5D, xCoord + 1.5D, yCoord + 2D, zCoord + 1.5D));
- if (object.getUnlocalizedName().contains("ring"))
- {
- if (JewelryNBT.isGemX(object, new ItemStack(Items.ender_pearl)) && JewelryNBT.dimension(object) != -2 && JewelryNBT.playerPosX(object) != -1 && JewelryNBT.playerPosY(object) != -1 && JewelryNBT.playerPosZ(object) != -1)
- {
- double posX = JewelryNBT.playerPosX(object), posY = JewelryNBT.playerPosY(object), posZ = JewelryNBT.playerPosZ(object);
- int dimension = JewelryNBT.dimension(object);
- for (int i = 0; i < entitiesR.size(); i++)
- {
- EntityLivingBase entity = (EntityLivingBase) entitiesR.get(i);
- if (!JewelryNBT.isDimensionX(object, entity.dimension) && JewelryNBT.isModifierX(object, new ItemStack(Items.bed)))
- {
- entity.travelToDimension(dimension);
- entity.setPositionAndUpdate(posX, posY, posZ);
- }
- else if (JewelryNBT.isDimensionX(object, entity.dimension)) entity.setPositionAndUpdate(posX, posY, posZ);
- }
- }
- if (JewelryNBT.isModifierX(object, new ItemStack(Items.dye, 1, 15)))
- {
- for (int i = -1; i <= 1; i++)
- for (int j = -1; j <= 1; j++)
- for (int k = -1; k <= 1; k++)
- {
- // if(worldObj.getBlockId(xCoord + i, yCoord +
- // j, zCoord + k) == Block.dirt.blockID &&
- // (worldObj.getBlockId(xCoord + i, yCoord + j +
- // 1, zCoord + k) == 0 ||
- // worldObj.getBlockId(xCoord + i, yCoord + j +
- // 1, zCoord + k) == Block.crops.blockID) ||
- // worldObj.getBlockId(xCoord + i, yCoord + j +
- // 1, zCoord + k) == Block.potato.blockID)
- // worldObj.setBlock(xCoord + i, yCoord + j,
- // zCoord + k, Block.tilledField.blockID);
- if (worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k) == Blocks.farmland) worldObj.setBlockMetadataWithNotify(xCoord + i, yCoord + j, zCoord + k, 1, 7);
- if (worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k) != Blocks.farmland) worldObj.scheduleBlockUpdate(xCoord + i, yCoord + j, zCoord + k, worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k), 5);
- // JewelrycraftUtil.applyBonemeal(object,
- // worldObj, xCoord + i, yCoord + j, zCoord + k,
- // player);
- }
- }
- }
- else if (object.getUnlocalizedName().contains("necklace"))
- {
- if (JewelryNBT.isGemX(object, new ItemStack(Items.ender_pearl)) && JewelryNBT.dimension(object) != -2 && JewelryNBT.playerPosX(object) != -1 && JewelryNBT.playerPosY(object) != -1 && JewelryNBT.playerPosZ(object) != -1)
- {
- double posX = JewelryNBT.playerPosX(object), posY = JewelryNBT.playerPosY(object), posZ = JewelryNBT.playerPosZ(object);
- int dimension = JewelryNBT.dimension(object);
- for (int i = 0; i < entitiesN.size(); i++)
- {
- EntityLivingBase entity = (EntityLivingBase) entitiesN.get(i);
- if (!JewelryNBT.isDimensionX(object, entity.dimension) && JewelryNBT.isModifierX(object, new ItemStack(Items.bed)))
- {
- entity.travelToDimension(dimension);
- entity.setPositionAndUpdate(posX, posY, posZ);
- }
- else if (JewelryNBT.isDimensionX(object, entity.dimension)) entity.setPositionAndUpdate(posX, posY, posZ);
- }
- }
- if (JewelryNBT.isModifierX(object, new ItemStack(Items.dye, 1, 15)))
- {
- for (int i = -3; i <= 3; i++)
- for (int j = -1; j <= 1; j++)
- for (int k = -3; k <= 3; k++)
- {
- // if(worldObj.getBlockId(xCoord + i, yCoord +
- // j, zCoord + k) == Block.dirt.blockID &&
- // (worldObj.getBlockId(xCoord + i, yCoord + j +
- // 1, zCoord + k) == 0 ||
- // worldObj.getBlockId(xCoord + i, yCoord + j +
- // 1, zCoord + k) == Block.crops.blockID) ||
- // worldObj.getBlockId(xCoord + i, yCoord + j +
- // 1, zCoord + k) == Block.potato.blockID)
- // worldObj.setBlock(xCoord + i, yCoord + j,
- // zCoord + k, Block.tilledField.blockID);
- if (worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k) == Blocks.farmland) worldObj.setBlockMetadataWithNotify(xCoord + i, yCoord + j, zCoord + k, 1, 7);
- if (worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k) != Blocks.farmland) worldObj.scheduleBlockUpdate(xCoord + i, yCoord + j, zCoord + k, worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k), 5);
- // JewelrycraftUtil.applyBonemeal(object,
- // worldObj, xCoord + i, yCoord + j, zCoord + k,
- // player);
- }
- }
- }
- }
}
+ /**
+ * @return
+ */
+ @Override
public Packet getDescriptionPacket()
{
NBTTagCompound nbttagcompound = new NBTTagCompound();
- this.writeToNBT(nbttagcompound);
- return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbttagcompound);
+ writeToNBT(nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound);
}
+ /**
+ * @param net
+ * @param packet
+ */
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)
{
diff --git a/java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java b/java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java
index 88ae7e3..b16ce31 100644
--- a/java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java
+++ b/java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java
@@ -12,11 +12,17 @@ public class TileEntityBlockShadow extends TileEntity
{
public int metadata;
+ /**
+ *
+ */
public TileEntityBlockShadow()
{
- this.metadata = -1;
+ metadata = -1;
}
+ /**
+ * @param nbt
+ */
@Override
public void writeToNBT(NBTTagCompound nbt)
{
@@ -24,13 +30,19 @@ public class TileEntityBlockShadow extends TileEntity
nbt.setInteger("metadata", metadata);
}
+ /**
+ * @param nbt
+ */
@Override
public void readFromNBT(NBTTagCompound nbt)
{
super.readFromNBT(nbt);
- this.metadata = nbt.getInteger("metadata");
+ metadata = nbt.getInteger("metadata");
}
+ /**
+ *
+ */
@Override
public void updateEntity()
{
@@ -38,33 +50,35 @@ public class TileEntityBlockShadow extends TileEntity
int blockLight, realLight;
int lightValue = worldObj.getSavedLightValue(EnumSkyBlock.Sky, xCoord, yCoord, zCoord) - worldObj.skylightSubtracted;
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((float) lightValue * MathHelper.cos(sunPosAngle));
-
+ 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));
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)) metadata = 15 - lightValue;
+ if (blockLight == 0 && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord) || lightValue >= blockLight) metadata = 15 - lightValue;
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));
}
+ /**
+ * @return
+ */
+ @Override
public Packet getDescriptionPacket()
{
NBTTagCompound nbttagcompound = new NBTTagCompound();
- this.writeToNBT(nbttagcompound);
- return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbttagcompound);
+ writeToNBT(nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound);
}
+ /**
+ * @param net
+ * @param packet
+ */
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)
{
diff --git a/java/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java b/java/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java
index 7a678e2..047f254 100644
--- a/java/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java
+++ b/java/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java
@@ -1,7 +1,5 @@
package darkknight.jewelrycraft.tileentity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -17,22 +15,28 @@ public class TileEntityDisplayer extends TileEntity
public ItemStack object;
public int quantity, infoIndex, timer = 0;
+ /**
+ *
+ */
public TileEntityDisplayer()
{
- this.ringTranslation1 = 0.6f;
- this.ringTranslation2 = 0.3f;
- this.ringTranslation3 = 0.0f;
- this.rotAngle = 0;
- this.quantity = 0;
- this.infoIndex = 1;
- this.isDescending1 = false;
- this.isDescending2 = false;
- this.isDescending3 = false;
- this.isDirty = false;
- this.hasObject = false;
- this.object = new ItemStack(Item.getItemById(0), 0, 0);
+ ringTranslation1 = 0.6f;
+ ringTranslation2 = 0.3f;
+ ringTranslation3 = 0.0f;
+ rotAngle = 0;
+ quantity = 0;
+ infoIndex = 1;
+ isDescending1 = false;
+ isDescending2 = false;
+ isDescending3 = false;
+ isDirty = false;
+ hasObject = false;
+ object = new ItemStack(Item.getItemById(0), 0, 0);
}
+ /**
+ * @param nbt
+ */
@Override
public void writeToNBT(NBTTagCompound nbt)
{
@@ -48,34 +52,39 @@ public class TileEntityDisplayer extends TileEntity
nbt.setBoolean("descending3", isDescending3);
nbt.setBoolean("hasObject", hasObject);
NBTTagCompound tag = new NBTTagCompound();
- this.object.writeToNBT(tag);
+ object.writeToNBT(tag);
nbt.setTag("object", tag);
}
+ /**
+ * @param nbt
+ */
@Override
public void readFromNBT(NBTTagCompound nbt)
{
super.readFromNBT(nbt);
- this.ringTranslation1 = nbt.getFloat("translation1");
- this.ringTranslation2 = nbt.getFloat("translation2");
- this.ringTranslation3 = nbt.getFloat("translation3");
- this.rotAngle = nbt.getFloat("angle");
- this.quantity = nbt.getInteger("quantity");
- this.infoIndex = nbt.getInteger("infoIndex");
- this.isDescending1 = nbt.getBoolean("descending1");
- this.isDescending2 = nbt.getBoolean("descending2");
- this.isDescending3 = nbt.getBoolean("descending3");
- this.hasObject = nbt.getBoolean("hasObject");
- this.object = new ItemStack(Item.getItemById(0), 0, 0);
- this.object.readFromNBT(nbt.getCompoundTag("object"));
+ ringTranslation1 = nbt.getFloat("translation1");
+ ringTranslation2 = nbt.getFloat("translation2");
+ ringTranslation3 = nbt.getFloat("translation3");
+ rotAngle = nbt.getFloat("angle");
+ quantity = nbt.getInteger("quantity");
+ infoIndex = nbt.getInteger("infoIndex");
+ isDescending1 = nbt.getBoolean("descending1");
+ isDescending2 = nbt.getBoolean("descending2");
+ isDescending3 = nbt.getBoolean("descending3");
+ hasObject = nbt.getBoolean("hasObject");
+ object = new ItemStack(Item.getItemById(0), 0, 0);
+ object.readFromNBT(nbt.getCompoundTag("object"));
}
+ /**
+ *
+ */
@Override
public void updateEntity()
{
super.updateEntity();
- if (isDirty)
- {
+ if (isDirty){
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
isDirty = false;
}
@@ -83,12 +92,10 @@ public class TileEntityDisplayer extends TileEntity
if (ringTranslation1 <= 0) isDescending1 = false;
if (!isDescending1) ringTranslation1 += 0.05;
if (isDescending1) ringTranslation1 -= 0.05;
-
if (ringTranslation2 >= 0.6) isDescending2 = true;
if (ringTranslation2 <= 0) isDescending2 = false;
if (!isDescending2) ringTranslation2 += 0.04;
if (isDescending2) ringTranslation2 -= 0.04;
-
if (ringTranslation3 >= 0.6) isDescending3 = true;
if (ringTranslation3 <= 0) isDescending3 = false;
if (!isDescending3) ringTranslation3 += 0.03;
@@ -96,19 +103,27 @@ public class TileEntityDisplayer extends TileEntity
if (rotAngle < 360F) rotAngle += 6F;
if (rotAngle >= 360F) rotAngle = 0F;
timer++;
- if(timer >= 20){
+ if (timer >= 20){
infoIndex++;
timer = 0;
}
}
+ /**
+ * @return
+ */
+ @Override
public Packet getDescriptionPacket()
{
NBTTagCompound nbttagcompound = new NBTTagCompound();
- this.writeToNBT(nbttagcompound);
- return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbttagcompound);
+ writeToNBT(nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound);
}
+ /**
+ * @param net
+ * @param packet
+ */
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)
{
diff --git a/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java b/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java
index f42ad75..ee48d08 100644
--- a/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java
+++ b/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java
@@ -1,8 +1,6 @@
package darkknight.jewelrycraft.tileentity;
-import java.util.List;
-
-import net.minecraft.item.Item;
+import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
@@ -10,59 +8,175 @@ import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
+/**
+ * @author Paul Fulham (pau101)
+ */
public class TileEntityHandPedestal extends TileEntity
{
- public boolean isDirty, hasObject;
- public ItemStack object = new ItemStack(Item.getItemById(0), 0, 0);
+ 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;
+ /**
+ *
+ */
public TileEntityHandPedestal()
{
- this.isDirty = false;
- this.hasObject = false;
+ isDirty = false;
+ heldItemStack = null;
+ grip = 0;
+ gripMax = 20;
+ gripScale = 1;
+ isHandOpen = true;
}
+ /**
+ * @param tagCompound
+ */
@Override
- public void writeToNBT(NBTTagCompound nbt)
+ public void writeToNBT(NBTTagCompound tagCompound)
{
- super.writeToNBT(nbt);
- nbt.setBoolean("hasObject", hasObject);
- NBTTagCompound tag = new NBTTagCompound();
- this.object.writeToNBT(tag);
- nbt.setTag("object", tag);
+ super.writeToNBT(tagCompound);
+ if (heldItemStack != null){
+ NBTTagCompound objectCompound = new NBTTagCompound();
+ heldItemStack.writeToNBT(objectCompound);
+ tagCompound.setTag("object", objectCompound);
+ }
+ tagCompound.setBoolean("isHandOpen", isHandOpen);
}
+ /**
+ * @param tagCompound
+ */
@Override
- public void readFromNBT(NBTTagCompound nbt)
+ public void readFromNBT(NBTTagCompound tagCompound)
{
- super.readFromNBT(nbt);
- this.hasObject = nbt.getBoolean("hasObject");
- this.object = new ItemStack(Item.getItemById(0), 0, 0);
- this.object.readFromNBT(nbt.getCompoundTag("object"));
+ super.readFromNBT(tagCompound);
+ if (tagCompound.hasKey("object", 10)) setHeldItemStack(ItemStack.loadItemStackFromNBT(tagCompound.getCompoundTag("object")));
+ else removeHeldItemStack();
+ isHandOpen = tagCompound.getBoolean("isHandOpen");
}
+ /**
+ *
+ */
@Override
public void updateEntity()
{
super.updateEntity();
- if (isDirty)
- {
+ updateGrip();
+ if (isDirty){
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
isDirty = false;
}
- //System.out.println(Item.getIdFromItem(object.getItem()));
}
+ /**
+ *
+ */
+ private void updateGrip()
+ {
+ prevGrip = grip;
+ if (grip > 0 && isHandOpen) grip -= 1 / gripScale;
+ else if (grip < gripMax && !isHandOpen) grip += 1 / gripScale;
+ }
+
+ /**
+ * @return
+ */
+ @Override
public Packet getDescriptionPacket()
{
NBTTagCompound nbttagcompound = new NBTTagCompound();
- this.writeToNBT(nbttagcompound);
- return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbttagcompound);
+ writeToNBT(nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, nbttagcompound);
}
+ /**
+ * @param networkManager
+ * @param packet
+ */
@Override
- public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)
+ public void onDataPacket(NetworkManager networkManager, S35PacketUpdateTileEntity packet)
{
readFromNBT(packet.func_148857_g());
worldObj.func_147479_m(xCoord, yCoord, zCoord);
}
-}
+
+ /**
+ *
+ */
+ @Override
+ public void markDirty()
+ {
+ super.markDirty();
+ isDirty = true;
+ }
+
+ /**
+ * @return
+ */
+ public ItemStack getHeldItemStack()
+ {
+ return heldItemStack;
+ }
+
+ /**
+ * @param heldItemStack
+ */
+ public void setHeldItemStack(ItemStack heldItemStack)
+ {
+ heldItemStack.stackSize = 1;
+ this.heldItemStack = heldItemStack;
+ if (heldItemStack.getItem() instanceof ItemBlock) gripScale = 0.5f;
+ else gripScale = 1;
+ }
+
+ /**
+ *
+ */
+ public void removeHeldItemStack()
+ {
+ heldItemStack = null;
+ }
+
+ /**
+ *
+ */
+ public void openHand()
+ {
+ isHandOpen = true;
+ }
+
+ /**
+ *
+ */
+ public void closeHand()
+ {
+ isHandOpen = false;
+ }
+
+ /**
+ * @param t
+ * @return
+ */
+ public float getGrip(float t)
+ {
+ return (prevGrip * (1 - t) + grip * t) / gripMax;
+ }
+
+ /**
+ * @return
+ */
+ public float getGripScale()
+ {
+ return gripScale;
+ }
+} \ No newline at end of file
diff --git a/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java b/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java
index 8fcf62f..c148bd0 100644
--- a/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java
+++ b/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java
@@ -1,21 +1,13 @@
package darkknight.jewelrycraft.tileentity;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.multiplayer.WorldClient;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
-import net.minecraft.potion.Potion;
-import net.minecraft.potion.PotionEffect;
import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.MathHelper;
import darkknight.jewelrycraft.config.ConfigHandler;
-import darkknight.jewelrycraft.particles.EntityShadowsFX;
import darkknight.jewelrycraft.util.JewelryNBT;
import darkknight.jewelrycraft.util.JewelrycraftUtil;
@@ -26,21 +18,27 @@ public class TileEntityJewelrsCraftingTable extends TileEntity
public int carving, effect;
public float angle;
+ /**
+ *
+ */
public TileEntityJewelrsCraftingTable()
{
- this.jewelry = new ItemStack(Item.getItemById(0), 0, 0);
- this.endItem = new ItemStack(Item.getItemById(0), 0, 0);
- this.gem = new ItemStack(Item.getItemById(0), 0, 0);
- this.hasJewelry = false;
- this.hasEndItem = false;
- this.hasGem = false;
- this.crafting = false;
- this.carving = 0;
- this.effect = 0;
- this.angle = 0;
- this.isDirty = false;
+ jewelry = new ItemStack(Item.getItemById(0), 0, 0);
+ endItem = new ItemStack(Item.getItemById(0), 0, 0);
+ gem = new ItemStack(Item.getItemById(0), 0, 0);
+ hasJewelry = false;
+ hasEndItem = false;
+ hasGem = false;
+ crafting = false;
+ carving = 0;
+ effect = 0;
+ angle = 0;
+ isDirty = false;
}
+ /**
+ * @param nbt
+ */
@Override
public void writeToNBT(NBTTagCompound nbt)
{
@@ -52,92 +50,79 @@ public class TileEntityJewelrsCraftingTable extends TileEntity
nbt.setInteger("timer", carving);
nbt.setInteger("effect", effect);
nbt.setFloat("angle", angle);
-
NBTTagCompound tag1 = new NBTTagCompound();
NBTTagCompound tag2 = new NBTTagCompound();
NBTTagCompound tag3 = new NBTTagCompound();
-
- this.jewelry.writeToNBT(tag1);
+ jewelry.writeToNBT(tag1);
nbt.setTag("jewelry", tag1);
- this.endItem.writeToNBT(tag2);
+ endItem.writeToNBT(tag2);
nbt.setTag("endItem", tag2);
- this.gem.writeToNBT(tag3);
+ gem.writeToNBT(tag3);
nbt.setTag("jewel", tag3);
}
+ /**
+ * @param nbt
+ */
@Override
public void readFromNBT(NBTTagCompound nbt)
{
super.readFromNBT(nbt);
- this.hasJewelry = nbt.getBoolean("hasJewelry");
- this.hasEndItem = nbt.getBoolean("hasEndItem");
- this.hasGem = nbt.getBoolean("hasJewel");
- this.crafting = nbt.getBoolean("crafting");
-
- this.carving = nbt.getInteger("timer");
- this.effect = nbt.getInteger("effect");
- this.angle = nbt.getFloat("angle");
- this.jewelry = new ItemStack(Item.getItemById(0), 0, 0);
- this.jewelry.readFromNBT(nbt.getCompoundTag("jewelry"));
- this.endItem = new ItemStack(Item.getItemById(0), 0, 0);
- this.endItem.readFromNBT(nbt.getCompoundTag("endItem"));
- this.gem = new ItemStack(Item.getItemById(0), 0, 0);
- this.gem.readFromNBT(nbt.getCompoundTag("jewel"));
+ hasJewelry = nbt.getBoolean("hasJewelry");
+ hasEndItem = nbt.getBoolean("hasEndItem");
+ hasGem = nbt.getBoolean("hasJewel");
+ crafting = nbt.getBoolean("crafting");
+ carving = nbt.getInteger("timer");
+ effect = nbt.getInteger("effect");
+ angle = nbt.getFloat("angle");
+ jewelry = new ItemStack(Item.getItemById(0), 0, 0);
+ jewelry.readFromNBT(nbt.getCompoundTag("jewelry"));
+ endItem = new ItemStack(Item.getItemById(0), 0, 0);
+ endItem.readFromNBT(nbt.getCompoundTag("endItem"));
+ gem = new ItemStack(Item.getItemById(0), 0, 0);
+ gem.readFromNBT(nbt.getCompoundTag("jewel"));
}
+ /**
+ *
+ */
@Override
public void updateEntity()
{
super.updateEntity();
- if (isDirty)
- {
+ if (isDirty){
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
isDirty = false;
}
if (angle < 360F) angle += 3F;
else angle = 0F;
-
- if (this.hasJewelry && this.hasGem && !this.hasEndItem && crafting)
- {
+ if (hasJewelry && hasGem && !hasEndItem && crafting){
if (carving > 0) carving--;
- if (crafting)
- {
- for (int l = 0; l < ConfigHandler.jewelryCraftingTime / (carving + 2); ++l)
- {
- if (worldObj.rand.nextInt(10) == 0) this.worldObj.playSoundEffect(xCoord, yCoord + 0.5F, zCoord, "random.orb", 0.05F, 1F);
- if (this.getBlockMetadata() == 0) this.worldObj.spawnParticle("instantSpell", xCoord + 0.5F, (double) yCoord + 0.8F, zCoord + 0.2F, 0.0D, 0.0D, 0.0D);
- if (this.getBlockMetadata() == 1) this.worldObj.spawnParticle("instantSpell", xCoord + 0.8F, (double) yCoord + 0.8F, zCoord + 0.5F, 0.0D, 0.0D, 0.0D);
- if (this.getBlockMetadata() == 2) this.worldObj.spawnParticle("instantSpell", xCoord + 0.5F, (double) yCoord + 0.8F, zCoord + 0.8F, 0.0D, 0.0D, 0.0D);
- if (this.getBlockMetadata() == 3) this.worldObj.spawnParticle("instantSpell", xCoord + 0.2F, (double) yCoord + 0.8F, zCoord + 0.5F, 0.0D, 0.0D, 0.0D);
-
- }
+ if (crafting) for(int l = 0; l < ConfigHandler.jewelryCraftingTime / (carving + 2); ++l){
+ if (worldObj.rand.nextInt(10) == 0) 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);
+ if (getBlockMetadata() == 1) 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);
+ if (getBlockMetadata() == 3) worldObj.spawnParticle("instantSpell", xCoord + 0.2F, (double)yCoord + 0.8F, zCoord + 0.5F, 0.0D, 0.0D, 0.0D);
}
- if (carving == 0)
- {
- this.hasEndItem = true;
- this.endItem = jewelry.copy();
- if (hasGem && gem != new ItemStack(Item.getItemById(0), 0, 0))
- {
- if (!JewelryNBT.hasTag(jewelry, "gem"))
- {
- JewelryNBT.addGem(endItem, gem);
- this.hasGem = false;
- this.gem = new ItemStack(Item.getItemById(0), 0, 0);
- }
- else
- {
- ItemStack aux = JewelryNBT.gem(jewelry);
- JewelryNBT.addGem(endItem, gem);
- if(JewelrycraftUtil.rand.nextBoolean()) gem = aux.copy();
- else
- {
- this.hasGem = false;
- this.gem = new ItemStack(Item.getItemById(0), 0, 0);
- }
+ 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);
+ hasGem = false;
+ gem = new ItemStack(Item.getItemById(0), 0, 0);
+ }else{
+ 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);
}
}
- this.hasJewelry = false;
- this.jewelry = new ItemStack(Item.getItemById(0), 0, 0);
+ hasJewelry = false;
+ jewelry = new ItemStack(Item.getItemById(0), 0, 0);
carving = -1;
crafting = false;
isDirty = true;
@@ -145,13 +130,21 @@ public class TileEntityJewelrsCraftingTable extends TileEntity
}
}
+ /**
+ * @return
+ */
+ @Override
public Packet getDescriptionPacket()
{
NBTTagCompound nbttagcompound = new NBTTagCompound();
- this.writeToNBT(nbttagcompound);
- return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbttagcompound);
+ writeToNBT(nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound);
}
+ /**
+ * @param net
+ * @param packet
+ */
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)
{
diff --git a/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java b/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java
index 62ec130..da8cc19 100644
--- a/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java
+++ b/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java
@@ -1,7 +1,5 @@
package darkknight.jewelrycraft.tileentity;
-import net.minecraft.block.Block;
-import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -19,20 +17,26 @@ public class TileEntityMolder extends TileEntity
public ItemStack mold, jewelBase, moltenMetal, ringMetal;
public float quantity;
+ /**
+ *
+ */
public TileEntityMolder()
{
- this.moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
- this.jewelBase = new ItemStack(Item.getItemById(0), 0, 0);
- this.mold = new ItemStack(Item.getItemById(0), 0, 0);
- this.ringMetal = new ItemStack(Item.getItemById(0), 0, 0);
- this.cooling = -1;
- this.quantity = 0f;
- this.hasJewelBase = false;
- this.hasMoltenMetal = false;
- this.hasMold = false;
- this.isDirty = false;
+ moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ jewelBase = new ItemStack(Item.getItemById(0), 0, 0);
+ mold = new ItemStack(Item.getItemById(0), 0, 0);
+ ringMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ cooling = -1;
+ quantity = 0f;
+ hasJewelBase = false;
+ hasMoltenMetal = false;
+ hasMold = false;
+ isDirty = false;
}
+ /**
+ * @param nbt
+ */
@Override
public void writeToNBT(NBTTagCompound nbt)
{
@@ -46,67 +50,69 @@ public class TileEntityMolder extends TileEntity
NBTTagCompound tag1 = new NBTTagCompound();
NBTTagCompound tag2 = new NBTTagCompound();
NBTTagCompound tag3 = new NBTTagCompound();
- this.mold.writeToNBT(tag);
+ mold.writeToNBT(tag);
nbt.setTag("mold", tag);
- this.jewelBase.writeToNBT(tag1);
+ jewelBase.writeToNBT(tag1);
nbt.setTag("jewelBase", tag1);
- this.moltenMetal.writeToNBT(tag2);
+ moltenMetal.writeToNBT(tag2);
nbt.setTag("moltenMetal", tag2);
- this.ringMetal.writeToNBT(tag3);
+ ringMetal.writeToNBT(tag3);
nbt.setTag("ringMetal", tag3);
}
+ /**
+ * @param nbt
+ */
@Override
public void readFromNBT(NBTTagCompound nbt)
{
super.readFromNBT(nbt);
- this.cooling = nbt.getInteger("cooling");
- this.quantity = nbt.getFloat("quantity");
- this.hasJewelBase = nbt.getBoolean("hasJewelBase");
- this.hasMoltenMetal = nbt.getBoolean("hasMoltenMetal");
- this.hasMold = nbt.getBoolean("hasMold");
- this.mold = new ItemStack(Item.getItemById(0), 0, 0);
- this.mold.readFromNBT(nbt.getCompoundTag("mold"));
- this.jewelBase = new ItemStack(Item.getItemById(0), 0, 0);
- this.jewelBase.readFromNBT(nbt.getCompoundTag("jewelBase"));
- this.moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
- this.moltenMetal.readFromNBT(nbt.getCompoundTag("moltenMetal"));
- this.ringMetal = new ItemStack(Item.getItemById(0), 0, 0);
- this.ringMetal.readFromNBT(nbt.getCompoundTag("ringMetal"));
+ cooling = nbt.getInteger("cooling");
+ quantity = nbt.getFloat("quantity");
+ hasJewelBase = nbt.getBoolean("hasJewelBase");
+ hasMoltenMetal = nbt.getBoolean("hasMoltenMetal");
+ hasMold = nbt.getBoolean("hasMold");
+ mold = new ItemStack(Item.getItemById(0), 0, 0);
+ mold.readFromNBT(nbt.getCompoundTag("mold"));
+ jewelBase = new ItemStack(Item.getItemById(0), 0, 0);
+ jewelBase.readFromNBT(nbt.getCompoundTag("jewelBase"));
+ moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ moltenMetal.readFromNBT(nbt.getCompoundTag("moltenMetal"));
+ ringMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ ringMetal.readFromNBT(nbt.getCompoundTag("ringMetal"));
}
+ /**
+ *
+ */
@Override
public void updateEntity()
{
super.updateEntity();
- if (isDirty)
- {
+ if (isDirty){
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
isDirty = false;
}
- if (this.hasMoltenMetal && moltenMetal.getItem() != Item.getItemById(0) && quantity > 0f)
- {
- if (worldObj.rand.nextInt(20) == 0) this.worldObj.playSoundEffect(xCoord, yCoord + 0.5F, zCoord, "random.fizz", 0.5F, 1F);
- for (int l = 0; l < 2; ++l)
- this.worldObj.spawnParticle("reddust", xCoord + Math.random(), (double) yCoord + 0.2F, zCoord + Math.random(), 0.0D, 1.0D, 1.0D);
+ 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);
+ 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);
}
- if (this.hasMoltenMetal && !this.hasJewelBase && quantity >= 0.1f)
- {
+ if (hasMoltenMetal && !hasJewelBase && quantity >= 0.1f){
ringMetal = moltenMetal.copy();
- if (cooling > 0) this.cooling--;
- if (cooling <= 0f)
- {
- if (mold.getItemDamage() == 0) this.jewelBase = moltenMetal;
- else if (mold.getItemDamage() == 1) this.jewelBase = new ItemStack(ItemList.ring);
- else if (mold.getItemDamage() == 2) this.jewelBase = new ItemStack(ItemList.necklace);
- else if (mold.getItemDamage() == 3) this.jewelBase = new ItemStack(ItemList.bracelet);
- else if (mold.getItemDamage() == 4) this.jewelBase = new ItemStack(ItemList.earrings);
+ if (cooling > 0) cooling--;
+ if (cooling <= 0f){
+ if (mold.getItemDamage() == 0) jewelBase = moltenMetal;
+ else if (mold.getItemDamage() == 1) jewelBase = new ItemStack(ItemList.ring);
+ else if (mold.getItemDamage() == 2) jewelBase = new ItemStack(ItemList.necklace);
+ else if (mold.getItemDamage() == 3) jewelBase = new ItemStack(ItemList.bracelet);
+ else if (mold.getItemDamage() == 4) 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);
- this.hasMoltenMetal = false;
- this.moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
- this.hasJewelBase = true;
+ hasMoltenMetal = false;
+ moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ hasJewelBase = true;
cooling = -1;
quantity = 0f;
isDirty = true;
@@ -114,13 +120,21 @@ public class TileEntityMolder extends TileEntity
}
}
+ /**
+ * @return
+ */
+ @Override
public Packet getDescriptionPacket()
{
NBTTagCompound nbttagcompound = new NBTTagCompound();
- this.writeToNBT(nbttagcompound);
- return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbttagcompound);
+ writeToNBT(nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound);
}
+ /**
+ * @param net
+ * @param packet
+ */
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)
{
diff --git a/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java b/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java
index 7a7a7c3..e02cac2 100644
--- a/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java
+++ b/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java
@@ -1,20 +1,17 @@
package darkknight.jewelrycraft.tileentity;
import java.util.ArrayList;
-import java.util.List;
-
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
-import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
-import cpw.mods.fml.common.registry.GameData;
import darkknight.jewelrycraft.block.BlockHandPedestal;
import darkknight.jewelrycraft.block.BlockList;
import darkknight.jewelrycraft.particles.EntityShadowsFX;
@@ -25,20 +22,22 @@ public class TileEntityShadowEye extends TileEntity
{
public int opening, timer, t = 20;
public boolean active;
- public int field_145926_a;
- public float field_145933_i;
- public float field_145931_j;
- public float field_145930_m;
- public float field_145927_n;
public ArrayList<ItemStack> pedestalItems = new ArrayList<ItemStack>();
+ ResourceLocation particleTexture = new ResourceLocation("jewelrycraft", "textures/particle/shadows.png");
+ /**
+ *
+ */
public TileEntityShadowEye()
{
- this.opening = 1;
- this.timer = 20;
- this.active = false;
+ opening = 1;
+ timer = 20;
+ active = false;
}
+ /**
+ * @param nbt
+ */
@Override
public void writeToNBT(NBTTagCompound nbt)
{
@@ -48,84 +47,83 @@ public class TileEntityShadowEye extends TileEntity
nbt.setBoolean("active", active);
}
+ /**
+ * @param nbt
+ */
@Override
public void readFromNBT(NBTTagCompound nbt)
{
super.readFromNBT(nbt);
- this.opening = nbt.getInteger("opening");
- this.timer = nbt.getInteger("timer");
- this.active = nbt.getBoolean("active");
+ opening = nbt.getInteger("opening");
+ timer = nbt.getInteger("timer");
+ active = nbt.getBoolean("active");
}
+ /**
+ *
+ */
@Override
public void updateEntity()
{
super.updateEntity();
boolean valid = isValidStructure(worldObj, xCoord, yCoord, zCoord, blockMetadata);
if (active) timer--;
- if (opening == 4 && timer <= 0)
- {
- active = false;
- }
- if (!active && timer <= 0 && opening != 1)
- {
+ if (opening == 4 && timer <= 0) active = false;
+ if (!active && timer <= 0 && opening != 1){
if (t > 0) t--;
- if (t <= 0)
- {
+ if (t <= 0){
opening--;
t = 20;
}
}
- if (opening == 4)
- {
+ if (opening == 2 && timer <= 0 && t == 10){
addData(worldObj, xCoord, yCoord, zCoord);
- TileEntityHandPedestal target = (TileEntityHandPedestal) worldObj.getTileEntity(xCoord, yCoord - 3, zCoord);
- if (target != null && target.object != null && target.object.getItem() != null) JewelryNBT.addModifiers(target.object, pedestalItems);
+ TileEntityHandPedestal target = (TileEntityHandPedestal)worldObj.getTileEntity(xCoord, yCoord - 3, zCoord);
+ if (target != null && target.getHeldItemStack() != null) JewelryNBT.addModifiers(target.getHeldItemStack(), pedestalItems);
}
- if (active && timer <= 0)
- {
- if (opening < 4)
- {
+ if (active && timer <= 0){
+ if (opening < 4){
opening++;
timer = 20;
}
- if (valid && opening == 4) timer = 200;
- else if (!valid)
- {
+ if (valid && opening == 4) timer = 1000;
+ else if (!valid){
active = false;
timer = -1;
}
}
- EntityPlayer player1 = this.worldObj.getClosestPlayer(xCoord, yCoord, zCoord, 7F);
- if (player1 != null)
- {
+ EntityPlayer player1 = worldObj.getClosestPlayer(xCoord, yCoord, zCoord, 7F);
+ if (player1 != null){
NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player1, "Jewelrycraft");
persistTag.setBoolean("nearStartedRitual", false);
}
- if (active && opening == 4)
- {
+ if (active && opening == 4){
float din = 6F;
int i = Minecraft.getMinecraft().gameSettings.particleSetting;
-
- for (float x = -din; x <= din; x += 0.2F)
- for (float z = -din; z <= din; z += 0.2F)
- if (x * x + z * z >= din * din - 1 && x * x + z * z <= din * din + 1) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityShadowsFX(worldObj, xCoord + x + 0.5F, yCoord - 0.5F, zCoord + z + 0.5F, 15F, 0.04F - 0.01F * i));
-
- for (int l = 0; l <= 2 - i; l++)
+ for(float x = -din; x <= din; x += 0.2F)
+ for(float z = -din; z <= din; z += 0.2F)
+ if (x * x + z * z >= din * din - 1 && x * x + z * z <= din * din + 1) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityShadowsFX(worldObj, xCoord + x + 0.5F, yCoord - 0.5F, zCoord + z + 0.5F, 15F, 0.04F - 0.01F * i, particleTexture));
+ for(int l = 0; l <= 2 - i; l++)
worldObj.spawnParticle("depthsuspend", xCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), yCoord - 2F + worldObj.rand.nextFloat(), zCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), 0, 0, 0);
- EntityPlayer player = this.worldObj.getClosestPlayer(xCoord, yCoord, zCoord, 6F);
- if (player != null)
- {
+ EntityPlayer player = worldObj.getClosestPlayer(xCoord, yCoord, zCoord, 6F);
+ if (player != null){
NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft");
persistTag.setBoolean("nearStartedRitual", true);
}
}
}
+ /**
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param metadata
+ * @return
+ */
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)
- {
+ 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) return false;
@@ -145,9 +143,7 @@ public class TileEntityShadowEye extends TileEntity
// 5th Layer
if (world.getBlock(x + 2, y - 3, z) != Blocks.stonebrick) return false;
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) return false;
@@ -189,74 +185,85 @@ public class TileEntityShadowEye extends TileEntity
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;
}
+ /**
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ */
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));
}
+ /**
+ * @param pedestal
+ */
public void addPedestalInfo(TileEntityHandPedestal pedestal)
{
- if (pedestal != null && pedestal.object != null && pedestal.object.getItem() != null)
- {
- if (pedestalItems.isEmpty()) pedestalItems.add(pedestal.object.copy());
- else
- {
+ ItemStack heldItemStack;
+ 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 (pedestal.object.getItem().equals(pedestalItems.get(ind).getItem()) && pedestal.object.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 (pedestal.object.hasTagCompound() && pedestalItems.get(ind).hasTagCompound() && !pedestal.object.getTagCompound().equals(pedestalItems.get(ind).getTagCompound())) hasItem = false;
+ if (heldItemStack.hasTagCompound() && pedestalItems.get(ind).hasTagCompound() && !heldItemStack.getTagCompound().equals(pedestalItems.get(ind).getTagCompound())) hasItem = false;
}
- }
- if (!hasItem) pedestalItems.add(pedestal.object.copy());
- else
- {
+ if (!hasItem) pedestalItems.add(heldItemStack.copy());
+ else{
ItemStack object = pedestalItems.get(index).copy();
object.stackSize++;
pedestalItems.set(index, object);
}
}
+ pedestal.removeHeldItemStack();
+ pedestal.openHand();
}
}
+ /**
+ * @return
+ */
+ @Override
public Packet getDescriptionPacket()
{
NBTTagCompound nbttagcompound = new NBTTagCompound();
- this.writeToNBT(nbttagcompound);
- return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbttagcompound);
+ writeToNBT(nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound);
}
+ /**
+ * @param net
+ * @param packet
+ */
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)
{
diff --git a/java/darkknight/jewelrycraft/tileentity/TileEntityShadowHand.java b/java/darkknight/jewelrycraft/tileentity/TileEntityShadowHand.java
index 1a274ec..b22602e 100644
--- a/java/darkknight/jewelrycraft/tileentity/TileEntityShadowHand.java
+++ b/java/darkknight/jewelrycraft/tileentity/TileEntityShadowHand.java
@@ -1,74 +1,7 @@
package darkknight.jewelrycraft.tileentity;
-import java.util.List;
-
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.network.NetworkManager;
-import net.minecraft.network.Packet;
-import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
-import net.minecraft.tileentity.TileEntity;
-
-public class TileEntityShadowHand extends TileEntity
-{
- public boolean isDirty, hasObject;
- public ItemStack object = new ItemStack(Item.getItemById(0), 0, 0);
- public float grip;
-
- public TileEntityShadowHand()
- {
- this.isDirty = false;
- this.hasObject = false;
- this.grip = 0f;
- }
-
- @Override
- public void writeToNBT(NBTTagCompound nbt)
- {
- super.writeToNBT(nbt);
- nbt.setBoolean("hasObject", hasObject);
- nbt.setFloat("Grip", grip);
- NBTTagCompound tag = new NBTTagCompound();
- this.object.writeToNBT(tag);
- nbt.setTag("object", tag);
- }
-
- @Override
- public void readFromNBT(NBTTagCompound nbt)
- {
- super.readFromNBT(nbt);
- this.hasObject = nbt.getBoolean("hasObject");
- this.grip = nbt.getFloat("Grip");
- this.object = new ItemStack(Item.getItemById(0), 0, 0);
- this.object.readFromNBT(nbt.getCompoundTag("object"));
- }
-
- @Override
- public void updateEntity()
- {
- super.updateEntity();
- if (isDirty)
- {
- worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
- isDirty = false;
- }
- if(grip <= 10f) grip++;
- else grip = 0;
- //System.out.println(Item.getIdFromItem(object.getItem()));
- }
-
- public Packet getDescriptionPacket()
- {
- NBTTagCompound nbttagcompound = new NBTTagCompound();
- this.writeToNBT(nbttagcompound);
- return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbttagcompound);
- }
-
- @Override
- public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)
- {
- readFromNBT(packet.func_148857_g());
- worldObj.func_147479_m(xCoord, yCoord, zCoord);
- }
-}
+/**
+ * @author Paul Fulham (pau101)
+ */
+public class TileEntityShadowHand extends TileEntityHandPedestal
+{} \ No newline at end of file
diff --git a/java/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java b/java/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java
index 22d0465..83f2cb2 100644
--- a/java/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java
+++ b/java/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java
@@ -1,10 +1,6 @@
package darkknight.jewelrycraft.tileentity;
import java.util.Random;
-
-import darkknight.jewelrycraft.config.ConfigHandler;
-import darkknight.jewelrycraft.util.JewelrycraftUtil;
-
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -12,6 +8,8 @@ import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
+import darkknight.jewelrycraft.config.ConfigHandler;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
public class TileEntitySmelter extends TileEntity
{
@@ -20,19 +18,25 @@ public class TileEntitySmelter extends TileEntity
public ItemStack metal, moltenMetal;
public float quantity, pouredQuantity = 0.1f;
+ /**
+ *
+ */
public TileEntitySmelter()
{
- this.melting = 0;
- this.pouring = false;
- this.flow = 0;
- this.quantity = 0f;
- this.hasMetal = false;
- this.hasMoltenMetal = false;
- this.metal = new ItemStack(Item.getItemById(0), 0, 0);
- this.moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
- this.isDirty = false;
+ melting = 0;
+ pouring = false;
+ flow = 0;
+ quantity = 0f;
+ hasMetal = false;
+ hasMoltenMetal = false;
+ metal = new ItemStack(Item.getItemById(0), 0, 0);
+ moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ isDirty = false;
}
+ /**
+ * @param nbt
+ */
@Override
public void writeToNBT(NBTTagCompound nbt)
{
@@ -44,121 +48,110 @@ public class TileEntitySmelter extends TileEntity
nbt.setBoolean("pouring", pouring);
NBTTagCompound tag = new NBTTagCompound();
NBTTagCompound tag1 = new NBTTagCompound();
- this.metal.writeToNBT(tag);
+ metal.writeToNBT(tag);
nbt.setTag("metal", tag);
- this.moltenMetal.writeToNBT(tag1);
+ moltenMetal.writeToNBT(tag1);
nbt.setTag("moltenMetal", tag1);
}
+ /**
+ * @param nbt
+ */
@Override
public void readFromNBT(NBTTagCompound nbt)
{
super.readFromNBT(nbt);
- this.melting = nbt.getInteger("melting");
- this.quantity = nbt.getFloat("quantity");
- this.hasMetal = nbt.getBoolean("hasMetal");
- this.hasMoltenMetal = nbt.getBoolean("hasMoltenMetal");
- this.pouring = nbt.getBoolean("pouring");
- this.metal = new ItemStack(Item.getItemById(0), 0, 0);
- this.metal.readFromNBT(nbt.getCompoundTag("metal"));
- this.moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
- this.moltenMetal.readFromNBT(nbt.getCompoundTag("moltenMetal"));
+ melting = nbt.getInteger("melting");
+ quantity = nbt.getFloat("quantity");
+ hasMetal = nbt.getBoolean("hasMetal");
+ hasMoltenMetal = nbt.getBoolean("hasMoltenMetal");
+ pouring = nbt.getBoolean("pouring");
+ metal = new ItemStack(Item.getItemById(0), 0, 0);
+ metal.readFromNBT(nbt.getCompoundTag("metal"));
+ moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ moltenMetal.readFromNBT(nbt.getCompoundTag("moltenMetal"));
}
+ /**
+ *
+ */
@Override
public void updateEntity()
{
super.updateEntity();
Random rand = new Random();
- if (isDirty)
- {
+ if (isDirty){
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
isDirty = false;
}
if (p > 0) --p;
else p = 5;
- if (n == 0 && p == 0)
- {
+ if (n == 0 && p == 0){
flow += 16;
if (flow >= 16 * 20) n = 1;
}
- if (n == 1 && p == 0)
- {
+ if (n == 1 && p == 0){
flow -= 16;
if (flow <= 0) n = 0;
}
- if (this.hasMetal)
- {
- for (int l = 0; l < 2; ++l)
- this.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 = this.xCoord + rand.nextFloat();
- double d7 = this.yCoord;
- double d6 = this.zCoord + rand.nextFloat();
- this.worldObj.playSound(d5, d7, d6, "liquid.lavapop", 0.2F + rand.nextFloat() * 0.2F, 0.9F + rand.nextFloat() * 0.15F, false);
+ 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);
+ 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);
}
- if (this.hasMetal && !this.hasMoltenMetal)
- {
+ if (hasMetal && !hasMoltenMetal){
boolean isOre = JewelrycraftUtil.isOre(metal);
- if (melting > 0) this.melting--;
- if (melting == 0)
- {
- this.hasMetal = false;
- if (!isOre) this.moltenMetal = metal;
- else
- {
- this.moltenMetal = JewelrycraftUtil.getIngotFromOre(metal.getItem());
+ if (melting > 0) melting--;
+ if (melting == 0){
+ hasMetal = false;
+ if (!isOre) moltenMetal = metal;
+ else{
+ moltenMetal = JewelrycraftUtil.getIngotFromOre(metal.getItem());
moltenMetal.stackSize *= 2;
}
- this.hasMoltenMetal = true;
- if (!isOre) this.quantity = 0.1f * metal.stackSize;
- else this.quantity = 0.2f * metal.stackSize;
- this.metal = new ItemStack(Item.getItemById(0), 0, 0);
+ hasMoltenMetal = true;
+ if (!isOre) quantity = 0.1f * metal.stackSize;
+ else quantity = 0.2f * metal.stackSize;
+ metal = new ItemStack(Item.getItemById(0), 0, 0);
melting = -1;
- this.isDirty = true;
+ isDirty = true;
}
- }
- else if (this.hasMoltenMetal)
- {
+ }else if (hasMoltenMetal){
boolean isOre = JewelrycraftUtil.isOre(metal);
- if (melting > 0) this.melting--;
- if (melting == 0)
- {
- this.hasMetal = false;
- if (!isOre) this.moltenMetal.stackSize += this.metal.stackSize;
- else this.moltenMetal.stackSize += this.metal.stackSize * 2;
- if (!isOre) this.quantity += 0.1f * metal.stackSize;
- else this.quantity += 0.2f * metal.stackSize;
- this.metal = new ItemStack(Item.getItemById(0), 0, 0);
+ if (melting > 0) melting--;
+ if (melting == 0){
+ hasMetal = false;
+ if (!isOre) moltenMetal.stackSize += metal.stackSize;
+ else 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);
melting = -1;
- this.isDirty = true;
+ 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);
- if (pouring && pouredQuantity > 0f)
- {
+ 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);
+ if (pouring && pouredQuantity > 0f){
quantity -= 0.01f;
pouredQuantity -= 0.01f;
me.quantity += 0.01f;
- if (!me.hasMoltenMetal)
- {
+ if (!me.hasMoltenMetal){
me.moltenMetal = moltenMetal;
me.hasMoltenMetal = true;
}
- if (pouredQuantity <= 0f)
- {
+ if (pouredQuantity <= 0f){
pouring = false;
pouredQuantity = 0.1f;
me.cooling = ConfigHandler.ingotCoolingTime;
}
- if (quantity <= 0f)
- {
+ if (quantity <= 0f){
quantity = 0f;
hasMoltenMetal = false;
moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
@@ -169,13 +162,21 @@ public class TileEntitySmelter extends TileEntity
}
}
+ /**
+ * @return
+ */
+ @Override
public Packet getDescriptionPacket()
{
NBTTagCompound nbttagcompound = new NBTTagCompound();
- this.writeToNBT(nbttagcompound);
- return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbttagcompound);
+ writeToNBT(nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound);
}
+ /**
+ * @param net
+ * @param packet
+ */
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)
{
diff --git a/java/darkknight/jewelrycraft/tileentity/renders/ItemRender.java b/java/darkknight/jewelrycraft/tileentity/renders/ItemRender.java
new file mode 100644
index 0000000..31e5676
--- /dev/null
+++ b/java/darkknight/jewelrycraft/tileentity/renders/ItemRender.java
@@ -0,0 +1,65 @@
+package darkknight.jewelrycraft.tileentity.renders;
+
+import net.minecraft.client.model.ModelBase;
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraftforge.client.IItemRenderer;
+import org.lwjgl.opengl.GL11;
+
+public class ItemRender implements IItemRenderer
+{
+ TileEntitySpecialRenderer render;
+ public TileEntity entity;
+ ModelBase model;
+
+ /**
+ * @param render
+ * @param entity
+ * @param model
+ */
+ public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model)
+ {
+ this.entity = entity;
+ this.render = render;
+ this.model = model;
+ }
+
+ /**
+ * @param item
+ * @param type
+ * @return
+ */
+ @Override
+ public boolean handleRenderType(ItemStack item, ItemRenderType type)
+ {
+ return true;
+ }
+
+ /**
+ * @param type
+ * @param item
+ * @param helper
+ * @return
+ */
+ @Override
+ public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
+ {
+ return true;
+ }
+
+ /**
+ * @param type
+ * @param item
+ * @param data
+ */
+ @Override
+ public void renderItem(ItemRenderType type, ItemStack item, Object ... data)
+ {
+ if (type == IItemRenderer.ItemRenderType.ENTITY){
+ GL11.glRotatef(180f, 0f, 1f, 0f);
+ GL11.glTranslatef(-0.5f, -0.5f, -0.4f);
+ }
+ render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F);
+ }
+}
diff --git a/java/darkknight/jewelrycraft/tileentity/renders/MaskRender.java b/java/darkknight/jewelrycraft/tileentity/renders/MaskRender.java
new file mode 100644
index 0000000..5f7a4a0
--- /dev/null
+++ b/java/darkknight/jewelrycraft/tileentity/renders/MaskRender.java
@@ -0,0 +1,63 @@
+package darkknight.jewelrycraft.tileentity.renders;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.model.ModelMask;
+import darkknight.jewelrycraft.tileentity.TileEntityDisplayer;
+
+public class MaskRender extends TileEntitySpecialRenderer
+{
+ ModelMask mask = new ModelMask();
+ ResourceLocation texture = new ResourceLocation("jewelrycraft", "textures/entities/Mask.png");
+
+ @Override
+ public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale)
+ {
+ }
+
+ public void doRender(Entity entity, double x, double y, double z, float f, float g)
+ {
+ GL11.glPushMatrix();
+ Minecraft.getMinecraft().renderEngine.bindTexture(texture);
+ GL11.glScalef(1.0f, 1.0f, 1.0f);
+ GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef((float)g, 0f, 1f, 0f);
+ GL11.glRotatef((float)f, 1f, 0f, 0f);
+ GL11.glTranslatef(-0.33f, -0.33f, -0.33f);
+ float relY = 0F, relZ = 0F;
+ if (f >-2 && f < 30)
+ {
+ relY = -(float)f / 90 * 0.25F;
+ if(!entity.isSneaking()) relZ = -0.1f;
+ else{
+ relZ = -0.2f;
+ relY += 0.1f;
+ }
+ }
+ else if (f > 0){
+ relY = -(float)f / 90 * 0.25F;
+ relZ = -(float)f / 90 * 0.3F;
+ if(entity.isSneaking()){
+ relZ -= 0.05f;
+ relY += 0.05f;
+ }
+ }
+ else{
+ relY = (float)f / 90 * 0.15F;
+ relZ = -(float)f / 90 * 0.15F;
+ if(entity.isSneaking()){
+ relZ -= 0.05f;
+ relY += 0.05f;
+ }
+ }
+ GL11.glTranslatef(0F, relY, relZ);
+ mask.render(entity, (float)x, (float)y, (float)z, 0F, 0F, 0.02F);
+ GL11.glPopMatrix();
+ }
+} \ No newline at end of file
diff --git a/java/darkknight/jewelrycraft/tileentity/renders/TileEntityDisplayerRender.java b/java/darkknight/jewelrycraft/tileentity/renders/TileEntityDisplayerRender.java
new file mode 100644
index 0000000..8cff8bc
--- /dev/null
+++ b/java/darkknight/jewelrycraft/tileentity/renders/TileEntityDisplayerRender.java
@@ -0,0 +1,262 @@
+package darkknight.jewelrycraft.tileentity.renders;
+
+import java.awt.Color;
+import java.util.HashMap;
+import java.util.List;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.client.renderer.OpenGlHelper;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.entity.RenderManager;
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Items;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.model.ModelDisplayer;
+import darkknight.jewelrycraft.tileentity.TileEntityDisplayer;
+
+public class TileEntityDisplayerRender extends TileEntitySpecialRenderer
+{
+ ModelDisplayer displayer = new ModelDisplayer();
+ String texture = "textures/tileentities/Displayer.png";
+ HashMap<EnumChatFormatting, Integer> colors = new HashMap<EnumChatFormatting, Integer>(){
+ {
+ put(EnumChatFormatting.AQUA, 5636095);
+ put(EnumChatFormatting.BLACK, 0);
+ put(EnumChatFormatting.BLUE, 5592575);
+ put(EnumChatFormatting.DARK_AQUA, 43690);
+ put(EnumChatFormatting.DARK_BLUE, 170);
+ put(EnumChatFormatting.DARK_GRAY, 5592405);
+ put(EnumChatFormatting.DARK_GREEN, 43520);
+ put(EnumChatFormatting.DARK_PURPLE, 11141290);
+ put(EnumChatFormatting.DARK_RED, 11141120);
+ put(EnumChatFormatting.GOLD, 16755200);
+ put(EnumChatFormatting.GRAY, 11184810);
+ put(EnumChatFormatting.GREEN, 5635925);
+ put(EnumChatFormatting.LIGHT_PURPLE, 16733695);
+ put(EnumChatFormatting.RED, 16733525);
+ put(EnumChatFormatting.WHITE, 16777215);
+ put(EnumChatFormatting.YELLOW, 16777045);
+ }
+ };
+
+ /**
+ * @param te
+ * @param x
+ * @param y
+ * @param z
+ * @param scale
+ */
+ @Override
+ 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);
+ TileEntityDisplayer disp = (TileEntityDisplayer)te;
+ ResourceLocation blockTexture = new ResourceLocation("jewelrycraft", 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, 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)){
+ int ind = -3;
+ GL11.glPushMatrix();
+ 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.glRotatef(disp.rotAngle, 0F, 1F, 0F);
+ if (RenderManager.instance.options.fancyGraphics) 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);
+ RenderManager.instance.options.fancyGraphics = false;
+ }
+ 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));
+ GL11.glPopMatrix();
+ ind++;
+ if (player != null && disp.quantity > 1){
+ GL11.glPushMatrix();
+ 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()) disp.infoIndex = 1;
+ if (tooltips.size() < 5) 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());
+ GL11.glPopMatrix();
+ ind++;
+ }
+ }
+ else 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());
+ GL11.glPopMatrix();
+ ind++;
+ }
+ }
+ }
+ }
+ }
+ catch(Exception e){}
+ GL11.glPopMatrix();
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * @param par2Str
+ * @param x
+ * @param y
+ * @param z
+ * @param metadata
+ * @param te
+ * @param color
+ */
+ protected void renderLabel(String par2Str, double x, double y, double z, int metadata, TileEntity te, int color)
+ {
+ FontRenderer fontrenderer = RenderManager.instance.getFontRenderer();
+ float var14 = 0.01266667F * 1.5F;
+ float var17 = 0.015F;
+ GL11.glRotatef(180F, 0F, 0F, 1F);
+ if (metadata == 0) GL11.glRotatef(0F, 0F, 1F, 0F);
+ else if (metadata == 1) GL11.glRotatef(270F, 0F, 1F, 0F);
+ else if (metadata == 2) GL11.glRotatef(180F, 0F, 1F, 0F);
+ else if (metadata == 3) GL11.glRotatef(90F, 0F, 1F, 0F);
+ GL11.glTranslatef((float)x, (float)y, (float)z + 0.45F);
+ GL11.glScalef(-0.015F, -var14, 0.015F);
+ GL11.glPushMatrix();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ Tessellator tessellator = Tessellator.instance;
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ int j = fontrenderer.getStringWidth(par2Str) / 2;
+ tessellator.startDrawingQuads();
+ tessellator.setColorRGBA_F(0.0F, 0.2F, 0.2F, 0.9F);
+ tessellator.addVertex(-33.333 - 0, 0D, 0.1D);
+ tessellator.addVertex(-33.333 - 0, 9D, 0.1D);
+ tessellator.addVertex(33.333 + 0, 9D, 0.1D);
+ tessellator.addVertex(33.333 + 0, 0D, 0.1D);
+ tessellator.draw();
+ if (fontrenderer.getStringWidth(par2Str) / 2 > 20) var17 = 0.9F / fontrenderer.getStringWidth(par2Str);
+ else var17 = var14;
+ int red = color >> 16 & 0xFF;
+ int green = color >> 8 & 0xFF;
+ int blue = color & 0xFF;
+ GL11.glTranslatef((float)x + 1f, (float)y + 1f, (float)z);
+ GL11.glPushMatrix();
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glScalef(var17 * 70F, 1F, 0F);
+ int i = 15728880;
+ int t = i % 65536;
+ int k = i / 65536;
+ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, t / 1.0F, k / 1.0F);
+ fontrenderer.drawString(par2Str.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, 65536 * (red > 170 ? red - 170 : 0) + 256 * (green > 170 ? green - 170 : 0) + (blue > 170 ? blue - 170 : 0));
+ GL11.glPopMatrix();
+ GL11.glTranslatef((float)x - 1f, (float)y - 1f, (float)z - 1F);
+ GL11.glScalef(var17 * 70F, 1F, 0F);
+ fontrenderer.drawString(par2Str, -j, 0, color);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * @param str
+ * @param color
+ */
+ public void replaceEnumEnchValues(String str, int color)
+ {
+ if (str.contains("§0")){
+ color = Color.BLACK.getRGB();
+ str.replace("§0", "");
+ }
+ if (str.contains("§1")){
+ color = 85;
+ str.replace("§1", "");
+ }
+ if (str.contains("§2")){
+ color = 17920;
+ str.replace("§2", "");
+ }
+ if (str.contains("§3")){
+ color = 1336183;
+ str.replace("§3", "");
+ }
+ if (str.contains("§4")){
+ color = 4587520;
+ str.replace("§4", "");
+ }
+ if (str.contains("§5")){
+ color = 5701759;
+ str.replace("§5", "");
+ }
+ if (str.contains("§6")){
+ color = 16762880;
+ str.replace("§6", "");
+ }
+ if (str.contains("§7")){
+ color = Color.GRAY.getRGB();
+ str.replace("§7", "");
+ }
+ if (str.contains("§8")){
+ color = Color.DARK_GRAY.getRGB();
+ str.replace("§8", "");
+ }
+ if (str.contains("§9")){
+ color = Color.BLUE.getRGB();
+ str.replace("§9", "");
+ }
+ if (str.contains("§a")){
+ color = Color.GREEN.getRGB();
+ str.replace("§a", "");
+ }
+ if (str.contains("§b")){
+ color = Color.CYAN.getRGB();
+ str.replace("§b", "");
+ }
+ if (str.contains("§c")){
+ color = Color.RED.getRGB();
+ str.replace("§c", "");
+ }
+ if (str.contains("§d")){
+ color = 11665663;
+ str.replace("§d", "");
+ }
+ if (str.contains("§e")){
+ color = Color.YELLOW.getRGB();
+ str.replace("§e", "");
+ }
+ if (str.contains("§f")){
+ color = Color.WHITE.getRGB();
+ str.replace("§f", "");
+ }
+ }
+} \ No newline at end of file
diff --git a/java/darkknight/jewelrycraft/tileentity/renders/TileEntityHandPedestalRender.java b/java/darkknight/jewelrycraft/tileentity/renders/TileEntityHandPedestalRender.java
new file mode 100644
index 0000000..ac98ca6
--- /dev/null
+++ b/java/darkknight/jewelrycraft/tileentity/renders/TileEntityHandPedestalRender.java
@@ -0,0 +1,47 @@
+package darkknight.jewelrycraft.tileentity.renders;
+
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.model.ModelHandPedestal;
+import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal;
+
+/**
+ * @author Paul Fulham (pau101)
+ */
+public class TileEntityHandPedestalRender extends TileEntitySpecialRenderer
+{
+ private ModelHandPedestal model;
+ private ResourceLocation texture;
+
+ /**
+ * @param model
+ * @param texture
+ */
+ public TileEntityHandPedestalRender(ModelHandPedestal model, ResourceLocation texture)
+ {
+ this.model = model;
+ this.texture = texture;
+ }
+
+ /**
+ * @param te
+ * @param x
+ * @param y
+ * @param z
+ * @param partialRenderTicks
+ */
+ @Override
+ 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);
+ 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);
+ model.render(pedestal, partialRenderTicks, 0.0625F);
+ GL11.glPopMatrix();
+ }
+} \ No newline at end of file
diff --git a/java/darkknight/jewelrycraft/tileentity/renders/TileEntityJewelrsCraftingTableRender.java b/java/darkknight/jewelrycraft/tileentity/renders/TileEntityJewelrsCraftingTableRender.java
new file mode 100644
index 0000000..7a8e35b
--- /dev/null
+++ b/java/darkknight/jewelrycraft/tileentity/renders/TileEntityJewelrsCraftingTableRender.java
@@ -0,0 +1,136 @@
+package darkknight.jewelrycraft.tileentity.renders;
+
+import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.OpenGlHelper;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.entity.RenderManager;
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.world.World;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.model.ModelJewlersCraftingBench;
+import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable;
+
+public class TileEntityJewelrsCraftingTableRender extends TileEntitySpecialRenderer
+{
+ ModelJewlersCraftingBench modelTable = new ModelJewlersCraftingBench();
+ String texture = "textures/tileentities/JewelrsCraftingBench.png";
+
+ /**
+ * @param te
+ * @param x
+ * @param y
+ * @param z
+ * @param scale
+ */
+ @Override
+ 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("jewelrycraft", texture);
+ Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture);
+ TileEntityJewelrsCraftingTable jt = (TileEntityJewelrsCraftingTable)te;
+ GL11.glPushMatrix();
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ try{
+ int block = te.getBlockMetadata();
+ if (block == 1) GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
+ else if (block == 2){
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
+ }else if (block == 3){
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(180F, 1.0F, 0.0F, 1.0F);
+ }
+ }
+ catch(Exception e){}
+ 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() != ""){
+ GL11.glPushMatrix();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ 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);
+ GL11.glScalef(0.5F, 0.5F, 0.5F);
+ 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);
+ 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.options.fancyGraphics = false;
+ }
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+ 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.getEntityItem().stackSize = 1;
+ entityitem.hoverStart = 0.0F;
+ GL11.glRotatef(180F, 1F, 0F, 0F);
+ GL11.glScalef(0.5F, 0.5F, 0.5F);
+ 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);
+ 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.options.fancyGraphics = false;
+ }
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+ 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.getEntityItem().stackSize = 1;
+ entityitem.hoverStart = 0.0F;
+ GL11.glRotatef(180F, 1F, 0F, 0F);
+ GL11.glScalef(0.5F, 0.5F, 0.5F);
+ 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);
+ 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.options.fancyGraphics = false;
+ }
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+ }
+ GL11.glPopMatrix();
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param 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 modulousModifier = skyLight % 65536;
+ int divModifier = skyLight / 65536;
+ tess.setColorOpaque_F(brightness, brightness, brightness);
+ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, modulousModifier, divModifier);
+ }
+}
diff --git a/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMolderRender.java b/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMolderRender.java
new file mode 100644
index 0000000..9685e2e
--- /dev/null
+++ b/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMolderRender.java
@@ -0,0 +1,138 @@
+package darkknight.jewelrycraft.tileentity.renders;
+
+import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.OpenGlHelper;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.entity.RenderItem;
+import net.minecraft.client.renderer.entity.RenderManager;
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.world.World;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.model.ModelMolder;
+import darkknight.jewelrycraft.tileentity.TileEntityMolder;
+import darkknight.jewelrycraft.util.JewelryNBT;
+
+public class TileEntityMolderRender extends TileEntitySpecialRenderer
+{
+ ModelMolder modelMolder = new ModelMolder();
+
+ /**
+ * @param te
+ * @param x
+ * @param y
+ * @param z
+ * @param scale
+ */
+ @Override
+ 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);
+ TileEntityMolder me = (TileEntityMolder)te;
+ String texture = "textures/tileentities/Molder.png";
+ ResourceLocation blockTexture = new ResourceLocation("jewelrycraft", texture);
+ Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture);
+ GL11.glPushMatrix();
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ try{
+ int block = me.getBlockMetadata();
+ if (block == 1) GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
+ else if (block == 2){
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
+ }else if (block == 3){
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(180F, 1.0F, 0.0F, 1.0F);
+ }
+ }
+ 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;
+ if (me != null){
+ if (me.hasMold){
+ GL11.glPushMatrix();
+ 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);
+ GL11.glScalef(1.25F, 1.0F, 1.25F);
+ 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);
+ }
+ Minecraft.getMinecraft().gameSettings.fancyGraphics = fancyGraphics;
+ GL11.glPopMatrix();
+ }
+ if (me.hasJewelBase && 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.getEntityItem().stackSize = 1;
+ entityitem.hoverStart = 0.0F;
+ GL11.glTranslatef(0F, 1.4F, -0.28F);
+ GL11.glScalef(1.25F, 1.0F, 1.25F);
+ 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);
+ 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)){
+ GL11.glPushMatrix();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ if (JewelrycraftMod.fancyRender){
+ GL11.glEnable(GL11.GL_BLEND);
+ OpenGlHelper.glBlendFunc(1, 1, 0, 0);
+ }
+ ItemStack metal = new ItemStack(ItemList.metal);
+ ItemStack ingot = me.moltenMetal.copy();
+ if (Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.carpet)) ingot.setItemDamage(15 - ingot.getItemDamage());
+ JewelryNBT.addMetal(metal, ingot);
+ 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.38f - 0.005f * me.quantity, -0.29F);
+ GL11.glScalef(1.1F, 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);
+ RenderItem.renderInFrame = false;
+ if (JewelrycraftMod.fancyRender) GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+ }
+ GL11.glPopMatrix();
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param 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 modulousModifier = skyLight % 65536;
+ int divModifier = skyLight / 65536;
+ tess.setColorOpaque_F(brightness, brightness, brightness);
+ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, modulousModifier, divModifier);
+ }
+}
diff --git a/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowEyeRender.java b/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowEyeRender.java
new file mode 100644
index 0000000..7bf2363
--- /dev/null
+++ b/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowEyeRender.java
@@ -0,0 +1,79 @@
+package darkknight.jewelrycraft.tileentity.renders;
+
+import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.OpenGlHelper;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.world.World;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.model.ModelShadowEye;
+import darkknight.jewelrycraft.tileentity.TileEntityShadowEye;
+
+public class TileEntityShadowEyeRender extends TileEntitySpecialRenderer
+{
+ ModelShadowEye eye = new ModelShadowEye();
+
+ /**
+ * @param te
+ * @param x
+ * @param y
+ * @param z
+ * @param scale
+ */
+ @Override
+ 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);
+ TileEntityShadowEye eyeS = (TileEntityShadowEye)te;
+ String texture = "textures/tileentities/ShadowEye" + eyeS.opening + ".png";
+ ResourceLocation blockTexture = new ResourceLocation("jewelrycraft", texture);
+ Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture);
+ GL11.glPushMatrix();
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ try{
+ int block = te.getBlockMetadata();
+ if (block == 0) GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
+ else if (block == 1){
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
+ }else if (block == 2){
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(180F, 1.0F, 0.0F, 1.0F);
+ }
+ }
+ catch(Exception e){}
+ try{
+ EntityPlayer player = te.getWorldObj().getClosestPlayer(te.xCoord, te.yCoord, te.zCoord, 16D);
+ if (player != null) eye.render(player, te.xCoord, te.yCoord, te.zCoord, te.blockMetadata, eyeS.opening, 0.0625F);
+ }
+ catch(Exception e){
+ eye.render((Entity)null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
+ }
+ GL11.glPopMatrix();
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param 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 modulousModifier = skyLight % 65536;
+ int divModifier = skyLight / 65536;
+ tess.setColorOpaque_F(brightness, brightness, brightness);
+ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, modulousModifier, divModifier);
+ }
+}
diff --git a/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowHandRender.java b/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowHandRender.java
new file mode 100644
index 0000000..d0e2799
--- /dev/null
+++ b/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowHandRender.java
@@ -0,0 +1,20 @@
+package darkknight.jewelrycraft.tileentity.renders;
+
+import net.minecraft.util.ResourceLocation;
+import darkknight.jewelrycraft.model.ModelHandPedestal;
+
+/**
+ * @author Paul Fulham (pau101)
+ */
+public class TileEntityShadowHandRender extends TileEntityHandPedestalRender
+{
+
+ /**
+ * @param model
+ * @param texture
+ */
+ public TileEntityShadowHandRender(ModelHandPedestal model, ResourceLocation texture)
+ {
+ super(model, texture);
+ }
+} \ No newline at end of file
diff --git a/java/darkknight/jewelrycraft/tileentity/renders/TileEntitySmelterRender.java b/java/darkknight/jewelrycraft/tileentity/renders/TileEntitySmelterRender.java
new file mode 100644
index 0000000..e6a92a5
--- /dev/null
+++ b/java/darkknight/jewelrycraft/tileentity/renders/TileEntitySmelterRender.java
@@ -0,0 +1,125 @@
+package darkknight.jewelrycraft.tileentity.renders;
+
+import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.OpenGlHelper;
+import net.minecraft.client.renderer.entity.RenderItem;
+import net.minecraft.client.renderer.entity.RenderManager;
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.model.ModelSmelter;
+import darkknight.jewelrycraft.tileentity.TileEntitySmelter;
+import darkknight.jewelrycraft.util.JewelryNBT;
+
+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;
+
+ /**
+ * @param te
+ * @param x
+ * @param y
+ * @param z
+ * @param scale
+ */
+ @Override
+ 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);
+ String texture = "textures/tileentities/Smelter.png";
+ ResourceLocation blockTexture = new ResourceLocation("jewelrycraft", texture);
+ Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture);
+ TileEntitySmelter st = (TileEntitySmelter)te;
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ try{
+ int block = te.getBlockMetadata();
+ if (block == 1) GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
+ else if (block == 2){
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
+ }else if (block == 3){
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(180F, 1.0F, 0.0F, 1.0F);
+ }
+ }
+ 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);
+ if (scale != 0){
+ GL11.glPushMatrix();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ if (JewelrycraftMod.fancyRender){
+ GL11.glEnable(GL11.GL_BLEND);
+ OpenGlHelper.glBlendFunc(1, 1, 0, 0);
+ }
+ 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);
+ GL11.glScalef(1.2F, 1.0F, 1.7F);
+ GL11.glRotatef(90F, 1F, 0F, 0f);
+ RenderItem.renderInFrame = 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);
+ RenderItem.renderInFrame = false;
+ if (JewelrycraftMod.fancyRender) GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+ if (st != 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);
+ metal.getEntityItem().stackSize = 1;
+ metal.hoverStart = 0.0F;
+ GL11.glRotatef(-50F, 1F, 0F, 0F);
+ GL11.glRotatef(-50F, 0F, 0F, 1F);
+ GL11.glRotatef(180F, 1F, 0F, 0F);
+ 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);
+ Minecraft.getMinecraft().gameSettings.fancyGraphics = fancyGraphics;
+ GL11.glPopMatrix();
+ }
+ 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);
+ }
+ ItemStack metal = new ItemStack(ItemList.metal);
+ ItemStack ingot = st.moltenMetal.copy();
+ if (Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.carpet)) ingot.setItemDamage(15 - ingot.getItemDamage());
+ JewelryNBT.addMetal(metal, ingot);
+ 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.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);
+ RenderItem.renderInFrame = false;
+ if (JewelrycraftMod.fancyRender) GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+ }
+ GL11.glPopMatrix();
+ }
+}