Skip to content

Commit b62c724

Browse files
Now using "Menus.PLUGIN"
1 parent aad2058 commit b62c724

File tree

1 file changed

+6
-9
lines changed
  • src/main/java/me/flame/menus/components/nbt

1 file changed

+6
-9
lines changed

src/main/java/me/flame/menus/components/nbt/Pdc.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
package me.flame.menus.components.nbt;
22

3+
import me.flame.menus.menu.Menus;
4+
35
import org.bukkit.NamespacedKey;
46
import org.bukkit.inventory.ItemStack;
57
import org.bukkit.inventory.meta.ItemMeta;
68
import org.bukkit.persistence.PersistentDataType;
7-
import org.bukkit.plugin.Plugin;
8-
import org.bukkit.plugin.java.JavaPlugin;
99
import org.jetbrains.annotations.NotNull;
1010
import org.jetbrains.annotations.Nullable;
1111

12+
import static me.flame.menus.menu.Menus.PLUGIN;
13+
1214
/**
1315
* Wrapper for compatibility with {@link LegacyNbt}.
1416
* This ideally wouldn't need exist, but legacy.
1517
*/
1618
public final class Pdc implements NbtWrapper {
1719

18-
/**
19-
* Plugin instance required for the {@link NamespacedKey}.
20-
*/
21-
private static final Plugin PLUGIN = JavaPlugin.getProvidingPlugin(Pdc.class);
22-
2320
/**
2421
* Sets a String NBT tag to the an {@link ItemStack}.
2522
*
@@ -40,7 +37,7 @@ public ItemStack setString(@NotNull final ItemStack itemStack, final String key,
4037
/**
4138
* Removes a tag from an {@link ItemStack}.
4239
*
43-
* @param itemStack The current {@link ItemStack} to be remove.
40+
* @param itemStack The current {@link ItemStack} to be removed.
4441
* @param key The NBT key to remove.
4542
* @return An {@link ItemStack} that has the tag removed.
4643
*/
@@ -85,4 +82,4 @@ public String getString(@NotNull final ItemStack itemStack, final String key) {
8582
if (meta == null) return null;
8683
return meta.getPersistentDataContainer().get(new NamespacedKey(PLUGIN, key), PersistentDataType.STRING);
8784
}
88-
}
85+
}

0 commit comments

Comments
 (0)