9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2026-01-04 15:41:38 +00:00

feat(bukkit): 添加自定义方块交互事件

- 新增 CustomBlockInteractEvent 类用于自定义方块交互事件
- 在 ItemEventListener 中添加自定义方块交互事件的处理逻辑
- 当玩家使用主手右键自定义方块时,触发 CustomBlockInteractEvent
- 如果事件被取消,则取消玩家的交互事件
This commit is contained in:
jhqwqmc
2025-02-13 02:31:25 +08:00
parent 40c8651210
commit 5df5fa320f

View File

@@ -57,7 +57,6 @@ public class ItemEventListener implements Listener {
Location interactionPoint = event.getInteractionPoint();
if (interactionPoint == null) return;
Player bukkitPlayer = event.getPlayer();
// TODO: 自定义方块交互事件
Block clickedBlock = Objects.requireNonNull(event.getClickedBlock());
if (event.getHand() == EquipmentSlot.HAND) {
Key blockKey = BlockStateUtils.getRealBlockId(clickedBlock);