From 45a434cc3341fc8aa98ce34672539bdec8f40d35 Mon Sep 17 00:00:00 2001 From: DuchLord Date: Thu, 17 Nov 2016 13:15:14 +0100 Subject: [PATCH] Tweaks --- build.gradle | 2 +- .../common/handler/TreeHandler.java | 2 +- .../java/treechopper/core/TreeChopper.java | 2 +- .../java/treechopper/proxy/ClientProxy.java | 18 +++++++++--------- .../java/treechopper/proxy/ServerProxy.java | 12 ++++++------ 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/build.gradle b/build.gradle index 0cec201..ca262da 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ apply plugin: 'net.minecraftforge.gradle.forge' //Only edit below this line, the above code adds and enables the nessasary things for Forge to be setup. -version = "1.10.2-1.1.1" +version = "1.10.2-1.1.1a" group = "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "TreeChopper" diff --git a/src/main/java/treechopper/common/handler/TreeHandler.java b/src/main/java/treechopper/common/handler/TreeHandler.java index 85842a1..2d0e2a2 100644 --- a/src/main/java/treechopper/common/handler/TreeHandler.java +++ b/src/main/java/treechopper/common/handler/TreeHandler.java @@ -167,7 +167,7 @@ private void lookAround(BlockPos position, World world, Set newLeaves) } - private boolean destroyBlockOverr(BlockPos pos, boolean dropBlock, World world) { + public boolean destroyBlockOverr(BlockPos pos, boolean dropBlock, World world) { IBlockState iblockstate = world.getBlockState(pos); Block block = iblockstate.getBlock(); diff --git a/src/main/java/treechopper/core/TreeChopper.java b/src/main/java/treechopper/core/TreeChopper.java index cf662f5..02d450e 100644 --- a/src/main/java/treechopper/core/TreeChopper.java +++ b/src/main/java/treechopper/core/TreeChopper.java @@ -26,7 +26,7 @@ public class TreeChopper { public static SimpleNetworkWrapper network; public static final String MODID = "treechopper"; - public static final String VERSION = "1.1.1"; + public static final String VERSION = "1.1.1a"; public static boolean BoPPresent = false; public static boolean ForestryPresent = false; diff --git a/src/main/java/treechopper/proxy/ClientProxy.java b/src/main/java/treechopper/proxy/ClientProxy.java index 9c83786..ffe43c1 100644 --- a/src/main/java/treechopper/proxy/ClientProxy.java +++ b/src/main/java/treechopper/proxy/ClientProxy.java @@ -68,10 +68,10 @@ public void interactTree(PlayerInteractEvent event) { if (event.getEntityPlayer().getHeldItemMainhand() != null) { // Player holds something in his main hand - if (ConfigHandler.axeTypes.contains(event.getEntityPlayer().getHeldItemMainhand().getUnlocalizedName())) { // Player holds allowed axe + if (ConfigHandler.axeTypes.contains(event.getEntityPlayer().getHeldItemMainhand().getItem().getUnlocalizedName())) { // Player holds allowed axe logCount = treeHandler.treeAnalyze(event.getWorld(), event.getPos()); - if (!TConstructHandler.tcAxes.contains(event.getEntityPlayer().getHeldItemMainhand().getUnlocalizedName())) { // For TConstruct axes.. + if (!TConstructHandler.tcAxes.contains(event.getEntityPlayer().getHeldItemMainhand().getItem().getUnlocalizedName())) { // For TConstruct axes.. axeDurability = event.getEntityPlayer().getHeldItemMainhand().getItem().getMaxDamage() + 1 - event.getEntityPlayer().getHeldItemMainhand().getItemDamage(); @@ -86,7 +86,7 @@ public void interactTree(PlayerInteractEvent event) { } if (!event.getEntityPlayer().isSneaking()) { - if (!TConstructHandler.tcAxes.contains(event.getEntityPlayer().getHeldItemMainhand().getUnlocalizedName())) + if (!TConstructHandler.tcAxes.contains(event.getEntityPlayer().getHeldItemMainhand().getItem().getUnlocalizedName())) ClientProxy.logCount = (int) logCount; else ClientProxy.logCount = 0; @@ -110,7 +110,7 @@ public void destroyTree(BlockEvent.BreakEvent event) { // Open to LAN if (event.getPlayer().getHeldItemMainhand() != null) { // Player holds something in his main hand - if (ConfigHandler.axeTypes.contains(event.getPlayer().getHeldItemMainhand().getUnlocalizedName())) { // Player holds allowed axe + if (ConfigHandler.axeTypes.contains(event.getPlayer().getHeldItemMainhand().getItem().getUnlocalizedName())) { // Player holds allowed axe logCount = treeHandler.treeAnalyze(event.getWorld(), event.getPos()); axeDurability = event.getPlayer().getHeldItemMainhand().getItem().getMaxDamage() + 1 - event.getPlayer().getHeldItemMainhand().getItemDamage(); @@ -124,26 +124,26 @@ public void destroyTree(BlockEvent.BreakEvent event) { // Open to LAN if (!StaticHandler.playerHoldShift.get(event.getPlayer().getEntityId())) { - if (logCount > axeDurability && !ConfigHandler.ignoreDurability && !TConstructHandler.tcAxes.contains(event.getPlayer().getHeldItemMainhand().getUnlocalizedName())) + if (logCount > axeDurability && !ConfigHandler.ignoreDurability && !TConstructHandler.tcAxes.contains(event.getPlayer().getHeldItemMainhand().getItem().getUnlocalizedName())) return; logDestroyCount = treeHandler.treeDestroy(event); - if (!event.getPlayer().isCreative() && !TConstructHandler.tcAxes.contains(event.getPlayer().getHeldItemMainhand().getUnlocalizedName())) + if (!event.getPlayer().isCreative() && !TConstructHandler.tcAxes.contains(event.getPlayer().getHeldItemMainhand().getItem().getUnlocalizedName())) event.getPlayer().getHeldItemMainhand().setItemDamage(event.getPlayer().getHeldItemMainhand().getItemDamage() + logDestroyCount); // Axe damage increase with size of tree - if (!event.getPlayer().isCreative() && TConstructHandler.tcAxes.contains(event.getPlayer().getHeldItemMainhand().getUnlocalizedName())) + if (!event.getPlayer().isCreative() && TConstructHandler.tcAxes.contains(event.getPlayer().getHeldItemMainhand().getItem().getUnlocalizedName())) event.getPlayer().getHeldItemMainhand().setItemDamage(event.getPlayer().getHeldItemMainhand().getItemDamage() + logDestroyCount * 4); // Axe damage increase with size of tree if (ConfigHandler.plantSapling) { - if (TConstructHandler.tcAxes.contains(event.getPlayer().getHeldItemMainhand().getUnlocalizedName()) || ConfigHandler.plantSaplingTree) { + if (TConstructHandler.tcAxes.contains(event.getPlayer().getHeldItemMainhand().getItem().getUnlocalizedName()) || ConfigHandler.plantSaplingTree) { event.getWorld().destroyBlock(event.getPos(), true); event.getWorld().setBlockToAir(event.getPos()); event.setCanceled(true); } treeHandler.plantSapling(event.getWorld(), event.getPos(), event); } - } else if (TConstructHandler.tcAxes.contains(event.getPlayer().getHeldItemMainhand().getUnlocalizedName())) { + } else if (TConstructHandler.tcAxes.contains(event.getPlayer().getHeldItemMainhand().getItem().getUnlocalizedName())) { event.setCanceled(true); event.getWorld().destroyBlock(event.getPos(), true); event.getWorld().setBlockToAir(event.getPos()); diff --git a/src/main/java/treechopper/proxy/ServerProxy.java b/src/main/java/treechopper/proxy/ServerProxy.java index cbbb215..689ab6b 100644 --- a/src/main/java/treechopper/proxy/ServerProxy.java +++ b/src/main/java/treechopper/proxy/ServerProxy.java @@ -37,7 +37,7 @@ public void destroyTree(BlockEvent.BreakEvent event) { if (event.getPlayer().getHeldItemMainhand() != null) { // Player holds something in his main hand - if (ConfigHandler.axeTypes.contains(event.getPlayer().getHeldItemMainhand().getUnlocalizedName())) { // Player holds allowed axe + if (ConfigHandler.axeTypes.contains(event.getPlayer().getHeldItemMainhand().getItem().getUnlocalizedName())) { // Player holds allowed axe logCount = treeHandler.treeAnalyze(event.getWorld(), event.getPos()); axeDurability = event.getPlayer().getHeldItemMainhand().getItem().getMaxDamage() + 1 - event.getPlayer().getHeldItemMainhand().getItemDamage(); @@ -51,26 +51,26 @@ public void destroyTree(BlockEvent.BreakEvent event) { if (!StaticHandler.playerHoldShift.get(event.getPlayer().getEntityId())) { - if (logCount > axeDurability && !ConfigHandler.ignoreDurability && !TConstructHandler.tcAxes.contains(event.getPlayer().getHeldItemMainhand().getUnlocalizedName())) + if (logCount > axeDurability && !ConfigHandler.ignoreDurability && !TConstructHandler.tcAxes.contains(event.getPlayer().getHeldItemMainhand().getItem().getUnlocalizedName())) return; logDestroyCount = treeHandler.treeDestroy(event); - if (!event.getPlayer().isCreative() && !TConstructHandler.tcAxes.contains(event.getPlayer().getHeldItemMainhand().getUnlocalizedName())) + if (!event.getPlayer().isCreative() && !TConstructHandler.tcAxes.contains(event.getPlayer().getHeldItemMainhand().getItem().getUnlocalizedName())) event.getPlayer().getHeldItemMainhand().setItemDamage(event.getPlayer().getHeldItemMainhand().getItemDamage() + logDestroyCount); // Axe damage increase with size of tree - if (!event.getPlayer().isCreative() && TConstructHandler.tcAxes.contains(event.getPlayer().getHeldItemMainhand().getUnlocalizedName())) + if (!event.getPlayer().isCreative() && TConstructHandler.tcAxes.contains(event.getPlayer().getHeldItemMainhand().getItem().getUnlocalizedName())) event.getPlayer().getHeldItemMainhand().setItemDamage(event.getPlayer().getHeldItemMainhand().getItemDamage() + logDestroyCount * 4); // Axe damage increase with size of tree if (ConfigHandler.plantSapling) { - if (TConstructHandler.tcAxes.contains(event.getPlayer().getHeldItemMainhand().getUnlocalizedName()) || ConfigHandler.plantSaplingTree) { + if (TConstructHandler.tcAxes.contains(event.getPlayer().getHeldItemMainhand().getItem().getUnlocalizedName()) || ConfigHandler.plantSaplingTree) { event.getWorld().destroyBlock(event.getPos(), true); event.getWorld().setBlockToAir(event.getPos()); event.setCanceled(true); } treeHandler.plantSapling(event.getWorld(), event.getPos(), event); } - } else if (TConstructHandler.tcAxes.contains(event.getPlayer().getHeldItemMainhand().getUnlocalizedName())) { + } else if (TConstructHandler.tcAxes.contains(event.getPlayer().getHeldItemMainhand().getItem().getUnlocalizedName())) { event.setCanceled(true); event.getWorld().destroyBlock(event.getPos(), true); event.getWorld().setBlockToAir(event.getPos());