From d7c4e390eadf8d2aa32f9e487e72a3e3cd7012d9 Mon Sep 17 00:00:00 2001 From: Mohammad-Ali Minaie Date: Tue, 25 Sep 2018 12:44:29 -0400 Subject: [PATCH] fixing forge --- kfc/To-Dos.md | 2 +- kfc/gradle.properties | 2 +- .../java/nmd/primal/forgecraft/ModInfo.java | 2 +- .../primal/forgecraft/tiles/TileForge.java | 44 ++++++++++--------- kfc/src/main/resources/mcmod.info | 2 +- 5 files changed, 28 insertions(+), 24 deletions(-) diff --git a/kfc/To-Dos.md b/kfc/To-Dos.md index ac522a58..60bd3e1d 100644 --- a/kfc/To-Dos.md +++ b/kfc/To-Dos.md @@ -3,7 +3,7 @@ ## Bugs ## Current Feature - +- [ ] FIX LONGBOW - [ ] Copper Tools - [ ] Craft Tweaker Support - [ ] Config Usage diff --git a/kfc/gradle.properties b/kfc/gradle.properties index a0dedd30..49416ba1 100644 --- a/kfc/gradle.properties +++ b/kfc/gradle.properties @@ -6,7 +6,7 @@ org.gradle.jvmargs=-Xmx3G mod_group=nmd.primal.forgecraft mod_name=ForgeCraft -mod_version=1.6.13 +mod_version=1.6.14 forge_version=14.23.4.2744 mcp_mappings=snapshot_20171003 mc_version=1.12.2 diff --git a/kfc/src/main/java/nmd/primal/forgecraft/ModInfo.java b/kfc/src/main/java/nmd/primal/forgecraft/ModInfo.java index b5b5b7ca..9e455a91 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/ModInfo.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/ModInfo.java @@ -18,7 +18,7 @@ public class ModInfo { //public static final String MOD_PREFIX = MOD_ID + ":"; public static final String MOD_CHANNEL = MOD_ID; - public static final String MOD_VERSION = "1.6.13"; + public static final String MOD_VERSION = "1.6.14"; public static final String MC_VERSIONS = "[1.12.0, 1.13.0)"; public static final String DEPENDENCIES = "required-after:forge@[14.21.1.2400,);" + "required-after:primal@[0.6.69,);"; diff --git a/kfc/src/main/java/nmd/primal/forgecraft/tiles/TileForge.java b/kfc/src/main/java/nmd/primal/forgecraft/tiles/TileForge.java index 54f1d1be..392136fa 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/tiles/TileForge.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/tiles/TileForge.java @@ -12,6 +12,8 @@ import nmd.primal.core.api.PrimalAPI; import nmd.primal.core.common.helper.RecipeHelper; import nmd.primal.forgecraft.blocks.machine.Forge; import nmd.primal.forgecraft.crafting.ForgeCrafting; +import nmd.primal.forgecraft.items.BaseMultiItem; +import nmd.primal.forgecraft.items.parts.ToolPart; import nmd.primal.forgecraft.util.ToolNBT; import static nmd.primal.core.api.PrimalAPI.randomCheck; @@ -210,11 +212,7 @@ public class TileForge extends TileBaseSlot implements ITickable, ToolNBT{ } if (cookCounter2 >= recipe.getIdealTime()) { ItemStack outputStack = recipe.getOutput().copy(); - if(stack.hasTagCompound()){ - outputStack.setItemDamage(stack.getItemDamage()); - outputStack.setTagCompound(stackCompound); - outputStack.getSubCompound("tags").setBoolean("hot", true); - } + outputNBTManager(stack, outputStack, stackCompound); this.setSlotStack(i, outputStack); cookCounter2 = 0; } @@ -228,11 +226,7 @@ public class TileForge extends TileBaseSlot implements ITickable, ToolNBT{ } if (cookCounter3 >= recipe.getIdealTime()) { ItemStack outputStack = recipe.getOutput().copy(); - if(stack.hasTagCompound()){ - outputStack.setItemDamage(stack.getItemDamage()); - outputStack.setTagCompound(stackCompound); - outputStack.getSubCompound("tags").setBoolean("hot", true); - } + outputNBTManager(stack, outputStack, stackCompound); this.setSlotStack(i, outputStack); cookCounter3 = 0; @@ -247,11 +241,7 @@ public class TileForge extends TileBaseSlot implements ITickable, ToolNBT{ } if (cookCounter4 >= recipe.getIdealTime()) { ItemStack outputStack = recipe.getOutput().copy(); - if(stack.hasTagCompound()){ - outputStack.setItemDamage(stack.getItemDamage()); - outputStack.setTagCompound(stackCompound); - outputStack.getSubCompound("tags").setBoolean("hot", true); - } + outputNBTManager(stack, outputStack, stackCompound); this.setSlotStack(i, outputStack); cookCounter4 = 0; } @@ -265,11 +255,7 @@ public class TileForge extends TileBaseSlot implements ITickable, ToolNBT{ } if (cookCounter5 >= recipe.getIdealTime()) { ItemStack outputStack = recipe.getOutput().copy(); - if(stack.hasTagCompound()){ - outputStack.setItemDamage(stack.getItemDamage()); - outputStack.setTagCompound(stackCompound); - outputStack.getSubCompound("tags").setBoolean("hot", true); - } + outputNBTManager(stack, outputStack, stackCompound); this.setSlotStack(i, outputStack); cookCounter5 = 0; } @@ -278,6 +264,24 @@ public class TileForge extends TileBaseSlot implements ITickable, ToolNBT{ } } + private ItemStack outputNBTManager(ItemStack stack, ItemStack outputStack, NBTTagCompound stackCompound){ + if(stack.hasTagCompound()){ + if(stack.getItem() instanceof ToolPart) { + outputStack.setItemDamage(stack.getItemDamage()); + outputStack.setTagCompound(stackCompound); + outputStack.getSubCompound("tags").setBoolean("hot", true); + return outputStack; + } + if(stack.getItem() instanceof BaseMultiItem) { + outputStack.setItemDamage(stack.getItemDamage()); + outputStack.setTagCompound(stackCompound); + outputStack.getTagCompound().setBoolean("hot", true); + return outputStack; + } + } + return null; + } + public int getHeat(){ return this.heat; } diff --git a/kfc/src/main/resources/mcmod.info b/kfc/src/main/resources/mcmod.info index fb3d51f1..09cb7b9c 100644 --- a/kfc/src/main/resources/mcmod.info +++ b/kfc/src/main/resources/mcmod.info @@ -2,7 +2,7 @@ "modid": "forgecraft", "name": "Kitsu's Forgecraft", "description": "Forged with sweat and blood", - "version": "1.6.13", + "version": "1.6.14", "mcversion": "1.12.2", "url": "", "updateUrl": "",