9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-30 20:39:10 +00:00

修复交互空气无位置参数

This commit is contained in:
XiaoMoMi
2025-05-30 18:40:20 +08:00
parent 5566f589a2
commit bac73e5553

View File

@@ -280,6 +280,7 @@ public class ItemEventListener implements Listener {
PlayerOptionalContext context = PlayerOptionalContext.of(serverPlayer, ContextHolder.builder()
.withParameter(DirectContextParameters.HAND, hand)
.withOptionalParameter(DirectContextParameters.ITEM_IN_HAND, itemInHand)
.withParameter(DirectContextParameters.POSITION, LocationUtils.toWorldPosition(player.getLocation()))
);
CustomItem<ItemStack> customItem = optionalCustomItem.get();
if (action.isRightClick()) customItem.execute(context, EventTrigger.RIGHT_CLICK);