3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-07 12:00:07 +01:00

Fix setting blocks in null sections

Dieser Commit ist enthalten in:
Jesse Boyd 2019-11-17 19:30:28 +00:00
Ursprung 868554367a
Commit e661652c12
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 59F1DE6293AF6E1F
5 geänderte Dateien mit 22 neuen und 14 gelöschten Zeilen

Datei anzeigen

@ -227,7 +227,7 @@ public final class BukkitAdapter_1_14 {
for (; i < 4096; i++) {
char ordinal = set[i];
switch (ordinal) {
case 0:
case BlockID.__RESERVED__:
break outer;
case BlockID.AIR:
case BlockID.CAVE_AIR:
@ -247,14 +247,17 @@ public final class BukkitAdapter_1_14 {
for (; i < 4096; i++) {
char ordinal = set[i];
switch (ordinal) {
case 0:
case BlockID.__RESERVED__:
ordinal = getArr[i];
set[i] = ordinal;
switch (ordinal) {
case BlockID.__RESERVED__:
ordinal = BlockID.AIR;
case BlockID.AIR:
case BlockID.CAVE_AIR:
case BlockID.VOID_AIR:
air++;
default:
set[i] = ordinal;
}
break;
case BlockID.AIR:

Datei anzeigen

@ -38,6 +38,7 @@ import java.util.concurrent.Future;
import java.util.function.Function;
import javax.annotation.Nullable;
import net.minecraft.server.v1_14_R1.BiomeBase;
import net.minecraft.server.v1_14_R1.Block;
import net.minecraft.server.v1_14_R1.BlockPosition;
import net.minecraft.server.v1_14_R1.Chunk;
import net.minecraft.server.v1_14_R1.ChunkSection;
@ -564,17 +565,20 @@ public class BukkitGetBlocks_1_14 extends CharGetBlocks {
return data;
}
char[] paletteToBlockChars = FaweCache.IMP.PALETTE_TO_BLOCK_CHAR.get();
char[] paletteToOrdinal = FaweCache.IMP.PALETTE_TO_BLOCK_CHAR.get();
try {
final int size = num_palette;
if (size != 1) {
for (int i = 0; i < size; i++) {
if (num_palette != 1) {
for (int i = 0; i < num_palette; i++) {
char ordinal = ordinal(palette.a(i), adapter);
paletteToBlockChars[i] = ordinal;
paletteToOrdinal[i] = ordinal;
}
for (int i = 0; i < 4096; i++) {
char paletteVal = data[i];
char val = paletteToBlockChars[paletteVal];
char val = paletteToOrdinal[paletteVal];
if (val == Character.MAX_VALUE) {
val = ordinal(palette.a(i), adapter);
paletteToOrdinal[i] = val;
}
data[i] = val;
}
} else {
@ -583,14 +587,14 @@ public class BukkitGetBlocks_1_14 extends CharGetBlocks {
}
} finally {
for (int i = 0; i < num_palette; i++) {
paletteToBlockChars[i] = Character.MAX_VALUE;
paletteToOrdinal[i] = Character.MAX_VALUE;
}
}
return data;
} catch (IllegalAccessException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
return data;
}
}

Datei anzeigen

@ -304,7 +304,7 @@ public class Fawe {
br.close();
this.version = FaweVersion.tryParse(versionString, commitString, dateString);
Settings.IMP.DATE = new Date(100 + version.year, version.month, version.day).toGMTString();
Settings.IMP.BUILD = "https://ci.athion.net/job/FastAsyncWorldEdit-Breaking/" + version.build;
Settings.IMP.BUILD = "https://ci.athion.net/job/FastAsyncWorldEdit-commanding-pipeline/" + version.build;
Settings.IMP.COMMIT = "https://github.com/IntellectualSites/FastAsyncWorldEdit-1.13/commit/" + Integer.toHexString(version.hash);
} catch (Throwable ignore) {}
try {

Datei anzeigen

@ -64,8 +64,6 @@ public interface IBlocks extends Trimable {
for (int layer = 0; layer < FaweCache.IMP.CHUNK_LAYERS; layer++) {
if (!this.hasSection(layer) || (bitMask & (1 << layer)) == 0) continue;
System.out.println("Write section " + layer);
char[] ids = this.load(layer);
int nonEmpty = 0; // TODO optimize into same loop as toPalette

Datei anzeigen

@ -20,6 +20,9 @@ public abstract class CharBlocks implements IBlocks {
char[] arr = blocks.blocks[layer];
if (arr == null) {
arr = blocks.blocks[layer] = blocks.update(layer, null);
if (arr == null) {
throw new IllegalStateException("Array cannot be null: " + blocks.getClass());
}
} else {
blocks.blocks[layer] = blocks.update(layer, arr);
}