diff --git a/src/no/runsafe/framework/tools/nms/EntityRegister.java b/src/no/runsafe/framework/tools/nms/EntityRegister.java index b9065afb..ae6ff1be 100644 --- a/src/no/runsafe/framework/tools/nms/EntityRegister.java +++ b/src/no/runsafe/framework/tools/nms/EntityRegister.java @@ -2,6 +2,7 @@ import net.minecraft.server.v1_12_R1.Entity; import net.minecraft.server.v1_12_R1.EntityTypes; +import net.minecraft.server.v1_12_R1.MinecraftKey; import java.io.DataOutput; import java.lang.reflect.Field; @@ -16,16 +17,9 @@ private EntityRegister() public static void registerEntity(Class customClass, String name, int id) { - try - { - Method method = EntityTypes.class.getDeclaredMethod("a", int.class, String.class, Class.class, String.class ); - method.setAccessible(true); - method.invoke(EntityTypes.class, id, name, customClass, name); - } - catch (Exception e) - { - // no custom entities for you - } + MinecraftKey key = new MinecraftKey(name); + EntityTypes.b.a(id, key, customClass); + EntityTypes.d.add(key); } public static void registerOverrideEntity(Class customClass, String name, int id)