diff --git a/kfc/src/main/java/nmd/primal/forgecraft/blocks/machine/Workbench.java b/kfc/src/main/java/nmd/primal/forgecraft/blocks/machine/Workbench.java index fcc2bd93..c457b55c 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/blocks/machine/Workbench.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/blocks/machine/Workbench.java @@ -54,13 +54,25 @@ public class Workbench extends CustomContainerFacing { ItemStack slot6 = tile.getSlotStack(6); if (hitY > 0.5D) { if (!player.isSneaking()) { - /*if (tile.isItemValidForSlot(6, playerStack)) { + if (tile.isItemValidForSlot(6, playerStack)) { if (slot6.isEmpty()) { - tile.setSlotStack(6, playerStack.splitStack(1)); - //player.inventory.getCurrentItem().shrink(1); - return true; + if (slot2.isEmpty() && slot3.isEmpty() && slot4.isEmpty() && slot5.isEmpty()) { + ItemStack tempStack = player.inventory.getCurrentItem().copy(); + tempStack.setCount(1); + tile.setSlotStack(6, tempStack); + player.inventory.setInventorySlotContents(player.inventory.currentItem, ItemStack.EMPTY); + + System.out.println(tile.getSlotStack(0)); + System.out.println(tile.getSlotStack(1)); + System.out.println(tile.getSlotStack(2)); + System.out.println(tile.getSlotStack(3)); + System.out.println(tile.getSlotStack(4)); + System.out.println(tile.getSlotStack(5)); + System.out.println(tile.getSlotStack(6)); + return true; + } } - }*/ + } if(! (playerStack.getItem() instanceof Gallagher)) { if (slot4.isEmpty() && slot3.isEmpty() && slot2.isEmpty()) { if (tile.isItemValidForSlot(5, playerStack)) { @@ -71,25 +83,27 @@ public class Workbench extends CustomContainerFacing { } } } - if (tile.isItemValidForSlot(4, playerStack)) { - if (slot4.isEmpty()) { - tile.setSlotStack(4, playerStack.splitStack(1)); - //player.inventory.getCurrentItem().shrink(1); - return true; + if(slot5.isEmpty()) { + if (tile.isItemValidForSlot(4, playerStack)) { + if (slot4.isEmpty()) { + tile.setSlotStack(4, playerStack.splitStack(1)); + //player.inventory.getCurrentItem().shrink(1); + return true; + } } - } - if (tile.isItemValidForSlot(3, playerStack)) { - if (slot3.isEmpty()) { - tile.setSlotStack(3, playerStack.splitStack(1)); - //player.inventory.getCurrentItem().shrink(1); - return true; + if (tile.isItemValidForSlot(3, playerStack)) { + if (slot3.isEmpty()) { + tile.setSlotStack(3, playerStack.splitStack(1)); + //player.inventory.getCurrentItem().shrink(1); + return true; + } } - } - if (tile.isItemValidForSlot(2, playerStack)) { - if (slot2.isEmpty()) { - tile.setSlotStack(2, playerStack.splitStack(1)); - //player.inventory.getCurrentItem().shrink(1); - return true; + if (tile.isItemValidForSlot(2, playerStack)) { + if (slot2.isEmpty()) { + tile.setSlotStack(2, playerStack.splitStack(1)); + //player.inventory.getCurrentItem().shrink(1); + return true; + } } } } @@ -132,24 +146,38 @@ public class Workbench extends CustomContainerFacing { } if(player.isSneaking()){ if(!slot2.isEmpty()){ - PlayerHelper.spawnItemOnPlayer(world, player, slot2); + PlayerHelper.spawnItemOnPlayer(world, player, tile.getSlotStack(2)); tile.clearSlot(2); + return true; } if(!slot3.isEmpty()){ - PlayerHelper.spawnItemOnPlayer(world, player, slot3); + PlayerHelper.spawnItemOnPlayer(world, player, tile.getSlotStack(3)); tile.clearSlot(3); + return true; } if(!slot4.isEmpty()){ - PlayerHelper.spawnItemOnPlayer(world, player, slot4); + PlayerHelper.spawnItemOnPlayer(world, player, tile.getSlotStack(4)); tile.clearSlot(4); + return true; } if(!slot5.isEmpty()){ - PlayerHelper.spawnItemOnPlayer(world, player, slot5); + PlayerHelper.spawnItemOnPlayer(world, player, tile.getSlotStack(5)); tile.clearSlot(5); + return true; } if(!slot6.isEmpty()){ - PlayerHelper.spawnItemOnPlayer(world, player, slot6); + + System.out.println(tile.getSlotStack(0)); + System.out.println(tile.getSlotStack(1)); + System.out.println(tile.getSlotStack(2)); + System.out.println(tile.getSlotStack(3)); + System.out.println(tile.getSlotStack(4)); + System.out.println(tile.getSlotStack(5)); + System.out.println(tile.getSlotStack(6)); + + PlayerHelper.spawnItemOnPlayer(world, player, tile.getSlotStack(6)); tile.clearSlot(6); + return true; } } diff --git a/kfc/src/main/java/nmd/primal/forgecraft/init/ModDictionary.java b/kfc/src/main/java/nmd/primal/forgecraft/init/ModDictionary.java index 7f347950..0e645af7 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/init/ModDictionary.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/init/ModDictionary.java @@ -36,7 +36,5 @@ public class ModDictionary {/*************************************************** OreDictionary.registerOre("nuggetWootz", ModItems.wootzchunk); //} OreDictionary.registerOre("dustBlaze", Items.BLAZE_POWDER); - OreDictionary.registerOre("weaponHandle", ModItems.bonehandle); - OreDictionary.registerOre("weaponGuard", ModItems.boneguard); } } \ No newline at end of file diff --git a/kfc/src/main/java/nmd/primal/forgecraft/init/ModItems.java b/kfc/src/main/java/nmd/primal/forgecraft/init/ModItems.java index cdcdc085..317f554c 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/init/ModItems.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/init/ModItems.java @@ -120,9 +120,6 @@ public class ModItems { public static Item wootzshovel; public static Item wootzhoe; - public static Item bonehandle; - public static Item boneguard; - public static Item rawbronzegladius; public static Item rawcoppergladius; public static Item rawwroughtirongladius; @@ -130,6 +127,16 @@ public class ModItems { public static Item rawsteelgladius; public static Item rawwootzgladius; + public static Item rawcleanironlongsword ; + public static Item rawsteellongsword; + public static Item rawwootzlongsword; + + public static Item rawironslayer; + public static Item rawcleanironslayer; + public static Item rawsteelslayer; + public static Item rawwootzslayer; + + public static Item coppergladius; public static Item bronzegladius; public static Item wroughtirongladius; public static Item cleanirongladius; @@ -263,8 +270,6 @@ public class ModItems { /********** WEAPONS **********/ - bonehandle = new WeaponHandle("bonehandle").setDictionaryNames("weaponHandle"); - boneguard = new WeaponGuard("boneguard").setDictionaryNames("weaponGuard"); rawbronzegladius = new WeaponPart("rawbronzegladius", PrimalAPI.ToolMaterials.TOOL_BRONZE); rawcoppergladius= new WeaponPart("rawcoppergladius", PrimalAPI.ToolMaterials.TOOL_COPPER); @@ -273,6 +278,16 @@ public class ModItems { rawsteelgladius= new WeaponPart("rawsteelgladius", PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL); rawwootzgladius= new WeaponPart("rawwootzgladius", PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL); + rawcleanironlongsword = new WeaponPart("rawcleanironlongsword", PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON); + rawsteellongsword = new WeaponPart("rawsteellongsword", PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL); + rawwootzlongsword = new WeaponPart("rawwootzlongsword", PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL); + + rawironslayer = new WeaponPart("rawironslayer", PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON); + rawcleanironslayer = new WeaponPart("rawcleanironslayer", PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON); + rawsteelslayer = new WeaponPart("rawsteelslayer", PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL); + rawwootzslayer = new WeaponPart("rawwootzslayer", PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL); + + coppergladius = new CustomSword("coppergladius", PrimalAPI.ToolMaterials.TOOL_COPPER, 5D, 2D); bronzegladius = new CustomSword("bronzegladius", PrimalAPI.ToolMaterials.TOOL_BRONZE, 5.5D, 2D); wroughtirongladius = new CustomSword("wroughtirongladius", PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON, 4.5D, -1.85D); cleanirongladius = new CustomSword("cleanirongladius", PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON, 5D, -1.85D); @@ -425,8 +440,6 @@ public class ModItems { /********** WEAPONS **********/ - ForgeRegistries.ITEMS.register(bonehandle); - ForgeRegistries.ITEMS.register(boneguard); ForgeRegistries.ITEMS.register(rawbronzegladius); ForgeRegistries.ITEMS.register(rawcoppergladius); @@ -435,6 +448,15 @@ public class ModItems { ForgeRegistries.ITEMS.register(rawsteelgladius); ForgeRegistries.ITEMS.register(rawwootzgladius); + ForgeRegistries.ITEMS.register(rawcleanironlongsword); + ForgeRegistries.ITEMS.register(rawsteellongsword); + ForgeRegistries.ITEMS.register(rawwootzlongsword); + + ForgeRegistries.ITEMS.register(rawironslayer); + ForgeRegistries.ITEMS.register(rawcleanironslayer); + ForgeRegistries.ITEMS.register(rawsteelslayer); + ForgeRegistries.ITEMS.register(rawwootzslayer); + ForgeRegistries.ITEMS.register(wroughtirongladius); ForgeRegistries.ITEMS.register(bronzegladius); ForgeRegistries.ITEMS.register(cleanirongladius); @@ -573,9 +595,6 @@ public class ModItems { WEAPON PARTS **********/ //registerRender(wroughtironshield); - registerRender(bonehandle); - registerRender(boneguard); - registerRender(rawbronzegladius); registerRender(rawcoppergladius); registerRender(rawwroughtirongladius); @@ -583,6 +602,15 @@ public class ModItems { registerRender(rawsteelgladius); registerRender(rawwootzgladius); + registerRender(rawcleanironlongsword); + registerRender(rawsteellongsword); + registerRender(rawwootzlongsword); + + registerRender(rawironslayer); + registerRender(rawcleanironslayer); + registerRender(rawsteelslayer); + registerRender(rawwootzslayer); + /********** WEAPONS **********/ diff --git a/kfc/src/main/java/nmd/primal/forgecraft/renders/blocks/TileWorkbenchRender.java b/kfc/src/main/java/nmd/primal/forgecraft/renders/blocks/TileWorkbenchRender.java index 4b5e7233..40b6d0a2 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/renders/blocks/TileWorkbenchRender.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/renders/blocks/TileWorkbenchRender.java @@ -13,6 +13,7 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import nmd.primal.core.common.helper.RecipeHelper; import nmd.primal.forgecraft.blocks.machine.Workbench; +import nmd.primal.forgecraft.items.parts.WeaponGuard; import nmd.primal.forgecraft.items.parts.WeaponHandle; import nmd.primal.forgecraft.items.parts.WeaponPart; import nmd.primal.forgecraft.tiles.TileWorkbench; @@ -89,7 +90,7 @@ public class TileWorkbenchRender extends TileEntitySpecialRenderer