mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2025-01-18 22:31:31 +01:00
Get around expensive validate calls (#2318)
This commit is contained in:
parent
ab32f938d7
commit
d83dd9ab8a
@ -178,7 +178,9 @@ class EntityUtilities {
|
||||
Validate.notNull(entity, "entity cannot be null");
|
||||
|
||||
Object trackerEntry = this.getEntityTrackerEntry(entity.getWorld(), entity.getEntityId());
|
||||
Validate.notNull(trackerEntry, "Could not find entity trackers for " + entity);
|
||||
if (trackerEntry == null) { //entity.toString() is too expensive to be called every time
|
||||
throw new IllegalArgumentException("Could not find entity trackers for " + entity);
|
||||
}
|
||||
|
||||
if (this.trackedPlayersField == null) {
|
||||
this.trackedPlayersField = Accessors.getFieldAccessor(
|
||||
|
Loading…
Reference in New Issue
Block a user