3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-26 02:50:06 +01:00

More verbosely get block data and ensure biome layer isn't null

Dieser Commit ist enthalten in:
dordsor21 2021-12-21 18:00:09 +00:00
Ursprung 9ec829eddf
Commit 28f3bc61ea
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 1E53E88969FFCF0B
3 geänderte Dateien mit 15 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -243,7 +243,12 @@ public final class PaperweightFaweAdapter extends CachedBukkitAdapter implements
LevelChunk chunk = handle.getChunk(x >> 4, z >> 4); LevelChunk chunk = handle.getChunk(x >> 4, z >> 4);
final BlockPos blockPos = new BlockPos(x, y, z); final BlockPos blockPos = new BlockPos(x, y, z);
final net.minecraft.world.level.block.state.BlockState blockData = chunk.getBlockState(blockPos); final net.minecraft.world.level.block.state.BlockState blockData = chunk.getBlockState(blockPos);
return adapt(blockData); BlockState state = adapt(blockData);
if (state == null) {
org.bukkit.block.Block bukkitBlock = location.getBlock();
state = BukkitAdapter.adapt(bukkitBlock.getBlockData());
}
return state;
} }
@Override @Override

Datei anzeigen

@ -553,6 +553,9 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
copy.storeBiomes(currentBiomes); copy.storeBiomes(currentBiomes);
} }
for (int layer = 0; layer < 16; layer++) { for (int layer = 0; layer < 16; layer++) {
if (biomes[layer] == null) {
continue;
}
for (int y = 0, i = 0; y < 4; y++) { for (int y = 0, i = 0; y < 4; y++) {
for (int z = 0; z < 4; z++) { for (int z = 0; z < 4; z++) {
for (int x = 0; x < 4; x++, i++) { for (int x = 0; x < 4; x++, i++) {

Datei anzeigen

@ -242,7 +242,12 @@ public final class PaperweightFaweAdapter extends CachedBukkitAdapter implements
LevelChunk chunk = handle.getChunk(x >> 4, z >> 4); LevelChunk chunk = handle.getChunk(x >> 4, z >> 4);
final BlockPos blockPos = new BlockPos(x, y, z); final BlockPos blockPos = new BlockPos(x, y, z);
final net.minecraft.world.level.block.state.BlockState blockData = chunk.getBlockState(blockPos); final net.minecraft.world.level.block.state.BlockState blockData = chunk.getBlockState(blockPos);
return adapt(blockData); BlockState state = adapt(blockData);
if (state == null) {
org.bukkit.block.Block bukkitBlock = location.getBlock();
state = BukkitAdapter.adapt(bukkitBlock.getBlockData());
}
return state;
} }
@Override @Override