miscellanious fixes

This commit is contained in:
Sen 2025-05-19 22:15:06 +02:00
parent 7c80936c05
commit e145675525
7 changed files with 16 additions and 5 deletions

View file

@ -2245,7 +2245,7 @@ public final class WorldServer extends AWorldServer {
// return new LazyBlock(state, this, position);
// }
public final boolean setBiome(BlockPos position, Biome biome) {
private final boolean setChunkBiome(BlockPos position, Biome biome) {
Chunk chunk = this.getChunk(position);
if((chunk != null) && (chunk.isLoaded())) {
chunk.getBiomes()[((position.getZ() & 0xF) << 4 | position.getX() & 0xF)] = (byte)biome.id;
@ -2258,7 +2258,7 @@ public final class WorldServer extends AWorldServer {
Set<ChunkPos> chunks = Sets.newHashSet();
for(int x = start.getX(); x <= end.getX(); x++) {
for(int z = start.getZ(); z <= end.getZ(); z++) {
if(this.setBiome(new BlockPos(x, 0, z), biome))
if(this.setChunkBiome(new BlockPos(x, 0, z), biome))
chunks.add(new ChunkPos(x >> 4, z >> 4));
}
}
@ -2267,6 +2267,11 @@ public final class WorldServer extends AWorldServer {
}
chunks.clear();
}
public final void setBiome(BlockPos pos, Biome biome) {
if(this.setChunkBiome(pos, biome))
this.updateBiomes(pos.getX() >> 4, pos.getZ() >> 4);
}
// public final List<? extends Entity> getEntities(EditRegion region) {
// List<Entity> entities = Lists.newArrayList();