This commit is contained in:
GaLicn 2025-09-06 15:25:00 +08:00
parent 9c8756ca59
commit f83c6ff51e

View File

@ -25,7 +25,8 @@ public final class WrenchHook {
@SubscribeEvent @SubscribeEvent
public static void onPlayerUseBlockEvent(PlayerInteractEvent.RightClickBlock event) { public static void onPlayerUseBlockEvent(PlayerInteractEvent.RightClickBlock event) {
if (event.getUseBlock() == Event.Result.DENY) { // 1.21 NeoForge: 避免依赖 Event.Result使用 isCanceled() 进行早退检查
if (event.isCanceled()) {
return; return;
} }
var player = event.getEntity(); var player = event.getEntity();