mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 03:49:29 +00:00
Merge pull request #804 from jodamm/patch-5
* fix for #527 Lumber Axe destroys indestructible blocks
This commit is contained in:
commit
9d4783547d
3 files changed
+6
-4
No files matched your search
@@ -162,7 +162,7 @@ public class Excavator extends HarvestTool
|
||||
}
|
||||
}
|
||||
|
||||
MovingObjectPosition mop = AbilityHelper.raytraceFromEntity(world, player, true, 5.0D);
|
||||
MovingObjectPosition mop = AbilityHelper.raytraceFromEntity(world, player, false, 5.0D);
|
||||
if (mop == null || !validStart)
|
||||
return super.onBlockStartBreak(stack, x, y, z, player);
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@ public class Hammer extends HarvestTool
|
||||
if (block == Blocks.monster_egg)
|
||||
validStart = true;
|
||||
|
||||
MovingObjectPosition mop = AbilityHelper.raytraceFromEntity(world, player, true, 4.5D);
|
||||
MovingObjectPosition mop = AbilityHelper.raytraceFromEntity(world, player, false, 4.5D);
|
||||
if (mop == null || !validStart)
|
||||
return super.onBlockStartBreak(stack, x, y, z, player);
|
||||
|
||||
|
||||
@@ -211,8 +211,9 @@ public class LumberAxe extends HarvestTool
|
||||
{
|
||||
int localMeta = world.getBlockMetadata(xPos, yPos, zPos);
|
||||
int hlvl = localBlock.getHarvestLevel(localMeta);
|
||||
float localHardness = localBlock == null ? Float.MAX_VALUE : localBlock.getBlockHardness(world, xPos, yPos, zPos);
|
||||
|
||||
if (hlvl <= tags.getInteger("HarvestLevel"))
|
||||
if (hlvl <= tags.getInteger("HarvestLevel") && !(localHardness < 0))
|
||||
{
|
||||
boolean cancelHarvest = false;
|
||||
for (ActiveToolMod mod : TConstructRegistry.activeModifiers)
|
||||
@@ -286,8 +287,9 @@ public class LumberAxe extends HarvestTool
|
||||
Block localBlock = world.getBlock(xPos, yPos, zPos);
|
||||
int localMeta = world.getBlockMetadata(xPos, yPos, zPos);
|
||||
int hlvl = localBlock.getHarvestLevel(localMeta);
|
||||
float localHardness = localBlock == null ? Float.MAX_VALUE : localBlock.getBlockHardness(world, xPos, yPos, zPos);
|
||||
|
||||
if (localBlock != null && localBlock.getMaterial() == Material.wood)
|
||||
if (localBlock != null && localBlock.getMaterial() == Material.wood && !(localHardness < 0))
|
||||
{
|
||||
if (hlvl <= tags.getInteger("HarvestLevel"))
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user