mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-11-28 13:45:36 +01:00
*
This commit is contained in:
parent
ae1e05fda4
commit
f0553f80ae
@ -137,7 +137,7 @@ public class FaweAdapter_All implements BukkitImplAdapter {
|
|||||||
int[] ids = new int[]{10, 1, 7, 6, 5, 3, 11, 9, 0, 8, 2, 4};
|
int[] ids = new int[]{10, 1, 7, 6, 5, 3, 11, 9, 0, 8, 2, 4};
|
||||||
|
|
||||||
int noMods = Modifier.STATIC;
|
int noMods = Modifier.STATIC;
|
||||||
int hasMods = Modifier.PRIVATE;
|
int hasMods = 0;
|
||||||
for (int i = 0; i < nmsClasses.size(); i++) {
|
for (int i = 0; i < nmsClasses.size(); i++) {
|
||||||
Class<?> nmsClass = ReflectionUtils.getNmsClass(nmsClasses.get(i));
|
Class<?> nmsClass = ReflectionUtils.getNmsClass(nmsClasses.get(i));
|
||||||
Class<? extends Tag> weClass = weClasses.get(i);
|
Class<? extends Tag> weClass = weClasses.get(i);
|
||||||
@ -221,7 +221,7 @@ public class FaweAdapter_All implements BukkitImplAdapter {
|
|||||||
classEntityTypes = ReflectionUtils.getNmsClass("EntityTypes");
|
classEntityTypes = ReflectionUtils.getNmsClass("EntityTypes");
|
||||||
|
|
||||||
getBukkitEntity = ReflectionUtils.setAccessible(classEntity.getDeclaredMethod("getBukkitEntity"));
|
getBukkitEntity = ReflectionUtils.setAccessible(classEntity.getDeclaredMethod("getBukkitEntity"));
|
||||||
addEntity = ReflectionUtils.setAccessible(classWorld.getDeclaredMethod("addEntity", classEntity));
|
addEntity = ReflectionUtils.setAccessible(classWorld.getDeclaredMethod("addEntity", classEntity, CreatureSpawnEvent.SpawnReason.class));
|
||||||
setLocation = ReflectionUtils.setAccessible(classEntity.getDeclaredMethod("setLocation", double.class, double.class, double.class, float.class, float.class));
|
setLocation = ReflectionUtils.setAccessible(classEntity.getDeclaredMethod("setLocation", double.class, double.class, double.class, float.class, float.class));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -290,7 +290,7 @@ public class ReflectionUtils {
|
|||||||
|
|
||||||
public static Field findField(final Class<?> clazz, final Class<?> type, int hasMods, int noMods) {
|
public static Field findField(final Class<?> clazz, final Class<?> type, int hasMods, int noMods) {
|
||||||
for (Field field : clazz.getDeclaredFields()) {
|
for (Field field : clazz.getDeclaredFields()) {
|
||||||
if (type == null || field.getType() == type) {
|
if (type == null || type.isAssignableFrom(field.getType())) {
|
||||||
int mods = field.getModifiers();
|
int mods = field.getModifiers();
|
||||||
if ((mods & hasMods) == hasMods && (mods & noMods) == 0) {
|
if ((mods & hasMods) == hasMods && (mods & noMods) == 0) {
|
||||||
return setAccessible(field);
|
return setAccessible(field);
|
||||||
|
Loading…
Reference in New Issue
Block a user