From 52cafbc7aa425d6bf6e6c05e82d9d71aa6d68b2e Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 5 Feb 2019 21:49:09 -0800 Subject: [PATCH] add a little version thingy --- build.gradle | 5 ++++- src/main/java/baritone/utils/ExampleBaritoneControl.java | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index a9f4c8ec..0833e04d 100755 --- a/build.gradle +++ b/build.gradle @@ -116,7 +116,10 @@ jar { jar { manifest { attributes( - 'MixinConfigs': 'mixins.baritone.json' + 'MixinConfigs': 'mixins.baritone.json', + + 'Implementation-Title': 'Baritone', + 'Implementation-Version': version ) } } diff --git a/src/main/java/baritone/utils/ExampleBaritoneControl.java b/src/main/java/baritone/utils/ExampleBaritoneControl.java index 289ff936..a5b2b57e 100644 --- a/src/main/java/baritone/utils/ExampleBaritoneControl.java +++ b/src/main/java/baritone/utils/ExampleBaritoneControl.java @@ -227,6 +227,15 @@ public class ExampleBaritoneControl extends Behavior implements Helper { } return true; } + if (msg.equals("version")) { + String version = ExampleBaritoneControl.class.getPackage().getImplementationVersion(); + if (version == null) { + logDirect("No version detected. Either dev environment or broken install."); + } else { + logDirect("You are using Baritone v" + version); + } + return true; + } if (msg.equals("repack") || msg.equals("rescan")) { ChunkProviderClient cli = (ChunkProviderClient) ctx.world().getChunkProvider(); int playerChunkX = ctx.playerFeet().getX() >> 4;