Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-26 02:50:06 +01:00
Adjust some synchronisation
Dieser Commit ist enthalten in:
Ursprung
09c4655be7
Commit
79f4be3941
@ -31,13 +31,14 @@ public abstract class CharBlocks implements IBlocks {
|
|||||||
};
|
};
|
||||||
protected final Section empty = new Section() {
|
protected final Section empty = new Section() {
|
||||||
@Override
|
@Override
|
||||||
public synchronized char[] get(CharBlocks blocks, int layer) {
|
public char[] get(CharBlocks blocks, int layer) {
|
||||||
// Defaults to aggressive as it should only be avoided where we know we've reset a chunk during an edit
|
// Defaults to aggressive as it should only be avoided where we know we've reset a chunk during an edit
|
||||||
return get(blocks, layer, true);
|
return get(blocks, layer, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized char[] get(CharBlocks blocks, int layer, boolean aggressive) {
|
public char[] get(CharBlocks blocks, int layer, boolean aggressive) {
|
||||||
|
synchronized (this) {
|
||||||
char[] arr = blocks.blocks[layer];
|
char[] arr = blocks.blocks[layer];
|
||||||
if (arr == null) {
|
if (arr == null) {
|
||||||
arr = blocks.blocks[layer] = blocks.update(layer, null, aggressive);
|
arr = blocks.blocks[layer] = blocks.update(layer, null, aggressive);
|
||||||
@ -55,6 +56,7 @@ public abstract class CharBlocks implements IBlocks {
|
|||||||
}
|
}
|
||||||
return arr;
|
return arr;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isFull() {
|
public boolean isFull() {
|
||||||
|
@ -24,7 +24,7 @@ public abstract class CharGetBlocks extends CharBlocks implements IChunkGet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean trim(boolean aggressive) {
|
public synchronized boolean trim(boolean aggressive) {
|
||||||
for (int i = 0; i < sectionCount; i++) {
|
for (int i = 0; i < sectionCount; i++) {
|
||||||
sections[i] = empty;
|
sections[i] = empty;
|
||||||
blocks[i] = null;
|
blocks[i] = null;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren