mirror of
https://github.com/YouHaveTrouble/BlockEdit.git
synced 2026-06-29 13:36:19 +00:00
fix ArrayOutOfBounds when selecting 1 chunk
This commit is contained in:
@@ -33,7 +33,7 @@ public class ReplaceOperation {
|
||||
task.cancel();
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i<= chunksPerTick; i++) {
|
||||
for (int i = 0; i< chunksPerTick; i++) {
|
||||
processChunkWork(chunkwork.get(element.getAndDecrement()), bePlayer.getSelectionWorld());
|
||||
}
|
||||
}, 0, 1);
|
||||
|
||||
@@ -24,6 +24,7 @@ public class SetOperation {
|
||||
this.selection = bePlayer.getSelection();
|
||||
this.blockToSet = blockToSet;
|
||||
this.chunkwork.addAll(chunkWorks);
|
||||
|
||||
AtomicInteger element = new AtomicInteger(chunkwork.size()-1);
|
||||
|
||||
Bukkit.getScheduler().runTaskTimer(BlockEdit.getPlugin(), (task) -> {
|
||||
@@ -31,7 +32,7 @@ public class SetOperation {
|
||||
task.cancel();
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i<= chunksPerTick; i++) {
|
||||
for (int i = 0; i< chunksPerTick; i++) {
|
||||
processChunkWork(chunkwork.get(element.getAndDecrement()), bePlayer.getSelectionWorld());
|
||||
}
|
||||
}, 0, 1);
|
||||
|
||||
Reference in New Issue
Block a user