mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2025-01-01 22:18:50 +01:00
More descriptive error message when an entities tracker is not found.
This commit is contained in:
parent
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
|
||||
|
Loading…
Reference in New Issue
Block a user