From b83ada46f15c214f8655472303e667cdff364d49 Mon Sep 17 00:00:00 2001 From: langua Date: Thu, 29 Aug 2024 15:00:28 +0200 Subject: [PATCH] (fix) exception thrown on removing legacy item frame lock... and clean up code --- src/main/java/cat/nyaa/ukit/SpigotLoader.java | 5 ----- src/main/java/cat/nyaa/ukit/lock/LockFunction.java | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/cat/nyaa/ukit/SpigotLoader.java b/src/main/java/cat/nyaa/ukit/SpigotLoader.java index 4d4aa80..727fd4c 100644 --- a/src/main/java/cat/nyaa/ukit/SpigotLoader.java +++ b/src/main/java/cat/nyaa/ukit/SpigotLoader.java @@ -58,7 +58,6 @@ public class SpigotLoader extends JavaPlugin implements TabExecutor { private ElytraFunction elytraFunction; private MailFunction mailFunction; private LoginPushFunction loginPushFunction; - private static UKitAPI uKitAPI; @Override public void onEnable() { @@ -309,10 +308,6 @@ private boolean setupChat() { private void IGNORE_RESULT(Object o) { } - public static UKitAPI getUKitAPI(){ - return uKitAPI; - } - enum SubCommands { RELOAD, SHOW, diff --git a/src/main/java/cat/nyaa/ukit/lock/LockFunction.java b/src/main/java/cat/nyaa/ukit/lock/LockFunction.java index 2a7c960..95e120b 100644 --- a/src/main/java/cat/nyaa/ukit/lock/LockFunction.java +++ b/src/main/java/cat/nyaa/ukit/lock/LockFunction.java @@ -34,7 +34,7 @@ public class LockFunction implements SubCommandExecutor, SubTabCompleter, Listen private final String LOCK_PERMISSION_PRIVILEGE_NODE = "ukit.lock.admin"; private final NamespacedKey LOCK_METADATA_KEY; private final NamespacedKey LOCK_CREATION_TIME_ON_ITEM_KEY; - private final NamespacedKey LEGACY_METADATA_UID = new NamespacedKey("nyaautils", "exhibitionkeyname"); + private final NamespacedKey LEGACY_METADATA_UID = new NamespacedKey("nyaautils", "exhibitionkeyuid"); private final UUID ZERO_UUID = UUID.fromString("00000000-0000-0000-0000-000000000000"); private final List subCommands = List.of("info", "setup", "remove", "property"); @@ -223,6 +223,7 @@ private boolean isLegacyLockedFrame(Entity entity) { private void removeLegacyLockedFrame(ItemFrame itemFrame) { itemFrame.setItem(null); itemFrame.setFixed(false); + itemFrame.getPersistentDataContainer().remove(LEGACY_METADATA_UID); } private UUID getLegacyLockFrameOwner(ItemFrame itemFrame) {