Archived
0

World types

This commit is contained in:
Forwolk
2018-07-26 09:00:53 +03:00
parent 0da566acb0
commit 39b85bd64d
4 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
package mc.core.world;
public interface IWorldType {
String name();
String description();
}

View File

@@ -10,6 +10,7 @@ import java.util.UUID;
public interface World {
UUID getWorldId();
IWorldType getWorldType();
Location getSpawn();
void setSpawn(Location location);

View 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;
}
}

View File

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