1
1
package me .flame .menus .components .nbt ;
2
2
3
+ import me .flame .menus .menu .Menus ;
4
+
3
5
import org .bukkit .NamespacedKey ;
4
6
import org .bukkit .inventory .ItemStack ;
5
7
import org .bukkit .inventory .meta .ItemMeta ;
6
8
import org .bukkit .persistence .PersistentDataType ;
7
- import org .bukkit .plugin .Plugin ;
8
- import org .bukkit .plugin .java .JavaPlugin ;
9
9
import org .jetbrains .annotations .NotNull ;
10
10
import org .jetbrains .annotations .Nullable ;
11
11
12
+ import static me .flame .menus .menu .Menus .PLUGIN ;
13
+
12
14
/**
13
15
* Wrapper for compatibility with {@link LegacyNbt}.
14
16
* This ideally wouldn't need exist, but legacy.
15
17
*/
16
18
public final class Pdc implements NbtWrapper {
17
19
18
- /**
19
- * Plugin instance required for the {@link NamespacedKey}.
20
- */
21
- private static final Plugin PLUGIN = JavaPlugin .getProvidingPlugin (Pdc .class );
22
-
23
20
/**
24
21
* Sets a String NBT tag to the an {@link ItemStack}.
25
22
*
@@ -40,7 +37,7 @@ public ItemStack setString(@NotNull final ItemStack itemStack, final String key,
40
37
/**
41
38
* Removes a tag from an {@link ItemStack}.
42
39
*
43
- * @param itemStack The current {@link ItemStack} to be remove .
40
+ * @param itemStack The current {@link ItemStack} to be removed .
44
41
* @param key The NBT key to remove.
45
42
* @return An {@link ItemStack} that has the tag removed.
46
43
*/
@@ -85,4 +82,4 @@ public String getString(@NotNull final ItemStack itemStack, final String key) {
85
82
if (meta == null ) return null ;
86
83
return meta .getPersistentDataContainer ().get (new NamespacedKey (PLUGIN , key ), PersistentDataType .STRING );
87
84
}
88
- }
85
+ }
0 commit comments