mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 04:56:50 +01:00
Check if entity is in list before decrementing. Fixes BUKKIT-5404
This commit is contained in:
parent
00b3721f07
commit
d9e04a5b24
1 changed files with 5 additions and 3 deletions
|
@ -976,10 +976,12 @@ public abstract class World implements IBlockAccess {
|
|||
|
||||
// CraftBukkit start - Decrement loop variable field if we've already ticked this entity
|
||||
int index = this.entityList.indexOf(entity);
|
||||
if (index <= this.tickPosition) {
|
||||
this.tickPosition--;
|
||||
if (index != -1) {
|
||||
if (index <= this.tickPosition) {
|
||||
this.tickPosition--;
|
||||
}
|
||||
this.entityList.remove(index);
|
||||
}
|
||||
this.entityList.remove(index);
|
||||
// CraftBukkit end
|
||||
|
||||
this.b(entity);
|
||||
|
|
Loading…
Reference in a new issue