diff --git a/kfc/gradle.properties b/kfc/gradle.properties index e9226ddf..a0dedd30 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.10 +mod_version=1.6.13 forge_version=14.23.4.2744 mcp_mappings=snapshot_20171003 mc_version=1.12.2 diff --git a/kfc/nbtCrucible-To-Dos.md b/kfc/nbtCrucible-To-Dos.md index 54d2579c..b4611355 100644 --- a/kfc/nbtCrucible-To-Dos.md +++ b/kfc/nbtCrucible-To-Dos.md @@ -11,44 +11,18 @@ make a copy of it somewhere, it doenst need to be instantiated or anything, the for your setRecipeName include your mod id like .setRecipeName(KFC.MOD_ID, "soft_crucible")); you'll need to update the annotation @GameRegistry.ObjectHolder(ModInfo.MOD_ID) with your mod id also +- [x] Fix Plate Crafting +- [x] Longbow animation +- [x] Fix Forge Cool Down +- [x] Fix Forge StackTagCompound management +- [x] ForgeHammer Recipes + - [ ] Leather Helmet Inventory Model - [ ] Config Usage - [ ] Craft Tweaker Support - [ ] Apply Forge turn off logic to Bloomery - [ ] Copper Tools - [ ] Config for lowering fortune multiplier -- [x] Bronze Plate Cast -- [x] JEI Support -- [x] Update SoftCrucible Model -- [x] Crucibles were returning input ingredients even after cooked -- [x] Hot Crucible doesn't have hot molten layer -- [x] Can't add upgrades to the anvil -- [x] Steel Plate Recipe #37 -- [x] Damascus Recipes -- [x] Damascus Weapons -- [x] Need Recipe for Soft Crucible -- [x] Make Wootz Weapons -- [x] Crucible is not resetting after iron is removed. -- [x] Chunk and Ball stacking -- [x] Delete unused models, blockstates, and textures -- [x] Inventory version of balls have the same texture -- [x] Wootz Chunk Model -- [x] Casting Mud Texture -- [x] Adobe Bloomery Texture -- [x] Adobe Forge Texture -- [x] Update nbt Crucible Models with open top -- [x] Update all slotted tong models -- [x] Inventory model for nbtCrucible -- [x] Tongs hot Texture -- [x] Casting Block line 103 -- [x] Bloomery rendering all messed up -- [x] Update Casting recipes to use new slotted tongs and nbtCrucible -- [x] NBT Crucible -- [x] NBT Crucible Recipes -- [x] Slotted Tongs -- [x] Item Crucible -- [x] NBTCrucible to ItemCrucible transformer -- [x] StoneTongs ItemCrucible to NBTCrucible transformer ## Feature Musket - [ ] Create powder charge item (copper, charcoal, gunpowder) @@ -81,6 +55,38 @@ rename s/iron/steel/ iron* ``` ### Completed +- [x] Bronze Plate Cast +- [x] JEI Support +- [x] Update SoftCrucible Model +- [x] Crucibles were returning input ingredients even after cooked +- [x] Hot Crucible doesn't have hot molten layer +- [x] Can't add upgrades to the anvil +- [x] Steel Plate Recipe #37 +- [x] Damascus Recipes +- [x] Damascus Weapons +- [x] Need Recipe for Soft Crucible +- [x] Make Wootz Weapons +- [x] Crucible is not resetting after iron is removed. +- [x] Chunk and Ball stacking +- [x] Delete unused models, blockstates, and textures +- [x] Inventory version of balls have the same texture +- [x] Wootz Chunk Model +- [x] Casting Mud Texture +- [x] Adobe Bloomery Texture +- [x] Adobe Forge Texture +- [x] Update nbt Crucible Models with open top +- [x] Update all slotted tong models +- [x] Inventory model for nbtCrucible +- [x] Tongs hot Texture +- [x] Casting Block line 103 +- [x] Bloomery rendering all messed up +- [x] Update Casting recipes to use new slotted tongs and nbtCrucible +- [x] NBT Crucible +- [x] NBT Crucible Recipes +- [x] Slotted Tongs +- [x] Item Crucible +- [x] NBTCrucible to ItemCrucible transformer +- [x] StoneTongs ItemCrucible to NBTCrucible transformer - [x] BlockBreaker Support for copper dust and tin dust - [x] picking up raw bronze crucible returns some other shit - [x] Tool breaking should return tool head diff --git a/kfc/src/main/java/nmd/primal/forgecraft/ModInfo.java b/kfc/src/main/java/nmd/primal/forgecraft/ModInfo.java index 9b00d516..b5b5b7ca 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.10"; + public static final String MOD_VERSION = "1.6.13"; 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/blocks/machine/BloomeryBase.java b/kfc/src/main/java/nmd/primal/forgecraft/blocks/machine/BloomeryBase.java index 2e260ee6..de30270e 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/blocks/machine/BloomeryBase.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/blocks/machine/BloomeryBase.java @@ -202,6 +202,7 @@ public class BloomeryBase extends CustomContainerFacing implements ITileEntityPr IItemHandler inventory = pItem.getCapability(ITEM_HANDLER, null); ItemStack slotStack = inventory.getStackInSlot(0).copy(); + SlottedTongs itemstackItem = (SlottedTongs) pItem.getItem(); //SlottedTongs temp = (SlottedTongs) pItem.getItem(); if (!pItem.isEmpty() && tile.isItemValidForSlot(1, slotStack)) { @@ -212,8 +213,8 @@ public class BloomeryBase extends CustomContainerFacing implements ITileEntityPr ItemStack place_stack = slotStack.copy(); //if (tile.putStack(slot, place_stack)) - tile.setSlotStack(1, place_stack); - inventory.insertItem(0, ItemStack.EMPTY, false); + tile.setSlotStack(1, inventory.extractItem(0, 1, false)); + itemstackItem.markDirty(pItem); return true; } } @@ -223,6 +224,7 @@ public class BloomeryBase extends CustomContainerFacing implements ITileEntityPr IItemHandler inventory = pItem.getCapability(ITEM_HANDLER, null); ItemStack slotStack = inventory.getStackInSlot(0).copy(); + SlottedTongs itemstackItem = (SlottedTongs) pItem.getItem(); //SlottedTongs temp = (SlottedTongs) pItem.getItem(); @@ -235,6 +237,7 @@ public class BloomeryBase extends CustomContainerFacing implements ITileEntityPr if(inventory.getStackInSlot(0).isEmpty()){ inventory.insertItem(0, place_stack, false); tile.setSlotStack(1, ItemStack.EMPTY); + itemstackItem.markDirty(pItem); return true; } } diff --git a/kfc/src/main/java/nmd/primal/forgecraft/blocks/machine/Forge.java b/kfc/src/main/java/nmd/primal/forgecraft/blocks/machine/Forge.java index 4026161f..3277257a 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/blocks/machine/Forge.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/blocks/machine/Forge.java @@ -255,7 +255,7 @@ public class Forge extends CustomContainerFacing implements ITileEntityProvider, public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing()).withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2); - System.out.println(placer.getHorizontalFacing()); + //System.out.println(placer.getHorizontalFacing()); } @Override diff --git a/kfc/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java b/kfc/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java index 03df9d9b..64606673 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java @@ -277,6 +277,18 @@ public class ModCrafting{ 1100, 800); + CrucibleCrafting.addRecipe( + Ingredient.fromStacks(new ItemStack(ModItems.brokenwroughtirontool, 1)), + Ingredient.EMPTY, + Ingredient.EMPTY, + Ingredient.EMPTY, + Ingredient.EMPTY, + new ItemStack(PrimalAPI.Items.SLAG, 1), + new ItemStack(ModItems.ironingotball, 1), + 1250, + 1100, + 800); + CrucibleCrafting.addRecipe( new OreIngredient("dustIron"), Ingredient.fromStacks(new ItemStack(PrimalAPI.Items.CARBONATE_SLACK, 1)), @@ -289,6 +301,18 @@ public class ModCrafting{ 1200, 800); + CrucibleCrafting.addRecipe( + Ingredient.fromStacks(new ItemStack(ModItems.brokencleanirontool, 1)), + new OreIngredient("nuggetIron"), + Ingredient.EMPTY, + Ingredient.EMPTY, + Ingredient.EMPTY, + new ItemStack(PrimalAPI.Items.SLAG, 1), + new ItemStack(ModItems.ironcleaningotball, 1), + 1550, + 1200, + 800); + CrucibleCrafting.addRecipe( Ingredient.fromStacks(new ItemStack(ModItems.ironcleaningotball, 1)), Ingredient.fromStacks(new ItemStack(PrimalAPI.Items.CHARCOAL_HIGH, 1)), @@ -301,6 +325,18 @@ public class ModCrafting{ 1500, 1000); + CrucibleCrafting.addRecipe( + Ingredient.fromStacks(new ItemStack(ModItems.brokensteeltool, 1)), + new OreIngredient("nuggetSteel"), + Ingredient.EMPTY, + Ingredient.EMPTY, + Ingredient.EMPTY, + new ItemStack(PrimalAPI.Items.SLAG, 1), + new ItemStack(ModItems.steelingotball, 1), + 2100, + 1500, + 1000); + CrucibleCrafting.addRecipe( new OreIngredient("dustMagnetite"), Ingredient.fromStacks(new ItemStack(Blocks.LEAVES, 1, BlockPlanks.EnumType.JUNGLE.getMetadata())), @@ -325,6 +361,19 @@ public class ModCrafting{ 1800, 1500); + CrucibleCrafting.addRecipe( + Ingredient.fromStacks(new ItemStack(ModItems.brokenwootztool, 1)), + new OreIngredient("nuggetWootz"), + Ingredient.EMPTY, + Ingredient.EMPTY, + Ingredient.EMPTY, + new ItemStack(PrimalAPI.Items.SLAG, 1), + new ItemStack(ModItems.wootzingotball, 1), + 2100, + 1800, + 1500); + +//TODO change plate recipe NBTTagCompound tagBronzeDefault = new NBTTagCompound(); tagBronzeDefault.setString("upgrades", ""); @@ -1064,9 +1113,9 @@ public class ModCrafting{ new ItemStack(ModItems.bronzeingotball, 1), new Item[] { muddd,muddd,muddd,muddd,muddd, - muddd,muddd,muddd,muddd,muddd, - muddd,empty,empty,muddd,muddd, - muddd,empty,empty,muddd,muddd, + muddd,empty,empty,empty,muddd, + muddd,empty,empty,empty,muddd, + muddd,empty,empty,empty,muddd, muddd,muddd,muddd,muddd,muddd }, new ItemStack(PrimalAPI.Items.BRONZE_PLATE, 1) ); @@ -1080,7 +1129,7 @@ public class ModCrafting{ ModItems.ironingotball, //800, 200 hotIronIngot, - 100, + 800, 100, 500, 1.0f, @@ -1355,6 +1404,42 @@ public class ModCrafting{ "null" ); + /*** ForgeHammer ***/ + AnvilCrafting.addRecipe( + new ItemStack [] { + emptyAir,hotCleanChunk,hotCleanChunk,hotCleanChunk,emptyAir, + emptyAir,hotCleanChunk,hotCleanChunk,emptyAir,emptyAir, + emptyAir,emptyAir,hotCleanChunk,emptyAir,emptyAir, + emptyAir,emptyAir,hotCleanChunk,emptyAir,emptyAir, + emptyAir,emptyAir,hotCleanChunk,emptyAir,emptyAir }, + new ItemStack(ModItems.forgehammer, 1), + "null" + ); + + /*** ForgeHammer ***/ + AnvilCrafting.addRecipe( + new ItemStack [] { + emptyAir,hotSteelChunk,hotSteelChunk,hotSteelChunk,emptyAir, + emptyAir,hotSteelChunk,hotSteelChunk,emptyAir,emptyAir, + emptyAir,emptyAir,hotSteelChunk,emptyAir,emptyAir, + emptyAir,emptyAir,hotSteelChunk,emptyAir,emptyAir, + emptyAir,emptyAir,hotSteelChunk,emptyAir,emptyAir }, + new ItemStack(ModItems.forgehammer, 1), + "null" + ); + + /*** ForgeHammer ***/ + AnvilCrafting.addRecipe( + new ItemStack [] { + emptyAir,hotWootzChunk,hotWootzChunk,hotWootzChunk,emptyAir, + emptyAir,hotWootzChunk,hotWootzChunk,emptyAir,emptyAir, + emptyAir,emptyAir,hotWootzChunk,emptyAir,emptyAir, + emptyAir,emptyAir,hotWootzChunk,emptyAir,emptyAir, + emptyAir,emptyAir,hotWootzChunk,emptyAir,emptyAir }, + new ItemStack(ModItems.forgehammer, 1), + "null" + ); + /*** Bucket ***/ AnvilCrafting.addRecipe( new ItemStack [] { @@ -1371,9 +1456,21 @@ public class ModCrafting{ AnvilCrafting.addRecipe( new ItemStack [] { emptyAir,emptyAir,emptyAir,emptyAir,emptyAir, + emptyAir,hotChunk,hotChunk,hotChunk,emptyAir, + emptyAir,hotChunk,hotChunk,hotChunk,emptyAir, + emptyAir,hotChunk,hotChunk,hotChunk,emptyAir, + emptyAir,emptyAir,emptyAir,emptyAir,emptyAir }, + new ItemStack(PrimalAPI.Items.IRON_PLATE, 1), + "null" + ); + + /*** Primal Plate ***/ + AnvilCrafting.addRecipe( + new ItemStack [] { emptyAir,emptyAir,emptyAir,emptyAir,emptyAir, - emptyAir,hotChunk,hotChunk,emptyAir,emptyAir, - emptyAir,hotChunk,hotChunk,emptyAir,emptyAir, + emptyAir,hotCleanChunk,hotCleanChunk,hotCleanChunk,emptyAir, + emptyAir,hotCleanChunk,hotCleanChunk,hotCleanChunk,emptyAir, + emptyAir,hotCleanChunk,hotCleanChunk,hotCleanChunk,emptyAir, emptyAir,emptyAir,emptyAir,emptyAir,emptyAir }, new ItemStack(PrimalAPI.Items.IRON_PLATE, 1), "null" @@ -1383,9 +1480,23 @@ public class ModCrafting{ AnvilCrafting.addRecipe( new ItemStack [] { emptyAir,emptyAir,emptyAir,emptyAir,emptyAir, + emptyAir,hotSteelChunk,hotSteelChunk,hotSteelChunk,emptyAir, + emptyAir,hotSteelChunk,hotSteelChunk,hotSteelChunk,emptyAir, + emptyAir,hotSteelChunk,hotSteelChunk,hotSteelChunk,emptyAir, + emptyAir,emptyAir,emptyAir,emptyAir,emptyAir }, + new ItemStack(PrimalAPI.Items.STEEL_PLATE, 1), + "null" + ); + + + + /*** Steel Plate ***/ + AnvilCrafting.addRecipe( + new ItemStack [] { emptyAir,emptyAir,emptyAir,emptyAir,emptyAir, - emptyAir,hotSteelChunk,hotSteelChunk,emptyAir,emptyAir, - emptyAir,hotSteelChunk,hotSteelChunk,emptyAir,emptyAir, + emptyAir,hotWootzChunk,hotWootzChunk,hotWootzChunk,emptyAir, + emptyAir,hotWootzChunk,hotWootzChunk,hotWootzChunk,emptyAir, + emptyAir,hotWootzChunk,hotWootzChunk,hotWootzChunk,emptyAir, emptyAir,emptyAir,emptyAir,emptyAir,emptyAir }, new ItemStack(PrimalAPI.Items.STEEL_PLATE, 1), "null" @@ -1865,7 +1976,7 @@ public class ModCrafting{ AnvilCrafting.addRecipe( new ItemStack [] { emptyAir,emptyAir,emptyAir,emptyAir,emptyAir, - emptyAir,emptyAir,hotChunk,emptyAir,emptyAir, + emptyAir,emptyAir,hotCleanChunk,emptyAir,emptyAir, emptyAir,emptyAir,cleanaxehead,emptyAir,emptyAir, emptyAir,emptyAir,emptyAir,emptyAir,emptyAir, emptyAir,emptyAir,emptyAir,emptyAir,emptyAir }, diff --git a/kfc/src/main/java/nmd/primal/forgecraft/items/BaseMultiItem.java b/kfc/src/main/java/nmd/primal/forgecraft/items/BaseMultiItem.java index 1615da42..c0f7667b 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/items/BaseMultiItem.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/items/BaseMultiItem.java @@ -189,7 +189,7 @@ public class BaseMultiItem extends BaseItem { if (stack.getTagCompound().getBoolean("hot")) { player.setFire(1); } - if (PrimalAPI.randomCheck(50)) { + if (PrimalAPI.randomCheck(10)) { stack.getTagCompound().setBoolean("hot", false); player.getEntityWorld().playSound(null, player.getPosition(), SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F); } @@ -200,22 +200,32 @@ public class BaseMultiItem extends BaseItem { @Override public boolean onEntityItemUpdate(net.minecraft.entity.item.EntityItem entityItem) { - if(entityItem.isWet()){ - if(entityItem.getItem().hasTagCompound()) { - if(entityItem.getItem().getTagCompound().getBoolean("hot")){ - entityItem.getItem().getTagCompound().setBoolean("hot", false); - entityItem.getEntityWorld().playSound(null, entityItem.getPosition(), SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F); + if(!entityItem.getEntityWorld().isRemote) { + if (entityItem.getItem().hasTagCompound()) { + if (entityItem.isWet()) { + if (entityItem.getItem().getTagCompound().getBoolean("hot")) { + entityItem.getItem().getTagCompound().setBoolean("hot", false); + entityItem.getEntityWorld().playSound(null, entityItem.getPosition(), SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F); + return true; + } + } + /* + if (!entityItem.isWet()) { + if (entityItem.getItem().getTagCompound().getBoolean("hot")) { + FireHelper.setFire(entityItem.getEntityWorld(), entityItem.getPosition()); return true; } } - } - if(!entityItem.isWet()){ - if(entityItem.getItem().getTagCompound().getBoolean("hot")) { - FireHelper.setFire(entityItem.getEntityWorld(), entityItem.getPosition()); - return true; + */ + if (PrimalAPI.randomCheck(10)) { + if (entityItem.getItem().getTagCompound().getBoolean("hot")) { + entityItem.getItem().getTagCompound().setBoolean("hot", false); + entityItem.getEntityWorld().playSound(null, entityItem.getPosition(), SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F); + return true; + } + } } } - return false; } diff --git a/kfc/src/main/java/nmd/primal/forgecraft/items/SlottedTongs.java b/kfc/src/main/java/nmd/primal/forgecraft/items/SlottedTongs.java index 76d65cdb..6771b4a5 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/items/SlottedTongs.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/items/SlottedTongs.java @@ -1,20 +1,18 @@ package nmd.primal.forgecraft.items; -import com.mojang.realmsclient.gui.ChatFormatting; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.SoundEvents; +import net.minecraft.inventory.ItemStackHelper; import net.minecraft.item.IItemPropertyGetter; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; -//TODO remove wildcard import import net.minecraft.util.*; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -25,7 +23,6 @@ import net.minecraftforge.common.capabilities.ICapabilitySerializable; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemStackHandler; import nmd.primal.core.api.PrimalAPI; @@ -43,7 +40,6 @@ import nmd.primal.forgecraft.items.blocks.ItemNBTCrucible; import nmd.primal.forgecraft.items.parts.ToolPart; import nmd.primal.forgecraft.tiles.TileNBTCrucible; import nmd.primal.forgecraft.util.AnvilHandler; -import org.lwjgl.Sys; import javax.annotation.Nullable; import java.util.List; @@ -57,7 +53,6 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{ @CapabilityInject(IItemHandler.class) public static Capability ITEM_HANDLER; - //public static CapabilityItemHandler ITEM_HANDLER; public SlottedTongs(String unlocalizedName) { this.setUnlocalizedName(unlocalizedName); @@ -70,223 +65,220 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{ @SideOnly(Side.CLIENT) public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) { - - - IItemHandler inventory = stack.getCapability(ITEM_HANDLER, null); - ItemStack slotStack = inventory.getStackInSlot(0); - + NonNullList renderList = NonNullList.withSize(1, ItemStack.EMPTY); if(stack.getTagCompound() != null){ - System.out.println(slotStack); - } - //System.out.println(slotStack); - if (stack.getItem() instanceof SlottedTongs) { - if (slotStack.getItem() instanceof ItemNBTCrucible) { - /***Render Empty Crucible***/ - if(inventory.getStackInSlot(0).getSubCompound("BlockEntityTag").getInteger("hot") == 0){ - return 0.99f; + ItemStackHelper.loadAllItems(stack.getTagCompound(), renderList); + ItemStack slotStack = renderList.get(0); + + if (stack.getItem() instanceof SlottedTongs) { + if (slotStack.getItem() instanceof ItemNBTCrucible) { + /***Render Empty Crucible***/ + if (slotStack.getSubCompound("BlockEntityTag").getInteger("hot") == 0) { + return 0.99f; + } + /***Render Level 1***/ + if (slotStack.getSubCompound("BlockEntityTag").getInteger("hot") == 1) { + return 0.011f; + } + /***Render Level 2***/ + if (slotStack.getSubCompound("BlockEntityTag").getInteger("hot") == 2) { + return 0.012f; + } + /***Render Level 3***/ + if (slotStack.getSubCompound("BlockEntityTag").getInteger("hot") == 3) { + return 0.013f; + } + /***Render Level 4***/ + if (slotStack.getSubCompound("BlockEntityTag").getInteger("hot") == 4) { + return 0.014f; + } + /***Render Level 5***/ + if (slotStack.getSubCompound("BlockEntityTag").getInteger("hot") == 5) { + return 0.015f; + } + /***Render Level Cooked***/ + if (slotStack.getSubCompound("BlockEntityTag").getInteger("hot") == 6) { + return 0.016f; + } + /***Render Failed***/ + if (slotStack.getSubCompound("BlockEntityTag").getInteger("hot") == 7) { + return 0.017f; + } + /***Render Hot***/ + if (slotStack.getSubCompound("BlockEntityTag").getInteger("hot") == 15) { + return 0.025f; + } } - /***Render Level 1***/ - if(inventory.getStackInSlot(0).getSubCompound("BlockEntityTag").getInteger("hot") == 1){ - return 0.011f; - } - /***Render Level 2***/ - if(inventory.getStackInSlot(0).getSubCompound("BlockEntityTag").getInteger("hot") == 2){ - return 0.012f; - } - /***Render Level 3***/ - if(inventory.getStackInSlot(0).getSubCompound("BlockEntityTag").getInteger("hot") == 3){ - return 0.013f; - } - /***Render Level 4***/ - if(inventory.getStackInSlot(0).getSubCompound("BlockEntityTag").getInteger("hot") == 4){ - return 0.014f; - } - /***Render Level 5***/ - if(inventory.getStackInSlot(0).getSubCompound("BlockEntityTag").getInteger("hot") == 5){ - return 0.015f; - } - /***Render Level Cooked***/ - if(inventory.getStackInSlot(0).getSubCompound("BlockEntityTag").getInteger("hot") == 6){ - return 0.016f; - } - /***Render Failed***/ - if(inventory.getStackInSlot(0).getSubCompound("BlockEntityTag").getInteger("hot") == 7){ - return 0.017f; - } - /***Render Hot***/ - if(inventory.getStackInSlot(0).getSubCompound("BlockEntityTag").getInteger("hot") == 15){ - return 0.025f; - } - } - if(slotStack.getItem() instanceof ToolPart){ - ToolPart toolPart = (ToolPart) inventory.getStackInSlot(0).getItem(); - if(toolPart.getID() == "pickaxe"){ - if (inventory.getStackInSlot(0).getSubCompound("tags") != null) { - if (slotStack.getSubCompound("tags").getBoolean("hot")) { - return 0.03f; + if (slotStack.getItem() instanceof ToolPart) { + ToolPart toolPart = (ToolPart) slotStack.getItem(); + if (toolPart.getID() == "pickaxe") { + if (slotStack.getSubCompound("tags") != null) { + if (slotStack.getSubCompound("tags").getBoolean("hot")) { + return 0.03f; + } + if (!slotStack.getSubCompound("tags").getBoolean("hot")) { + if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON) { + return 0.04f; + } + if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON) { + return 0.05f; + } + if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL) { + return 0.06f; + } + if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL) { + return 0.07f; + } + if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BRONZE) { + return 0.08f; + } + } } - if (!inventory.getStackInSlot(0).getSubCompound("tags").getBoolean("hot")) { - if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON){ - return 0.04f; + } + if (toolPart.getID() == "axe") { + if (slotStack.getSubCompound("tags") != null) { + if (slotStack.getSubCompound("tags").getBoolean("hot")) { + return 0.09f; } - if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON){ - return 0.05f; + if (!slotStack.getSubCompound("tags").getBoolean("hot")) { + if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON) { + return 0.10f; + } + if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON) { + return 0.11f; + } + if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL) { + return 0.12f; + } + if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL) { + return 0.13f; + } + if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BRONZE) { + return 0.14f; + } } - if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL){ - return 0.06f; + } + } + if (toolPart.getID() == "shovel") { + if (slotStack.getSubCompound("tags") != null) { + if (slotStack.getSubCompound("tags").getBoolean("hot")) { + return 0.15f; } - if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL){ - return 0.07f; + if (!slotStack.getSubCompound("tags").getBoolean("hot")) { + if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON) { + return 0.16f; + } + if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON) { + return 0.17f; + } + if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL) { + return 0.18f; + } + if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL) { + return 0.19f; + } + if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BRONZE) { + return 0.20f; + } } - if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BRONZE){ - return 0.08f; + } + } + if (toolPart.getID() == "hoe") { + if (slotStack.getSubCompound("tags") != null) { + if (slotStack.getSubCompound("tags").getBoolean("hot")) { + return 0.21f; + } + if (!slotStack.getSubCompound("tags").getBoolean("hot")) { + if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON) { + return 0.22f; + } + if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON) { + return 0.23f; + } + if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL) { + return 0.24f; + } + if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL) { + return 0.25f; + } + if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BRONZE) { + return 0.26f; + } } } } } - if(toolPart.getID() == "axe"){ - if (inventory.getStackInSlot(0).getSubCompound("tags") != null) { - if (slotStack.getSubCompound("tags").getBoolean("hot")) { - return 0.09f; - } - if (!inventory.getStackInSlot(0).getSubCompound("tags").getBoolean("hot")) { - if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON){ - return 0.10f; + if (slotStack.getItem() instanceof BaseMultiItem) { + Item slotItem = slotStack.getItem(); + if (slotStack.getTagCompound() != null) { + if (!slotStack.getTagCompound().getBoolean("hot")) { + if (slotItem.equals(ModItems.bronzeingotball)) { + return 0.27f; } - if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON){ - return 0.11f; + if (slotItem.equals(ModItems.ironingotball)) { + return 0.28f; } - if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL){ - return 0.12f; + if (slotItem.equals(ModItems.ironcleaningotball)) { + return 0.29f; } - if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL){ - return 0.13f; + if (slotItem.equals(ModItems.steelingotball)) { + return 0.30f; } - if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BRONZE){ - return 0.14f; + if (slotItem.equals(ModItems.wootzingotball)) { + return 0.31f; + } + if (slotItem.equals(ModItems.bronzechunk)) { + return 0.32f; + } + if (slotItem.equals(ModItems.wroughtironchunk)) { + return 0.33f; + } + if (slotItem.equals(ModItems.ironcleanchunk)) { + return 0.34f; + } + if (slotItem.equals(ModItems.steelchunk)) { + return 0.35f; + } + if (slotItem.equals(ModItems.wootzchunk)) { + return 0.36f; } } - } - } - if(toolPart.getID() == "shovel"){ - if (inventory.getStackInSlot(0).getSubCompound("tags") != null) { - if (slotStack.getSubCompound("tags").getBoolean("hot")) { - return 0.15f; - } - if (!inventory.getStackInSlot(0).getSubCompound("tags").getBoolean("hot")) { - if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON){ - return 0.16f; + if (slotStack.getTagCompound().getBoolean("hot")) { + if (slotItem.equals(ModItems.bronzeingotball)) { + return 0.37f; } - if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON){ - return 0.17f; + if (slotItem.equals(ModItems.ironingotball)) { + return 0.38f; } - if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL){ - return 0.18f; + if (slotItem.equals(ModItems.ironcleaningotball)) { + return 0.39f; } - if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL){ - return 0.19f; + if (slotItem.equals(ModItems.steelingotball)) { + return 0.40f; } - if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BRONZE){ - return 0.20f; + if (slotItem.equals(ModItems.wootzingotball)) { + return 0.41f; } - } - } - } - if(toolPart.getID() == "hoe"){ - if (inventory.getStackInSlot(0).getSubCompound("tags") != null) { - if (slotStack.getSubCompound("tags").getBoolean("hot")) { - return 0.21f; - } - if (!inventory.getStackInSlot(0).getSubCompound("tags").getBoolean("hot")) { - if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON){ - return 0.22f; + if (slotItem.equals(ModItems.bronzechunk)) { + return 0.42f; } - if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON){ - return 0.23f; + if (slotItem.equals(ModItems.wroughtironchunk)) { + return 0.43f; } - if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL){ - return 0.24f; + if (slotItem.equals(ModItems.ironcleanchunk)) { + return 0.44f; } - if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL){ - return 0.25f; + if (slotItem.equals(ModItems.steelchunk)) { + return 0.45f; } - if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BRONZE){ - return 0.26f; + if (slotItem.equals(ModItems.wootzchunk)) { + return 0.46f; } } } } } - if(slotStack.getItem() instanceof BaseMultiItem){ - Item slotItem = slotStack.getItem(); - if (slotStack.getTagCompound() != null) { - if (!slotStack.getTagCompound().getBoolean("hot")) { - if (slotItem.equals(ModItems.bronzeingotball)) { - return 0.27f; - } - if (slotItem.equals(ModItems.ironingotball)) { - return 0.28f; - } - if (slotItem.equals(ModItems.ironcleaningotball)) { - return 0.29f; - } - if (slotItem.equals(ModItems.steelingotball)) { - return 0.30f; - } - if (slotItem.equals(ModItems.wootzingotball)) { - return 0.31f; - } - if (slotItem.equals(ModItems.bronzechunk)) { - return 0.32f; - } - if (slotItem.equals(ModItems.wroughtironchunk)) { - return 0.33f; - } - if (slotItem.equals(ModItems.ironcleanchunk)) { - return 0.34f; - } - if (slotItem.equals(ModItems.steelchunk)) { - return 0.35f; - } - if (slotItem.equals(ModItems.wootzchunk)) { - return 0.36f; - } - } - if (slotStack.getTagCompound().getBoolean("hot")) { - if (slotItem.equals(ModItems.bronzeingotball)) { - return 0.37f; - } - if (slotItem.equals(ModItems.ironingotball)) { - return 0.38f; - } - if (slotItem.equals(ModItems.ironcleaningotball)) { - return 0.39f; - } - if (slotItem.equals(ModItems.steelingotball)) { - return 0.40f; - } - if (slotItem.equals(ModItems.wootzingotball)) { - return 0.41f; - } - if (slotItem.equals(ModItems.bronzechunk)) { - return 0.42f; - } - if (slotItem.equals(ModItems.wroughtironchunk)) { - return 0.43f; - } - if (slotItem.equals(ModItems.ironcleanchunk)) { - return 0.44f; - } - if (slotItem.equals(ModItems.steelchunk)) { - return 0.45f; - } - if (slotItem.equals(ModItems.wootzchunk)) { - return 0.46f; - } - } - } - } } return 0.0F; } @@ -349,6 +341,7 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{ ItemStack tempStack = slotStack; PlayerHelper.spawnItemOnGround(world, pos, tempStack); inventory.extractItem(0, 1, false); + itemstackItem.markDirty(itemstack); return EnumActionResult.SUCCESS; } @@ -367,6 +360,7 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{ ItemStack tempStack = slotStack.copy(); tempStack.getTagCompound().setBoolean("hot", false); inventory.extractItem(0, 1, false); + itemstackItem.markDirty(itemstack); PlayerHelper.spawnItemOnGround(world, pos, tempStack); world.playSound(null, pos, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F); return EnumActionResult.SUCCESS; @@ -379,12 +373,11 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{ DROPS the Ingots into the World *****/ if (!slotStack.isEmpty()) { - System.out.println("Tongs isn't empty"); if (slotStack.getItem() instanceof BaseMultiItem) { ItemStack tempStack = slotStack.copy(); PlayerHelper.spawnItemOnGround(world, pos, tempStack); inventory.extractItem(0, 1, false); - System.out.println(inventory.getStackInSlot(0)); + itemstackItem.markDirty(itemstack); return EnumActionResult.SUCCESS; } if (!(slotStack.getItem() instanceof BaseMultiItem)) { @@ -392,25 +385,28 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{ ItemStack tempStack = slotStack.copy(); PlayerHelper.spawnItemOnGround(world, pos, tempStack); inventory.extractItem(0, 1, false); + itemstackItem.markDirty(itemstack); return EnumActionResult.SUCCESS; } if (RecipeHelper.isOreName(slotStack.getItem(), "nuggetIron")) { ItemStack tempStack = slotStack.copy(); PlayerHelper.spawnItemOnGround(world, pos, tempStack); inventory.extractItem(0, 1, false); + itemstackItem.markDirty(itemstack); return EnumActionResult.SUCCESS; } if (RecipeHelper.isOreName(slotStack.getItem(), "ingotSteel")) { ItemStack tempStack = slotStack.copy(); PlayerHelper.spawnItemOnGround(world, pos, tempStack); inventory.extractItem(0, 1, false); + itemstackItem.markDirty(itemstack); return EnumActionResult.SUCCESS; } if (RecipeHelper.isOreName(slotStack.getItem(), "nuggetSteel")) { ItemStack tempStack = slotStack.copy(); PlayerHelper.spawnItemOnGround(world, pos, tempStack); inventory.extractItem(0, 1, false); - //inventory.insertItem(0, ItemStack.EMPTY, false); + itemstackItem.markDirty(itemstack); return EnumActionResult.SUCCESS; } } @@ -524,8 +520,6 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{ @Override public NBTTagCompound getNBTShareTag(ItemStack stack) { - System.out.println("Does getNBT ever run"); - ItemStackHandler h = (ItemStackHandler)stack.getCapability(ITEM_HANDLER, null); if(stack.getTagCompound() != null) { NBTTagCompound tag = stack.getTagCompound().copy(); @@ -542,7 +536,6 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{ @Override public void readNBTShareTag(ItemStack stack, @Nullable NBTTagCompound nbt) { - System.out.println("Does readNBT ever run"); if (nbt != null) { ItemStackHandler h = (ItemStackHandler)stack.getCapability(ITEM_HANDLER, null); @@ -558,21 +551,28 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{ @Override public boolean getShareTag() { - System.out.println("Getting share tag"); return true; } @Override public boolean updateItemStackNBT(NBTTagCompound nbt) { - System.out.println("Update NBT"); - return true; } - public void markDirty(ItemStack stack){ + public void markDirty(ItemStack stack) { NBTTagCompound tag = stack.getTagCompound(); - tag.setInteger("changeNumber", tag.getInteger("changeNumber") + 1); + IItemHandler inventory = stack.getCapability(ITEM_HANDLER, null); + NonNullList sendList = NonNullList.withSize(1, inventory.getStackInSlot(0)); + if (stack.getTagCompound() != null) { + stack.getTagCompound().setInteger("changeNumber", tag.getInteger("changeNumber") + 1); + ItemStackHelper.saveAllItems(stack.getTagCompound(), sendList); + } else { + NBTTagCompound tagCompound = new NBTTagCompound(); + tagCompound.setInteger("changeNumber", 0); + ItemStackHelper.saveAllItems(tagCompound, sendList); + stack.setTagCompound(tagCompound); + } } } diff --git a/kfc/src/main/java/nmd/primal/forgecraft/items/parts/ToolPart.java b/kfc/src/main/java/nmd/primal/forgecraft/items/parts/ToolPart.java index ea0de39f..43e95325 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/items/parts/ToolPart.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/items/parts/ToolPart.java @@ -278,7 +278,7 @@ public class ToolPart extends Item implements ToolNBT{ if (item.hasTagCompound()) { if (item.getSubCompound("tags").getBoolean("hot")) { player.setFire(1); - if (PrimalAPI.randomCheck(50)) { + if (PrimalAPI.randomCheck(10)) { item.getSubCompound("tags").setBoolean("hot", false); player.getEntityWorld().playSound(null, player.getPosition(), SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F); } @@ -290,19 +290,30 @@ public class ToolPart extends Item implements ToolNBT{ @Override public boolean onEntityItemUpdate(net.minecraft.entity.item.EntityItem entityItem) { - if(entityItem.isWet()){ - if(entityItem.getItem().hasTagCompound()) { - if(entityItem.getItem().getTagCompound().getBoolean("hot")){ - entityItem.getItem().getTagCompound().setBoolean("hot", false); - entityItem.getEntityWorld().playSound(null, entityItem.getPosition(), SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F); + if(!entityItem.getEntityWorld().isRemote) { + if (entityItem.getItem().hasTagCompound()) { + if (entityItem.isWet()) { + + if (entityItem.getItem().getTagCompound().getBoolean("hot")) { + entityItem.getItem().getTagCompound().setBoolean("hot", false); + entityItem.getEntityWorld().playSound(null, entityItem.getPosition(), SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F); + return true; + } + } + /* + if (!entityItem.isWet()) { + if (entityItem.getItem().getTagCompound().getBoolean("hot")) { + FireHelper.setFire(entityItem.getEntityWorld(), entityItem.getPosition()); return true; } - } - } - if(!entityItem.isWet()){ - if(entityItem.getItem().getTagCompound().getBoolean("hot")) { - FireHelper.setFire(entityItem.getEntityWorld(), entityItem.getPosition()); - return true; + }*/ + if (PrimalAPI.randomCheck(10)) { + if (entityItem.getItem().getTagCompound().getBoolean("hot")) { + entityItem.getItem().getSubCompound("tags").setBoolean("hot", false); + entityItem.getEntityWorld().playSound(null, entityItem.getPosition(), SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F); + return true; + } + } } } diff --git a/kfc/src/main/java/nmd/primal/forgecraft/items/weapons/Longbow.java b/kfc/src/main/java/nmd/primal/forgecraft/items/weapons/Longbow.java index 1e7132bb..ad9587b7 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/items/weapons/Longbow.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/items/weapons/Longbow.java @@ -27,7 +27,7 @@ import javax.annotation.Nullable; */ public class Longbow extends BaseItem { - int mod=5; + int mod=15; int time=0; public Longbow(String name) { 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 28952f64..54f1d1be 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/tiles/TileForge.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/tiles/TileForge.java @@ -85,12 +85,15 @@ public class TileForge extends TileBaseSlot implements ITickable, ToolNBT{ if(randomCheck(1000)) { makeSmoke(world, pos); } - this.heatManager(this.getHeat(), state, this.getSlotStack(0), world, pos); - } + } //slotZeroManager(world); craftingManager(); } + if(this.iteration == 299){ + this.heatManager(this.getHeat(), state, this.getSlotStack(0), world, pos); + } + } } @@ -194,7 +197,7 @@ public class TileForge extends TileBaseSlot implements ITickable, ToolNBT{ ForgeCrafting recipe = ForgeCrafting.getRecipe(stack.getItem()); if (recipe != null) { - NBTTagCompound stackCompound = null; + NBTTagCompound stackCompound = new NBTTagCompound(); if(stack.hasTagCompound()){ stackCompound=stack.getTagCompound().copy(); } @@ -207,9 +210,11 @@ public class TileForge extends TileBaseSlot implements ITickable, ToolNBT{ } if (cookCounter2 >= recipe.getIdealTime()) { ItemStack outputStack = recipe.getOutput().copy(); - outputStack.setItemDamage(stack.getItemDamage()); - outputStack.setTagCompound(stackCompound); - outputStack.getSubCompound("tags").setBoolean("hot", true); + if(stack.hasTagCompound()){ + outputStack.setItemDamage(stack.getItemDamage()); + outputStack.setTagCompound(stackCompound); + outputStack.getSubCompound("tags").setBoolean("hot", true); + } this.setSlotStack(i, outputStack); cookCounter2 = 0; } @@ -223,9 +228,11 @@ public class TileForge extends TileBaseSlot implements ITickable, ToolNBT{ } if (cookCounter3 >= recipe.getIdealTime()) { ItemStack outputStack = recipe.getOutput().copy(); - outputStack.setItemDamage(stack.getItemDamage()); - outputStack.setTagCompound(stackCompound); - outputStack.getSubCompound("tags").setBoolean("hot", true); + if(stack.hasTagCompound()){ + outputStack.setItemDamage(stack.getItemDamage()); + outputStack.setTagCompound(stackCompound); + outputStack.getSubCompound("tags").setBoolean("hot", true); + } this.setSlotStack(i, outputStack); cookCounter3 = 0; @@ -240,9 +247,11 @@ public class TileForge extends TileBaseSlot implements ITickable, ToolNBT{ } if (cookCounter4 >= recipe.getIdealTime()) { ItemStack outputStack = recipe.getOutput().copy(); - outputStack.setItemDamage(stack.getItemDamage()); - outputStack.setTagCompound(stackCompound); - outputStack.getSubCompound("tags").setBoolean("hot", true); + if(stack.hasTagCompound()){ + outputStack.setItemDamage(stack.getItemDamage()); + outputStack.setTagCompound(stackCompound); + outputStack.getSubCompound("tags").setBoolean("hot", true); + } this.setSlotStack(i, outputStack); cookCounter4 = 0; } @@ -256,9 +265,11 @@ public class TileForge extends TileBaseSlot implements ITickable, ToolNBT{ } if (cookCounter5 >= recipe.getIdealTime()) { ItemStack outputStack = recipe.getOutput().copy(); - outputStack.setItemDamage(stack.getItemDamage()); - outputStack.setTagCompound(stackCompound); - outputStack.getSubCompound("tags").setBoolean("hot", true); + if(stack.hasTagCompound()){ + outputStack.setItemDamage(stack.getItemDamage()); + outputStack.setTagCompound(stackCompound); + outputStack.getSubCompound("tags").setBoolean("hot", true); + } this.setSlotStack(i, outputStack); cookCounter5 = 0; } diff --git a/kfc/src/main/java/nmd/primal/forgecraft/util/AnvilHandler.java b/kfc/src/main/java/nmd/primal/forgecraft/util/AnvilHandler.java index 5f31b0bc..b9aa144a 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/util/AnvilHandler.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/util/AnvilHandler.java @@ -18,6 +18,7 @@ import nmd.primal.forgecraft.crafting.AnvilCrafting; import nmd.primal.forgecraft.init.ModItems; import nmd.primal.forgecraft.items.BaseMultiItem; import nmd.primal.forgecraft.items.ForgeHammer; +import nmd.primal.forgecraft.items.SlottedTongs; import nmd.primal.forgecraft.items.parts.ToolPart; import nmd.primal.forgecraft.tiles.TileAnvil; @@ -70,8 +71,6 @@ public interface AnvilHandler { if (recipe.getOutput().getItem() instanceof ToolPart) { - System.out.println(tile.getSlotStack(12).getTagCompound()); - if (!tile.getSlotStack(12).getItem().equals(recipe.getOutput().getItem()) ) { ItemStack tempStack = recipe.getOutput(); @@ -243,21 +242,22 @@ public interface AnvilHandler { IItemHandler inventory = pItem.getCapability(ITEM_HANDLER, null); ItemStack tongStack = inventory.getStackInSlot(0).copy(); + SlottedTongs itemstackItem = (SlottedTongs) pItem.getItem(); if (tongStack.isEmpty()) { if (!tile.getSlotStack(counter).isEmpty()) { ItemStack tempStack = tile.getSlotStack(counter).copy(); inventory.insertItem(0,tempStack, false); tile.setSlotStack(counter, ItemStack.EMPTY); + itemstackItem.markDirty(pItem); return true; } } if (!tongStack.isEmpty()) { if (tile.getSlotStack(counter).isEmpty()) { - //ItemStack tempStack = tongStack.copy(); tile.setSlotStack(counter, inventory.extractItem(0, 1, false)); - //System.out.println(tile.getSlotStack(counter).getTagCompound()); + itemstackItem.markDirty(pItem); return true; } } diff --git a/kfc/src/main/java/nmd/primal/forgecraft/util/ForgeHandler.java b/kfc/src/main/java/nmd/primal/forgecraft/util/ForgeHandler.java index 49d2a238..707d9c66 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/util/ForgeHandler.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/util/ForgeHandler.java @@ -10,6 +10,7 @@ import net.minecraftforge.items.IItemHandler; import nmd.primal.core.common.helper.RecipeHelper; import nmd.primal.forgecraft.init.ModItems; import nmd.primal.forgecraft.items.BaseMultiItem; +import nmd.primal.forgecraft.items.SlottedTongs; import nmd.primal.forgecraft.items.parts.ToolPart; import nmd.primal.forgecraft.tiles.TileForge; @@ -109,12 +110,14 @@ public interface ForgeHandler { if (pItem.getItem().equals(ModItems.slottedtongs)) { IItemHandler inventory = pItem.getCapability(ITEM_HANDLER, null); ItemStack tongsStack = inventory.getStackInSlot(0).copy(); + SlottedTongs itemstackItem = (SlottedTongs) pItem.getItem(); if (tongsStack.isEmpty()) { if (!tile.getSlotStack(counter).isEmpty()) { ItemStack tempStack = tile.getSlotStack(counter).copy(); inventory.insertItem(0, tempStack, false); tile.setSlotStack(counter, ItemStack.EMPTY); + itemstackItem.markDirty(pItem); return true; } } @@ -124,6 +127,7 @@ public interface ForgeHandler { ItemStack tempStack = tongsStack.copy(); tile.setSlotStack(counter, tempStack); inventory.extractItem(0, 1, false); + itemstackItem.markDirty(pItem); return true; } } diff --git a/kfc/src/main/resources/assets/forgecraft/models/item/longbow/longbow_2.json b/kfc/src/main/resources/assets/forgecraft/models/item/longbow/longbow_2.json index 5a80ae6d..713d112e 100644 --- a/kfc/src/main/resources/assets/forgecraft/models/item/longbow/longbow_2.json +++ b/kfc/src/main/resources/assets/forgecraft/models/item/longbow/longbow_2.json @@ -654,6 +654,8 @@ "scale": [ 0.5, 0.875, 0.75 ] }, "firstperson_righthand": { + "rotation": [ 13, 3, 5 ], + "translation": [ -2, 0, 0 ], "scale": [ 0.5, 0.875, 0.75 ] }, "firstperson_lefthand": { diff --git a/kfc/src/main/resources/mcmod.info b/kfc/src/main/resources/mcmod.info index fb140653..fb3d51f1 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.10", + "version": "1.6.13", "mcversion": "1.12.2", "url": "", "updateUrl": "",