Skip to content

Commit

Permalink
Add Ref before each reflected class
Browse files Browse the repository at this point in the history
  • Loading branch information
srnyx committed May 24, 2023
1 parent 173f1da commit dd784fd
Show file tree
Hide file tree
Showing 17 changed files with 66 additions and 66 deletions.
6 changes: 3 additions & 3 deletions api/src/main/java/xyz/srnyx/annoyingapi/AnnoyingMessage.java
Expand Up @@ -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;


/**
Expand Down
16 changes: 8 additions & 8 deletions api/src/main/java/xyz/srnyx/annoyingapi/file/AnnoyingFile.java
Expand Up @@ -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.*;


/**
Expand Down
Expand Up @@ -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 {
;

/**
Expand Down
Expand Up @@ -12,7 +12,7 @@
/**
* org.bukkit.NamespacedKey
*/
public class NamespacedKey {
public class RefNamespacedKey {
/**
* 1.12+ org.bukkit.NamespacedKey
*/
Expand All @@ -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");
}
}
Expand Up @@ -8,7 +8,7 @@
/**
* org.bukkit.attribute.Attribute
*/
public enum Attribute {
public enum RefAttribute {
;

/**
Expand Down
Expand Up @@ -13,7 +13,7 @@
/**
* org.bukkit.attribute.AttributeModifier
*/
public class AttributeModifier {
public class RefAttributeModifier {
/**
* 1.9+ org.bukkit.attribute.AttributeModifier
*/
Expand All @@ -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 {
;

/**
Expand Down
Expand Up @@ -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)
*/
Expand All @@ -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...)
*/
Expand All @@ -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");
}
}
Expand Down
Expand Up @@ -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;
Expand All @@ -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<org.bukkit.inventory.ShapedRecipe> SHAPED_RECIPE_CONSTRUCTOR = ReflectionUtility.getConstructor(10120, org.bukkit.inventory.ShapedRecipe.class, NamespacedKey.NAMESPACED_KEY_CLASS, ItemStack.class);
@Nullable public static final Constructor<org.bukkit.inventory.ShapedRecipe> 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");
}
}
Expand Up @@ -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;
Expand All @@ -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<org.bukkit.inventory.ShapelessRecipe> SHAPELESS_RECIPE_CONSTRUCTOR = ReflectionUtility.getConstructor(10120, org.bukkit.inventory.ShapelessRecipe.class, NamespacedKey.NAMESPACED_KEY_CLASS, ItemStack.class);
@Nullable public static final Constructor<org.bukkit.inventory.ShapelessRecipe> 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");
}
}
Expand Up @@ -10,7 +10,7 @@
/**
* org.bukkit.inventory.meta.Damageable
*/
public class Damageable {
public class RefDamageable {
/**
* 1.13+ org.bukkit.inventory.meta.Damageable
*/
Expand All @@ -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");
}
}
Expand Up @@ -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;
Expand All @@ -12,7 +12,7 @@
/**
* org.bukkit.inventory.meta.ItemMeta
*/
public class ItemMeta {
public class RefItemMeta {
/**
* 1.11+ org.bukkit.inventory.meta.ItemMeta#setUnbreakable(boolean)
*/
Expand All @@ -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()
Expand All @@ -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");
}
}
Expand Up @@ -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;
Expand All @@ -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
*/
Expand All @@ -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");
}
}
Expand Up @@ -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
*/
Expand All @@ -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");
}
}
Expand Up @@ -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;
Expand All @@ -11,7 +11,7 @@
/**
* org.bukkit.persistence.PersistentDataContainer
*/
public class PersistentDataContainer {
public class RefPersistentDataContainer {
/**
* 1.14+ org.bukkit.persistence.PersistentDataContainer
*/
Expand All @@ -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");
}
}

0 comments on commit dd784fd

Please sign in to comment.