Fix paper & bounding boxes hating each other

This commit is contained in:
libraryaddict 2020-09-19 09:01:28 +12:00
parent 2e22dad323
commit 6d559b1887

View File

@ -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; return entityObject;
} catch (Exception e) { } catch (Exception e) {
DisguiseUtilities.getLogger() DisguiseUtilities.getLogger()
@ -1369,7 +1375,8 @@ public class ReflectionManager {
public static Object getEntityType(EntityType entityType) { public static Object getEntityType(EntityType entityType) {
try { try {
Object val = entityTypesAMethod.invoke(null, 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()) { if (NmsVersion.v1_14.isSupported()) {
return ((Optional<Object>) val).orElse(null); return ((Optional<Object>) val).orElse(null);