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