mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-31 21:52:59 +00:00 
			
		
		
		
	needs further testing, but presumably fixes #55
This commit is contained in:
		| @@ -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 ) ); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jacob Farley
					Jacob Farley