From 54f8cd8b21988e31e0569b1eea1ed0f6e46c57ce Mon Sep 17 00:00:00 2001 From: Petr Ilin Date: Sun, 12 Jun 2022 01:14:04 +0300 Subject: Ability to change gamemode --- build.gradle | 4 ++-- src/main/java/net/elytrium/limboauth/LimboAuth.java | 2 ++ src/main/java/net/elytrium/limboauth/Settings.java | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 352ec43..4f1dccf 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ plugins { } setGroup("net.elytrium") -setVersion("1.0.5") +setVersion("1.0.6-SNAPSHOT") java { setSourceCompatibility(JavaVersion.VERSION_11) @@ -39,7 +39,7 @@ repositories { } dependencies { - compileOnly("net.elytrium:limboapi-api:1.0.5") + compileOnly("net.elytrium:limboapi-api:1.0.6-SNAPSHOT") compileOnly("com.velocitypowered:velocity-api:3.1.2-SNAPSHOT") annotationProcessor("com.velocitypowered:velocity-api:3.1.2-SNAPSHOT") diff --git a/src/main/java/net/elytrium/limboauth/LimboAuth.java b/src/main/java/net/elytrium/limboauth/LimboAuth.java index eb052fe..cc7c291 100644 --- a/src/main/java/net/elytrium/limboauth/LimboAuth.java +++ b/src/main/java/net/elytrium/limboauth/LimboAuth.java @@ -77,6 +77,7 @@ import net.elytrium.limboapi.api.command.LimboCommandMeta; import net.elytrium.limboapi.api.file.SchematicFile; import net.elytrium.limboapi.api.file.StructureFile; import net.elytrium.limboapi.api.file.WorldFile; +import net.elytrium.limboapi.api.player.GameMode; import net.elytrium.limboauth.command.ChangePasswordCommand; import net.elytrium.limboauth.command.DestroySessionCommand; import net.elytrium.limboauth.command.ForceChangePasswordCommand; @@ -351,6 +352,7 @@ public class LimboAuth { .createLimbo(authWorld) .setName("LimboAuth") .setWorldTime(Settings.IMP.MAIN.WORLD_TICKS) + .setGameMode(GameMode.valueOf(Settings.IMP.MAIN.GAME_MODE)) .registerCommand(new LimboCommandMeta(this.filterCommands(Settings.IMP.MAIN.REGISTER_COMMAND))) .registerCommand(new LimboCommandMeta(this.filterCommands(Settings.IMP.MAIN.LOGIN_COMMAND))) .registerCommand(new LimboCommandMeta(this.filterCommands(Settings.IMP.MAIN.TOTP_COMMAND))); diff --git a/src/main/java/net/elytrium/limboauth/Settings.java b/src/main/java/net/elytrium/limboauth/Settings.java index a6f188a..775976f 100644 --- a/src/main/java/net/elytrium/limboauth/Settings.java +++ b/src/main/java/net/elytrium/limboauth/Settings.java @@ -128,6 +128,10 @@ public class Settings extends YamlConfig { @Comment("World time in ticks (24000 ticks == 1 in-game day)") public long WORLD_TICKS = 1000L; + + @Comment("Available: ADVENTURE, CREATIVE, SURVIVAL, SPECTATOR") + public String GAME_MODE = "ADVENTURE"; + @Comment({ "Custom isPremium URL", "You can use Mojang one's API (set by default)", -- cgit