Class ReflectionUtil

java.lang.Object
com.ranull.graves.util.ReflectionUtil

public final class ReflectionUtil extends Object
Utility class for handling reflection operations related to Bukkit and Minecraft server classes.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Class<?>
    Retrieves a class from the net.minecraft.server package using the server version from the Bukkit package.
    static void
    swingMainHand(org.bukkit.entity.Player player)
    Triggers the main hand swing animation for the specified player using reflection to access Minecraft server methods.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ReflectionUtil

      public ReflectionUtil()
  • Method Details

    • swingMainHand

      public static void swingMainHand(org.bukkit.entity.Player player)
      Triggers the main hand swing animation for the specified player using reflection to access Minecraft server methods.
      Parameters:
      player - The player whose main hand swing animation is to be triggered.
    • getClass

      public static Class<?> getClass(String clazz) throws ClassNotFoundException
      Retrieves a class from the net.minecraft.server package using the server version from the Bukkit package.
      Parameters:
      clazz - The name of the class to retrieve.
      Returns:
      The class object for the specified class name.
      Throws:
      ClassNotFoundException - If the class cannot be found.