mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
More verbosely get block data and ensure biome layer isn't null
This commit is contained in:
parent
9ec829eddf
commit
28f3bc61ea
@ -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
|
||||||
|
@ -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++) {
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user