mirror of
https://github.com/Nan1t/NanoLimbo.git
synced 2025-07-15 21:50:14 +02:00
Added settings
This commit is contained in:
parent
26c8dbba20
commit
9f3fa80eef
@ -23,6 +23,7 @@ import org.spongepowered.configurate.serialize.TypeSerializerCollection;
|
||||
import org.spongepowered.configurate.yaml.YamlConfigurationLoader;
|
||||
import ru.nanit.limbo.server.data.*;
|
||||
import ru.nanit.limbo.util.Colors;
|
||||
import ru.nanit.limbo.world.Location;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileNotFoundException;
|
||||
@ -41,8 +42,11 @@ public final class LimboConfig {
|
||||
private int maxPlayers;
|
||||
private PingData pingData;
|
||||
|
||||
private boolean useSchematic;
|
||||
private Path schematicPath;
|
||||
|
||||
private String dimensionType;
|
||||
private Position spawnPosition;
|
||||
private Location spawnPosition;
|
||||
private int gameMode;
|
||||
|
||||
private boolean useBrandName;
|
||||
@ -78,14 +82,18 @@ public final class LimboConfig {
|
||||
address = conf.node("bind").get(SocketAddress.class);
|
||||
maxPlayers = conf.node("maxPlayers").getInt();
|
||||
pingData = conf.node("ping").get(PingData.class);
|
||||
useSchematic = conf.node("world", "enable").getBoolean(false);
|
||||
dimensionType = conf.node("dimension").getString();
|
||||
spawnPosition = conf.node("spawnPosition").get(Position.class);
|
||||
spawnPosition = conf.node("spawnPosition").get(Location.class);
|
||||
gameMode = conf.node("gameMode").getInt();
|
||||
useBrandName = conf.node("brandName", "enable").getBoolean();
|
||||
useJoinMessage = conf.node("joinMessage", "enable").getBoolean();
|
||||
useBossBar = conf.node("bossBar", "enable").getBoolean();
|
||||
useTitle = conf.node("title", "enable").getBoolean();
|
||||
|
||||
if (useSchematic)
|
||||
schematicPath = Paths.get(conf.node("world", "path").getString("./spawn.schem"));
|
||||
|
||||
if(useBrandName)
|
||||
brandName = conf.node("brandName", "content").getString();
|
||||
|
||||
@ -130,7 +138,7 @@ public final class LimboConfig {
|
||||
.register(PingData.class, new PingData.Serializer())
|
||||
.register(BossBar.class, new BossBar.Serializer())
|
||||
.register(Title.class, new Title.Serializer())
|
||||
.register(Position.class, new Position.Serializer())
|
||||
.register(Location.class, new Location.Serializer())
|
||||
.build();
|
||||
}
|
||||
|
||||
@ -146,11 +154,19 @@ public final class LimboConfig {
|
||||
return pingData;
|
||||
}
|
||||
|
||||
public boolean isUseSchematic() {
|
||||
return useSchematic;
|
||||
}
|
||||
|
||||
public Path getSchematicPath() {
|
||||
return schematicPath;
|
||||
}
|
||||
|
||||
public String getDimensionType() {
|
||||
return dimensionType;
|
||||
}
|
||||
|
||||
public Position getSpawnPosition() {
|
||||
public Location getSpawnPosition() {
|
||||
return spawnPosition;
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,14 @@ ping:
|
||||
description: '{"text": "&9NanoLimbo"}'
|
||||
version: 'NanoLimbo'
|
||||
|
||||
# World settings
|
||||
world:
|
||||
# Enable schematic loading.
|
||||
# If false, then player will be spawned in the void
|
||||
enable: false
|
||||
# Relative path to schematic file
|
||||
path: "./spawn.schem"
|
||||
|
||||
# Available dimensions: OVERWORLD, NETHER, THE_END
|
||||
dimension: THE_END
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user