From 69ab05bc1897d42d7802a8b75f35b72a09c3264c Mon Sep 17 00:00:00 2001 From: Mohammad-Ali Minaie Date: Sat, 6 Oct 2018 02:38:22 -0400 Subject: [PATCH] need to add bounding for chisel, chisel and sledgehammer crafting, chisel and sledgehammer asset updates --- kfc/To-Dos.md | 10 +- kfc/idea_backup/excludeFromValidation.xml | 6 + kfc/idea_backup/gradle.xml | 16 + .../inspectionProfiles/Project_Default.xml | 117 ++ kfc/idea_backup/misc.xml | 17 + kfc/idea_backup/vcs.xml | 6 + kfc/idea_backup/workspace.xml | 1649 +++++++++++++++++ .../nmd/primal/forgecraft/blocks/Chisel.java | 284 ++- .../nmd/primal/forgecraft/init/ModBlocks.java | 28 +- .../nmd/primal/forgecraft/init/ModItems.java | 61 +- .../primal/forgecraft/items/SledgeHammer.java | 18 +- .../items/tools/AbstractPickaxe.java | 5 +- .../primal/forgecraft/tiles/TileBloomery.java | 2 +- .../forgecraft/blockstates/nbtcrucible.json | 16 +- .../forgecraft/textures/items/bronze/1.png | Bin 0 -> 846 bytes 15 files changed, 2098 insertions(+), 137 deletions(-) create mode 100644 kfc/idea_backup/excludeFromValidation.xml create mode 100644 kfc/idea_backup/gradle.xml create mode 100644 kfc/idea_backup/inspectionProfiles/Project_Default.xml create mode 100644 kfc/idea_backup/misc.xml create mode 100644 kfc/idea_backup/vcs.xml create mode 100644 kfc/idea_backup/workspace.xml create mode 100644 kfc/src/main/resources/assets/forgecraft/textures/items/bronze/1.png diff --git a/kfc/To-Dos.md b/kfc/To-Dos.md index e27a57ca..6a21b818 100644 --- a/kfc/To-Dos.md +++ b/kfc/To-Dos.md @@ -1,13 +1,15 @@ # To-Dos ## Bugs +- [x] Hot Crucible block form missing texture +- [x] Soft Crucible drop from tongs +- [x] Pickaxe upgrades printout - [ ] Can't put a crucible straight from creative inventory into bloomery and pull with tongs -- [ ] Hot Crucible block form missing texture -- [ ] Soft Crucible drop from tongs -- [ ] Pickaxe upgrades printout ## Current Feature -- [ ] SledgeHammer and Chisel +- [x] SledgeHammer and Chisel item and blocks +- [ ] Chisel Bounding Box changes +- [ ] SledgeHammer and Chisel crafting - [ ] Play a sound when bloomery or forge finishes - [ ] Hardness and Resistance calculation for durability damage - [ ] Craft Tweaker Support diff --git a/kfc/idea_backup/excludeFromValidation.xml b/kfc/idea_backup/excludeFromValidation.xml new file mode 100644 index 00000000..21318969 --- /dev/null +++ b/kfc/idea_backup/excludeFromValidation.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/kfc/idea_backup/gradle.xml b/kfc/idea_backup/gradle.xml new file mode 100644 index 00000000..ba1ec5c7 --- /dev/null +++ b/kfc/idea_backup/gradle.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/kfc/idea_backup/inspectionProfiles/Project_Default.xml b/kfc/idea_backup/inspectionProfiles/Project_Default.xml new file mode 100644 index 00000000..929940d4 --- /dev/null +++ b/kfc/idea_backup/inspectionProfiles/Project_Default.xml @@ -0,0 +1,117 @@ + + + + \ No newline at end of file diff --git a/kfc/idea_backup/misc.xml b/kfc/idea_backup/misc.xml new file mode 100644 index 00000000..0164d4e2 --- /dev/null +++ b/kfc/idea_backup/misc.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + ApexVCS + + + + + \ No newline at end of file diff --git a/kfc/idea_backup/vcs.xml b/kfc/idea_backup/vcs.xml new file mode 100644 index 00000000..6c0b8635 --- /dev/null +++ b/kfc/idea_backup/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/kfc/idea_backup/workspace.xml b/kfc/idea_backup/workspace.xml new file mode 100644 index 00000000..3d77aeb3 --- /dev/null +++ b/kfc/idea_backup/workspace.xml @@ -0,0 +1,1649 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1538460072488 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.8 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kfc/src/main/java/nmd/primal/forgecraft/blocks/Chisel.java b/kfc/src/main/java/nmd/primal/forgecraft/blocks/Chisel.java index 8be02bde..89a601c9 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/blocks/Chisel.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/blocks/Chisel.java @@ -16,6 +16,8 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.client.event.RenderBlockOverlayEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import nmd.primal.core.api.PrimalAPI; import nmd.primal.core.common.helper.PlayerHelper; import nmd.primal.forgecraft.init.ModBlocks; @@ -65,105 +67,185 @@ public class Chisel extends CustomFacing { if(!player.isSwingInProgress) { if (playerStack.getItem() instanceof SledgeHammer) { world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.CHISEL_HIT, SoundCategory.BLOCKS, 0.8F, 0.3F / (PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F)); + playerStack.damageItem(1, player); - if (state.getValue(FACING) == EnumFacing.UP) { - if (state.getValue(PrimalAPI.States.ACTIVE)) { - for (int i = 0; i < 3; i++) { - for (int a = 0; a < 3; a++) { - BlockPos movePos = pos.add((a - 1), (1), (i - 1)); - IBlockState breakState = world.getBlockState(movePos); - if (state.getValue(PrimalAPI.States.ACTIVE)) { - doBreaking(world, movePos, pos, breakState); - } - } - } - world.setBlockState(pos.up(), state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2); - world.setBlockToAir(pos); - return true; - } - if (!state.getValue(PrimalAPI.States.ACTIVE)) { - for (int i = 0; i < 3; i++) { - for (int a = 0; a < 3; a++) { - BlockPos movePos = pos.add((a - 1), (1), (i - 1)); - if (world.getBlockState(movePos).getBlock() != ModBlocks.chisel) { - world.sendBlockBreakProgress(player.getEntityId() + PrimalAPI.getRandom().nextInt(100), movePos, 4); - } - } - } - world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, true), 2); - return true; - } - } - - if (state.getValue(FACING) == EnumFacing.DOWN) { - if (state.getValue(PrimalAPI.States.ACTIVE)) { - for (int i = 0; i < 3; i++) { - for (int a = 0; a < 3; a++) { - BlockPos movePos = pos.add((a - 1), (-1), (i - 1)); - IBlockState breakState = world.getBlockState(movePos); - if (state.getValue(PrimalAPI.States.ACTIVE)) { - doBreaking(world, movePos, pos, breakState); - } - } - } - world.setBlockState(pos.down(), state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2); - world.setBlockToAir(pos); - return true; - } - if (!state.getValue(PrimalAPI.States.ACTIVE)) { - for (int i = 0; i < 3; i++) { - for (int a = 0; a < 3; a++) { - BlockPos movePos = pos.add((a - 1), (-1), (i - 1)); - if (world.getBlockState(movePos).getBlock() != ModBlocks.chisel) { - world.sendBlockBreakProgress(player.getEntityId() + PrimalAPI.getRandom().nextInt(100), movePos, 4); - } - } - } - world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, true), 2); - return true; - } - } - if (state.getValue(FACING) == EnumFacing.SOUTH) { - if (state.getValue(PrimalAPI.States.ACTIVE)) { - for (int i = 0; i < 3; i++) { - for (int a = 0; a < 3; a++) { - BlockPos movePos = pos.add((a - 1), (i-1), (1)); - IBlockState breakState = world.getBlockState(movePos); - if (state.getValue(PrimalAPI.States.ACTIVE)) { - doBreaking(world, movePos, pos, breakState); - } - } - } - world.setBlockState(pos.south(), state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2); - world.setBlockToAir(pos); - return true; - } - if (!state.getValue(PrimalAPI.States.ACTIVE)) { - for (int i = 0; i < 3; i++) { - for (int a = 0; a < 3; a++) { - BlockPos movePos = pos.add((a - 1), (i-1), (1)); - if (world.getBlockState(movePos).getBlock() != ModBlocks.chisel) { - world.sendBlockBreakProgress(player.getEntityId() + PrimalAPI.getRandom().nextInt(100), movePos, 4); - } - } - } - world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, true), 2); - return true; - } - } - if (state.getValue(FACING) == EnumFacing.NORTH) { + if(PrimalAPI.getRandom().nextInt(1,10)!=1) { + if (state.getValue(FACING) == EnumFacing.UP) { + if (state.getValue(PrimalAPI.States.ACTIVE)) { for (int i = 0; i < 3; i++) { for (int a = 0; a < 3; a++) { - BlockPos movePos = pos.add((a-1), (i-1), (1)); + BlockPos movePos = pos.add((a - 1), (1), (i - 1)); IBlockState breakState = world.getBlockState(movePos); - doBreaking(world, movePos, pos, breakState); + if (state.getValue(PrimalAPI.States.ACTIVE)) { + doBreaking(world, movePos, breakState, player); + } + } + } + world.setBlockState(pos.up(), state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2); + world.setBlockToAir(pos); + return true; + } + if (!state.getValue(PrimalAPI.States.ACTIVE)) { + for (int i = 0; i < 3; i++) { + for (int a = 0; a < 3; a++) { + BlockPos movePos = pos.add((a - 1), (1), (i - 1)); + if (world.getBlockState(movePos).getBlock() != ModBlocks.chisel) { + IBlockState breakState = world.getBlockState(movePos); + doDamaging(world, movePos, breakState, player); + } + } + } + world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, true), 2); + return true; + } + } + + if (state.getValue(FACING) == EnumFacing.DOWN) { + if (state.getValue(PrimalAPI.States.ACTIVE)) { + for (int i = 0; i < 3; i++) { + for (int a = 0; a < 3; a++) { + BlockPos movePos = pos.add((a - 1), (-1), (i - 1)); + IBlockState breakState = world.getBlockState(movePos); + if (state.getValue(PrimalAPI.States.ACTIVE)) { + doBreaking(world, movePos, breakState, player); + } + } + } + world.setBlockState(pos.down(), state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2); + world.setBlockToAir(pos); + return true; + } + if (!state.getValue(PrimalAPI.States.ACTIVE)) { + for (int i = 0; i < 3; i++) { + for (int a = 0; a < 3; a++) { + BlockPos movePos = pos.add((a - 1), (-1), (i - 1)); + if (world.getBlockState(movePos).getBlock() != ModBlocks.chisel) { + IBlockState breakState = world.getBlockState(movePos); + doDamaging(world, movePos, breakState, player); + } + } + } + world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, true), 2); + return true; + } + } + if (state.getValue(FACING) == EnumFacing.SOUTH) { + if (state.getValue(PrimalAPI.States.ACTIVE)) { + for (int i = 0; i < 3; i++) { + for (int a = 0; a < 3; a++) { + BlockPos movePos = pos.add((a - 1), (i - 1), (1)); + IBlockState breakState = world.getBlockState(movePos); + if (state.getValue(PrimalAPI.States.ACTIVE)) { + doBreaking(world, movePos, breakState, player); + } } } world.setBlockState(pos.south(), state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2); world.setBlockToAir(pos); return true; } - + if (!state.getValue(PrimalAPI.States.ACTIVE)) { + for (int i = 0; i < 3; i++) { + for (int a = 0; a < 3; a++) { + BlockPos movePos = pos.add((a - 1), (i - 1), (1)); + if (world.getBlockState(movePos).getBlock() != ModBlocks.chisel) { + IBlockState breakState = world.getBlockState(movePos); + doDamaging(world, movePos, breakState, player); + } + } + } + world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, true), 2); + return true; + } + } + if (state.getValue(FACING) == EnumFacing.NORTH) { + if (state.getValue(PrimalAPI.States.ACTIVE)) { + for (int i = 0; i < 3; i++) { + for (int a = 0; a < 3; a++) { + BlockPos movePos = pos.add((a - 1), (i - 1), (-1)); + IBlockState breakState = world.getBlockState(movePos); + if (state.getValue(PrimalAPI.States.ACTIVE)) { + doBreaking(world, movePos, breakState, player); + } + } + } + world.setBlockState(pos.north(), state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2); + world.setBlockToAir(pos); + return true; + } + if (!state.getValue(PrimalAPI.States.ACTIVE)) { + for (int i = 0; i < 3; i++) { + for (int a = 0; a < 3; a++) { + BlockPos movePos = pos.add((a - 1), (i - 1), (-1)); + if (world.getBlockState(movePos).getBlock() != ModBlocks.chisel) { + IBlockState breakState = world.getBlockState(movePos); + doDamaging(world, movePos, breakState, player); + } + } + } + world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, true), 2); + return true; + } + } + if (state.getValue(FACING) == EnumFacing.EAST) { + if (state.getValue(PrimalAPI.States.ACTIVE)) { + for (int i = 0; i < 3; i++) { + for (int a = 0; a < 3; a++) { + BlockPos movePos = pos.add((1), (i - 1), (a - 1)); + IBlockState breakState = world.getBlockState(movePos); + if (state.getValue(PrimalAPI.States.ACTIVE)) { + doBreaking(world, movePos, breakState, player); + } + } + } + world.setBlockState(pos.east(), state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2); + world.setBlockToAir(pos); + return true; + } + if (!state.getValue(PrimalAPI.States.ACTIVE)) { + for (int i = 0; i < 3; i++) { + for (int a = 0; a < 3; a++) { + BlockPos movePos = pos.add((1), (i - 1), (a - 1)); + if (world.getBlockState(movePos).getBlock() != ModBlocks.chisel) { + IBlockState breakState = world.getBlockState(movePos); + doDamaging(world, movePos, breakState, player); + } + } + } + world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, true), 2); + return true; + } + } + if (state.getValue(FACING) == EnumFacing.WEST) { + if (state.getValue(PrimalAPI.States.ACTIVE)) { + for (int i = 0; i < 3; i++) { + for (int a = 0; a < 3; a++) { + BlockPos movePos = pos.add((-1), (i - 1), (a - 1)); + IBlockState breakState = world.getBlockState(movePos); + if (state.getValue(PrimalAPI.States.ACTIVE)) { + doBreaking(world, movePos, breakState, player); + } + } + } + world.setBlockState(pos.west(), state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2); + world.setBlockToAir(pos); + return true; + } + if (!state.getValue(PrimalAPI.States.ACTIVE)) { + for (int i = 0; i < 3; i++) { + for (int a = 0; a < 3; a++) { + BlockPos movePos = pos.add((-1), (i - 1), (a - 1)); + if (world.getBlockState(movePos).getBlock() != ModBlocks.chisel) { + IBlockState breakState = world.getBlockState(movePos); + doDamaging(world, movePos, breakState, player); + } + } + } + world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, true), 2); + return true; + } + } + } } } } @@ -224,13 +306,27 @@ public class Chisel extends CustomFacing { return null; } - private void doBreaking(World world, BlockPos movePos, BlockPos pos, IBlockState state){ + @SideOnly(Side.CLIENT) + public boolean hasCustomBreakingProgress(IBlockState state) + { + return true; + } + + private void doBreaking(World world, BlockPos movePos, IBlockState state, EntityPlayer player){ if (!(state.getBlock().equals(Blocks.AIR))) { - NonNullList tempDrops = NonNullList.create(); - world.getBlockState(movePos).getBlock().getDrops(tempDrops, world, movePos, state, 0); - PlayerHelper.spawnItemOnGround(world, pos, tempDrops); - world.setBlockToAir(movePos); + if(world.getBlockState(movePos).getBlock().getBlockHardness(state, world, movePos)>0) { + world.destroyBlock(movePos, player.canHarvestBlock(state)); + world.sendBlockBreakProgress(player.getEntityId()+PrimalAPI.getRandom().nextInt(100), movePos, 0); + } + } + } + + private void doDamaging(World world, BlockPos movePos, IBlockState state, EntityPlayer player){ + if (!(state.getBlock().equals(Blocks.AIR))) { + if(world.getBlockState(movePos).getBlock().getBlockHardness(state, world, movePos)>0) { + world.sendBlockBreakProgress(player.getEntityId() + PrimalAPI.getRandom().nextInt(100), movePos, PrimalAPI.getRandom().nextInt(3,10)); + } } } diff --git a/kfc/src/main/java/nmd/primal/forgecraft/init/ModBlocks.java b/kfc/src/main/java/nmd/primal/forgecraft/init/ModBlocks.java index 35bc416e..327b5104 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/init/ModBlocks.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/init/ModBlocks.java @@ -30,7 +30,12 @@ public class ModBlocks { public static Block blockbreaker; public static Block castingform; - public static Block chisel; + public static Block bronzechisel; + public static Block copperchisel; + public static Block ironchisel; + public static Block cleanironchisel; + public static Block steelchisel; + public static Block wootzchisel; public static Block pistonbellowsoak; public static Block pistonbellowsjungle; @@ -54,7 +59,12 @@ public class ModBlocks { blockbreaker = new Breaker(Material.WOOD, "blockbreaker", 4.0f); castingform = new CastingForm(Material.WOOD, "castingform"); - chisel = new Chisel(Material.IRON, "chisel"); + copperchisel = new Chisel(Material.IRON, "copperchisel"); + ironchisel = new Chisel(Material.IRON, "ironchisel"); + bronzechisel = new Chisel(Material.IRON, "bronzechisel"); + cleanironchisel = new Chisel(Material.IRON, "cleanironchisel"); + steelchisel = new Chisel(Material.IRON, "steelchisel"); + wootzchisel = new Chisel(Material.IRON, "wootzchisel"); pistonbellowsoak = new PistonBellows(Material.WOOD, "pistonbellowsoak"); pistonbellowsjungle = new PistonBellows(Material.WOOD, "pistonbellowsjungle"); @@ -80,7 +90,12 @@ public class ModBlocks { registerBlockWithItem(blockbreaker); registerBlockWithItem(castingform); - registerBlockWithItem(chisel); + registerBlockWithItem(copperchisel); + registerBlockWithItem(bronzechisel); + registerBlockWithItem(ironchisel); + registerBlockWithItem(cleanironchisel); + registerBlockWithItem(steelchisel); + registerBlockWithItem(wootzchisel); registerBlockWithItem(pistonbellowsoak); registerBlockWithItem(pistonbellowsjungle); @@ -102,7 +117,12 @@ public class ModBlocks { registerRender(forge_adobe); registerRender(castingform); - registerRender(chisel); + registerRender(copperchisel); + registerRender(bronzechisel); + registerRender(ironchisel); + registerRender(cleanironchisel); + registerRender(steelchisel); + registerRender(wootzchisel); registerRender(blockbreaker); registerRender(pistonbellowsoak); 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 429c713f..59e87c47 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/init/ModItems.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/init/ModItems.java @@ -53,7 +53,12 @@ public class ModItems { public static Item wootzingotball; public static Item wootzchunk; - public static Item IRON_SLEDGE_HAMMER; + public static Item ironsledgehammer; + public static Item coppersledgehammer; + public static Item bronzesledgehammer; + public static Item cleanironsledgehammer; + public static Item steelsledgehammer; + public static Item wootzsledgehammer; public static Item copperpickaxehead; public static Item copperaxehead; @@ -180,12 +185,6 @@ public class ModItems { coppershovelhead= new ToolPart("coppershovelhead", PrimalAPI.ToolMaterials.TOOL_COPPER, "shovel"); copperhoehead = new ToolPart("copperhoehead", PrimalAPI.ToolMaterials.TOOL_COPPER, "hoe"); - copperpickaxe = new CustomPickaxe("copperpickaxe", PrimalAPI.ToolMaterials.TOOL_COPPER, brokencoppertool); - copperaxe = new CustomAxe("copperaxe", PrimalAPI.ToolMaterials.TOOL_COPPER, brokencoppertool, 4, -2.6F); - coppershovel = new CustomShovel("coppershovel", PrimalAPI.ToolMaterials.TOOL_COPPER, brokencoppertool); - copperhoe = new CustomHoe("copperhoe", PrimalAPI.ToolMaterials.TOOL_COPPER, brokencoppertool); - - bronzepickaxehead = new ToolPart("bronzepickaxehead", PrimalAPI.ToolMaterials.TOOL_BRONZE, "pickaxe"); bronzeaxehead = new ToolPart("bronzeaxehead", PrimalAPI.ToolMaterials.TOOL_BRONZE, "axe"); bronzeshovelhead = new ToolPart("bronzeshovelhead", PrimalAPI.ToolMaterials.TOOL_BRONZE, "shovel"); @@ -214,31 +213,41 @@ public class ModItems { /********** TOOLS **********/ + copperpickaxe = new CustomPickaxe("copperpickaxe", PrimalAPI.ToolMaterials.TOOL_COPPER, brokencoppertool); + copperaxe = new CustomAxe("copperaxe", PrimalAPI.ToolMaterials.TOOL_COPPER, brokencoppertool, 4, -2.6F); + coppershovel = new CustomShovel("coppershovel", PrimalAPI.ToolMaterials.TOOL_COPPER, brokencoppertool); + copperhoe = new CustomHoe("copperhoe", PrimalAPI.ToolMaterials.TOOL_COPPER, brokencoppertool); + coppersledgehammer = new SledgeHammer("coppersledgehammer", PrimalAPI.ToolMaterials.TOOL_COPPER); + bronzepickaxe = new CustomPickaxe("bronzepickaxe", PrimalAPI.ToolMaterials.TOOL_BRONZE, bronzepickaxehead); bronzeaxe = new CustomAxe("bronzeaxe", PrimalAPI.ToolMaterials.TOOL_BRONZE, bronzeaxehead, 5, -2.4f); bronzeshovel = new CustomShovel("bronzeshovel", PrimalAPI.ToolMaterials.TOOL_BRONZE, bronzeshovelhead); bronzehoe = new CustomHoe("bronzehoe", PrimalAPI.ToolMaterials.TOOL_BRONZE, bronzehoehead); + bronzesledgehammer = new SledgeHammer("bronzesledgehammer", PrimalAPI.ToolMaterials.TOOL_BRONZE); ironpickaxe = new CustomPickaxe("ironpickaxe", PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON, pickaxehead); ironaxe = new CustomAxe("ironaxe", PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON, ironaxehead, 5, -3.6f); ironshovel = new CustomShovel("ironshovel", PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON, ironshovelhead); ironhoe = new CustomHoe("ironhoe", PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON, ironhoehead); - IRON_SLEDGE_HAMMER = new SledgeHammer("ironsledgehammer", PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL); + ironsledgehammer = new SledgeHammer("ironsledgehammer", PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON); cleanironpickaxe = new CustomPickaxe("cleanironpickaxe", PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON, cleanironpickaxehead); cleanironaxe = new CustomAxe("cleanironaxe", PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON, cleanironaxehead, 6, -3.2f); cleanironshovel = new CustomShovel("cleanironshovel", PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON, cleanironshovelhead); cleanironhoe = new CustomHoe("cleanironhoe", PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON, cleanironhoehead); + cleanironsledgehammer = new SledgeHammer("cleanironsledgehammer", PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON); steelpickaxe = new CustomPickaxe("steelpickaxe", PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL, steelpickaxehead); steelaxe = new CustomAxe("steelaxe", PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL, steelaxehead, 7, -2.8f); steelshovel = new CustomShovel("steelshovel", PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL, steelshovelhead); steelhoe = new CustomHoe("steelhoe", PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL, steelhoehead); + steelsledgehammer = new SledgeHammer("steelsledgehammer", PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL); wootzpickaxe = new CustomPickaxe("wootzpickaxe", PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL, wootzpickaxehead); wootzaxe = new CustomAxe("wootzaxe", PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL, wootzaxehead, 8, -2.4f); wootzshovel = new CustomShovel("wootzshovel", PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL, wootzshovelhead); wootzhoe = new CustomHoe("wootzhoe", PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL, wootzhoehead); + wootzsledgehammer = new SledgeHammer("wootzsledgehammer", PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL); /********** WEAPONS @@ -328,12 +337,6 @@ public class ModItems { ForgeRegistries.ITEMS.register(coppershovelhead); ForgeRegistries.ITEMS.register(copperhoehead); - ForgeRegistries.ITEMS.register(copperpickaxe); - ForgeRegistries.ITEMS.register(copperaxe); - ForgeRegistries.ITEMS.register(coppershovel); - ForgeRegistries.ITEMS.register(copperhoe); - - ForgeRegistries.ITEMS.register(bronzepickaxehead); ForgeRegistries.ITEMS.register(bronzeaxehead); ForgeRegistries.ITEMS.register(bronzeshovelhead); @@ -343,7 +346,6 @@ public class ModItems { ForgeRegistries.ITEMS.register(ironaxehead); ForgeRegistries.ITEMS.register(ironshovelhead); ForgeRegistries.ITEMS.register(ironhoehead); - ForgeRegistries.ITEMS.register(IRON_SLEDGE_HAMMER); ForgeRegistries.ITEMS.register(cleanironpickaxehead); ForgeRegistries.ITEMS.register(cleanironaxehead); @@ -363,30 +365,41 @@ public class ModItems { /********** TOOLS **********/ + ForgeRegistries.ITEMS.register(copperpickaxe); + ForgeRegistries.ITEMS.register(copperaxe); + ForgeRegistries.ITEMS.register(coppershovel); + ForgeRegistries.ITEMS.register(copperhoe); + ForgeRegistries.ITEMS.register(coppersledgehammer); + ForgeRegistries.ITEMS.register(bronzepickaxe); ForgeRegistries.ITEMS.register(bronzeaxe); ForgeRegistries.ITEMS.register(bronzeshovel); ForgeRegistries.ITEMS.register(bronzehoe); + ForgeRegistries.ITEMS.register(bronzesledgehammer); ForgeRegistries.ITEMS.register(ironpickaxe); ForgeRegistries.ITEMS.register(ironaxe); ForgeRegistries.ITEMS.register(ironshovel); ForgeRegistries.ITEMS.register(ironhoe); + ForgeRegistries.ITEMS.register(ironsledgehammer); ForgeRegistries.ITEMS.register(cleanironpickaxe); ForgeRegistries.ITEMS.register(cleanironaxe); ForgeRegistries.ITEMS.register(cleanironshovel); ForgeRegistries.ITEMS.register(cleanironhoe); + ForgeRegistries.ITEMS.register(cleanironsledgehammer); ForgeRegistries.ITEMS.register(steelpickaxe); ForgeRegistries.ITEMS.register(steelaxe); ForgeRegistries.ITEMS.register(steelshovel); ForgeRegistries.ITEMS.register(steelhoe); + ForgeRegistries.ITEMS.register(steelsledgehammer); ForgeRegistries.ITEMS.register(wootzpickaxe); ForgeRegistries.ITEMS.register(wootzaxe); ForgeRegistries.ITEMS.register(wootzshovel); ForgeRegistries.ITEMS.register(wootzhoe); + ForgeRegistries.ITEMS.register(wootzsledgehammer); /********** WEAPONS @@ -462,12 +475,6 @@ public class ModItems { registerRender(coppershovelhead); registerRender(copperhoehead); - registerRender(copperpickaxe); - registerRender(copperaxe); - registerRender(coppershovel); - registerRender(copperhoe); - - registerRender(bronzepickaxehead); registerRender(bronzeaxehead); registerRender(bronzeshovelhead); @@ -496,31 +503,41 @@ public class ModItems { /********** TOOLS **********/ + registerRender(copperpickaxe); + registerRender(copperaxe); + registerRender(coppershovel); + registerRender(copperhoe); + registerRender(coppersledgehammer); + registerRender(bronzepickaxe); registerRender(bronzeaxe); registerRender(bronzeshovel); registerRender(bronzehoe); + registerRender(bronzesledgehammer); registerRender(ironpickaxe); registerRender(ironaxe); registerRender(ironshovel); registerRender(ironhoe); - registerRender(IRON_SLEDGE_HAMMER); + registerRender(ironsledgehammer); registerRender(cleanironpickaxe); registerRender(cleanironaxe); registerRender(cleanironshovel); registerRender(cleanironhoe); + registerRender(cleanironsledgehammer); registerRender(steelpickaxe); registerRender(steelaxe); registerRender(steelshovel); registerRender(steelhoe); + registerRender(steelsledgehammer); registerRender(wootzpickaxe); registerRender(wootzaxe); registerRender(wootzshovel); registerRender(wootzhoe); + registerRender(wootzsledgehammer); /********** WEAPONS diff --git a/kfc/src/main/java/nmd/primal/forgecraft/items/SledgeHammer.java b/kfc/src/main/java/nmd/primal/forgecraft/items/SledgeHammer.java index 7f462137..cffdd8ef 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/items/SledgeHammer.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/items/SledgeHammer.java @@ -1,5 +1,7 @@ package nmd.primal.forgecraft.items; +import com.mojang.realmsclient.gui.ChatFormatting; +import net.minecraft.client.util.ITooltipFlag; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.MobEffects; @@ -10,9 +12,14 @@ import net.minecraft.util.ActionResult; import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumHand; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import nmd.primal.core.api.PrimalAPI; import nmd.primal.forgecraft.util.ToolMaterialMap; +import javax.annotation.Nullable; +import java.util.List; + public class SledgeHammer extends BaseItem implements ToolMaterialMap { @@ -45,7 +52,8 @@ public class SledgeHammer extends BaseItem implements ToolMaterialMap { { if(!world.isRemote) { if (!player.isSwingInProgress) { - player.addPotionEffect(new PotionEffect(MobEffects.MINING_FATIGUE, (100/materialModifiers.get(this.getMaterial()) / (player.getActivePotionEffect(MobEffects.STRENGTH).getAmplifier()+1)), 100)); + int tempInt = 0; + player.addPotionEffect(new PotionEffect(MobEffects.MINING_FATIGUE, (100/(materialModifiers.get(this.getMaterial())+tempInt)), 100)); player.swingArm(hand); return new ActionResult(EnumActionResult.PASS, player.getHeldItem(hand)); } @@ -56,4 +64,12 @@ public class SledgeHammer extends BaseItem implements ToolMaterialMap { public ToolMaterial getMaterial() { return material; } + + @Override + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack item, @Nullable World world, List tooltip, ITooltipFlag flagIn) + { + tooltip.add(ChatFormatting.LIGHT_PURPLE + "Damage: " + item.getItemDamage() ); + } + } diff --git a/kfc/src/main/java/nmd/primal/forgecraft/items/tools/AbstractPickaxe.java b/kfc/src/main/java/nmd/primal/forgecraft/items/tools/AbstractPickaxe.java index 770a772d..970cebca 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/items/tools/AbstractPickaxe.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/items/tools/AbstractPickaxe.java @@ -136,11 +136,10 @@ public abstract class AbstractPickaxe extends ItemPickaxe implements ToolNBT { @SideOnly(Side.CLIENT) public void addInformation(ItemStack item, @Nullable World world, List tooltip, ITooltipFlag flagIn) { - //tooltip.add(ChatFormatting.GRAY + "Damage: " + item.getItemDamage() ); if(item.hasTagCompound()) { - tooltip.add(ChatFormatting.GRAY + "Upgrades left: " + (ToolMaterialMap.materialModifiers.get(this.toolMaterial) - getModifiers(item))); - if (getEmerald(item) == true) { + tooltip.add(ChatFormatting.GRAY + "Total Allowed: " + (ToolMaterialMap.materialModifiers.get(this.toolMaterial) )); + if (getEmerald(item)) { tooltip.add(ChatFormatting.DARK_GREEN + "Emerald"); } if (getDiamondLevel(item) > 0) { diff --git a/kfc/src/main/java/nmd/primal/forgecraft/tiles/TileBloomery.java b/kfc/src/main/java/nmd/primal/forgecraft/tiles/TileBloomery.java index a27854b8..d1fac684 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/tiles/TileBloomery.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/tiles/TileBloomery.java @@ -287,7 +287,7 @@ public class TileBloomery extends TileBaseSlot implements ITickable { } if(index == 1){ if (stack.getItem() == ModItems.softcrucible) { - return true; + return false; } if(Block.getBlockFromItem(stack.getItem()) instanceof NBTCrucible ){ return true; diff --git a/kfc/src/main/resources/assets/forgecraft/blockstates/nbtcrucible.json b/kfc/src/main/resources/assets/forgecraft/blockstates/nbtcrucible.json index b1ffc235..79faf2ec 100644 --- a/kfc/src/main/resources/assets/forgecraft/blockstates/nbtcrucible.json +++ b/kfc/src/main/resources/assets/forgecraft/blockstates/nbtcrucible.json @@ -76,7 +76,7 @@ "textures": { "particle": "forgecraft:blocks/stone_slab_hot", "texture": "forgecraft:blocks/stone_slab_hot", - "texture1": "forgecraft:items/hot_bronze" + "texture1": "forgecraft:items/bronze/1" }, "model": "forgecraft:castingcrucible" }, @@ -84,7 +84,7 @@ "textures": { "particle": "forgecraft:blocks/stone_slab_hot", "texture": "forgecraft:blocks/stone_slab_hot", - "texture1": "forgecraft:items/hot_bronze" + "texture1": "forgecraft:items/bronze/1" }, "model": "forgecraft:castingcrucible" }, @@ -92,7 +92,7 @@ "textures": { "particle": "forgecraft:blocks/stone_slab_hot", "texture": "forgecraft:blocks/stone_slab_hot", - "texture1": "forgecraft:items/hot_bronze" + "texture1": "forgecraft:items/bronze/1" }, "model": "forgecraft:castingcrucible" }, @@ -100,7 +100,7 @@ "textures": { "particle": "forgecraft:blocks/stone_slab_hot", "texture": "forgecraft:blocks/stone_slab_hot", - "texture1": "forgecraft:items/hot_bronze" + "texture1": "forgecraft:items/bronze/1" }, "model": "forgecraft:castingcrucible" }, @@ -108,7 +108,7 @@ "textures": { "particle": "forgecraft:blocks/stone_slab_hot", "texture": "forgecraft:blocks/stone_slab_hot", - "texture1": "forgecraft:items/hot_bronze" + "texture1": "forgecraft:items/bronze/1" }, "model": "forgecraft:castingcrucible" }, @@ -116,7 +116,7 @@ "textures": { "particle": "forgecraft:blocks/stone_slab_hot", "texture": "forgecraft:blocks/stone_slab_hot", - "texture1": "forgecraft:items/hot_bronze" + "texture1": "forgecraft:items/bronze/1" }, "model": "forgecraft:castingcrucible" }, @@ -124,7 +124,7 @@ "textures": { "particle": "forgecraft:blocks/stone_slab_hot", "texture": "forgecraft:blocks/stone_slab_hot", - "texture1": "forgecraft:items/hot_bronze" + "texture1": "forgecraft:items/bronze/1" }, "model": "forgecraft:castingcrucible" }, @@ -132,7 +132,7 @@ "textures": { "particle": "forgecraft:blocks/stone_slab_hot", "texture": "forgecraft:blocks/stone_slab_hot", - "texture1": "forgecraft:items/hot_bronze" + "texture1": "forgecraft:items/bronze/1" }, "model": "forgecraft:castingcrucible" } diff --git a/kfc/src/main/resources/assets/forgecraft/textures/items/bronze/1.png b/kfc/src/main/resources/assets/forgecraft/textures/items/bronze/1.png new file mode 100644 index 0000000000000000000000000000000000000000..1939724cbeb897d3ff4d51bee2c2f806718c1b4b GIT binary patch literal 846 zcmV-U1F`&xP)5B>03B&m zSad^gZEa<4bN~PV002XBWnpw>WFU8GbZ8()Nlj2>E@cM*00Oc}L_t(I%LT#Na^pk* zK+&sKcWbj`Id*28WftBj-uQEVh2mkLikhOb5Hg8nTavZ)#yOGs?LHjm6?FyTu+UV7 zYFv>l3O*Xl^NdnGbCNTMnM$RQW)KW+Xpj%0Aj=ozdE!w?He-cg;A9Tur!B*k<3hag(BC zL7N4HQEPN=>GA<-W>OvTa_DJwLhnAKyB&Jov$KX$9Y}@4xIh{v%05C|5qSI?1R3)d zDx0z~G2?bYiZ{~s4{Y9ppGjPb-@t4}UUfozHz5w2iQV?Zo$jb@hmS#th3X#(CZV~$ zK?cifQ^MNQ_c4)zo!8VaBT^qc@g6v4^dq#1?Z0=zl!8_;ALxBX91Vo(BY*lc0y*&07-18O z1v-7g^&oYI%Ok3LOX8oIt)(dy^=x=Ef~(%JSsBDQDb8LZ3Yb*N-W4Pt95yLfcZP3+ zqRTXYMV26T1QujsImVW{E0I~95CsK~DcN>GI!SjP=u=DH%>0tC$R^LvV@IF8