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,23 +70,22 @@ 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();
|
||||||
while (it.hasNext()) {
|
Bukkit.getScheduler().runTask(Iris.instance, () -> {
|
||||||
Map.Entry<Block, BlockData> entry = it.next();
|
int amount = 0;
|
||||||
BlockData data = entry.getValue();
|
while (it.hasNext()) {
|
||||||
Bukkit.getScheduler().runTask(Iris.instance, () -> {
|
Map.Entry<Block, BlockData> entry = it.next();
|
||||||
|
BlockData data = entry.getValue();
|
||||||
entry.getKey().setBlockData(data, false);
|
entry.getKey().setBlockData(data, false);
|
||||||
});
|
|
||||||
|
|
||||||
it.remove();
|
it.remove();
|
||||||
|
|
||||||
amount++;
|
amount++;
|
||||||
|
|
||||||
if (amount > 200) {
|
if (amount > 200) {
|
||||||
J.s(() -> revert(blocks), 1);
|
J.s(() -> revert(blocks), 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user