Archiviert
13
0

More descriptive error message when an entities tracker is not found.

Dieser Commit ist enthalten in:
Kristian S. Stangeland 2013-09-15 20:42:07 +02:00
Ursprung bed74f6ab6
Commit 4e2af45428

Datei anzeigen

@ -132,8 +132,13 @@ class EntityUtilities {
List<Player> result = new ArrayList<Player>();
Object trackerEntry = getEntityTrackerEntry(entity.getWorld(), entity.getEntityId());
if (trackedPlayersField == null)
if (trackerEntry == null) {
throw new IllegalArgumentException("Cannot find entity trackers for " + entity +
(entity.isDead() ? " - entity is dead." : "."));
}
if (trackedPlayersField == null) {
trackedPlayersField = FuzzyReflection.fromObject(trackerEntry).getFieldByType("java\\.util\\..*");
}
Collection<?> trackedPlayers = (Collection<?>) FieldUtils.readField(trackedPlayersField, trackerEntry, false);