mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Fix infinite loop re-sizing block state internal ID array.
This commit is contained in:
parent
efc4d7cba1
commit
542f87b8f7
@ -57,8 +57,12 @@ public final class BlockStateIdAccess {
|
|||||||
OptionalInt id = getBlockStateId(blockState);
|
OptionalInt id = getBlockStateId(blockState);
|
||||||
if (id.isPresent()) {
|
if (id.isPresent()) {
|
||||||
int i = id.getAsInt();
|
int i = id.getAsInt();
|
||||||
while (i >= blockStates.length) {
|
if (i >= blockStates.length) {
|
||||||
blockStates = Arrays.copyOf(blockStates, blockStates.length + blockStates.length >> 1);
|
int curLength = blockStates.length;
|
||||||
|
do {
|
||||||
|
curLength += curLength >> 1;
|
||||||
|
} while (i >= curLength);
|
||||||
|
blockStates = Arrays.copyOf(blockStates, curLength);
|
||||||
}
|
}
|
||||||
BlockState existing = blockStates[i];
|
BlockState existing = blockStates[i];
|
||||||
checkState(existing == null || existing == blockState,
|
checkState(existing == null || existing == blockState,
|
||||||
|
Loading…
Reference in New Issue
Block a user