update rpc formatting

This commit is contained in:
Bella 2020-03-19 12:58:54 -04:00
parent 62883df004
commit 9b78ecb03d
No known key found for this signature in database
GPG Key ID: 815562EA23BFE344
1 changed files with 8 additions and 7 deletions

View File

@ -18,11 +18,11 @@ public class DiscordSettings extends Module {
public Setting<Boolean> coordsConfirm = register(Settings.b("Coords Confirm", false)); public Setting<Boolean> coordsConfirm = register(Settings.b("Coords Confirm", false));
public Setting<LineInfo> line1Setting = register(Settings.e("Line 1 Left", LineInfo.VERSION)); // details left public Setting<LineInfo> line1Setting = register(Settings.e("Line 1 Left", LineInfo.VERSION)); // details left
public Setting<LineInfo> line3Setting = register(Settings.e("Line 1 Right", LineInfo.USERNAME)); // details right public Setting<LineInfo> line3Setting = register(Settings.e("Line 1 Right", LineInfo.USERNAME)); // details right
public Setting<LineInfo> line2Setting = register(Settings.e("Line 2 Left", LineInfo.SERVERIP)); // state left public Setting<LineInfo> line2Setting = register(Settings.e("Line 2 Left", LineInfo.SERVER_IP)); // state left
public Setting<LineInfo> line4Setting = register(Settings.e("Line 2 Right", LineInfo.HEALTH)); // state right public Setting<LineInfo> line4Setting = register(Settings.e("Line 2 Right", LineInfo.HEALTH)); // state right
public enum LineInfo { public enum LineInfo {
VERSION, WORLD, USERNAME, HEALTH, SERVERIP, COORDS, NONE VERSION, WORLD, USERNAME, HEALTH, SERVER_IP, COORDS, NONE
} }
public String getLine(LineInfo line) { public String getLine(LineInfo line) {
@ -36,14 +36,15 @@ public class DiscordSettings extends Module {
if (mc.player != null) return mc.player.getName(); if (mc.player != null) return mc.player.getName();
else return mc.getSession().getUsername(); else return mc.getSession().getUsername();
case HEALTH: case HEALTH:
if (mc.player != null) return "(" + ((int) mc.player.getHealth()) + " hp)"; if (mc.player != null) return ((int) mc.player.getHealth()) + " hp";
else return "(No hp)"; else return "null hp";
case SERVERIP: case SERVER_IP:
if (mc.getCurrentServerData() != null) return mc.getCurrentServerData().serverIP; if (mc.getCurrentServerData() != null) return mc.getCurrentServerData().serverIP;
else return "(Offline)"; else if (mc.isIntegratedServerRunning()) return "Offline";
else return "Main Menu";
case COORDS: case COORDS:
if (mc.player != null && coordsConfirm.getValue()) return "(" + (int) mc.player.posX + " " + (int) mc.player.posY + " " + (int) mc.player.posZ + ")"; if (mc.player != null && coordsConfirm.getValue()) return "(" + (int) mc.player.posX + " " + (int) mc.player.posY + " " + (int) mc.player.posZ + ")";
else return "(No coords)"; else return "null coords";
default: return ""; default: return "";
} }
} }