Made InstanceContainer#cacheChunk public

This commit is contained in:
themode 2020-11-05 22:42:03 +01:00
parent 0ee8eb7d45
commit 73d99bf462
2 changed files with 6 additions and 3 deletions

View File

@ -677,10 +677,12 @@ public class InstanceContainer extends Instance {
/**
* Adds a {@link Chunk} to the internal instance map.
* <p>
* WARNING: the chunk will not automatically be sent to players
*
* @param chunk the chunk to cache
*/
private void cacheChunk(Chunk chunk) {
public void cacheChunk(@NotNull Chunk chunk) {
final long index = ChunkUtils.getChunkIndex(chunk.getChunkX(), chunk.getChunkZ());
this.chunks.put(index, chunk);
}

View File

@ -28,14 +28,15 @@ public class StaticChunk extends Chunk {
protected final BlockProvider blockProvider;
public StaticChunk(Biome[] biomes, int chunkX, int chunkZ, BlockProvider blockProvider) {
public StaticChunk(@Nullable Biome[] biomes, int chunkX, int chunkZ,
@NotNull BlockProvider blockProvider) {
super(biomes, chunkX, chunkZ, false);
this.blockProvider = blockProvider;
setReadOnly(true);
}
@Override
public void UNSAFE_setBlock(int x, int y, int z, short blockStateId, short customBlockId, Data data, boolean updatable) {
public void UNSAFE_setBlock(int x, int y, int z, short blockStateId, short customBlockId, @Nullable Data data, boolean updatable) {
//noop
}