summaryrefslogtreecommitdiff
path: root/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2013-12-16 16:34:17 +0200
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2013-12-16 16:34:17 +0200
commit26d28c9b93133a6cfc5d2544c662e9d77955b6f5 (patch)
treeba4a4cb9829a14db82e67af26e2e21fc59571ead /common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java
parent1f718427162fa59a22c08a32e68e133fb411aa37 (diff)
Rings and molder
Diffstat (limited to 'common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java')
-rw-r--r--common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java31
1 files changed, 21 insertions, 10 deletions
diff --git a/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java b/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java
index 092bb47..27cd27e 100644
--- a/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java
+++ b/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java
@@ -1,8 +1,8 @@
package darkknight.jewelrycraft.tileentity;
+import darkknight.jewelrycraft.item.ItemList;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.Packet132TileEntityData;
@@ -12,13 +12,14 @@ public class TileEntityMolder extends TileEntity
{
public int cooling;
public boolean hasMoltenMetal, hasJewelBase, hasMold;
- public ItemStack mold, jewelBase, moltenMetal;
+ public ItemStack mold, jewelBase, moltenMetal, ringMetal;
public TileEntityMolder()
{
this.moltenMetal = new ItemStack(0, 0, 0);
this.jewelBase = new ItemStack(0, 0, 0);
this.mold = new ItemStack(0, 0, 0);
+ this.ringMetal = new ItemStack(0, 0, 0);
this.cooling = 0;
this.hasJewelBase = false;
this.hasMoltenMetal = false;
@@ -36,12 +37,15 @@ public class TileEntityMolder extends TileEntity
NBTTagCompound tag = new NBTTagCompound();
NBTTagCompound tag1 = new NBTTagCompound();
NBTTagCompound tag2 = new NBTTagCompound();
+ NBTTagCompound tag3 = new NBTTagCompound();
this.mold.writeToNBT(tag);
nbt.setCompoundTag("mold", tag);
this.jewelBase.writeToNBT(tag1);
nbt.setCompoundTag("jewelBase", tag1);
this.moltenMetal.writeToNBT(tag2);
nbt.setCompoundTag("moltenMetal", tag2);
+ this.ringMetal.writeToNBT(tag2);
+ nbt.setCompoundTag("ringMetal", tag3);
}
@Override
@@ -58,6 +62,8 @@ public class TileEntityMolder extends TileEntity
this.jewelBase.readFromNBT(nbt.getCompoundTag("jewelBase"));
this.moltenMetal = new ItemStack(0, 0, 0);
this.moltenMetal.readFromNBT(nbt.getCompoundTag("moltenMetal"));
+ this.ringMetal = new ItemStack(0, 0, 0);
+ this.ringMetal.readFromNBT(nbt.getCompoundTag("ringMetal"));
}
public void updateEntity()
@@ -65,22 +71,27 @@ public class TileEntityMolder extends TileEntity
super.updateEntity();
if(this.hasMoltenMetal && !this.hasJewelBase)
{
- while(cooling > 0)
- {
- this.cooling--;
- System.out.println(cooling);
- }
+ ringMetal = moltenMetal;
+ if(cooling > 0) this.cooling--;
+ System.out.println(mold.getItemDamage());
if(cooling == 0)
{
this.hasMoltenMetal = false;
- this.jewelBase = moltenMetal;
+ if(mold.getItemDamage() == 0) this.jewelBase = moltenMetal;
+ else this.jewelBase = new ItemStack(ItemList.ring);
this.moltenMetal = new ItemStack(0, 0, 0);
this.hasJewelBase = true;
}
+
+ this.worldObj.playSoundEffect((double)((float)xCoord + 0.5F), (double)((float)yCoord + 0.5F), (double)((float)zCoord + 0.5F), "random.fizz", 0.5F, 2.6F + 0.2F * 0.8F);
+ for (int l = 0; l < 4; ++l)
+ {
+ //EntityFX entityfx = new EntityReddustFX(this.worldObj, (double)xCoord + Math.random(), (double)yCoord + 0.2D, (double)zCoord + Math.random(), 0.0F, 0.0F, 0.0F);
+ this.worldObj.spawnParticle("reddust", (double)xCoord + Math.random(), (double)yCoord + 0.2F, (double)zCoord + Math.random(), 0.0D, 1.0D, 0.0D);
+ }
}
- System.out.print(hasJewelBase);
}
-
+
public void onDataPacket(INetworkManager net, Packet132TileEntityData pkt)
{
readFromNBT(pkt.data);