From 73511390d17a16cbe14371fc8f8a2541bd0a2b6d Mon Sep 17 00:00:00 2001 From: Mohammad-Ali Minaie Date: Tue, 7 Mar 2017 22:30:56 -0500 Subject: [PATCH] updated forge hammer model and texture --- .../nmd/primal/forgecraft/blocks/Anvil.java | 8 +- .../nmd/primal/forgecraft/init/ModBlocks.java | 54 +++---- .../primal/forgecraft/init/ModCrafting.java | 4 +- .../primal/forgecraft/items/ForgeHammer.java | 2 +- .../forgecraft/models/item/forgehammer.json | 140 ++++++++++-------- .../textures/items/forgehammer_iron.png | Bin 0 -> 474 bytes 6 files changed, 120 insertions(+), 88 deletions(-) create mode 100644 1.11/src/main/resources/assets/forgecraft/textures/items/forgehammer_iron.png 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 c6814e5f..81311032 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 @@ -77,7 +77,7 @@ public class Anvil extends CustomContainerFacing { // ***************************************************************************** // // Crafting Anvil Recipes // ***************************************************************************** // - if(pItem.getItem() == PrimalItems.STONE_GALLAGHER){ + if((pItem.getItem().equals(PrimalItems.STONE_GALLAGHER)) || (pItem.getItem() == ModItems.forgehammer)){ Integer[] tempArray = new Integer[25]; for(int i=0; i < 25 ; i++){ if(!tile.getSlotStack(i).isEmpty()){ @@ -86,6 +86,12 @@ public class Anvil extends CustomContainerFacing { } AnvilCrafting recipe = AnvilCrafting.getRecipe(tempArray); if(recipe != null) { + if(pItem.getItem().equals(PrimalItems.STONE_GALLAGHER)) { + pItem.damageItem(15, player); + } + if(pItem.getItem().equals(ModItems.forgehammer)) { + pItem.damageItem(1, player); + } CommonUtils.spawnItemEntityFromWorld(world, pos, recipe.getOutput()); world.playEvent(1031, pos, 0); for (int i = 0; i < tile.getSlotListSize(); i++) { diff --git a/1.11/src/main/java/nmd/primal/forgecraft/init/ModBlocks.java b/1.11/src/main/java/nmd/primal/forgecraft/init/ModBlocks.java index 38dac0b4..b41a90d4 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/init/ModBlocks.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/init/ModBlocks.java @@ -100,33 +100,37 @@ public class ModBlocks { //CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(ModBlocks.stoneanvil, 1)); return true; } - if (pItem.equals(PrimalItems.STONE_GALLAGHER) && world.getBlockState(belowPos).getBlock().equals(ModBlocks.stoneanvil)) { - TileAnvil tile = (TileAnvil) world.getTileEntity(belowPos); + if (pItem.equals(PrimalItems.STONE_GALLAGHER) || pItem.equals(ModItems.forgehammer)) { + if(world.getBlockState(belowPos).getBlock().equals(ModBlocks.stoneanvil)) { - if (tile.getSlotStack(6).isEmpty() && - tile.getSlotStack(7).isEmpty() && - tile.getSlotStack(8).isEmpty() && - tile.getSlotStack(11).isEmpty() && - tile.getSlotStack(12).isEmpty() && - tile.getSlotStack(13).isEmpty() && - tile.getSlotStack(16).isEmpty() && - tile.getSlotStack(17).isEmpty() && - tile.getSlotStack(18).isEmpty() - ) { - player.swingArm(hand); - world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2); - tile.setSlotStack(6, new ItemStack(ModItems.ironchunkhot, 1)); - tile.setSlotStack(7, new ItemStack(ModItems.ironchunkhot, 1)); - tile.setSlotStack(8, new ItemStack(ModItems.ironchunkhot, 1)); - tile.setSlotStack(11, new ItemStack(ModItems.ironchunkhot, 1)); - tile.setSlotStack(12, new ItemStack(ModItems.ironchunkhot, 1)); - tile.setSlotStack(13, new ItemStack(ModItems.ironchunkhot, 1)); - tile.setSlotStack(16, new ItemStack(ModItems.ironchunkhot, 1)); - tile.setSlotStack(17, new ItemStack(ModItems.ironchunkhot, 1)); - tile.setSlotStack(18, new ItemStack(ModItems.ironchunkhot, 1)); - world.playEvent(1031, pos, 0); - return true; + TileAnvil tile = (TileAnvil) world.getTileEntity(belowPos); + + + if (tile.getSlotStack(6).isEmpty() && + tile.getSlotStack(7).isEmpty() && + tile.getSlotStack(8).isEmpty() && + tile.getSlotStack(11).isEmpty() && + tile.getSlotStack(12).isEmpty() && + tile.getSlotStack(13).isEmpty() && + tile.getSlotStack(16).isEmpty() && + tile.getSlotStack(17).isEmpty() && + tile.getSlotStack(18).isEmpty() + ) { + player.swingArm(hand); + world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2); + tile.setSlotStack(6, new ItemStack(ModItems.ironchunkhot, 1)); + tile.setSlotStack(7, new ItemStack(ModItems.ironchunkhot, 1)); + tile.setSlotStack(8, new ItemStack(ModItems.ironchunkhot, 1)); + tile.setSlotStack(11, new ItemStack(ModItems.ironchunkhot, 1)); + tile.setSlotStack(12, new ItemStack(ModItems.ironchunkhot, 1)); + tile.setSlotStack(13, new ItemStack(ModItems.ironchunkhot, 1)); + tile.setSlotStack(16, new ItemStack(ModItems.ironchunkhot, 1)); + tile.setSlotStack(17, new ItemStack(ModItems.ironchunkhot, 1)); + tile.setSlotStack(18, new ItemStack(ModItems.ironchunkhot, 1)); + world.playEvent(1031, pos, 0); + return true; + } } } diff --git a/1.11/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java b/1.11/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java index 533bb6ad..db118c64 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java @@ -157,8 +157,8 @@ public class ModCrafting { //Makes a ForgeHammer AnvilCrafting.addRecipe( new Integer[] { - 1,1,1,1,0, - 0,0,1,0,0, + 0,1,1,1,0, + 0,1,1,0,0, 0,0,1,0,0, 0,0,1,0,0, 0,0,1,0,0 }, diff --git a/1.11/src/main/java/nmd/primal/forgecraft/items/ForgeHammer.java b/1.11/src/main/java/nmd/primal/forgecraft/items/ForgeHammer.java index fe2c31e1..187b8be4 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/items/ForgeHammer.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/items/ForgeHammer.java @@ -11,7 +11,7 @@ public class ForgeHammer extends Item { public ForgeHammer(String unlocalizedName) { setUnlocalizedName(unlocalizedName); this.setRegistryName(unlocalizedName); - //this.setMaxDamage(1000); + this.setMaxDamage(1000); //this.setHasSubtypes(true); //This just says the item has metadata this.setMaxStackSize(1); this.setCreativeTab(ModInfo.TAB_FORGECRAFT); diff --git a/1.11/src/main/resources/assets/forgecraft/models/item/forgehammer.json b/1.11/src/main/resources/assets/forgecraft/models/item/forgehammer.json index 7c8b1930..d7df65ef 100644 --- a/1.11/src/main/resources/assets/forgecraft/models/item/forgehammer.json +++ b/1.11/src/main/resources/assets/forgecraft/models/item/forgehammer.json @@ -1,86 +1,107 @@ { "__comment": "Designed by Kitsushadow with Cubik Studio - https://cubik.studio", "textures": { - "particle": "forgecraft:blocks/iron_ingot", - "texture": "forgecraft:blocks/anvil_base" + "particle": "forgecraft:items/forgehammer_iron", + "texture": "forgecraft:items/forgehammer_iron" }, "elements": [ { "__comment": "Cube1", "from": [ 7, 0, 7 ], - "to": [ 9, 15.5, 9 ], + "to": [ 9, 13, 9 ], "faces": { - "down": { "uv": [ 7, 7, 9, 9 ], "texture": "#texture" }, - "up": { "uv": [ 7, 7, 9, 9 ], "texture": "#texture" }, - "north": { "uv": [ 7, 0.5, 9, 16 ], "texture": "#texture" }, - "south": { "uv": [ 7, 0.5, 9, 16 ], "texture": "#texture" }, - "west": { "uv": [ 7, 0.5, 9, 16 ], "texture": "#texture" }, - "east": { "uv": [ 7, 0.5, 9, 16 ], "texture": "#texture" } - } - }, - { - "__comment": "Cube2", - "from": [ 7, 13.5, 9 ], - "to": [ 9, 15.5, 10.5 ], - "faces": { - "down": { "uv": [ 7, 5.5, 9, 7 ], "texture": "#texture" }, - "up": { "uv": [ 7, 9, 9, 10.5 ], "texture": "#texture" }, - "north": { "uv": [ 7, 0.5, 9, 2.5 ], "texture": "#texture" }, - "south": { "uv": [ 7, 0.5, 9, 2.5 ], "texture": "#texture" }, - "west": { "uv": [ 9, 0.5, 10.5, 2.5 ], "texture": "#texture" }, - "east": { "uv": [ 5.5, 0.5, 7, 2.5 ], "texture": "#texture" } + "down": { "uv": [ 0, 0, 2, 2 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 2, 2 ], "texture": "#texture" }, + "north": { "uv": [ 0, 0, 2, 13 ], "texture": "#texture" }, + "south": { "uv": [ 0, 0, 2, 13 ], "texture": "#texture" }, + "west": { "uv": [ 0, 0, 2, 13 ], "texture": "#texture" }, + "east": { "uv": [ 0, 0, 2, 13 ], "texture": "#texture" } } }, { "__comment": "Cube3", - "from": [ 7, 13.5, 4.5 ], - "to": [ 9, 15.5, 7 ], + "from": [ 6.5, 13, 5 ], + "to": [ 9.5, 16, 10 ], "faces": { - "down": { "uv": [ 7, 9, 9, 11.5 ], "texture": "#texture" }, - "up": { "uv": [ 7, 4.5, 9, 7 ], "texture": "#texture" }, - "north": { "uv": [ 7, 0.5, 9, 2.5 ], "texture": "#texture" }, - "south": { "uv": [ 7, 0.5, 9, 2.5 ], "texture": "#texture" }, - "west": { "uv": [ 4.5, 0.5, 7, 2.5 ], "texture": "#texture" }, - "east": { "uv": [ 9, 0.5, 11.5, 2.5 ], "texture": "#texture" } + "down": { "uv": [ 13, 0, 16, 5 ], "texture": "#texture" }, + "up": { "uv": [ 13, 0, 16, 5 ], "texture": "#texture" }, + "north": { "uv": [ 13, 0, 16, 3 ], "texture": "#texture" }, + "south": { "uv": [ 13, 0, 16, 3 ], "texture": "#texture" }, + "west": { "uv": [ 13, 0, 16, 5 ], "texture": "#texture" }, + "east": { "uv": [ 13, 0, 16, 5 ], "texture": "#texture" } } }, { - "__comment": "Cube5", - "from": [ 6.5, 13.5, 6.5 ], - "to": [ 7, 15.5, 9.5 ], + "__comment": "PlaneY18", + "from": [ 6.5, 16, 10 ], + "to": [ 9.5, 16.001, 11.5 ], + "rotation": { "origin": [ 6.5, 16, 10 ], "axis": "x", "angle": 45 }, "faces": { - "down": { "uv": [ 6.5, 6.5, 7, 9.5 ], "texture": "#texture" }, - "up": { "uv": [ 6.5, 6.5, 7, 9.5 ], "texture": "#texture" }, - "north": { "uv": [ 9, 0.5, 9.5, 2.5 ], "texture": "#texture" }, - "south": { "uv": [ 6.5, 0.5, 7, 2.5 ], "texture": "#texture" }, - "west": { "uv": [ 6.5, 0.5, 9.5, 2.5 ], "texture": "#texture" }, - "east": { "uv": [ 6.5, 0.5, 9.5, 2.5 ], "texture": "#texture" } + "down": { "uv": [ 7, 3, 10, 4 ], "texture": "#texture" }, + "up": { "uv": [ 7, 3, 10, 4 ], "texture": "#texture" } } }, { - "__comment": "Cube5", - "from": [ 9, 13.5, 6.5 ], - "to": [ 9.5, 15.5, 9.5 ], + "__comment": "PlaneY19", + "from": [ 6.5, 13, 10 ], + "to": [ 9.5, 13.001, 11.5 ], + "rotation": { "origin": [ 6.5, 13, 10 ], "axis": "x", "angle": -45 }, "faces": { - "down": { "uv": [ 6.5, 6.5, 7, 9.5 ], "texture": "#texture" }, - "up": { "uv": [ 6.5, 6.5, 7, 9.5 ], "texture": "#texture" }, - "north": { "uv": [ 9, 0, 9.5, 2 ], "texture": "#texture" }, - "south": { "uv": [ 6.5, 0, 7, 2 ], "texture": "#texture" }, - "west": { "uv": [ 6.5, 0, 9.5, 2 ], "texture": "#texture" }, - "east": { "uv": [ 6.5, 0, 9.5, 2 ], "texture": "#texture" } + "down": { "uv": [ 7, 3, 10, 4 ], "texture": "#texture" }, + "up": { "uv": [ 7, 7, 10, 8 ], "texture": "#texture" } } }, { - "__comment": "Cube7", - "from": [ 7, 15.5, 6.5 ], - "to": [ 9, 16, 9.5 ], + "__comment": "Cube20", + "from": [ 6.5, 14, 10 ], + "to": [ 9.5, 15, 11 ], "faces": { - "down": { "uv": [ 7, 6.5, 9, 9.5 ], "texture": "#texture" }, - "up": { "uv": [ 7, 6.5, 9, 9.5 ], "texture": "#texture" }, - "north": { "uv": [ 7, 0, 9, 0.5 ], "texture": "#texture" }, - "south": { "uv": [ 7, 0, 9, 0.5 ], "texture": "#texture" }, - "west": { "uv": [ 6.5, 0, 9.5, 0.5 ], "texture": "#texture" }, - "east": { "uv": [ 6.5, 0, 9.5, 0.5 ], "texture": "#texture" } + "down": { "uv": [ 8, 2, 11, 3 ], "texture": "#texture" }, + "up": { "uv": [ 8, 4, 11, 5 ], "texture": "#texture" }, + "north": { "uv": [ 7, 3, 10, 4 ], "texture": "#texture" }, + "south": { "uv": [ 8, 1, 11, 2 ], "texture": "#texture" }, + "west": { "uv": [ 10, 1, 11, 2 ], "texture": "#texture" }, + "east": { "uv": [ 7, 2, 8, 3 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX21", + "from": [ 6.5, 14.5, 10 ], + "to": [ 6.501, 16, 11.5 ], + "rotation": { "origin": [ 6.5, 16, 10 ], "axis": "x", "angle": 45 }, + "faces": { + "west": { "uv": [ 9, 6, 10, 7 ], "texture": "#texture", "rotation": 90 }, + "east": { "uv": [ 5, 6, 6, 7 ], "texture": "#texture", "rotation": 270 } + } + }, + { + "__comment": "PlaneX21", + "from": [ 9.5, 14.5, 10 ], + "to": [ 9.501, 16, 11.5 ], + "rotation": { "origin": [ 9.5, 16, 10 ], "axis": "x", "angle": 45 }, + "faces": { + "west": { "uv": [ 8, 7, 9, 8 ], "texture": "#texture", "rotation": 90 }, + "east": { "uv": [ 9, 4, 10, 5 ], "texture": "#texture", "rotation": 270 } + } + }, + { + "__comment": "PlaneX24", + "from": [ 6.5, 13, 10 ], + "to": [ 6.501, 14, 11.5 ], + "rotation": { "origin": [ 6.5, 13, 10 ], "axis": "x", "angle": -45 }, + "faces": { + "west": { "uv": [ 9, 2, 10, 3 ], "texture": "#texture" }, + "east": { "uv": [ 6, 1.5, 7, 2.5 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX24", + "from": [ 9.5, 13, 10 ], + "to": [ 9.501, 14, 11.5 ], + "rotation": { "origin": [ 9.5, 13, 10 ], "axis": "x", "angle": -45 }, + "faces": { + "west": { "uv": [ 7, 3, 8, 4 ], "texture": "#texture" }, + "east": { "uv": [ 7, 3, 8, 4 ], "texture": "#texture" } } } ], @@ -92,8 +113,9 @@ "translation": [ 0, 4.1, 0 ] }, "gui": { - "rotation": [ 0, 90, 0 ], - "scale": [ 0.9, 0.9, 0.9 ] + "rotation": [ -90, 135, 90 ], + "translation": [ -0.5, -0.5, 0 ], + "scale": [ 0.95, 0.95, 0.95 ] }, "ground": { "rotation": [ 90, 90, 0 ] diff --git a/1.11/src/main/resources/assets/forgecraft/textures/items/forgehammer_iron.png b/1.11/src/main/resources/assets/forgecraft/textures/items/forgehammer_iron.png new file mode 100644 index 0000000000000000000000000000000000000000..a6f89d191aa55feca0207ff9ad737f1f90f8f22c GIT binary patch literal 474 zcmV<00VV#4P) zK~y-)U6Vc5D<2W!gA_8~E0DAA386q+-TWh#G`@ZAuWG20L))f)h{eH*Y>AjPg zxH}?(h_LVbWK(AakeR3|dY&f$nF)ZI{Vr57Gg@n?Dk1_fWgW-ys~3@pP@PNnbzP_` z5dkpw?#>v4F$SipQ%^}SGcuFRL`3HK=kvkc|M*}LF%dG8ZQB4CW6)ZgO#t5S_XMiO zdK||zsveeMsydmh@fKru$11|>y7+%p(VEa|IDl5(5iyaAVm)y8nar95fPTMU)+md5 zF)IBftvsq|bv3LID%xr~#+VNxVtO-EXsyj6Gh>YLXPgUh^&ujDb8wy~y?3^4LqsOk zbvDYE@@Zvbz4tj?MSqR0Oe-VT#;vs