mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2024-11-28 12:55:34 +01:00
Fixed ConcurrentModificationException while using queueLookup API method (fixes #481)
This commit is contained in:
parent
7424037795
commit
c91f460e42
@ -3,6 +3,7 @@ package net.coreprotect.api;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.ListIterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -49,7 +50,9 @@ public class QueueLookup extends Queue {
|
|||||||
Map<Integer, Object> consumerObject = Consumer.consumerObjects.get(currentConsumer);
|
Map<Integer, Object> consumerObject = Consumer.consumerObjects.get(currentConsumer);
|
||||||
|
|
||||||
Location oldLocation = block.getLocation();
|
Location oldLocation = block.getLocation();
|
||||||
for (Object[] data : consumerData) {
|
ListIterator<Object[]> iterator = consumerData.listIterator();
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
Object[] data = iterator.next();
|
||||||
int id = (int) data[0];
|
int id = (int) data[0];
|
||||||
int action = (int) data[1];
|
int action = (int) data[1];
|
||||||
if (action != Process.BLOCK_BREAK && action != Process.BLOCK_PLACE) {
|
if (action != Process.BLOCK_BREAK && action != Process.BLOCK_PLACE) {
|
||||||
|
Loading…
Reference in New Issue
Block a user