fixed Worlditem
This commit is contained in:
parent
2fa5946190
commit
49ea2b1aad
@ -25,7 +25,7 @@ public class World extends InstanceContainer {
|
||||
private final String defaultConfig = "{\n" +
|
||||
" \"enabled\": false,\n" +
|
||||
" \"name\": \"DEFAULT_NAME\",\n" +
|
||||
" \"material\": \"GRASS_BLOCK\",\n" +
|
||||
" \"material\": \"2\",\n" +
|
||||
" \"spawn\": {\n" +
|
||||
" \"x\": 0,\n" +
|
||||
" \"y\": 0,\n" +
|
||||
@ -63,7 +63,7 @@ public class World extends InstanceContainer {
|
||||
this.name = config.get("name").getAsString();
|
||||
JsonObject spawn = config.getAsJsonObject("spawn");
|
||||
this.spawn = new Pos(spawn.get("x").getAsDouble(), spawn.get("y").getAsDouble(), spawn.get("z").getAsDouble());
|
||||
this.material = Material.values().stream().filter(m -> m.name().equals(config.get("material").getAsString())).findFirst().orElse(Material.GRASS_BLOCK);
|
||||
this.material = Material.fromNamespaceId("minecraft:" + config.get("material").getAsString().toLowerCase());
|
||||
this.enabled = config.get("enabled").getAsBoolean();
|
||||
|
||||
} catch (FileNotFoundException e) {
|
||||
|
Reference in New Issue
Block a user