This commit is contained in:
Jesse Boyd 2017-04-23 02:09:15 +10:00
parent 763ca00b4b
commit aa3e8e3815
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
14 changed files with 72 additions and 2 deletions

View File

@ -165,6 +165,12 @@ public class BukkitQueue_1_10 extends BukkitQueue_0<net.minecraft.server.v1_10_R
getImpWorld();
}
@Override
public void saveChunk(net.minecraft.server.v1_10_R1.Chunk chunk) {
chunk.f(true); // Set Modified
chunk.mustSave = true;
}
@Override
public ChunkSection[] getSections(net.minecraft.server.v1_10_R1.Chunk chunk) {
return chunk.getSections();

View File

@ -199,6 +199,12 @@ public class BukkitQueue_1_11 extends BukkitQueue_0<net.minecraft.server.v1_11_R
return chunkSections[cy];
}
@Override
public void saveChunk(net.minecraft.server.v1_11_R1.Chunk chunk) {
chunk.f(true); // Set Modified
chunk.mustSave = true;
}
@Override
public boolean regenerateChunk(World world, int x, int z, BaseBiome biome, Long seed) {
if (biome != null) {

View File

@ -25,6 +25,7 @@ import java.util.Map;
import java.util.Set;
import java.util.UUID;
import net.minecraft.server.v1_7_R4.Block;
import net.minecraft.server.v1_7_R4.Chunk;
import net.minecraft.server.v1_7_R4.ChunkCoordIntPair;
import net.minecraft.server.v1_7_R4.ChunkPosition;
import net.minecraft.server.v1_7_R4.ChunkSection;
@ -113,6 +114,12 @@ public class BukkitQueue17 extends BukkitQueue_0<net.minecraft.server.v1_7_R4.Ch
getImpWorld();
}
@Override
public void saveChunk(Chunk nmsChunk) {
nmsChunk.e(); // Modified
nmsChunk.mustSave = true;
}
@Override
public boolean regenerateChunk(World world, int x, int z, BaseBiome biome, Long seed) {
if (biome != null) {

View File

@ -24,6 +24,7 @@ import java.util.Set;
import java.util.UUID;
import net.minecraft.server.v1_8_R3.Block;
import net.minecraft.server.v1_8_R3.BlockPosition;
import net.minecraft.server.v1_8_R3.Chunk;
import net.minecraft.server.v1_8_R3.ChunkSection;
import net.minecraft.server.v1_8_R3.Entity;
import net.minecraft.server.v1_8_R3.EntityPlayer;
@ -117,6 +118,12 @@ public class BukkitQueue18R3 extends BukkitQueue_0<net.minecraft.server.v1_8_R3.
getImpWorld();
}
@Override
public void saveChunk(Chunk nmsChunk) {
nmsChunk.f(true); // Modified
nmsChunk.mustSave = true;
}
@Override
public boolean regenerateChunk(World world, int x, int z, BaseBiome biome, Long seed) {
if (biome != null) {

View File

@ -146,6 +146,12 @@ public class BukkitQueue_1_9_R1 extends BukkitQueue_0<net.minecraft.server.v1_9_
getImpWorld();
}
@Override
public void saveChunk(net.minecraft.server.v1_9_R2.Chunk chunk) {
chunk.f(true); // Set Modified
chunk.mustSave = true;
}
@Override
public boolean regenerateChunk(World world, int x, int z, BaseBiome biome, Long seed) {
if (biome != null) {

View File

@ -139,6 +139,8 @@ public abstract class NMSMappedFaweQueue<WORLD, CHUNK, CHUNKSECTION, SECTION> ex
return section[j] >> 4;
}
public void saveChunk(CHUNK chunk) {}
public abstract void relight(int x, int y, int z);
public abstract void relightBlock(int x, int y, int z);

View File

@ -313,7 +313,7 @@ public class NMSRelighter implements Relighter{
}
int bx = chunk.x << 4;
int bz = chunk.z << 4;
queue.ensureChunkLoaded(chunk.x, chunk.z);
Object chunkObj = queue.ensureChunkLoaded(chunk.x, chunk.z);
Object sections = queue.getCachedSections(queue.getWorld(), chunk.x, chunk.z);
if (sections == null)continue;
Object section = queue.getCachedSection(sections, layer);
@ -372,6 +372,7 @@ public class NMSRelighter implements Relighter{
chunk.smooth = true;
queue.setSkyLight(section, x, y, z, value);
}
queue.saveChunk(chunkObj);
}
for (RelightSkyEntry chunk : chunks) { // Smooth forwards
if (chunk.smooth) {

View File

@ -95,6 +95,11 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
getImpWorld();
}
@Override
public void saveChunk(Chunk chunk) {
chunk.setChunkModified();
}
@Override
public void setHeightMap(FaweChunk chunk, byte[] heightMap) {
Chunk forgeChunk = (Chunk) chunk.getChunk();

View File

@ -125,6 +125,11 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
getImpWorld();
}
@Override
public void saveChunk(Chunk chunk) {
chunk.setChunkModified();
}
@Override
public ExtendedBlockStorage[] getSections(Chunk chunk) {
return chunk.getBlockStorageArray();

View File

@ -85,6 +85,11 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
}
}
@Override
public void saveChunk(Chunk chunk) {
chunk.setChunkModified();
}
@Override
public void setHeightMap(FaweChunk chunk, byte[] heightMap) {
Chunk forgeChunk = (Chunk) chunk.getChunk();

View File

@ -88,6 +88,11 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
getImpWorld();
}
@Override
public void saveChunk(Chunk chunk) {
chunk.setChunkModified();
}
@Override
public ExtendedBlockStorage[] getSections(Chunk chunk) {
return chunk.getBlockStorageArray();

View File

@ -95,6 +95,11 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
getImpWorld();
}
@Override
public void saveChunk(Chunk chunk) {
chunk.setChunkModified();
}
@Override
public ExtendedBlockStorage[] getSections(Chunk chunk) {
return chunk.getBlockStorageArray();

View File

@ -111,6 +111,11 @@ public class NukkitQueue extends NMSMappedFaweQueue<Level, BaseFullChunk, BaseFu
}
}
@Override
public void saveChunk(BaseFullChunk baseFullChunk) {
baseFullChunk.setChanged();
}
@Override
public void refreshChunk(FaweChunk fs) {
sendChunk(fs.getX(), fs.getZ(), fs.getBitMask());

View File

@ -186,6 +186,11 @@ public class SpongeQueue_1_11 extends NMSMappedFaweQueue<World, net.minecraft.wo
}
}
@Override
public void saveChunk(Chunk chunk) {
chunk.setChunkModified();
}
@Override
public ExtendedBlockStorage[] getSections(Chunk chunk) {
return chunk.getBlockStorageArray();