mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-08-29 08:42:17 +00:00
needs further testing, but presumably fixes #55
This commit is contained in:
parent
8985ea9560
commit
ca40c9cf19
@ -23,6 +23,7 @@ import dan200.computercraft.shared.util.WorldUtil;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.event.player.AttackEntityCallback;
|
||||
import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
@ -233,6 +234,10 @@ public class TurtleTool extends AbstractTurtleUpgrade
|
||||
return TurtleCommandResult.failure( digEvent.getFailureMessage() );
|
||||
}
|
||||
|
||||
if (!PlayerBlockBreakEvents.BEFORE.invoker().beforeBlockBreak(world, turtlePlayer, blockPosition, state, null)) {
|
||||
return TurtleCommandResult.failure( "Break cancelled" );
|
||||
}
|
||||
|
||||
// Consume the items the block drops
|
||||
DropConsumer.set( world, blockPosition, turtleDropConsumer( turtleBlock, turtle ) );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user