WORLD --[RegionManager]--> REGION --[ChunkLoader]--> CHUNK
This commit is contained in:
@@ -6,8 +6,11 @@ import lombok.Setter;
|
|||||||
import mc.core.Location;
|
import mc.core.Location;
|
||||||
import mc.core.WarpPosition;
|
import mc.core.WarpPosition;
|
||||||
import mc.core.player.Look;
|
import mc.core.player.Look;
|
||||||
import mc.core.world.*;
|
import mc.core.world.Chunk;
|
||||||
import mc.world.generated_world.chunk.InMemoryCacheChunkLoader;
|
import mc.core.world.IWorldType;
|
||||||
|
import mc.core.world.Region;
|
||||||
|
import mc.core.world.World;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -20,32 +23,29 @@ public class CubicWorld implements World {
|
|||||||
private final int seed;
|
private final int seed;
|
||||||
private volatile WarpPosition warpPosition;
|
private volatile WarpPosition warpPosition;
|
||||||
private final transient Object spawnLocationLock = new Object();
|
private final transient Object spawnLocationLock = new Object();
|
||||||
private final transient ChunkLoader chunkLoader;
|
|
||||||
private final Map<String, Tag<?>> nbtTagMap = new HashMap<>();
|
private final Map<String, Tag<?>> nbtTagMap = new HashMap<>();
|
||||||
|
@Autowired
|
||||||
|
private RegionManager regionManager;
|
||||||
@Getter@Setter
|
@Getter@Setter
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
public CubicWorld(UUID worldId, int seed) {
|
public CubicWorld(UUID worldId, int seed) {
|
||||||
this.worldId = worldId;
|
this.worldId = worldId;
|
||||||
chunkLoader = new InMemoryCacheChunkLoader(this);
|
|
||||||
this.seed = seed;
|
this.seed = seed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CubicWorld(int seed) {
|
public CubicWorld(int seed) {
|
||||||
this.worldId = UUID.randomUUID();
|
this.worldId = UUID.randomUUID();
|
||||||
chunkLoader = new InMemoryCacheChunkLoader(this);
|
|
||||||
this.seed = seed;
|
this.seed = seed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CubicWorld(UUID worldId) {
|
public CubicWorld(UUID worldId) {
|
||||||
this.worldId = worldId;
|
this.worldId = worldId;
|
||||||
chunkLoader = new InMemoryCacheChunkLoader(this);
|
|
||||||
this.seed = 0;
|
this.seed = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CubicWorld () {
|
public CubicWorld () {
|
||||||
this.worldId = UUID.randomUUID();
|
this.worldId = UUID.randomUUID();
|
||||||
chunkLoader = new InMemoryCacheChunkLoader(this);
|
|
||||||
this.seed = 0;
|
this.seed = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user