From d147097df6b3bf44625aff94b46413ca3bad577e Mon Sep 17 00:00:00 2001 From: dfsek Date: Sun, 8 Nov 2020 22:23:19 -0700 Subject: [PATCH] Add Gaea version information to /te version --- .../java/com/dfsek/terra/command/VersionCommand.java | 10 +++++++++- src/main/resources/lang/en_us.yml | 2 +- src/main/resources/plugin.yml | 2 +- src/main/resources/world.yml | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/dfsek/terra/command/VersionCommand.java b/src/main/java/com/dfsek/terra/command/VersionCommand.java index 31f7014bf..6cf7b7a28 100644 --- a/src/main/java/com/dfsek/terra/command/VersionCommand.java +++ b/src/main/java/com/dfsek/terra/command/VersionCommand.java @@ -1,12 +1,15 @@ package com.dfsek.terra.command; import com.dfsek.terra.config.lang.LangUtil; +import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; +import org.bukkit.plugin.Plugin; import org.jetbrains.annotations.NotNull; import org.polydev.gaea.command.Command; import java.util.Collections; import java.util.List; +import java.util.Objects; public class VersionCommand extends Command { public VersionCommand(Command parent) { @@ -25,7 +28,12 @@ public class VersionCommand extends Command { @Override public boolean execute(@NotNull CommandSender sender, org.bukkit.command.@NotNull Command command, @NotNull String label, @NotNull String[] args) { - LangUtil.send("command.version", sender, getMain().getDescription().getVersion()); + Plugin gaea = Objects.requireNonNull(Bukkit.getPluginManager().getPlugin("Gaea")); + String gaeaVersion = gaea.getDescription().getVersion(); + + String terraVersion = getMain().getDescription().getVersion(); + LangUtil.send("command.version", sender, terraVersion, gaeaVersion); + return true; } diff --git a/src/main/resources/lang/en_us.yml b/src/main/resources/lang/en_us.yml index 17e40ec04..f5b4e5fba 100644 --- a/src/main/resources/lang/en_us.yml +++ b/src/main/resources/lang/en_us.yml @@ -11,7 +11,7 @@ command: players-only: "Command is for players only." world: "This command must be executed in a Terra world!" reload: "Reloaded Terra config." - version: "This server is running Terra version \"%s\"" + version: "This server is running Terra version \"%1$s\", implementing Gaea version \"%2$s\"" main-menu: - "--------------------Terra--------------------" - "reload - Reload configuration data" diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 4cf39c40c..bd6168ce1 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,7 +1,7 @@ name: "Terra" depend: [ "Gaea" ] main: "com.dfsek.terra.Terra" -version: "1.1.1-BETA" +version: "1.2.0-BETA" load: "STARTUP" api-version: "1.16" softdepend: [ "WorldEdit" ] diff --git a/src/main/resources/world.yml b/src/main/resources/world.yml index 161ec2727..8b1378917 100644 --- a/src/main/resources/world.yml +++ b/src/main/resources/world.yml @@ -1 +1 @@ -config: DEFAULT \ No newline at end of file +