summaryrefslogtreecommitdiff
path: root/common/darkknight/jewelrycraft/block/BlockMolder.java
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2013-12-21 12:58:12 +0200
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2013-12-21 12:58:12 +0200
commit4d44f0da49a8676fe557ba5da9022428a6b6f061 (patch)
tree7ef3a610ef60fcb5b63ac72962da6af27b8005ed /common/darkknight/jewelrycraft/block/BlockMolder.java
parent401d313409ca088156f5e7658cdb744a9d2d2cb7 (diff)
Added new messages, added the timers to the config file, changed the config file a bit, fixed the molds not dropping correctly
Diffstat (limited to 'common/darkknight/jewelrycraft/block/BlockMolder.java')
-rw-r--r--common/darkknight/jewelrycraft/block/BlockMolder.java30
1 files changed, 16 insertions, 14 deletions
diff --git a/common/darkknight/jewelrycraft/block/BlockMolder.java b/common/darkknight/jewelrycraft/block/BlockMolder.java
index a58323b..22fca62 100644
--- a/common/darkknight/jewelrycraft/block/BlockMolder.java
+++ b/common/darkknight/jewelrycraft/block/BlockMolder.java
@@ -43,21 +43,23 @@ public class BlockMolder extends BlockContainer
{
TileEntityMolder te = (TileEntityMolder) world.getBlockTileEntity(i, j, k);
ItemStack item = entityPlayer.inventory.getCurrentItem();
- if (te != null && item != null && !te.hasMold && item.itemID == ItemList.molds.itemID && !world.isRemote)
+ if (te != null && !world.isRemote)
{
- te.mold = item;
- te.hasMold = true;
- --item.stackSize;
- if (world.isRemote)
+ if(item != null && !te.hasMold && item.itemID == ItemList.molds.itemID)
+ {
+ te.mold = item.copy();
+ te.hasMold = true;
+ if (!entityPlayer.capabilities.isCreativeMode) --item.stackSize;
entityPlayer.addChatMessage(StatCollector.translateToLocalFormatted("chatmessage.jewelrycraft.molder.addedmold", te.mold.getDisplayName()));
- te.isDirty = true;
- }
- if (te.hasMold && entityPlayer.isSneaking() && !world.isRemote)
- {
- dropItem(world, (double)te.xCoord, (double)te.yCoord, (double)te.zCoord, te.mold);
- te.mold = new ItemStack(0, 0, 0);
- te.hasMold = false;
- te.isDirty = true;
+ te.isDirty = true;
+ }
+ if (te.hasMold && entityPlayer.isSneaking())
+ {
+ dropItem(world, (double)te.xCoord, (double)te.yCoord, (double)te.zCoord, te.mold);
+ te.mold = new ItemStack(0, 0, 0);
+ te.hasMold = false;
+ te.isDirty = true;
+ }
}
return true;
}
@@ -70,7 +72,7 @@ public class BlockMolder extends BlockContainer
entityitem.motionY = 0.11000000298023224D;
world.spawnEntityInWorld(entityitem);
}
-
+
public void breakBlock(World world, int i, int j, int k, int par5, int par6)
{
TileEntityMolder te = (TileEntityMolder) world.getBlockTileEntity(i, j, k);