hooks包
This commit is contained in:
parent
9c8756ca59
commit
f83c6ff51e
|
|
@ -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();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user