mirror of
https://github.com/Minestom/Minestom.git
synced 2024-09-28 14:37:31 +02:00
Renamed ChunkSupplier#createChunk
This commit is contained in:
parent
a3613bff89
commit
0658d1659c
@ -539,7 +539,7 @@ public class InstanceContainer extends Instance {
|
||||
chunkGenerator.fillBiomes(biomes, chunkX, chunkZ);
|
||||
}
|
||||
|
||||
final Chunk chunk = chunkSupplier.getChunk(biomes, chunkX, chunkZ);
|
||||
final Chunk chunk = chunkSupplier.createChunk(biomes, chunkX, chunkZ);
|
||||
Check.notNull(chunk, "Chunks supplied by a ChunkSupplier cannot be null.");
|
||||
|
||||
cacheChunk(chunk);
|
||||
|
@ -77,7 +77,7 @@ public class MinestomBasicChunkLoader implements IChunkLoader {
|
||||
// Found, load from result bytes
|
||||
BinaryReader reader = new BinaryReader(bytes);
|
||||
// Create the chunk object using the instance's ChunkSupplier to support multiple implementations
|
||||
Chunk chunk = instanceContainer.getChunkSupplier().getChunk(null, chunkX, chunkZ);
|
||||
Chunk chunk = instanceContainer.getChunkSupplier().createChunk(null, chunkX, chunkZ);
|
||||
// Execute the callback once all blocks are placed (allow for multithreaded implementations)
|
||||
chunk.readChunk(reader, callback);
|
||||
return true;
|
||||
|
@ -20,5 +20,5 @@ public interface ChunkSupplier {
|
||||
* @return a newly {@link Chunk} object, cannot be null
|
||||
*/
|
||||
@NotNull
|
||||
Chunk getChunk(@Nullable Biome[] biomes, int chunkX, int chunkZ);
|
||||
Chunk createChunk(@Nullable Biome[] biomes, int chunkX, int chunkZ);
|
||||
}
|
||||
|
@ -6,6 +6,11 @@ import org.jetbrains.annotations.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
/**
|
||||
* Convenient interface to deep-copy single object or collections.
|
||||
* <p>
|
||||
* Most of the methods require object to implement the {@link PublicCloneable} interface.
|
||||
*/
|
||||
public final class CloneUtils {
|
||||
|
||||
@Nullable
|
||||
|
Loading…
Reference in New Issue
Block a user