From bd140502f5d1a8bc78c27f79327be89caf0d76fe Mon Sep 17 00:00:00 2001 From: Mohammad-Ali Minaie Date: Sat, 1 Apr 2017 20:29:36 -0400 Subject: [PATCH] updating ignore --- .gitignore | 6 +- .../nmd/primal/forgecraft/blocks/Anvil.java | 95 ++++++++++--------- 2 files changed, 54 insertions(+), 47 deletions(-) diff --git a/.gitignore b/.gitignore index 42bedf08..3ea35ad1 100644 --- a/.gitignore +++ b/.gitignore @@ -19,7 +19,11 @@ forge-*-changelog.txt 1.11/usernamecache.json 1.11/options.txt *.DS_Store - +*.iml +*.ipr +*.iws +1.11/eula.txt +1.11/server.properties # eclipse bin diff --git a/1.11/src/main/java/nmd/primal/forgecraft/blocks/Anvil.java b/1.11/src/main/java/nmd/primal/forgecraft/blocks/Anvil.java index f435c409..978e2587 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/blocks/Anvil.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/blocks/Anvil.java @@ -94,6 +94,8 @@ public class Anvil extends CustomContainerFacing { //System.out.println("Tile is not null"); //if ((player.inventory.getCurrentItem().getItem().equals(PrimalItems.STONE_GALLAGHER)) || (player.inventory.getCurrentItem().getItem() == ModItems.forgehammer)) { + + if ((pItem.getItem() instanceof WorkMallet) || (pItem.getItem() == ModItems.forgehammer)) { @@ -244,65 +246,66 @@ public class Anvil extends CustomContainerFacing { if ( (!(pItem.getItem() instanceof WorkMallet)) || (!(pItem.getItem() instanceof ForgeHammer)) ) { + if(Block.getBlockFromItem(pItem.getItem()) instanceof IngotBall) { + return false; + } - if (state.getValue(FACING) == EnumFacing.NORTH) { - int counter = 0; - for (int z = 0; z < 5; z++) { - for (int x = 0; x < 5; x++) { - if (hitx >= this.getNormalMin(x) && hitx <= this.getNormalMax(x)) { - if (hitz >= this.getNormalMin(z) && hitz <= this.getNormalMax(z)) { - doWork(pItem, counter, tile, world, pos, player); - return true; - } - } - counter++; + if (state.getValue(FACING) == EnumFacing.NORTH) { + int counter = 0; + for (int z = 0; z < 5; z++) { + for (int x = 0; x < 5; x++) { + if (hitx >= this.getNormalMin(x) && hitx <= this.getNormalMax(x)) { + if (hitz >= this.getNormalMin(z) && hitz <= this.getNormalMax(z)) { + doWork(pItem, counter, tile, world, pos, player); + return true; } } + counter++; } - if (state.getValue(FACING) == EnumFacing.SOUTH) { - int counter = 0; - for (int z = 0; z < 5; z++) { - for (int x = 0; x < 5; x++) { - if (hitx >= this.getReverseMin(x) && hitx <= this.getReverseMax(x)) { - if (hitz >= this.getReverseMin(z) && hitz <= this.getReverseMax(z)) { - doWork(pItem, counter, tile, world, pos, player); - return true; - } - } - counter++; + } + } + if (state.getValue(FACING) == EnumFacing.SOUTH) { + int counter = 0; + for (int z = 0; z < 5; z++) { + for (int x = 0; x < 5; x++) { + if (hitx >= this.getReverseMin(x) && hitx <= this.getReverseMax(x)) { + if (hitz >= this.getReverseMin(z) && hitz <= this.getReverseMax(z)) { + doWork(pItem, counter, tile, world, pos, player); + return true; } } + counter++; } - if (state.getValue(FACING) == EnumFacing.WEST) { - int counter = 0; - for (int x = 0; x < 5; x++) { - for (int z = 0; z < 5; z++) { - if (hitx >= this.getNormalMin(x) && hitx <= this.getNormalMax(x)) { - if (hitz >= this.getReverseMin(z) && hitz <= this.getReverseMax(z)) { - doWork(pItem, counter, tile, world, pos, player); - return true; - } - } - counter++; + } + } + if (state.getValue(FACING) == EnumFacing.WEST) { + int counter = 0; + for (int x = 0; x < 5; x++) { + for (int z = 0; z < 5; z++) { + if (hitx >= this.getNormalMin(x) && hitx <= this.getNormalMax(x)) { + if (hitz >= this.getReverseMin(z) && hitz <= this.getReverseMax(z)) { + doWork(pItem, counter, tile, world, pos, player); + return true; } } + counter++; } - if (state.getValue(FACING) == EnumFacing.EAST) { - int counter = 0; - for (int x = 0; x < 5; x++) { - for (int z = 0; z < 5; z++) { - if (hitx >= this.getReverseMin(x) && hitx <= this.getReverseMax(x)) { - if (hitz >= this.getNormalMin(z) && hitz <= this.getNormalMax(z)) { - doWork(pItem, counter, tile, world, pos, player); - return true; - } - } - counter++; + } + } + if (state.getValue(FACING) == EnumFacing.EAST) { + int counter = 0; + for (int x = 0; x < 5; x++) { + for (int z = 0; z < 5; z++) { + if (hitx >= this.getReverseMin(x) && hitx <= this.getReverseMax(x)) { + if (hitz >= this.getNormalMin(z) && hitz <= this.getNormalMax(z)) { + doWork(pItem, counter, tile, world, pos, player); + return true; } } + counter++; } - - + } + } } } return false;