1.14.4 Why doesn't this work again?

Discussion in 'Spigot Plugin Development' started by THE_REal_jadENO, Jul 19, 2021 at 9:04 AM.

  1. What ReflectUtils is ? Imported API, something in our class ?

    We can't help you if you just send a non-informative message...
     
  2. ReflectUtils is a class.

    Heres the code

    package de.superfreek.freeksentials.features.main;

    import java.lang.reflect.Field;

    import org.bukkit.Bukkit;

    public class ReflectUtils {

    public static void setField(Class<?> clazz, String fieldName, Object value) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException {
    Field f = clazz.getDeclaredField(fieldName);

    f.setAccessible(true);
    f.set(clazz, value);
    f.setAccessible(false);
    }
    public static void setField(Object o, String fieldName, Object value) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException {
    Field f = o.getClass().getDeclaredField(fieldName);

    f.setAccessible(true);
    f.set(o, value);
    f.setAccessible(false);
    }

    public static Class<?> getNMSClass(String className) {
    try {
    return Class.forName("net.minecraft.server." + getVersion() + "." + className);
    }
    }
    }
     
  3. Probably because there is no getVersion() method in your ReflectUtils class :unsure:
     
    • Agree Agree x 2