Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-07 20:10:06 +01:00
Ursprung
39de48cdb1
Commit
1ede11b129
@ -30,7 +30,8 @@ public class NMSAdapter implements FAWEPlatformAdapterImpl {
|
|||||||
ordinal = BlockTypesCache.ReservedIDs.AIR;
|
ordinal = BlockTypesCache.ReservedIDs.AIR;
|
||||||
nonAir--;
|
nonAir--;
|
||||||
}
|
}
|
||||||
case BlockTypesCache.ReservedIDs.AIR, BlockTypesCache.ReservedIDs.CAVE_AIR, BlockTypesCache.ReservedIDs.VOID_AIR -> nonAir--;
|
case BlockTypesCache.ReservedIDs.AIR, BlockTypesCache.ReservedIDs.CAVE_AIR, BlockTypesCache.ReservedIDs.VOID_AIR ->
|
||||||
|
nonAir--;
|
||||||
}
|
}
|
||||||
int palette = blockToPalette[ordinal];
|
int palette = blockToPalette[ordinal];
|
||||||
if (palette == Integer.MAX_VALUE) {
|
if (palette == Integer.MAX_VALUE) {
|
||||||
@ -73,6 +74,8 @@ public class NMSAdapter implements FAWEPlatformAdapterImpl {
|
|||||||
CachedBukkitAdapter adapter,
|
CachedBukkitAdapter adapter,
|
||||||
short[] nonEmptyBlockCount
|
short[] nonEmptyBlockCount
|
||||||
) {
|
) {
|
||||||
|
// Write to new array to avoid editing SET array
|
||||||
|
char[] copy = new char[set.length];
|
||||||
short nonAir = 4096;
|
short nonAir = 4096;
|
||||||
int num_palette = 0;
|
int num_palette = 0;
|
||||||
char[] getArr = null;
|
char[] getArr = null;
|
||||||
@ -83,23 +86,19 @@ public class NMSAdapter implements FAWEPlatformAdapterImpl {
|
|||||||
if (getArr == null) {
|
if (getArr == null) {
|
||||||
getArr = get.apply(layer);
|
getArr = get.apply(layer);
|
||||||
}
|
}
|
||||||
// write to set array as this should be a copied array, and will be important when the changes are written
|
switch (ordinal = getArr[i]) {
|
||||||
// to the GET chunk cached by FAWE
|
|
||||||
set[i] = switch (ordinal = getArr[i]) {
|
|
||||||
case BlockTypesCache.ReservedIDs.__RESERVED__ -> {
|
case BlockTypesCache.ReservedIDs.__RESERVED__ -> {
|
||||||
nonAir--;
|
nonAir--;
|
||||||
yield (ordinal = BlockTypesCache.ReservedIDs.AIR);
|
ordinal = BlockTypesCache.ReservedIDs.AIR;
|
||||||
}
|
}
|
||||||
case BlockTypesCache.ReservedIDs.AIR, BlockTypesCache.ReservedIDs.CAVE_AIR,
|
case BlockTypesCache.ReservedIDs.AIR, BlockTypesCache.ReservedIDs.CAVE_AIR, BlockTypesCache.ReservedIDs.VOID_AIR ->
|
||||||
BlockTypesCache.ReservedIDs.VOID_AIR -> {
|
|
||||||
nonAir--;
|
nonAir--;
|
||||||
yield ordinal;
|
|
||||||
}
|
}
|
||||||
default -> ordinal;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
case BlockTypesCache.ReservedIDs.AIR, BlockTypesCache.ReservedIDs.CAVE_AIR, BlockTypesCache.ReservedIDs.VOID_AIR -> nonAir--;
|
case BlockTypesCache.ReservedIDs.AIR, BlockTypesCache.ReservedIDs.CAVE_AIR, BlockTypesCache.ReservedIDs.VOID_AIR ->
|
||||||
|
nonAir--;
|
||||||
}
|
}
|
||||||
|
copy[i] = ordinal;
|
||||||
int palette = blockToPalette[ordinal];
|
int palette = blockToPalette[ordinal];
|
||||||
if (palette == Integer.MAX_VALUE) {
|
if (palette == Integer.MAX_VALUE) {
|
||||||
blockToPalette[ordinal] = num_palette;
|
blockToPalette[ordinal] = num_palette;
|
||||||
@ -117,7 +116,7 @@ public class NMSAdapter implements FAWEPlatformAdapterImpl {
|
|||||||
System.arraycopy(adapter.getOrdinalToIbdID(), 0, blockToPalette, 0, adapter.getOrdinalToIbdID().length);
|
System.arraycopy(adapter.getOrdinalToIbdID(), 0, blockToPalette, 0, adapter.getOrdinalToIbdID().length);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < 4096; i++) {
|
for (int i = 0; i < 4096; i++) {
|
||||||
char ordinal = set[i];
|
char ordinal = copy[i];
|
||||||
if (ordinal == BlockTypesCache.ReservedIDs.__RESERVED__) {
|
if (ordinal == BlockTypesCache.ReservedIDs.__RESERVED__) {
|
||||||
LOGGER.error("Empty (__RESERVED__) ordinal given where not expected, default to air.");
|
LOGGER.error("Empty (__RESERVED__) ordinal given where not expected, default to air.");
|
||||||
ordinal = BlockTypesCache.ReservedIDs.AIR;
|
ordinal = BlockTypesCache.ReservedIDs.AIR;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren