From 6d559b18873c8753ee95789da787fceb84f7b41b Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sat, 19 Sep 2020 09:01:28 +1200 Subject: [PATCH] Fix paper & bounding boxes hating each other --- .../disguise/utilities/reflection/ReflectionManager.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java b/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java index 7f604027..d5f51dd1 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java @@ -410,6 +410,12 @@ public class ReflectionManager { } } + // Workaround for paper being 2 smart 4 me + getNmsMethod("Entity", "setPosition", double.class, double.class, double.class) + .invoke(entityObject, 1, 1, 1); + getNmsMethod("Entity", "setPosition", double.class, double.class, double.class) + .invoke(entityObject, 0, 0, 0); + return entityObject; } catch (Exception e) { DisguiseUtilities.getLogger() @@ -1369,7 +1375,8 @@ public class ReflectionManager { public static Object getEntityType(EntityType entityType) { try { Object val = entityTypesAMethod.invoke(null, - entityType.getName() == null ? entityType.name().toLowerCase(Locale.ENGLISH) : entityType.getName()); + entityType.getName() == null ? entityType.name().toLowerCase(Locale.ENGLISH) : + entityType.getName()); if (NmsVersion.v1_14.isSupported()) { return ((Optional) val).orElse(null);