From 81ea23a8c997cc6a84c2b95b94fa233de33092ce Mon Sep 17 00:00:00 2001 From: Mohammad-Ali Minaie Date: Fri, 3 Feb 2017 21:43:04 -0500 Subject: [PATCH] can pull hot crucibles out of bloomery --- .../nmd/primal/forgecraft/init/ModItems.java | 18 ++- .../forgecraft/items/ItemStoneTongs.java | 29 +--- .../models/item/stonetongs_default.json | 104 +++++++++++++- .../models/item/stonetongs_default2.json | 9 ++ .../models/item/stonetongs_emptyhot.json | 127 +++++++++++++++++- 5 files changed, 250 insertions(+), 37 deletions(-) create mode 100644 1.11/src/main/resources/assets/forgecraft/models/item/stonetongs_default2.json diff --git a/1.11/src/main/java/nmd/primal/forgecraft/init/ModItems.java b/1.11/src/main/java/nmd/primal/forgecraft/init/ModItems.java index 03f9149f..54154e2e 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/init/ModItems.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/init/ModItems.java @@ -49,18 +49,22 @@ public class ModItems { } public static void registerCustomRenders(){ - ModelBakery.registerItemVariants(ModItems.stonetongs, ModItems.stonetongs.getRegistryName(), new ResourceLocation(ModInfo.MOD_ID, "stonetongs")); + ModelBakery.registerItemVariants(ModItems.stonetongs, ModItems.stonetongs.getRegistryName(), + new ResourceLocation(ModInfo.MOD_ID, "stonetongs"), + new ResourceLocation(ModInfo.MOD_ID, "stonetongs_default"), + new ResourceLocation(ModInfo.MOD_ID, "stonetongs_emptyhot")); ModelLoader.setCustomMeshDefinition(ModItems.stonetongs, new ItemMeshDefinition() { @Override public ModelResourceLocation getModelLocation(ItemStack stack) { if (stack.hasTagCompound()) { - //if (stack.getTagCompound().getInteger("type")) { - if (stack.getTagCompound().getInteger("type") == 0 ){ - return new ModelResourceLocation(stack.getItem().getRegistryName() + "_default"); - } else { - return new ModelResourceLocation(stack.getItem().getRegistryName(), "inventory"); - } + if (stack.getTagCompound().getInteger("type") == 0 ){ + return new ModelResourceLocation(stack.getItem().getRegistryName() + "_default", "inventory"); + } + else if (stack.getTagCompound().getInteger("type") == 1 ) { + return new ModelResourceLocation(stack.getItem().getRegistryName() + "_emptyhot", "inventory"); + } + else return new ModelResourceLocation(stack.getItem().getRegistryName(), "inventory"); } return new ModelResourceLocation(stack.getItem().getRegistryName(), "inventory"); } diff --git a/1.11/src/main/java/nmd/primal/forgecraft/items/ItemStoneTongs.java b/1.11/src/main/java/nmd/primal/forgecraft/items/ItemStoneTongs.java index 596fa17c..b7452fd7 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/items/ItemStoneTongs.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/items/ItemStoneTongs.java @@ -49,29 +49,6 @@ public class ItemStoneTongs extends Item { } } - /* //For Subtypes - @Override - public String getUnlocalizedName(ItemStack stack) { - for(int i = 0; i < TongTypes.values().length; i++) { - if(stack.getItemDamage() == i) { - return this.getUnlocalizedName() + "." + TongTypes.values()[i].getName(); - } - else { - continue; - } - } - return this.getUnlocalizedName() + "." + TongTypes.DEFAULT.getName(); - } - - @SideOnly(Side.CLIENT) - @Override - public void getSubItems(Item item, CreativeTabs tab, NonNullList items) { - for(int i = 0; i < TongTypes.values().length; i++) { - items.add(new ItemStack(item, 1, i)); - } - } - */ - public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { //pos = pos.offset(facing); @@ -81,7 +58,11 @@ public class ItemStoneTongs extends Item { TileBloomery tile = (TileBloomery) world.getTileEntity(pos); System.out.println(tile.getSlotStack(1)); //itemstack.damageItem(1, player); - return EnumActionResult.SUCCESS; + if(tile.getSlotStack(1).getItem().equals(Item.getItemFromBlock(ModBlocks.emptycruciblehot))){ + itemstack.getTagCompound().setInteger("type", 1); + tile.setSlotStack(1, ItemStack.EMPTY); + return EnumActionResult.SUCCESS; + } else return EnumActionResult.FAIL; } else return EnumActionResult.FAIL; } diff --git a/1.11/src/main/resources/assets/forgecraft/models/item/stonetongs_default.json b/1.11/src/main/resources/assets/forgecraft/models/item/stonetongs_default.json index 75a38d2b..2e4eddf1 100644 --- a/1.11/src/main/resources/assets/forgecraft/models/item/stonetongs_default.json +++ b/1.11/src/main/resources/assets/forgecraft/models/item/stonetongs_default.json @@ -1,9 +1,109 @@ { - "forge_marker":1, + "__comment": "Designed by Kitsushadow with Cubik Studio - https://cubik.studio", "textures": { "particle": "blocks/planks_oak", "texture": "blocks/planks_oak", "texture1": "forgecraft:blocks/stone_slab" }, - "parent": "forgecraft:item/stonetongs" + "elements": [ + { + "__comment": "Cube1", + "from": [ 4, 0, 0 ], + "to": [ 5, 1, 3 ], + "faces": { + "down": { "uv": [ 4, 12, 5, 15 ], "texture": "#texture1" }, + "up": { "uv": [ 4, 1, 5, 4 ], "texture": "#texture1" }, + "north": { "uv": [ 11, 13, 12, 14 ], "texture": "#texture1" }, + "south": { "uv": [ 4, 13, 5, 14 ], "texture": "#texture1" }, + "west": { "uv": [ 1, 14, 4, 15 ], "texture": "#texture1" }, + "east": { "uv": [ 12, 14, 15, 15 ], "texture": "#texture1" } + } + }, + { + "__comment": "Cube2", + "from": [ 11, 0, 0 ], + "to": [ 12, 1, 3 ], + "faces": { + "down": { "uv": [ 4, 12, 5, 15 ], "texture": "#texture1" }, + "up": { "uv": [ 4, 1, 5, 4 ], "texture": "#texture1" }, + "north": { "uv": [ 11, 13, 12, 14 ], "texture": "#texture1" }, + "south": { "uv": [ 4, 13, 5, 14 ], "texture": "#texture1" }, + "west": { "uv": [ 1, 14, 4, 15 ], "texture": "#texture1" }, + "east": { "uv": [ 12, 14, 15, 15 ], "texture": "#texture1" } + } + }, + { + "__comment": "Cube3", + "from": [ 4, 0, 3 ], + "to": [ 5, 1, 10 ], + "rotation": { "origin": [ 4, 0, 3 ], "axis": "y", "angle": 45 }, + "faces": { + "down": { "uv": [ 4, 2, 5, 9 ], "texture": "#texture" }, + "up": { "uv": [ 4, 3, 5, 10 ], "texture": "#texture" }, + "north": { "uv": [ 11, 15, 12, 16 ], "texture": "#texture" }, + "south": { "uv": [ 4, 15, 5, 16 ], "texture": "#texture" }, + "west": { "uv": [ 3, 15, 10, 16 ], "texture": "#texture" }, + "east": { "uv": [ 7, 15, 14, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "Cube4", + "from": [ 11, 0, 3 ], + "to": [ 12, 1, 10 ], + "rotation": { "origin": [ 12, 1, 3 ], "axis": "y", "angle": -45 }, + "faces": { + "down": { "uv": [ 4, 2, 5, 9 ], "texture": "#texture" }, + "up": { "uv": [ 4, 3, 5, 10 ], "texture": "#texture" }, + "north": { "uv": [ 11, 15, 12, 16 ], "texture": "#texture" }, + "south": { "uv": [ 4, 15, 5, 16 ], "texture": "#texture" }, + "west": { "uv": [ 3, 15, 10, 16 ], "texture": "#texture" }, + "east": { "uv": [ 7, 15, 14, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "Cube5", + "from": [ 6.5, 0, 7.5 ], + "to": [ 7.5, 1, 16 ], + "faces": { + "down": { "uv": [ 6.5, 0, 7.5, 8.5 ], "texture": "#texture" }, + "up": { "uv": [ 6.5, 7.5, 7.5, 16 ], "texture": "#texture" }, + "north": { "uv": [ 8.5, 15, 9.5, 16 ], "texture": "#texture" }, + "south": { "uv": [ 6.5, 15, 7.5, 16 ], "texture": "#texture" }, + "west": { "uv": [ 7.5, 15, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 15, 8.5, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "Cube6", + "from": [ 8.5, 0, 7.5 ], + "to": [ 9.5, 1, 16 ], + "faces": { + "down": { "uv": [ 8.5, 0, 9.5, 8.5 ], "texture": "#texture" }, + "up": { "uv": [ 8.5, 7.5, 9.5, 16 ], "texture": "#texture" }, + "north": { "uv": [ 6.5, 15, 7.5, 16 ], "texture": "#texture" }, + "south": { "uv": [ 8.5, 15, 9.5, 16 ], "texture": "#texture" }, + "west": { "uv": [ 7.5, 15, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 15, 8.5, 16 ], "texture": "#texture" } + } + } + ], + "display": { + "thirdperson_righthand": { + "translation": [ 0, 5.5, -7 ] + }, + "firstperson_righthand": { + "translation": [ 0, 5.5, -7 ] + }, + "gui": { + "rotation": [ 90, 0, 0 ], + "scale": [ 0.95, 0.95, 0.95 ] + }, + "ground": { + "translation": [ 0, 4, 0 ] + }, + "fixed": { + "rotation": [ 90, 0, 0 ], + "translation": [ 0, 0, 8 ] + } + } } \ No newline at end of file diff --git a/1.11/src/main/resources/assets/forgecraft/models/item/stonetongs_default2.json b/1.11/src/main/resources/assets/forgecraft/models/item/stonetongs_default2.json new file mode 100644 index 00000000..75a38d2b --- /dev/null +++ b/1.11/src/main/resources/assets/forgecraft/models/item/stonetongs_default2.json @@ -0,0 +1,9 @@ +{ + "forge_marker":1, + "textures": { + "particle": "blocks/planks_oak", + "texture": "blocks/planks_oak", + "texture1": "forgecraft:blocks/stone_slab" + }, + "parent": "forgecraft:item/stonetongs" +} \ No newline at end of file diff --git a/1.11/src/main/resources/assets/forgecraft/models/item/stonetongs_emptyhot.json b/1.11/src/main/resources/assets/forgecraft/models/item/stonetongs_emptyhot.json index 2e4eddf1..30292aef 100644 --- a/1.11/src/main/resources/assets/forgecraft/models/item/stonetongs_emptyhot.json +++ b/1.11/src/main/resources/assets/forgecraft/models/item/stonetongs_emptyhot.json @@ -1,9 +1,10 @@ { "__comment": "Designed by Kitsushadow with Cubik Studio - https://cubik.studio", "textures": { - "particle": "blocks/planks_oak", - "texture": "blocks/planks_oak", - "texture1": "forgecraft:blocks/stone_slab" + "particle": "forgecraft:blocks/stone_slab", + "texture": "forgecraft:blocks/stone_slab", + "texture1": "forgecraft:blocks/stone_slab", + "texture2": "forgecraft:blocks/stone_slab_hot" }, "elements": [ { @@ -85,11 +86,129 @@ "west": { "uv": [ 7.5, 15, 16, 16 ], "texture": "#texture" }, "east": { "uv": [ 0, 15, 8.5, 16 ], "texture": "#texture" } } + }, + { + "__comment": "Cube1", + "from": [ 5, -4, -3 ], + "to": [ 11, -3, 3 ], + "faces": { + "down": { "uv": [ 5, 5, 11, 11 ], "texture": "#texture2" }, + "up": { "uv": [ 5, 5, 11, 11 ], "texture": "#texture2" }, + "north": { "uv": [ 5, 15, 11, 16 ], "texture": "#texture2" }, + "south": { "uv": [ 5, 15, 11, 16 ], "texture": "#texture2" }, + "west": { "uv": [ 5, 15, 11, 16 ], "texture": "#texture2" }, + "east": { "uv": [ 5, 15, 11, 16 ], "texture": "#texture2" } + } + }, + { + "__comment": "Cube11", + "from": [ 5, -3, -3 ], + "to": [ 11, 3, -2 ], + "faces": { + "down": { "uv": [ 5, 10, 11, 11 ], "texture": "#texture2" }, + "up": { "uv": [ 5, 5, 11, 6 ], "texture": "#texture2" }, + "north": { "uv": [ 5, 9, 11, 15 ], "texture": "#texture2" }, + "south": { "uv": [ 5, 9, 11, 15 ], "texture": "#texture2" }, + "west": { "uv": [ 5, 9, 6, 15 ], "texture": "#texture2" }, + "east": { "uv": [ 10, 9, 11, 15 ], "texture": "#texture2" } + } + }, + { + "__comment": "Cube11", + "from": [ 5, -3, 2 ], + "to": [ 11, 3, 3 ], + "faces": { + "down": { "uv": [ 5, 10, 11, 11 ], "texture": "#texture2" }, + "up": { "uv": [ 5, 5, 11, 6 ], "texture": "#texture2" }, + "north": { "uv": [ 5, 9, 11, 15 ], "texture": "#texture2" }, + "south": { "uv": [ 5, 9, 11, 15 ], "texture": "#texture2" }, + "west": { "uv": [ 5, 9, 6, 15 ], "texture": "#texture2" }, + "east": { "uv": [ 10, 9, 11, 15 ], "texture": "#texture2" } + } + }, + { + "__comment": "Cube13", + "from": [ 5, -3, -2 ], + "to": [ 6, 3, 2 ], + "faces": { + "down": { "uv": [ 5, 6, 6, 10 ], "texture": "#texture2" }, + "up": { "uv": [ 5, 6, 6, 10 ], "texture": "#texture2" }, + "north": { "uv": [ 10, 9, 11, 15 ], "texture": "#texture2" }, + "south": { "uv": [ 5, 9, 6, 15 ], "texture": "#texture2" }, + "west": { "uv": [ 6, 9, 10, 15 ], "texture": "#texture2" }, + "east": { "uv": [ 6, 9, 10, 15 ], "texture": "#texture2" } + } + }, + { + "__comment": "Cube13", + "from": [ 10, -3, -2 ], + "to": [ 11, 3, 2 ], + "faces": { + "down": { "uv": [ 5, 6, 6, 10 ], "texture": "#texture2" }, + "up": { "uv": [ 5, 6, 6, 10 ], "texture": "#texture2" }, + "north": { "uv": [ 10, 9, 11, 15 ], "texture": "#texture2" }, + "south": { "uv": [ 5, 9, 6, 15 ], "texture": "#texture2" }, + "west": { "uv": [ 6, 9, 10, 15 ], "texture": "#texture2" }, + "east": { "uv": [ 6, 9, 10, 15 ], "texture": "#texture2" } + } + }, + { + "__comment": "Cube15", + "from": [ 4, 1, -2 ], + "to": [ 5, 2, 2 ], + "faces": { + "down": { "uv": [ 4, 6, 5, 10 ], "texture": "#texture2" }, + "up": { "uv": [ 4, 6, 5, 10 ], "texture": "#texture2" }, + "north": { "uv": [ 11, 10, 12, 11 ], "texture": "#texture2" }, + "south": { "uv": [ 4, 10, 5, 11 ], "texture": "#texture2" }, + "west": { "uv": [ 6, 10, 10, 11 ], "texture": "#texture2" }, + "east": { "uv": [ 6, 10, 10, 11 ], "texture": "#texture2" } + } + }, + { + "__comment": "Cube15", + "from": [ 11, 1, -2 ], + "to": [ 12, 2, 2 ], + "faces": { + "down": { "uv": [ 4, 6, 5, 10 ], "texture": "#texture2" }, + "up": { "uv": [ 4, 6, 5, 10 ], "texture": "#texture2" }, + "north": { "uv": [ 11, 10, 12, 11 ], "texture": "#texture2" }, + "south": { "uv": [ 4, 10, 5, 11 ], "texture": "#texture2" }, + "west": { "uv": [ 6, 10, 10, 11 ], "texture": "#texture2" }, + "east": { "uv": [ 6, 10, 10, 11 ], "texture": "#texture2" } + } + }, + { + "__comment": "Cube17", + "from": [ 6, 1, -4 ], + "to": [ 10, 2, -3 ], + "faces": { + "down": { "uv": [ 6, 11, 10, 12 ], "texture": "#texture2" }, + "up": { "uv": [ 6, 4, 10, 5 ], "texture": "#texture2" }, + "north": { "uv": [ 6, 10, 10, 11 ], "texture": "#texture2" }, + "south": { "uv": [ 6, 10, 10, 11 ], "texture": "#texture2" }, + "west": { "uv": [ 4, 10, 5, 11 ], "texture": "#texture2" }, + "east": { "uv": [ 11, 10, 12, 11 ], "texture": "#texture2" } + } + }, + { + "__comment": "Cube18", + "from": [ 6, 1, 3 ], + "to": [ 10, 2, 4 ], + "faces": { + "down": { "uv": [ 6, 4, 10, 5 ], "texture": "#texture2" }, + "up": { "uv": [ 6, 11, 10, 12 ], "texture": "#texture2" }, + "north": { "uv": [ 6, 10, 10, 11 ], "texture": "#texture2" }, + "south": { "uv": [ 6, 10, 10, 11 ], "texture": "#texture2" }, + "west": { "uv": [ 11, 10, 12, 11 ], "texture": "#texture2" }, + "east": { "uv": [ 4, 10, 5, 11 ], "texture": "#texture2" } + } } ], "display": { "thirdperson_righthand": { - "translation": [ 0, 5.5, -7 ] + "rotation": [60, 0, 0], + "translation": [ 0, 8.9, 3.7 ] }, "firstperson_righthand": { "translation": [ 0, 5.5, -7 ]