From dd784fda2aee98613c6b20216a625a8e1c11400c Mon Sep 17 00:00:00 2001 From: srnyx <25808801+srnyx@users.noreply.github.com> Date: Tue, 23 May 2023 23:20:31 -0400 Subject: [PATCH] Add `Ref` before each reflected class --- .../xyz/srnyx/annoyingapi/AnnoyingMessage.java | 6 +++--- .../xyz/srnyx/annoyingapi/file/AnnoyingFile.java | 16 ++++++++-------- .../chat/{ClickEvent.java => RefClickEvent.java} | 6 +++--- ...{NamespacedKey.java => RefNamespacedKey.java} | 4 ++-- .../{Attribute.java => RefAttribute.java} | 2 +- ...teModifier.java => RefAttributeModifier.java} | 10 +++++----- .../entity/{Player.java => RefPlayer.java} | 8 ++++---- .../{ShapedRecipe.java => RefShapedRecipe.java} | 8 ++++---- ...pelessRecipe.java => RefShapelessRecipe.java} | 8 ++++---- .../meta/{Damageable.java => RefDamageable.java} | 4 ++-- .../meta/{ItemMeta.java => RefItemMeta.java} | 10 +++++----- ...ainer.java => RefCustomItemTagContainer.java} | 12 ++++++------ .../{ItemTagType.java => RefItemTagType.java} | 4 ++-- ...iner.java => RefPersistentDataContainer.java} | 12 ++++++------ ...aHolder.java => RefPersistentDataHolder.java} | 4 ++-- ...tDataType.java => RefPersistentDataType.java} | 4 ++-- .../annoyingapi/utility/ItemDataUtility.java | 14 +++++++------- 17 files changed, 66 insertions(+), 66 deletions(-) rename api/src/main/java/xyz/srnyx/annoyingapi/reflection/net/md_5/bungee/api/chat/{ClickEvent.java => RefClickEvent.java} (90%) rename api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/{NamespacedKey.java => RefNamespacedKey.java} (93%) rename api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/attribute/{Attribute.java => RefAttribute.java} (94%) rename api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/attribute/{AttributeModifier.java => RefAttributeModifier.java} (83%) rename api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/entity/{Player.java => RefPlayer.java} (93%) rename api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/{ShapedRecipe.java => RefShapedRecipe.java} (75%) rename api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/{ShapelessRecipe.java => RefShapelessRecipe.java} (80%) rename api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/{Damageable.java => RefDamageable.java} (94%) rename api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/{ItemMeta.java => RefItemMeta.java} (82%) rename api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/tags/{CustomItemTagContainer.java => RefCustomItemTagContainer.java} (76%) rename api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/tags/{ItemTagType.java => RefItemTagType.java} (93%) rename api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/persistence/{PersistentDataContainer.java => RefPersistentDataContainer.java} (76%) rename api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/persistence/{PersistentDataHolder.java => RefPersistentDataHolder.java} (92%) rename api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/persistence/{PersistentDataType.java => RefPersistentDataType.java} (92%) diff --git a/api/src/main/java/xyz/srnyx/annoyingapi/AnnoyingMessage.java b/api/src/main/java/xyz/srnyx/annoyingapi/AnnoyingMessage.java index 0c6c172..235cbe3 100644 --- a/api/src/main/java/xyz/srnyx/annoyingapi/AnnoyingMessage.java +++ b/api/src/main/java/xyz/srnyx/annoyingapi/AnnoyingMessage.java @@ -24,9 +24,9 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import static xyz.srnyx.annoyingapi.reflection.net.md_5.bungee.api.chat.ClickEvent.Action.COPY_TO_CLIPBOARD; -import static xyz.srnyx.annoyingapi.reflection.org.bukkit.entity.Player.PLAYER_SEND_TITLE_METHOD; -import static xyz.srnyx.annoyingapi.reflection.org.bukkit.entity.Player.Spigot.PLAYER_SPIGOT_SEND_MESSAGE_METHOD; +import static xyz.srnyx.annoyingapi.reflection.net.md_5.bungee.api.chat.RefClickEvent.RefAction.COPY_TO_CLIPBOARD; +import static xyz.srnyx.annoyingapi.reflection.org.bukkit.entity.RefPlayer.PLAYER_SEND_TITLE_METHOD; +import static xyz.srnyx.annoyingapi.reflection.org.bukkit.entity.RefPlayer.RefSpigot.PLAYER_SPIGOT_SEND_MESSAGE_METHOD; /** diff --git a/api/src/main/java/xyz/srnyx/annoyingapi/file/AnnoyingFile.java b/api/src/main/java/xyz/srnyx/annoyingapi/file/AnnoyingFile.java index ffe578c..cc9bd83 100644 --- a/api/src/main/java/xyz/srnyx/annoyingapi/file/AnnoyingFile.java +++ b/api/src/main/java/xyz/srnyx/annoyingapi/file/AnnoyingFile.java @@ -27,14 +27,14 @@ import java.util.logging.Level; import java.util.stream.Collectors; -import static xyz.srnyx.annoyingapi.reflection.org.bukkit.NamespacedKey.NAMESPACED_KEY_CONSTRUCTOR; -import static xyz.srnyx.annoyingapi.reflection.org.bukkit.attribute.Attribute.ATTRIBUTE_ENUM; -import static xyz.srnyx.annoyingapi.reflection.org.bukkit.attribute.AttributeModifier.*; -import static xyz.srnyx.annoyingapi.reflection.org.bukkit.attribute.AttributeModifier.Operation.ATTRIBUTE_MODIFIER_OPERATION_ENUM; -import static xyz.srnyx.annoyingapi.reflection.org.bukkit.inventory.ShapedRecipe.SHAPED_RECIPE_CONSTRUCTOR; -import static xyz.srnyx.annoyingapi.reflection.org.bukkit.inventory.ShapelessRecipe.SHAPELESS_RECIPE_CONSTRUCTOR; -import static xyz.srnyx.annoyingapi.reflection.org.bukkit.inventory.meta.Damageable.*; -import static xyz.srnyx.annoyingapi.reflection.org.bukkit.inventory.meta.ItemMeta.*; +import static xyz.srnyx.annoyingapi.reflection.org.bukkit.RefNamespacedKey.NAMESPACED_KEY_CONSTRUCTOR; +import static xyz.srnyx.annoyingapi.reflection.org.bukkit.attribute.RefAttribute.ATTRIBUTE_ENUM; +import static xyz.srnyx.annoyingapi.reflection.org.bukkit.attribute.RefAttributeModifier.*; +import static xyz.srnyx.annoyingapi.reflection.org.bukkit.attribute.RefAttributeModifier.RefOperation.ATTRIBUTE_MODIFIER_OPERATION_ENUM; +import static xyz.srnyx.annoyingapi.reflection.org.bukkit.inventory.RefShapedRecipe.SHAPED_RECIPE_CONSTRUCTOR; +import static xyz.srnyx.annoyingapi.reflection.org.bukkit.inventory.RefShapelessRecipe.SHAPELESS_RECIPE_CONSTRUCTOR; +import static xyz.srnyx.annoyingapi.reflection.org.bukkit.inventory.meta.RefDamageable.*; +import static xyz.srnyx.annoyingapi.reflection.org.bukkit.inventory.meta.RefItemMeta.*; /** diff --git a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/net/md_5/bungee/api/chat/ClickEvent.java b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/net/md_5/bungee/api/chat/RefClickEvent.java similarity index 90% rename from api/src/main/java/xyz/srnyx/annoyingapi/reflection/net/md_5/bungee/api/chat/ClickEvent.java rename to api/src/main/java/xyz/srnyx/annoyingapi/reflection/net/md_5/bungee/api/chat/RefClickEvent.java index 14d9247..dcc6e64 100644 --- a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/net/md_5/bungee/api/chat/ClickEvent.java +++ b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/net/md_5/bungee/api/chat/RefClickEvent.java @@ -8,20 +8,20 @@ /** * net.md_5.bungee.api.chat.ClickEvent */ -public class ClickEvent { +public class RefClickEvent { /** * This class cannot be instantiated * * @throws UnsupportedOperationException if this class is instantiated */ - private ClickEvent() { + private RefClickEvent() { throw new UnsupportedOperationException("This is a reflected class and cannot be instantiated"); } /** * net.md_5.bungee.api.chat.ClickEvent.Action */ - public enum Action { + public enum RefAction { ; /** diff --git a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/NamespacedKey.java b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/RefNamespacedKey.java similarity index 93% rename from api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/NamespacedKey.java rename to api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/RefNamespacedKey.java index 1f451ab..38671e9 100644 --- a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/NamespacedKey.java +++ b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/RefNamespacedKey.java @@ -12,7 +12,7 @@ /** * org.bukkit.NamespacedKey */ -public class NamespacedKey { +public class RefNamespacedKey { /** * 1.12+ org.bukkit.NamespacedKey */ @@ -28,7 +28,7 @@ public class NamespacedKey { * * @throws UnsupportedOperationException if this class is instantiated */ - private NamespacedKey() { + private RefNamespacedKey() { throw new UnsupportedOperationException("This is a reflected class and cannot be instantiated"); } } diff --git a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/attribute/Attribute.java b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/attribute/RefAttribute.java similarity index 94% rename from api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/attribute/Attribute.java rename to api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/attribute/RefAttribute.java index 5ea71ba..694de99 100644 --- a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/attribute/Attribute.java +++ b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/attribute/RefAttribute.java @@ -8,7 +8,7 @@ /** * org.bukkit.attribute.Attribute */ -public enum Attribute { +public enum RefAttribute { ; /** diff --git a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/attribute/AttributeModifier.java b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/attribute/RefAttributeModifier.java similarity index 83% rename from api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/attribute/AttributeModifier.java rename to api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/attribute/RefAttributeModifier.java index 4cdece2..3211e02 100644 --- a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/attribute/AttributeModifier.java +++ b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/attribute/RefAttributeModifier.java @@ -13,7 +13,7 @@ /** * org.bukkit.attribute.AttributeModifier */ -public class AttributeModifier { +public class RefAttributeModifier { /** * 1.9+ org.bukkit.attribute.AttributeModifier */ @@ -22,26 +22,26 @@ public class AttributeModifier { /** * 1.9+ org.bukkit.attribute.AttributeModifier(String, double, org.bukkit.attribute.AttributeModifier.Operation) */ - @Nullable public static final Constructor ATTRIBUTE_MODIFIER_CONSTRUCTOR_3 = ReflectionUtility.getConstructor(10090, ATTRIBUTE_MODIFIER_CLASS, String.class, double.class, Operation.ATTRIBUTE_MODIFIER_OPERATION_ENUM); + @Nullable public static final Constructor ATTRIBUTE_MODIFIER_CONSTRUCTOR_3 = ReflectionUtility.getConstructor(10090, ATTRIBUTE_MODIFIER_CLASS, String.class, double.class, RefOperation.ATTRIBUTE_MODIFIER_OPERATION_ENUM); /** * 1.13.2+ org.bukkit.attribute.AttributeModifier(String, double, org.bukkit.attribute.AttributeModifier.Operation, org.bukkit.inventory.EquipmentSlot) */ - @Nullable public static final Constructor ATTRIBUTE_MODIFIER_CONSTRUCTOR_5 = ReflectionUtility.getConstructor(10132, ATTRIBUTE_MODIFIER_CLASS, UUID.class, String.class, double.class, Operation.ATTRIBUTE_MODIFIER_OPERATION_ENUM, EquipmentSlot.class); + @Nullable public static final Constructor ATTRIBUTE_MODIFIER_CONSTRUCTOR_5 = ReflectionUtility.getConstructor(10132, ATTRIBUTE_MODIFIER_CLASS, UUID.class, String.class, double.class, RefOperation.ATTRIBUTE_MODIFIER_OPERATION_ENUM, EquipmentSlot.class); /** * This class cannot be instantiated * * @throws UnsupportedOperationException if this class is instantiated */ - private AttributeModifier() { + private RefAttributeModifier() { throw new UnsupportedOperationException("This is a reflected class and cannot be instantiated"); } /** * org.bukkit.attribute.AttributeModifier.Operation */ - public enum Operation { + public enum RefOperation { ; /** diff --git a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/entity/Player.java b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/entity/RefPlayer.java similarity index 93% rename from api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/entity/Player.java rename to api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/entity/RefPlayer.java index f5c7195..49e5c7d 100644 --- a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/entity/Player.java +++ b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/entity/RefPlayer.java @@ -13,7 +13,7 @@ /** * org.bukkit.entity.Player */ -public class Player { +public class RefPlayer { /** * 1.11+ org.bukkit.entity.Player#sendTitle(String, String, int, int, int) */ @@ -24,14 +24,14 @@ public class Player { * * @throws UnsupportedOperationException if this class is instantiated */ - private Player() { + private RefPlayer() { throw new UnsupportedOperationException("This is a reflected class and cannot be instantiated"); } /** * org.bukkit.entity.Player.Spigot */ - public static class Spigot { + public static class RefSpigot { /** * 1.11+ org.bukkit.entity.Player.Spigot#sendMessage(net.md_5.bungee.api.ChatMessageType, net.md_5.bungee.api.chat.BaseComponent...) */ @@ -42,7 +42,7 @@ public static class Spigot { * * @throws UnsupportedOperationException if this class is instantiated */ - private Spigot() { + private RefSpigot() { throw new UnsupportedOperationException("This is a reflected class and cannot be instantiated"); } } diff --git a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/ShapedRecipe.java b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/RefShapedRecipe.java similarity index 75% rename from api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/ShapedRecipe.java rename to api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/RefShapedRecipe.java index e4fefa0..b2c5ca5 100644 --- a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/ShapedRecipe.java +++ b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/RefShapedRecipe.java @@ -4,7 +4,7 @@ import org.jetbrains.annotations.Nullable; -import xyz.srnyx.annoyingapi.reflection.org.bukkit.NamespacedKey; +import xyz.srnyx.annoyingapi.reflection.org.bukkit.RefNamespacedKey; import xyz.srnyx.annoyingapi.utility.ReflectionUtility; import java.lang.reflect.Constructor; @@ -13,18 +13,18 @@ /** * org.bukkit.inventory.ShapelessRecipe */ -public class ShapedRecipe { +public class RefShapedRecipe { /** * 1.12+ org.bukkit.inventory.ShapedRecipe(org.bukkit.NamespacedKey, ItemStack) */ - @Nullable public static final Constructor SHAPED_RECIPE_CONSTRUCTOR = ReflectionUtility.getConstructor(10120, org.bukkit.inventory.ShapedRecipe.class, NamespacedKey.NAMESPACED_KEY_CLASS, ItemStack.class); + @Nullable public static final Constructor SHAPED_RECIPE_CONSTRUCTOR = ReflectionUtility.getConstructor(10120, org.bukkit.inventory.ShapedRecipe.class, RefNamespacedKey.NAMESPACED_KEY_CLASS, ItemStack.class); /** * This class cannot be instantiated * * @throws UnsupportedOperationException if this class is instantiated */ - private ShapedRecipe() { + private RefShapedRecipe() { throw new UnsupportedOperationException("This is a reflected class and cannot be instantiated"); } } diff --git a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/ShapelessRecipe.java b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/RefShapelessRecipe.java similarity index 80% rename from api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/ShapelessRecipe.java rename to api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/RefShapelessRecipe.java index 4a2929c..bebb18c 100644 --- a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/ShapelessRecipe.java +++ b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/RefShapelessRecipe.java @@ -4,7 +4,7 @@ import org.jetbrains.annotations.Nullable; -import xyz.srnyx.annoyingapi.reflection.org.bukkit.NamespacedKey; +import xyz.srnyx.annoyingapi.reflection.org.bukkit.RefNamespacedKey; import xyz.srnyx.annoyingapi.utility.ReflectionUtility; import java.lang.reflect.Constructor; @@ -13,18 +13,18 @@ /** * org.bukkit.inventory.ShapelessRecipe */ -public class ShapelessRecipe { +public class RefShapelessRecipe { /** * 1.12+ org.bukkit.inventory.ShapelessRecipe(org.bukkit.NamespacedKey, ItemStack) */ - @Nullable public static final Constructor SHAPELESS_RECIPE_CONSTRUCTOR = ReflectionUtility.getConstructor(10120, org.bukkit.inventory.ShapelessRecipe.class, NamespacedKey.NAMESPACED_KEY_CLASS, ItemStack.class); + @Nullable public static final Constructor SHAPELESS_RECIPE_CONSTRUCTOR = ReflectionUtility.getConstructor(10120, org.bukkit.inventory.ShapelessRecipe.class, RefNamespacedKey.NAMESPACED_KEY_CLASS, ItemStack.class); /** * This class cannot be instantiated * * @throws UnsupportedOperationException if this class is instantiated */ - private ShapelessRecipe() { + private RefShapelessRecipe() { throw new UnsupportedOperationException("This is a reflected class and cannot be instantiated"); } } diff --git a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/Damageable.java b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/RefDamageable.java similarity index 94% rename from api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/Damageable.java rename to api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/RefDamageable.java index 368cb40..eb81dcb 100644 --- a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/Damageable.java +++ b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/RefDamageable.java @@ -10,7 +10,7 @@ /** * org.bukkit.inventory.meta.Damageable */ -public class Damageable { +public class RefDamageable { /** * 1.13+ org.bukkit.inventory.meta.Damageable */ @@ -26,7 +26,7 @@ public class Damageable { * * @throws UnsupportedOperationException if this class is instantiated */ - private Damageable() { + private RefDamageable() { throw new UnsupportedOperationException("This is a reflected class and cannot be instantiated"); } } diff --git a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/ItemMeta.java b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/RefItemMeta.java similarity index 82% rename from api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/ItemMeta.java rename to api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/RefItemMeta.java index 49c2792..fd19026 100644 --- a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/ItemMeta.java +++ b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/RefItemMeta.java @@ -2,8 +2,8 @@ import org.jetbrains.annotations.Nullable; -import xyz.srnyx.annoyingapi.reflection.org.bukkit.attribute.Attribute; -import xyz.srnyx.annoyingapi.reflection.org.bukkit.attribute.AttributeModifier; +import xyz.srnyx.annoyingapi.reflection.org.bukkit.attribute.RefAttribute; +import xyz.srnyx.annoyingapi.reflection.org.bukkit.attribute.RefAttributeModifier; import xyz.srnyx.annoyingapi.utility.ReflectionUtility; import java.lang.reflect.Method; @@ -12,7 +12,7 @@ /** * org.bukkit.inventory.meta.ItemMeta */ -public class ItemMeta { +public class RefItemMeta { /** * 1.11+ org.bukkit.inventory.meta.ItemMeta#setUnbreakable(boolean) */ @@ -21,7 +21,7 @@ public class ItemMeta { /** * 1.13.2+ org.bukkit.inventory.meta.ItemMeta#addAttributeModifier(org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier) */ - @Nullable public static final Method ITEM_META_ADD_ATTRIBUTE_MODIFIER = ReflectionUtility.getMethod(10132, org.bukkit.inventory.meta.ItemMeta.class, "addAttributeModifier", Attribute.ATTRIBUTE_ENUM, AttributeModifier.ATTRIBUTE_MODIFIER_CLASS); + @Nullable public static final Method ITEM_META_ADD_ATTRIBUTE_MODIFIER = ReflectionUtility.getMethod(10132, org.bukkit.inventory.meta.ItemMeta.class, "addAttributeModifier", RefAttribute.ATTRIBUTE_ENUM, RefAttributeModifier.ATTRIBUTE_MODIFIER_CLASS); /** * 1.13.2+ org.bukkit.inventory.meta.ItemMeta#getCustomTagContainer() @@ -38,7 +38,7 @@ public class ItemMeta { * * @throws UnsupportedOperationException if this class is instantiated */ - private ItemMeta() { + private RefItemMeta() { throw new UnsupportedOperationException("This is a reflected class and cannot be instantiated"); } } diff --git a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/tags/CustomItemTagContainer.java b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/tags/RefCustomItemTagContainer.java similarity index 76% rename from api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/tags/CustomItemTagContainer.java rename to api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/tags/RefCustomItemTagContainer.java index 496b31a..696a46e 100644 --- a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/tags/CustomItemTagContainer.java +++ b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/tags/RefCustomItemTagContainer.java @@ -2,7 +2,7 @@ import org.jetbrains.annotations.Nullable; -import xyz.srnyx.annoyingapi.reflection.org.bukkit.NamespacedKey; +import xyz.srnyx.annoyingapi.reflection.org.bukkit.RefNamespacedKey; import xyz.srnyx.annoyingapi.utility.ReflectionUtility; import java.lang.reflect.Method; @@ -11,7 +11,7 @@ /** * org.bukkit.inventory.meta.tags.CustomItemTagContainer */ -public class CustomItemTagContainer { +public class RefCustomItemTagContainer { /** * 1.13.2+ org.bukkit.inventory.meta.tags.CustomItemTagContainer */ @@ -20,24 +20,24 @@ public class CustomItemTagContainer { /** * 1.13.2+ org.bukkit.inventory.meta.tags.CustomItemTagContainer#getCustomTag(org.bukkit.NamespacedKey, org.bukkit.inventory.meta.tags.ItemTagType) */ - @Nullable public static final Method CUSTOM_ITEM_TAG_CONTAINER_GET_CUSTOM_TAG_METHOD = ReflectionUtility.getMethod(10132, CUSTOM_ITEM_TAG_CONTAINER_CLASS, "getCustomTag", NamespacedKey.NAMESPACED_KEY_CLASS, ItemTagType.ITEM_TAG_TYPE_CLASS); + @Nullable public static final Method CUSTOM_ITEM_TAG_CONTAINER_GET_CUSTOM_TAG_METHOD = ReflectionUtility.getMethod(10132, CUSTOM_ITEM_TAG_CONTAINER_CLASS, "getCustomTag", RefNamespacedKey.NAMESPACED_KEY_CLASS, RefItemTagType.ITEM_TAG_TYPE_CLASS); /** * 1.13.2+ org.bukkit.inventory.meta.tags.CustomItemTagContainer#setCustomTag(org.bukkit.NamespacedKey, org.bukkit.inventory.meta.tags.ItemTagType, Object) */ - @Nullable public static final Method CUSTOM_ITEM_TAG_CONTAINER_SET_CUSTOM_TAG_METHOD = ReflectionUtility.getMethod(10132, CUSTOM_ITEM_TAG_CONTAINER_CLASS, "setCustomTag", NamespacedKey.NAMESPACED_KEY_CLASS, ItemTagType.ITEM_TAG_TYPE_CLASS, Object.class); + @Nullable public static final Method CUSTOM_ITEM_TAG_CONTAINER_SET_CUSTOM_TAG_METHOD = ReflectionUtility.getMethod(10132, CUSTOM_ITEM_TAG_CONTAINER_CLASS, "setCustomTag", RefNamespacedKey.NAMESPACED_KEY_CLASS, RefItemTagType.ITEM_TAG_TYPE_CLASS, Object.class); /** * 1.13.2+ org.bukkit.inventory.meta.tags.CustomItemTagContainer#removeCustomTag(org.bukkit.NamespacedKey) */ - @Nullable public static final Method CUSTOM_ITEM_TAG_CONTAINER_REMOVE_CUSTOM_TAG_METHOD = ReflectionUtility.getMethod(10132, CUSTOM_ITEM_TAG_CONTAINER_CLASS, "removeCustomTag", NamespacedKey.NAMESPACED_KEY_CLASS); + @Nullable public static final Method CUSTOM_ITEM_TAG_CONTAINER_REMOVE_CUSTOM_TAG_METHOD = ReflectionUtility.getMethod(10132, CUSTOM_ITEM_TAG_CONTAINER_CLASS, "removeCustomTag", RefNamespacedKey.NAMESPACED_KEY_CLASS); /** * This class cannot be instantiated * * @throws UnsupportedOperationException if this class is instantiated */ - private CustomItemTagContainer() { + private RefCustomItemTagContainer() { throw new UnsupportedOperationException("This is a reflected class and cannot be instantiated"); } } diff --git a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/tags/ItemTagType.java b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/tags/RefItemTagType.java similarity index 93% rename from api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/tags/ItemTagType.java rename to api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/tags/RefItemTagType.java index ed1965b..a96886b 100644 --- a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/tags/ItemTagType.java +++ b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/inventory/meta/tags/RefItemTagType.java @@ -8,7 +8,7 @@ /** * org.bukkit.inventory.meta.tags.ItemTagType */ -public class ItemTagType { +public class RefItemTagType { /** * 1.13.2+ org.bukkit.inventory.meta.tags.ItemTagType */ @@ -24,7 +24,7 @@ public class ItemTagType { * * @throws UnsupportedOperationException if this class is instantiated */ - private ItemTagType() { + private RefItemTagType() { throw new UnsupportedOperationException("This is a reflected class and cannot be instantiated"); } } diff --git a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/persistence/PersistentDataContainer.java b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/persistence/RefPersistentDataContainer.java similarity index 76% rename from api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/persistence/PersistentDataContainer.java rename to api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/persistence/RefPersistentDataContainer.java index 60576ca..c873f12 100644 --- a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/persistence/PersistentDataContainer.java +++ b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/persistence/RefPersistentDataContainer.java @@ -2,7 +2,7 @@ import org.jetbrains.annotations.Nullable; -import xyz.srnyx.annoyingapi.reflection.org.bukkit.NamespacedKey; +import xyz.srnyx.annoyingapi.reflection.org.bukkit.RefNamespacedKey; import xyz.srnyx.annoyingapi.utility.ReflectionUtility; import java.lang.reflect.Method; @@ -11,7 +11,7 @@ /** * org.bukkit.persistence.PersistentDataContainer */ -public class PersistentDataContainer { +public class RefPersistentDataContainer { /** * 1.14+ org.bukkit.persistence.PersistentDataContainer */ @@ -20,24 +20,24 @@ public class PersistentDataContainer { /** * 1.14+ org.bukkit.persistence.PersistentDataContainer#get(org.bukkit.NamespacedKey, org.bukkit.persistence.PersistentDataType) */ - @Nullable public static final Method PERSISTENT_DATA_CONTAINER_GET_METHOD = ReflectionUtility.getMethod(10140, PERSISTENT_DATA_CONTAINER_CLASS, "get", NamespacedKey.NAMESPACED_KEY_CLASS, PersistentDataType.PERSISTENT_DATA_TYPE_CLASS); + @Nullable public static final Method PERSISTENT_DATA_CONTAINER_GET_METHOD = ReflectionUtility.getMethod(10140, PERSISTENT_DATA_CONTAINER_CLASS, "get", RefNamespacedKey.NAMESPACED_KEY_CLASS, RefPersistentDataType.PERSISTENT_DATA_TYPE_CLASS); /** * 1.14+ org.bukkit.persistence.PersistentDataContainer#get(org.bukkit.NamespacedKey, org.bukkit.persistence.PersistentDataType, Object) */ - @Nullable public static final Method PERSISTENT_DATA_CONTAINER_SET_METHOD = ReflectionUtility.getMethod(10140, PERSISTENT_DATA_CONTAINER_CLASS, "set", NamespacedKey.NAMESPACED_KEY_CLASS, PersistentDataType.PERSISTENT_DATA_TYPE_CLASS, Object.class); + @Nullable public static final Method PERSISTENT_DATA_CONTAINER_SET_METHOD = ReflectionUtility.getMethod(10140, PERSISTENT_DATA_CONTAINER_CLASS, "set", RefNamespacedKey.NAMESPACED_KEY_CLASS, RefPersistentDataType.PERSISTENT_DATA_TYPE_CLASS, Object.class); /** * 1.14+ org.bukkit.persistence.PersistentDataContainer#remove(org.bukkit.NamespacedKey) */ - @Nullable public static final Method PERSISTENT_DATA_CONTAINER_REMOVE_METHOD = ReflectionUtility.getMethod(10140, PERSISTENT_DATA_CONTAINER_CLASS, "remove", NamespacedKey.NAMESPACED_KEY_CLASS); + @Nullable public static final Method PERSISTENT_DATA_CONTAINER_REMOVE_METHOD = ReflectionUtility.getMethod(10140, PERSISTENT_DATA_CONTAINER_CLASS, "remove", RefNamespacedKey.NAMESPACED_KEY_CLASS); /** * This class cannot be instantiated * * @throws UnsupportedOperationException if this class is instantiated */ - private PersistentDataContainer() { + private RefPersistentDataContainer() { throw new UnsupportedOperationException("This is a reflected class and cannot be instantiated"); } } diff --git a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/persistence/PersistentDataHolder.java b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/persistence/RefPersistentDataHolder.java similarity index 92% rename from api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/persistence/PersistentDataHolder.java rename to api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/persistence/RefPersistentDataHolder.java index 4ed462a..73862cd 100644 --- a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/persistence/PersistentDataHolder.java +++ b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/persistence/RefPersistentDataHolder.java @@ -10,7 +10,7 @@ /** * org.bukkit.persistence.PersistentDataHolder */ -public class PersistentDataHolder { +public class RefPersistentDataHolder { /** * 1.14+ org.bukkit.persistence.PersistentDataHolder */ @@ -26,7 +26,7 @@ public class PersistentDataHolder { * * @throws UnsupportedOperationException if this class is instantiated */ - private PersistentDataHolder() { + private RefPersistentDataHolder() { throw new UnsupportedOperationException("This is a reflected class and cannot be instantiated"); } } diff --git a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/persistence/PersistentDataType.java b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/persistence/RefPersistentDataType.java similarity index 92% rename from api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/persistence/PersistentDataType.java rename to api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/persistence/RefPersistentDataType.java index e28b3d3..d08e5ea 100644 --- a/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/persistence/PersistentDataType.java +++ b/api/src/main/java/xyz/srnyx/annoyingapi/reflection/org/bukkit/persistence/RefPersistentDataType.java @@ -8,7 +8,7 @@ /** * org.bukkit.persistence.PersistentDataType */ -public class PersistentDataType { +public class RefPersistentDataType { /** * 1.14+ org.bukkit.persistence.PersistentDataType */ @@ -24,7 +24,7 @@ public class PersistentDataType { * * @throws UnsupportedOperationException if this class is instantiated */ - private PersistentDataType() { + private RefPersistentDataType() { throw new UnsupportedOperationException("This is a reflected class and cannot be instantiated"); } } diff --git a/api/src/main/java/xyz/srnyx/annoyingapi/utility/ItemDataUtility.java b/api/src/main/java/xyz/srnyx/annoyingapi/utility/ItemDataUtility.java index fd9cb1a..9d9f70e 100644 --- a/api/src/main/java/xyz/srnyx/annoyingapi/utility/ItemDataUtility.java +++ b/api/src/main/java/xyz/srnyx/annoyingapi/utility/ItemDataUtility.java @@ -12,13 +12,13 @@ import java.util.logging.Level; -import static xyz.srnyx.annoyingapi.reflection.org.bukkit.NamespacedKey.NAMESPACED_KEY_CONSTRUCTOR; -import static xyz.srnyx.annoyingapi.reflection.org.bukkit.inventory.meta.ItemMeta.ITEM_META_GET_CUSTOM_TAG_CONTAINER_METHOD; -import static xyz.srnyx.annoyingapi.reflection.org.bukkit.inventory.meta.tags.CustomItemTagContainer.*; -import static xyz.srnyx.annoyingapi.reflection.org.bukkit.inventory.meta.tags.ItemTagType.ITEM_TAG_TYPE_STRING; -import static xyz.srnyx.annoyingapi.reflection.org.bukkit.persistence.PersistentDataContainer.*; -import static xyz.srnyx.annoyingapi.reflection.org.bukkit.persistence.PersistentDataHolder.PERSISTENT_DATA_HOLDER_GET_PERSISTENT_DATA_CONTAINER_METHOD; -import static xyz.srnyx.annoyingapi.reflection.org.bukkit.persistence.PersistentDataType.PERSISTENT_DATA_TYPE_STRING; +import static xyz.srnyx.annoyingapi.reflection.org.bukkit.RefNamespacedKey.NAMESPACED_KEY_CONSTRUCTOR; +import static xyz.srnyx.annoyingapi.reflection.org.bukkit.inventory.meta.RefItemMeta.ITEM_META_GET_CUSTOM_TAG_CONTAINER_METHOD; +import static xyz.srnyx.annoyingapi.reflection.org.bukkit.inventory.meta.tags.RefCustomItemTagContainer.*; +import static xyz.srnyx.annoyingapi.reflection.org.bukkit.inventory.meta.tags.RefItemTagType.ITEM_TAG_TYPE_STRING; +import static xyz.srnyx.annoyingapi.reflection.org.bukkit.persistence.RefPersistentDataContainer.*; +import static xyz.srnyx.annoyingapi.reflection.org.bukkit.persistence.RefPersistentDataHolder.PERSISTENT_DATA_HOLDER_GET_PERSISTENT_DATA_CONTAINER_METHOD; +import static xyz.srnyx.annoyingapi.reflection.org.bukkit.persistence.RefPersistentDataType.PERSISTENT_DATA_TYPE_STRING; /**