Archiviert
13
0

Revert changes to EntityUtilities

Citizens fixed the problem on their end
Dieser Commit ist enthalten in:
Dan Mulloy 2016-03-06 18:32:39 -05:00
Ursprung b8497a91a6
Commit ec38ac7292

Datei anzeigen

@ -216,9 +216,7 @@ class EntityUtilities {
throw new FieldAccessException("Cannot access 'trackedEntities' field due to security limitations.", e);
}
Object trackerEntry = WrappedIntHashMap.fromHandle(trackedEntities).get(entityID);
Class<?> entryClass = MinecraftReflection.getMinecraftClass("EntityTrackerEntry");
return entryClass.cast(trackerEntry);
return WrappedIntHashMap.fromHandle(trackedEntities).get(entityID);
}
/**
@ -235,28 +233,28 @@ class EntityUtilities {
if (trackerEntry != null) {
if (trackerField == null) {
try {
trackerField = trackerEntry.getClass().getDeclaredField("tracker");
Class<?> entryClass = MinecraftReflection.getMinecraftClass("EntityTrackerEntry");
trackerField = entryClass.getDeclaredField("tracker");
} catch (NoSuchFieldException e) {
// Assume it's the first entity field then
trackerField = FuzzyReflection.fromObject(trackerEntry, true)
.getFieldByType("tracker", MinecraftReflection.getEntityClass());
}
}
tracker = FieldUtils.readField(trackerField, trackerEntry, true);
}
// If the tracker is NULL, we'll just assume this entity doesn't exist
if (tracker != null)
return (Entity) MinecraftReflection.getBukkitEntity(tracker);
else
return null;
} catch (Exception e) {
throw new FieldAccessException("Cannot find entity from ID " + entityID + ".", e);
}
}
private static List<Object> unwrapBukkit(List<Player> players) {
List<Object> output = Lists.newArrayList();