diff options
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java')
| -rwxr-xr-x | src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java index 9fca5fc..c7607a4 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java @@ -11,8 +11,9 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity;
public class TileEntityMolder extends TileEntity {
- public int cooling;
- public boolean hasMoltenMetal, hasJewelBase, hasMold, isDirty;
+ public int cooling;
+ public boolean hasMoltenMetal, hasJewelBase, hasMold,
+ isDirty;
public ItemStack mold, jewelBase, moltenMetal, ringMetal;
public float quantity;
@@ -85,17 +86,23 @@ public class TileEntityMolder extends TileEntity { public void updateEntity() {
super.updateEntity();
if (isDirty) {
- worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ worldObj.markBlockForUpdate(xCoord, yCoord,
+ zCoord);
isDirty = false;
}
- if (hasMoltenMetal && moltenMetal.getItem() != Item.getItemById(0)
+ if (hasMoltenMetal
+ && moltenMetal.getItem() != Item
+ .getItemById(0)
&& quantity > 0f) {
if (worldObj.rand.nextInt(20) == 0)
- worldObj.playSoundEffect(xCoord, yCoord + 0.5F, zCoord,
+ 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(),
+ worldObj.spawnParticle("reddust",
+ xCoord + Math.random(),
+ (double) yCoord + 0.2F,
+ zCoord + Math.random(),
0.0D, 1.0D, 1.0D);
}
if (hasMoltenMetal && !hasJewelBase && quantity >= 0.1f) {
@@ -106,21 +113,29 @@ public class TileEntityMolder extends TileEntity { if (mold.getItemDamage() == 0)
jewelBase = moltenMetal;
else if (mold.getItemDamage() == 1)
- jewelBase = new ItemStack(ItemList.ring);
+ jewelBase = new ItemStack(
+ ItemList.ring);
else if (mold.getItemDamage() == 2)
- jewelBase = new ItemStack(ItemList.necklace);
+ jewelBase = new ItemStack(
+ ItemList.necklace);
else if (mold.getItemDamage() == 3)
- jewelBase = new ItemStack(ItemList.bracelet);
+ jewelBase = new ItemStack(
+ ItemList.bracelet);
else if (mold.getItemDamage() == 4)
- jewelBase = new ItemStack(ItemList.earrings);
+ jewelBase = new ItemStack(
+ ItemList.earrings);
ringMetal.stackSize = 1;
jewelBase.stackSize = 1;
if (mold.getItemDamage() != 0
- && jewelBase != new ItemStack(Item.getItemById(0),
+ && jewelBase != new ItemStack(
+ Item.getItemById(
+ 0),
0, 0))
- JewelryNBT.addMetal(jewelBase, ringMetal);
+ JewelryNBT.addMetal(jewelBase,
+ ringMetal);
hasMoltenMetal = false;
- moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ moltenMetal = new ItemStack(
+ Item.getItemById(0), 0, 0);
hasJewelBase = true;
cooling = -1;
quantity = 0f;
@@ -136,8 +151,8 @@ public class TileEntityMolder extends TileEntity { public Packet getDescriptionPacket() {
NBTTagCompound nbttagcompound = new NBTTagCompound();
writeToNBT(nbttagcompound);
- return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1,
- nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord,
+ zCoord, 1, nbttagcompound);
}
/**
|
