Skip to content

Commit

Permalink
(fix) exception thrown on removing legacy item frame lock...
Browse files Browse the repository at this point in the history
and clean up code
  • Loading branch information
Lori3f6 committed Aug 29, 2024
1 parent e34b95a commit b83ada4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 0 additions & 5 deletions src/main/java/cat/nyaa/ukit/SpigotLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -309,10 +308,6 @@ private boolean setupChat() {
private void IGNORE_RESULT(Object o) {
}

public static UKitAPI getUKitAPI(){
return uKitAPI;
}

enum SubCommands {
RELOAD,
SHOW,
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/cat/nyaa/ukit/lock/LockFunction.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> subCommands = List.of("info", "setup", "remove", "property");

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit b83ada4

Please sign in to comment.