Use more cached methods

This commit is contained in:
vemacs 2016-06-10 07:44:16 -06:00
parent 91bebabc7f
commit fdd5bc5a8e

View File

@ -92,10 +92,10 @@ public class SpawnEggRefl {
tagCompound = NBTTagCompoundConstructor.newInstance();
}
Object id = NBTTagCompoundConstructor.newInstance();
Method tagSetString = NBTTagCompoundClass.getDeclaredMethod("setString", String.class, String.class);
Method tagSetString = ReflUtil.getMethodCached(NBTTagCompoundClass, "setString", String.class, String.class);
tagSetString.invoke(id, "id", type.getName());
Method tagSetTag = NBTTagCompoundClass.getDeclaredMethod("set", String.class, NBTTagCompoundClass.getSuperclass());
Method tagSetTag = ReflUtil.getMethodCached(NBTTagCompoundClass, "set", String.class, NBTTagCompoundClass.getSuperclass());
tagSetTag.invoke(tagCompound, "EntityTag", id);
Method stackSetTag = ReflUtil.getMethodCached(NMSItemStackClass, "setTag", NBTTagCompoundClass);