diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2013-12-21 12:58:12 +0200 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2013-12-21 12:58:12 +0200 |
| commit | 4d44f0da49a8676fe557ba5da9022428a6b6f061 (patch) | |
| tree | 7ef3a610ef60fcb5b63ac72962da6af27b8005ed /common/darkknight/jewelrycraft/block/BlockJewelrsCraftingTable.java | |
| parent | 401d313409ca088156f5e7658cdb744a9d2d2cb7 (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/BlockJewelrsCraftingTable.java')
| -rw-r--r-- | common/darkknight/jewelrycraft/block/BlockJewelrsCraftingTable.java | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/common/darkknight/jewelrycraft/block/BlockJewelrsCraftingTable.java b/common/darkknight/jewelrycraft/block/BlockJewelrsCraftingTable.java index 4f327ff..30daab2 100644 --- a/common/darkknight/jewelrycraft/block/BlockJewelrsCraftingTable.java +++ b/common/darkknight/jewelrycraft/block/BlockJewelrsCraftingTable.java @@ -13,8 +13,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import darkknight.jewelrycraft.config.ConfigHandler; import darkknight.jewelrycraft.item.ItemList; import darkknight.jewelrycraft.item.ItemRing; import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; @@ -55,7 +57,7 @@ public class BlockJewelrsCraftingTable extends BlockContainer { te.jewel = item.copy(); te.hasJewel = true; - --item.stackSize; + if (!entityPlayer.capabilities.isCreativeMode) --item.stackSize; entityPlayer.inventory.onInventoryChanged(); } if (!te.hasEndItem && !te.hasModifier && item != null && item.getItem().itemID == modifiers[0]) @@ -63,10 +65,10 @@ public class BlockJewelrsCraftingTable extends BlockContainer te.modifier = item.copy(); te.modifier.stackSize = 1; te.hasModifier = true; - --item.stackSize; + if (!entityPlayer.capabilities.isCreativeMode) --item.stackSize; entityPlayer.inventory.onInventoryChanged(); } - if(te.hasEndItem && item != null) entityPlayer.addChatMessage("First take out the crafted jewel before inserting new stuff."); + if(te.hasEndItem && item != null) entityPlayer.addChatMessage(StatCollector.translateToLocal("chatmessage.jewelrycraft.table.hasenditem")); if (te.hasModifier && entityPlayer.isSneaking()) { @@ -135,13 +137,15 @@ public class BlockJewelrsCraftingTable extends BlockContainer te.endItem = new ItemStack(0, 0, 0); te.hasEndItem = false; } - else if (!te.hasModifier && !te.hasJewel && !world.isRemote) - player.addChatMessage("You need a ring and a modifier"); - else if (!te.hasJewel && !world.isRemote) - player.addChatMessage("You're missing a ring"); - else if (!te.hasModifier && !world.isRemote) - player.addChatMessage("You need a modifier"); - te.timer = 2000; + else if (te.hasJewel && te.hasModifier && te.timer > 0 && te.jewel != null) + player.addChatMessage(StatCollector.translateToLocalFormatted("chatmessage.jewelrycraft.table.iscrafting", te.jewel.getDisplayName()) + " (" + ((ConfigHandler.jewelryCraftingTime - te.timer)*100/ConfigHandler.jewelryCraftingTime) + "%)"); + else if (!te.hasModifier && !te.hasJewel) + player.addChatMessage(StatCollector.translateToLocal("chatmessage.jewelrycraft.table.missingjewelryandmodifier")); + else if (!te.hasJewel) + player.addChatMessage(StatCollector.translateToLocal("chatmessage.jewelrycraft.table.misingjewelry")); + else if (!te.hasModifier) + player.addChatMessage(StatCollector.translateToLocal("chatmessage.jewelrycraft.table.missingmodifier")); + if(te.timer == 0 && !te.hasEndItem) te.timer = ConfigHandler.jewelryCraftingTime; te.isDirty = true; } } |
