mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-11 20:13:55 +00:00
Fix biome sending
This commit is contained in:
@ -57,6 +57,9 @@ public interface IBlocks extends Trimable {
|
||||
BlockRegistry registry = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry();
|
||||
FastByteArrayOutputStream sectionByteArray = new FastByteArrayOutputStream(buffer);
|
||||
FaweOutputStream sectionWriter = new FaweOutputStream(sectionByteArray);
|
||||
|
||||
System.out.println("Bitmask " + getBitMask());
|
||||
|
||||
try {
|
||||
for (int layer = 0; layer < FaweCache.IMP.CHUNK_LAYERS; layer++) {
|
||||
if (!this.hasSection(layer)) continue;
|
||||
@ -136,9 +139,15 @@ public interface IBlocks extends Trimable {
|
||||
// }
|
||||
// }
|
||||
if (writeBiomes) {
|
||||
for (int i = 0; i < 256; i++) {
|
||||
// TODO biomes
|
||||
sectionWriter.writeInt(0);
|
||||
for (int z = 0; z < 16; z++) {
|
||||
for (int x = 0; x < 16; x++) {
|
||||
BiomeType biome = getBiomeType(x, z);
|
||||
if (biome != null) {
|
||||
sectionWriter.writeInt(biome.getLegacyId());
|
||||
} else {
|
||||
sectionWriter.writeInt(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
@ -38,6 +38,10 @@ public interface IChunkSet extends IBlocks, OutputExtent {
|
||||
|
||||
BiomeType[] getBiomes();
|
||||
|
||||
default boolean hasBiomes() {
|
||||
return getBiomes() != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
BiomeType getBiomeType(int x, int z);
|
||||
|
||||
|
@ -170,6 +170,11 @@ public interface IDelegateChunk<U extends IQueueChunk> extends IQueueChunk {
|
||||
return getParent().getBiomes();
|
||||
}
|
||||
|
||||
@Override
|
||||
default boolean hasBiomes() {
|
||||
return getParent().hasBiomes();
|
||||
}
|
||||
|
||||
default <T extends IChunk> T findParent(Class<T> clazz) {
|
||||
IChunk root = getParent();
|
||||
if (clazz.isAssignableFrom(root.getClass())) {
|
||||
|
@ -46,6 +46,7 @@ public class CharSetBlocks extends CharBlocks implements IChunkSet {
|
||||
|
||||
@Override
|
||||
public BiomeType getBiomeType(int x, int z) {
|
||||
if (biomes == null) return null;
|
||||
return biomes[(z << 4) | x];
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ public class ChunkSendProcessor implements IBatchProcessor {
|
||||
public IChunkSet processSet(IChunk chunk, IChunkGet get, IChunkSet set) {
|
||||
int chunkX = chunk.getX();
|
||||
int chunkZ = chunk.getZ();
|
||||
boolean replaceAll = set.getBiomeType(0, 0) != null;
|
||||
boolean replaceAll = set.hasBiomes();
|
||||
ChunkPacket packet = new ChunkPacket(chunkX, chunkZ, () -> set, replaceAll);
|
||||
Stream<Player> stream = this.players.get();
|
||||
if (stream == null) {
|
||||
|
@ -219,7 +219,7 @@ public final class BiomeTypes {
|
||||
ERODED_BADLANDS.setLegacyId(165);
|
||||
MODIFIED_WOODED_BADLANDS_PLATEAU.setLegacyId(166);
|
||||
MODIFIED_BADLANDS_PLATEAU.setLegacyId(167);
|
||||
// BAMBOO_JUNGLE.setLegacyId(168);
|
||||
// BAMBOO_JUNGLE_HILLS.setLegacyId(169);
|
||||
BAMBOO_JUNGLE.setLegacyId(168);
|
||||
BAMBOO_JUNGLE_HILLS.setLegacyId(169);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user