mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-04 00:46:08 +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
|
* @param blocks The blocks to remove
|
||||||
*/
|
*/
|
||||||
private void revert(Map<Block, BlockData> blocks) {
|
private void revert(Map<Block, BlockData> blocks) {
|
||||||
int amount = 0;
|
|
||||||
Iterator<Map.Entry<Block, BlockData>> it = blocks.entrySet().iterator();
|
Iterator<Map.Entry<Block, BlockData>> it = blocks.entrySet().iterator();
|
||||||
|
Bukkit.getScheduler().runTask(Iris.instance, () -> {
|
||||||
|
int amount = 0;
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
Map.Entry<Block, BlockData> entry = it.next();
|
Map.Entry<Block, BlockData> entry = it.next();
|
||||||
BlockData data = entry.getValue();
|
BlockData data = entry.getValue();
|
||||||
Bukkit.getScheduler().runTask(Iris.instance, () -> {
|
|
||||||
entry.getKey().setBlockData(data, false);
|
entry.getKey().setBlockData(data, false);
|
||||||
});
|
|
||||||
|
|
||||||
it.remove();
|
it.remove();
|
||||||
|
|
||||||
@ -87,6 +86,6 @@ public class ObjectSVC implements IrisService {
|
|||||||
J.s(() -> revert(blocks), 1);
|
J.s(() -> revert(blocks), 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user