Renamed ChunkSupplier#createChunk

This commit is contained in:
themode 2020-12-15 04:21:26 +01:00
parent a3613bff89
commit 0658d1659c
4 changed files with 8 additions and 3 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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);
}

View File

@ -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