Fix/improve Affects Spawning API (#7329)

This commit is contained in:
Jake Potrebic
2022-11-15 11:15:01 -08:00
parent f93eb6e135
commit a81c97eafe
3 changed files with 52 additions and 32 deletions

View File

@@ -20,8 +20,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override
public boolean canUse() {
- return this.horse.level.hasNearbyAlivePlayer(this.horse.getX(), this.horse.getY(), this.horse.getZ(), 10.0D);
+ return !(eligiblePlayers = this.horse.level.findNearbyBukkitPlayers(this.horse.getX(), this.horse.getY(), this.horse.getZ(), 10.0D, false)).isEmpty(); // Paper
- return this.horse.level.hasNearbyAlivePlayerThatAffectsSpawning(this.horse.getX(), this.horse.getY(), this.horse.getZ(), 10.0D); // Paper - Affects Spawning API
+ return !(eligiblePlayers = this.horse.level.findNearbyBukkitPlayers(this.horse.getX(), this.horse.getY(), this.horse.getZ(), 10.0D, net.minecraft.world.entity.EntitySelector.PLAYER_AFFECTS_SPAWNING)).isEmpty(); // Paper - Affects Spawning API & SkeletonHorseTrapEvent
}
@Override