mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-03 08:26:11 +00:00
Optimized it thx coco
This commit is contained in:
parent
cce3d74c52
commit
f42f06226c
@ -70,14 +70,13 @@ public class ObjectSVC implements IrisService {
|
||||
* @param blocks The blocks to remove
|
||||
*/
|
||||
private void revert(Map<Block, BlockData> blocks) {
|
||||
int amount = 0;
|
||||
Iterator<Map.Entry<Block, BlockData>> it = blocks.entrySet().iterator();
|
||||
Bukkit.getScheduler().runTask(Iris.instance, () -> {
|
||||
int amount = 0;
|
||||
while (it.hasNext()) {
|
||||
Map.Entry<Block, BlockData> entry = it.next();
|
||||
BlockData data = entry.getValue();
|
||||
Bukkit.getScheduler().runTask(Iris.instance, () -> {
|
||||
entry.getKey().setBlockData(data, false);
|
||||
});
|
||||
|
||||
it.remove();
|
||||
|
||||
@ -87,6 +86,6 @@ public class ObjectSVC implements IrisService {
|
||||
J.s(() -> revert(blocks), 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user