mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-04-11 21:33:15 +00:00
Fix turtles harvesting blocks when they shouldn't (#276)
harvestBlock should only be called when removedByPlayer and canHarvestBlock return true, otherwise we run the risk of causing dupe bugs. See #273.
This commit is contained in:
parent
6279816ecc
commit
303b57779a
@ -246,7 +246,7 @@ public class TurtleTool extends AbstractTurtleUpgrade
|
||||
boolean canHarvest = state.getBlock().canHarvestBlock( world, blockPosition, turtlePlayer );
|
||||
boolean canBreak = state.getBlock().removedByPlayer( state, world, blockPosition, turtlePlayer, canHarvest );
|
||||
if( canBreak ) state.getBlock().onPlayerDestroy( world, blockPosition, state );
|
||||
if( canHarvest )
|
||||
if( canHarvest && canBreak )
|
||||
{
|
||||
state.getBlock().harvestBlock( world, turtlePlayer, blockPosition, state, tile, turtlePlayer.getHeldItemMainhand() );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user