More descriptive error message when an entities tracker is not found.
Dieser Commit ist enthalten in:
Ursprung
bed74f6ab6
Commit
4e2af45428
@ -132,9 +132,14 @@ 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);
|
||||
|
||||
// Wrap every player - we also ensure that the underlying tracker list is immutable
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren