From f0553f80ae1c3094290c86740a7f886121ce082a Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sun, 13 Aug 2017 16:30:31 +1000 Subject: [PATCH] * --- .../main/java/com/boydti/fawe/bukkit/v0/FaweAdapter_All.java | 4 ++-- core/src/main/java/com/boydti/fawe/util/ReflectionUtils.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bukkit/src/main/java/com/boydti/fawe/bukkit/v0/FaweAdapter_All.java b/bukkit/src/main/java/com/boydti/fawe/bukkit/v0/FaweAdapter_All.java index e08a3541..88411785 100644 --- a/bukkit/src/main/java/com/boydti/fawe/bukkit/v0/FaweAdapter_All.java +++ b/bukkit/src/main/java/com/boydti/fawe/bukkit/v0/FaweAdapter_All.java @@ -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 noMods = Modifier.STATIC; - int hasMods = Modifier.PRIVATE; + int hasMods = 0; for (int i = 0; i < nmsClasses.size(); i++) { Class nmsClass = ReflectionUtils.getNmsClass(nmsClasses.get(i)); Class weClass = weClasses.get(i); @@ -221,7 +221,7 @@ public class FaweAdapter_All implements BukkitImplAdapter { classEntityTypes = ReflectionUtils.getNmsClass("EntityTypes"); 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)); try { diff --git a/core/src/main/java/com/boydti/fawe/util/ReflectionUtils.java b/core/src/main/java/com/boydti/fawe/util/ReflectionUtils.java index 4c8f12da..a221e9f6 100644 --- a/core/src/main/java/com/boydti/fawe/util/ReflectionUtils.java +++ b/core/src/main/java/com/boydti/fawe/util/ReflectionUtils.java @@ -290,7 +290,7 @@ public class ReflectionUtils { public static Field findField(final Class clazz, final Class type, int hasMods, int noMods) { for (Field field : clazz.getDeclaredFields()) { - if (type == null || field.getType() == type) { + if (type == null || type.isAssignableFrom(field.getType())) { int mods = field.getModifiers(); if ((mods & hasMods) == hasMods && (mods & noMods) == 0) { return setAccessible(field);