mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-31 04:46:37 +00:00
修复交互空气无位置参数
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user