fix NMS queue palette size

This commit is contained in:
Jesse Boyd 2019-04-14 21:43:06 +10:00
parent b3e1076868
commit fab197034e
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
3 changed files with 11 additions and 3 deletions

View File

@ -297,6 +297,7 @@ public class BukkitChunk_1_13 extends IntFaweChunk<Chunk, BukkitQueue_1_13> {
net.minecraft.server.v1_13_R2.Chunk nmsChunk = ((CraftChunk) chunk).getHandle(); net.minecraft.server.v1_13_R2.Chunk nmsChunk = ((CraftChunk) chunk).getHandle();
nmsChunk.f(true); // Set Modified nmsChunk.f(true); // Set Modified
nmsChunk.mustSave = true; nmsChunk.mustSave = true;
nmsChunk.markDirty();
net.minecraft.server.v1_13_R2.World nmsWorld = nmsChunk.world; net.minecraft.server.v1_13_R2.World nmsWorld = nmsChunk.world;
ChunkSection[] sections = nmsChunk.getSections(); ChunkSection[] sections = nmsChunk.getSections();
List<Entity>[] entities = nmsChunk.getEntitySlices(); List<Entity>[] entities = nmsChunk.getEntitySlices();

View File

@ -700,7 +700,6 @@ public class BukkitQueue_1_13 extends BukkitQueue_0<net.minecraft.server.v1_13_R
} else { } else {
dirtyBits |= mask; dirtyBits |= mask;
} }
System.out.println("Mask is " + dirtyBits);
fieldDirtyBits.set(playerChunk, dirtyBits); fieldDirtyBits.set(playerChunk, dirtyBits);
fieldDirtyCount.set(playerChunk, 64); fieldDirtyCount.set(playerChunk, 64);
@ -829,7 +828,7 @@ public class BukkitQueue_1_13 extends BukkitQueue_0<net.minecraft.server.v1_13_R
} }
public static void setCount(int tickingBlockCount, int nonEmptyBlockCount, ChunkSection section) throws NoSuchFieldException, IllegalAccessException { public static void setCount(int tickingBlockCount, int nonEmptyBlockCount, ChunkSection section) throws NoSuchFieldException, IllegalAccessException {
// fieldFluidCount.set(section, 0); // TODO FIXME fieldFluidCount.set(section, 0); // TODO FIXME
fieldTickingBlockCount.set(section, tickingBlockCount); fieldTickingBlockCount.set(section, tickingBlockCount);
fieldNonEmptyBlockCount.set(section, nonEmptyBlockCount); fieldNonEmptyBlockCount.set(section, nonEmptyBlockCount);
} }
@ -911,7 +910,7 @@ public class BukkitQueue_1_13 extends BukkitQueue_0<net.minecraft.server.v1_13_R
try { try {
fieldBits.set(dataPaletteBlocks, nmsBits); fieldBits.set(dataPaletteBlocks, nmsBits);
fieldPalette.set(dataPaletteBlocks, palette); fieldPalette.set(dataPaletteBlocks, palette);
fieldSize.set(dataPaletteBlocks, num_palette); fieldSize.set(dataPaletteBlocks, bitsPerEntry);
setCount(0, 4096 - air, section); setCount(0, 4096 - air, section);
} catch (IllegalAccessException | NoSuchFieldException e) { } catch (IllegalAccessException | NoSuchFieldException e) {
throw new RuntimeException(e); throw new RuntimeException(e);

View File

@ -87,6 +87,14 @@ public class MaskedFaweQueue extends DelegateFaweQueue {
return false; return false;
} }
@Override
public boolean setBiome(int x, int y, int z, BiomeType biome) {
if (region.contains(x, y, z)) {
return super.setBiome(x, y, z, biome);
}
return false;
}
@Override @Override
public boolean setBiome(BlockVector2 position, BiomeType biome) { public boolean setBiome(BlockVector2 position, BiomeType biome) {
if (region.contains(position.getBlockX(), position.getBlockZ())) { if (region.contains(position.getBlockX(), position.getBlockZ())) {