World types
This commit is contained in:
6
core/src/main/java/mc/core/world/IWorldType.java
Normal file
6
core/src/main/java/mc/core/world/IWorldType.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package mc.core.world;
|
||||
|
||||
public interface IWorldType {
|
||||
String name();
|
||||
String description();
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import java.util.UUID;
|
||||
|
||||
public interface World {
|
||||
UUID getWorldId();
|
||||
IWorldType getWorldType();
|
||||
|
||||
Location getSpawn();
|
||||
void setSpawn(Location location);
|
||||
|
||||
18
core/src/main/java/mc/core/world/WorldType.java
Normal file
18
core/src/main/java/mc/core/world/WorldType.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package mc.core.world;
|
||||
|
||||
public enum WorldType implements IWorldType {
|
||||
GENERAl ("Standard world type"),
|
||||
NETHER ("Nether world type"),
|
||||
END ("End world type");
|
||||
|
||||
private final String description;
|
||||
|
||||
WorldType(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return description;
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,9 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import mc.core.Location;
|
||||
import mc.core.world.Chunk;
|
||||
import mc.core.world.IWorldType;
|
||||
import mc.core.world.World;
|
||||
import mc.core.world.WorldType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -22,6 +24,11 @@ public class FlatWorld implements World {
|
||||
private Location spawn = new Location(0, 6, 0);
|
||||
private Chunk chunk = new SimpleChunk();
|
||||
|
||||
@Override
|
||||
public IWorldType getWorldType() {
|
||||
return WorldType.GENERAl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Chunk getChunk(int x, int y, int z) {
|
||||
return chunk;
|
||||
|
||||
Reference in New Issue
Block a user