mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-13 16:54:06 +00:00
Fixed order of calls in ToolCommons. Closes #470.
This commit is contained in:
1 parent
a2a9f8a5b5
commit
f2b5e1f928
1 file changed
+11
-8
@@ -67,21 +67,24 @@ public final class ToolCommons {
|
||||
return;
|
||||
|
||||
Material mat = world.getBlock(x, y, z).getMaterial();
|
||||
if(!world.isRemote && blk != null && !blk.isAir(world, x, y, z) && blk.getPlayerRelativeBlockHardness(player, world, x, y, z) != 0) {
|
||||
if(!world.isRemote && blk != null && !blk.isAir(world, x, y, z) && blk.getPlayerRelativeBlockHardness(player, world, x, y, z) < 0) {
|
||||
new ArrayList();
|
||||
|
||||
if(!blk.canHarvestBlock(player, meta) || !isRightMaterial(mat, materialsListing))
|
||||
return;
|
||||
|
||||
if(!player.capabilities.isCreativeMode && blk != Blocks.bedrock) {
|
||||
if(!player.capabilities.isCreativeMode) {
|
||||
int localMeta = world.getBlockMetadata(x, y, z);
|
||||
if (blk.removedByPlayer(world, player, x, y, z))
|
||||
blk.onBlockDestroyedByPlayer(world, x, y, z, localMeta);
|
||||
|
||||
damageItem(stack, 1, player, 80);
|
||||
if(!dispose || !ItemElementiumPick.isDisposable(blk))
|
||||
blk.harvestBlock(world, player, x, y, z, localMeta);
|
||||
blk.onBlockHarvested(world, x, y, z, localMeta, player);
|
||||
|
||||
if(blk.removedByPlayer(world, player, x, y, z, true)) {
|
||||
blk.onBlockDestroyedByPlayer(world, x, y, z, localMeta);
|
||||
|
||||
if(!dispose || !ItemElementiumPick.isDisposable(blk))
|
||||
blk.harvestBlock(world, player, x, y, z, localMeta);
|
||||
}
|
||||
|
||||
damageItem(stack, 1, player, 80);
|
||||
} else world.setBlockToAir(x, y, z);
|
||||
|
||||
if(ConfigHandler.blockBreakParticles && ConfigHandler.blockBreakParticlesTool && !world.isRemote)
|
||||
|
||||
Reference in new issue
Block a user