Skip to content

Commit 0e58ee1

Browse files
去掉LandmarkMenu对于Listener接口的实现
1 parent a76f639 commit 0e58ee1

1 file changed

Lines changed: 1 addition & 19 deletions

File tree

src/main/java/ict/minesunshineone/landmark/gui/LandmarkMenu.java

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import net.kyori.adventure.text.Component;
2828
import net.kyori.adventure.text.minimessage.MiniMessage;
2929

30-
public class LandmarkMenu implements InventoryHolder, Listener {
30+
public class LandmarkMenu implements InventoryHolder {
3131

3232
private static final String LANDMARK_KEY = "landmark_name";
3333
private final LandmarkPlugin plugin;
@@ -321,22 +321,4 @@ private void handleItemClick(ItemStack item, Player player) {
321321
}
322322
}
323323

324-
// 添加关闭菜单时的清理方法
325-
private void cleanup() {
326-
// 清理物品栏内容
327-
if (inventory != null) {
328-
inventory.clear();
329-
}
330-
331-
// 注销事件监听器
332-
HandlerList.unregisterAll(this);
333-
}
334-
335-
// 监听菜单关闭事件
336-
@EventHandler
337-
public void onInventoryClose(InventoryCloseEvent event) {
338-
if (event.getInventory().equals(inventory)) {
339-
cleanup();
340-
}
341-
}
342324
}

0 commit comments

Comments
 (0)