mirror of
https://github.com/Minestom/Minestom.git
synced 2024-10-03 00:47:28 +02:00
Made InstanceContainer#cacheChunk public
This commit is contained in:
parent
0ee8eb7d45
commit
73d99bf462
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user