Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
DuchLord committed Nov 17, 2016
1 parent 0f59852 commit 45a434c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/treechopper/common/handler/TreeHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private void lookAround(BlockPos position, World world, Set<BlockPos> 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();

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/treechopper/core/TreeChopper.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/treechopper/proxy/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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;
Expand All @@ -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();
Expand All @@ -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());
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/treechopper/proxy/ServerProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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());
Expand Down

0 comments on commit 45a434c

Please sign in to comment.