AOE Tools now only break up to 10x harder blocks with it. (Yes, 10. believe me, you wouldn't like any lower value.)

That mean stone breaking obsidian is not a thing anymore
This commit is contained in:
Bernhard Bonigl committed 2014-10-06 09:43:57 +02:00
1 parent 92a1948831
commit bb652931a6
2 files changed
+8 -3

No files matched your search

@@ -82,7 +82,7 @@ public abstract class AOEHarvestTool extends HarvestTool {
// don't break the originally already broken block, duh
if (xPos == x && yPos == y && zPos == z)
continue;
breakExtraBlock(player.worldObj, xPos, yPos, zPos, sideHit, player);
breakExtraBlock(player.worldObj, xPos, yPos, zPos, sideHit, player, x,y,z);
}
}
@@ -221,7 +221,7 @@ public abstract class HarvestTool extends ToolCore
return used;
}
protected void breakExtraBlock(World world, int x, int y, int z, int sidehit, EntityPlayer player) {
protected void breakExtraBlock(World world, int x, int y, int z, int sidehit, EntityPlayer player, int refX, int refY, int refZ) {
// prevent calling that stuff for air blocks, could lead to unexpected behaviour since it fires events
if (world.isAirBlock(x, y, z))
return;
@@ -235,8 +235,13 @@ public abstract class HarvestTool extends ToolCore
if (!isEffective(block, meta))
return;
Block refBlock = world.getBlock(refX, refY, refZ);
float refStrength = ForgeHooks.blockStrength(refBlock, player, world, refX, refY, refZ);
float strength = ForgeHooks.blockStrength(block, player, world, x,y,z);
float foo = refStrength/strength;
// only harvestable blocks that aren't impossibly slow to harvest
if (!ForgeHooks.canHarvestBlock(block, player, meta) || ForgeHooks.blockStrength(block, player, world, x, y, z) <= 0.0001f)
if (!ForgeHooks.canHarvestBlock(block, player, meta) || refStrength/strength > 10f)
return;
if (player.capabilities.isCreativeMode) {