Fix palette / region iteration

This commit is contained in:
Jesse Boyd
2019-11-04 07:47:31 +00:00
parent 930dfb7f7c
commit 1e16095cba
9 changed files with 138 additions and 56 deletions

View File

@ -115,7 +115,7 @@ public class CharFilterBlock extends ChunkFilterBlock {
@Override
public void filter(Filter filter, int yStart, int yEnd) {
for (y = yStart, index = yStart << 8; y < yEnd; y++) {
for (y = yStart, index = yStart << 8; y <= yEnd; y++) {
for (z = 0; z < 16; z++) {
for (x = 0; x < 16; x++, index++) {
filter.applyBlock(this);

View File

@ -57,7 +57,7 @@ public class ChunkPacket implements Function<byte[], byte[]>, Supplier<byte[]> {
return chunk;
}
private byte[] getSectionBytes() {
public byte[] getSectionBytes() {
byte[] tmp = this.sectionBytes;
if (tmp == null) {
synchronized (this) {
@ -107,7 +107,6 @@ public class ChunkPacket implements Function<byte[], byte[]>, Supplier<byte[]> {
fos.writeVarInt(getChunk().getBitMask());
fos.writeNBT("", getHeightMap());
fos.writeVarInt(sectionBytes.length);

View File

@ -8,6 +8,7 @@ import com.boydti.fawe.beta.implementation.packet.ChunkPacket;
import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.biome.BiomeType;
import java.util.function.Supplier;
import java.util.stream.Stream;
@ -25,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 = true;
boolean replaceAll = set.getBiomeType(0, 0) != null;
ChunkPacket packet = new ChunkPacket(chunkX, chunkZ, () -> set, replaceAll);
Stream<Player> stream = this.players.get();
if (stream == null) {
@ -41,4 +42,4 @@ public class ChunkSendProcessor implements IBatchProcessor {
public Extent construct(Extent child) {
return null;
}
}
}