SPIGOT-1864: Improve entity collision capping

This commit is contained in:
md_5 2016-03-10 16:23:26 +11:00
parent f91b836282
commit c81789f27e

View file

@ -27,7 +27,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (this.isInteractable() && !list.isEmpty()) { // Spigot: Add isInteractable() condition
- for (int i = 0; i < list.size(); ++i) {
+ numCollisions -= world.spigotConfig.maxCollisionsPerEntity; // Spigot
+ numCollisions = Math.max(0, numCollisions - world.spigotConfig.maxCollisionsPerEntity); // Spigot
+ for (int i = 0; i < list.size() && numCollisions < world.spigotConfig.maxCollisionsPerEntity; ++i) {
Entity entity = (Entity) list.get(i);
// TODO better check now?