From 5ba327799f8361b4f06fd5dec33af563977bd2cc Mon Sep 17 00:00:00 2001 From: KitsuShadow Date: Sun, 24 Jan 2016 19:59:45 -0500 Subject: [PATCH] Forge Hammer Fix --- bin/com/kitsu/medievalcraft/Main.class | Bin 6767 -> 6767 bytes .../item/craftingtools/ForgeHammer.class | Bin 10846 -> 10893 bytes bin/mcmod.info | 2 +- .../java/com/kitsu/medievalcraft/Main.java | 2 +- .../item/craftingtools/ForgeHammer.java | 126 +++++++++--------- src/main/resources/mcmod.info | 2 +- 6 files changed, 68 insertions(+), 64 deletions(-) diff --git a/bin/com/kitsu/medievalcraft/Main.class b/bin/com/kitsu/medievalcraft/Main.class index ac9f538d0f6c05146bd7eb823b5b968cde59f62b..70a766c5df5c501a1751bb5a7c002e7289879722 100644 GIT binary patch delta 12 UcmaEF^4?^^Rz|~(+jdF<04aq9_W%F@ delta 12 UcmaEF^4?^^Rz`!3+jdF<04ab4_5c6? diff --git a/bin/com/kitsu/medievalcraft/item/craftingtools/ForgeHammer.class b/bin/com/kitsu/medievalcraft/item/craftingtools/ForgeHammer.class index a0ee7f6ee1769ae7837aa47ce7b2f2ad1adab936..564f1988be3b67c9ef19fea4ddd6b8d5f7ca96a0 100644 GIT binary patch delta 589 zcmXYtO-Phc6o#KO-@P-bqcO?oOr|zDU(PVprqUek*M+nb$~35K;j*ZOwQ!LTLBv!9 zm%uEDilla>6+s)P|E#PaC?bSPntq5hXfYF1cRu58o_pVO&VA22wdHu%)oV4S^Ps{W z^c8cvrYX@M4P3_z>)p%3Dy&ss*ngA3afZ^RsVu{%RcC6Hff2Q7EV^i)iq@Y7Q``!8>Za%cJK!~>?3iet@lstAje)lbC53_<14rLZjQvW zp&4symP&pSVFs69=G@X|bJE=z%3GyCl;6~mC&eH0*FCX7d}wi~6h*|cD*@YZDrC2l za-vc}odiiq$QD{1lA0#?Sen$t$LOeowRW(Rlb}{nham0dlA7fr zXm{NNHBv;uG`^n&K^M^|J_xF#r#z&7j<(z-ZSB8lUt^md|^)YEqN-8 z*C+bRGSzS{G3PXBI`iCiUUSF!!d+*Dd+O)D#(1Df9%_z9TH>)D=7~=7R8R9vtGr|c zsQu5wUPkTBCgUV0kX6Z$Rhz2<7x1_$62fscOlTN&xy2T}u1ZqI=W45L!@nvzh!J47 zmSwx_Ajlz2n1iV>3il&hn4=>x7@5K2*f@SjjG#dwM?fkLjzeMb>I;}I}u>)tr zepCX)B}hX2= 4 + rand.nextInt(3)){ - world.setBlock(x, y, z, Blocks.air, 0, 2); - - if(tileEnt.getStackInSlot(0).getItem().equals(Items.flower_pot)){ - tileEnt.decrStackSize(0, 1); - } - world.spawnEntityInWorld(new EntityItem(world, x+0.5D, y+0.6D, z+0.5D, new ItemStack(Items.bucket, 1))); - } - } - - - //IRON FORMS - if(tileEnt.getStackInSlot(0)!=null){ - if((tileEnt.getStackInSlot(0).getItem() instanceof IronForms)&&(tile.hot==true)){ - //System.out.println("working"); + if((tileEnt.getStackInSlot(0).getItem().equals(Items.flower_pot))||tileEnt.getStackInSlot(0).getItem().equals(Items.bucket)){ p.worldObj.playSoundAtEntity(p, Main.MODID + ":anvilhammer", 1.0F, 1.0F); Main.sNet.sendToAll(new MsgPacket(true)); Main.sNet.sendToAll(new MsgPacketLocX(x)); @@ -134,60 +112,86 @@ public class ForgeHammer extends Item implements AnvilUtil{ tile.hits++; stack.damageItem(1, p); if(tile.hits >= 4 + rand.nextInt(3)){ - world.spawnEntityInWorld(new EntityItem(world, x+0.5D, y+0.6D, z+0.5D, formsIron.get(tileEnt.getStackInSlot(0).getItem()))); world.setBlock(x, y, z, Blocks.air, 0, 2); - if(tileEnt.getStackInSlot(0).getMaxStackSize() == 1){ - if(tileEnt.getStackInSlot(0).getItemDamage() == tileEnt.getStackInSlot(0).getMaxDamage()-1){ - tileEnt.decrStackSize(0, 1); - } - else {tileEnt.getStackInSlot(0).setItemDamage(tileEnt.getStackInSlot(0).getItemDamage()+1); - } + + if(tileEnt.getStackInSlot(0).getItem().equals(Items.flower_pot)){ + tileEnt.decrStackSize(0, 1); } + world.spawnEntityInWorld(new EntityItem(world, x+0.5D, y+0.6D, z+0.5D, new ItemStack(Items.bucket, 1))); } } - //CLAY FORMS - if((tileEnt.getStackInSlot(0).getItem() instanceof ClayForms)&&(tile.hot==true)){ - p.worldObj.playSoundAtEntity(p, Main.MODID + ":anvilhammer", 1.0F, 1.0F); - Main.sNet.sendToAll(new MsgPacket(true)); - Main.sNet.sendToAll(new MsgPacketLocX(x)); - Main.sNet.sendToAll(new MsgPacketLocY(y)); - Main.sNet.sendToAll(new MsgPacketLocZ(z)); - tile.hits++; - stack.damageItem(1, p); - if(tile.hits >= 4 + rand.nextInt(3)){ - world.spawnEntityInWorld(new EntityItem(world, x+0.5D, y+0.6D, z+0.5D, formsClay.get(tileEnt.getStackInSlot(0).getItem()))); - world.setBlock(x, y, z, Blocks.air, 0, 2); - tileEnt.decrStackSize(0, 1); - tile.markForUpdate(); - } - } - } - } - if((block instanceof IngotBase)){ - //TileIngotBase tile = (TileIngotBase) world.getTileEntity(x, y, z); - //REPAIR TOOLS - if(tileEnt.getStackInSlot(0) != null){ - Item checkItem = tileEnt.getStackInSlot(0).getItem(); - String displayName = tileEnt.getStackInSlot(0).getDisplayName(); - if(displayName.equals(getTool(tileEnt.getStackInSlot(0)))&&(tile.hot == true)&&(block==ModBlocks.refinedIron)){ - if(tileEnt.getStackInSlot(0).isItemDamaged() == true){ + //IRON FORMS + if(tileEnt.getStackInSlot(0)!=null){ + if((tileEnt.getStackInSlot(0).getItem() instanceof IronForms)&&(tile.hot==true)){ + //System.out.println("working"); p.worldObj.playSoundAtEntity(p, Main.MODID + ":anvilhammer", 1.0F, 1.0F); Main.sNet.sendToAll(new MsgPacket(true)); Main.sNet.sendToAll(new MsgPacketLocX(x)); Main.sNet.sendToAll(new MsgPacketLocY(y)); Main.sNet.sendToAll(new MsgPacketLocZ(z)); - stack.damageItem(1, p); tile.hits++; + stack.damageItem(1, p); if(tile.hits >= 4 + rand.nextInt(3)){ - checkItem.setDamage(tileEnt.getStackInSlot(0), 0); + world.spawnEntityInWorld(new EntityItem(world, x+0.5D, y+0.6D, z+0.5D, formsIron.get(tileEnt.getStackInSlot(0).getItem()))); world.setBlock(x, y, z, Blocks.air, 0, 2); + if(tileEnt.getStackInSlot(0).getMaxStackSize() == 1){ + if(tileEnt.getStackInSlot(0).getItemDamage() == tileEnt.getStackInSlot(0).getMaxDamage()-1){ + tileEnt.decrStackSize(0, 1); + } + else {tileEnt.getStackInSlot(0).setItemDamage(tileEnt.getStackInSlot(0).getItemDamage()+1); + } + } + } + } + //CLAY FORMS + if((tileEnt.getStackInSlot(0).getItem() instanceof ClayForms)&&(tile.hot==true)){ + p.worldObj.playSoundAtEntity(p, Main.MODID + ":anvilhammer", 1.0F, 1.0F); + Main.sNet.sendToAll(new MsgPacket(true)); + Main.sNet.sendToAll(new MsgPacketLocX(x)); + Main.sNet.sendToAll(new MsgPacketLocY(y)); + Main.sNet.sendToAll(new MsgPacketLocZ(z)); + tile.hits++; + stack.damageItem(1, p); + if(tile.hits >= 4 + rand.nextInt(3)){ + world.spawnEntityInWorld(new EntityItem(world, x+0.5D, y+0.6D, z+0.5D, formsClay.get(tileEnt.getStackInSlot(0).getItem()))); + world.setBlock(x, y, z, Blocks.air, 0, 2); + tileEnt.decrStackSize(0, 1); + tile.markForUpdate(); } } } } - //MAKE FORMS + + if((block instanceof IngotBase)){ + //TileIngotBase tile = (TileIngotBase) world.getTileEntity(x, y, z); + //REPAIR TOOLS + + if(tileEnt.getStackInSlot(0) != null){ + Item checkItem = tileEnt.getStackInSlot(0).getItem(); + String displayName = tileEnt.getStackInSlot(0).getDisplayName(); + if(displayName.equals(getTool(tileEnt.getStackInSlot(0)))&&(tile.hot == true)&&(block==ModBlocks.refinedIron)){ + if(tileEnt.getStackInSlot(0).isItemDamaged() == true){ + p.worldObj.playSoundAtEntity(p, Main.MODID + ":anvilhammer", 1.0F, 1.0F); + Main.sNet.sendToAll(new MsgPacket(true)); + Main.sNet.sendToAll(new MsgPacketLocX(x)); + Main.sNet.sendToAll(new MsgPacketLocY(y)); + Main.sNet.sendToAll(new MsgPacketLocZ(z)); + stack.damageItem(1, p); + tile.hits++; + if(tile.hits >= 4 + rand.nextInt(3)){ + checkItem.setDamage(tileEnt.getStackInSlot(0), 0); + world.setBlock(x, y, z, Blocks.air, 0, 2); + } + } + } + } + } + } + //MAKE FORMS + if((block instanceof IngotBase)&&(block==ModBlocks.ironPlate)){ + TileIngotBase tile = (TileIngotBase) world.getTileEntity(x, y, z); if(tileEnt.getStackInSlot(0)!= null){ if((makeForms.containsKey(tileEnt.getStackInSlot(0).getItem())==true)){ if((tile.hot == true)&&(block==ModBlocks.ironPlate)){ @@ -209,8 +213,8 @@ public class ForgeHammer extends Item implements AnvilUtil{ } } } - } } + /* * ItemStack gladius0 = new ItemStack(ModItems.gladius); gladius0.stackTagCompound = new NBTTagCompound(); diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index dc8c8d60..18a9e0f5 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "kitsumedievalcraft", "name": "ForgeCraft", "description": "ForgeCraft", - "version": "{2.3.0}", + "version": "{2.3.1}", "mcversion": "{1.7.10}", "url": "http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/2296334-wip-kitsus-forgecraft-blacksmith-style-forging", "updateUrl": "https://bitbucket.org/kitsushadow/kitsus-forgecraft/downloads",