mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-23 09:37:50 +01:00
Use more cached methods
This commit is contained in:
parent
91bebabc7f
commit
fdd5bc5a8e
@ -92,10 +92,10 @@ public class SpawnEggRefl {
|
|||||||
tagCompound = NBTTagCompoundConstructor.newInstance();
|
tagCompound = NBTTagCompoundConstructor.newInstance();
|
||||||
}
|
}
|
||||||
Object id = 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());
|
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);
|
tagSetTag.invoke(tagCompound, "EntityTag", id);
|
||||||
|
|
||||||
Method stackSetTag = ReflUtil.getMethodCached(NMSItemStackClass, "setTag", NBTTagCompoundClass);
|
Method stackSetTag = ReflUtil.getMethodCached(NMSItemStackClass, "setTag", NBTTagCompoundClass);
|
||||||
|
Loading…
Reference in New Issue
Block a user