diff --git a/src/main/java/me/zeroeightsix/kami/DiscordPresence.java b/src/main/java/me/zeroeightsix/kami/DiscordPresence.java index 939a3d12..b159f37b 100644 --- a/src/main/java/me/zeroeightsix/kami/DiscordPresence.java +++ b/src/main/java/me/zeroeightsix/kami/DiscordPresence.java @@ -42,7 +42,7 @@ public class DiscordPresence { while (!Thread.currentThread().isInterrupted()) { try { DiscordPresence.rpc.Discord_RunCallbacks(); - discordSettings = ((DiscordSettings) ModuleManager.getModuleByName("DiscordRPC")); + discordSettings = ((DiscordSettings) ModuleManager.getModuleByName("DiscordSettings")); String separator = " | "; details = discordSettings.getLine(discordSettings.line1Setting.getValue()) + separator + discordSettings.getLine(discordSettings.line3Setting.getValue()); state = discordSettings.getLine(discordSettings.line2Setting.getValue()) + separator + discordSettings.getLine(discordSettings.line4Setting.getValue()); @@ -56,7 +56,7 @@ public class DiscordPresence { } } private static void setRpcFromSettings() { - discordSettings = ((DiscordSettings) ModuleManager.getModuleByName("DiscordRPC")); + discordSettings = ((DiscordSettings) ModuleManager.getModuleByName("DiscordSettings")); details = discordSettings.getLine(discordSettings.line1Setting.getValue()) + " " + discordSettings.getLine(discordSettings.line3Setting.getValue()); state = discordSettings.getLine(discordSettings.line2Setting.getValue()) + " " + discordSettings.getLine(discordSettings.line4Setting.getValue()); DiscordPresence.presence.details = details; diff --git a/src/main/java/me/zeroeightsix/kami/KamiMod.java b/src/main/java/me/zeroeightsix/kami/KamiMod.java index 1d0bfe3c..268d192d 100644 --- a/src/main/java/me/zeroeightsix/kami/KamiMod.java +++ b/src/main/java/me/zeroeightsix/kami/KamiMod.java @@ -192,8 +192,8 @@ public class KamiMod { ModuleManager.getModuleByName("InfoOverlay").setEnabled(true); ModuleManager.getModuleByName("InventoryViewer").setEnabled(true); - if (((DiscordSettings) ModuleManager.getModuleByName("DiscordRPC")).startupGlobal.getValue()) { - ModuleManager.getModuleByName("DiscordRPC").setEnabled(true); + if (((DiscordSettings) ModuleManager.getModuleByName("DiscordSettings")).startupGlobal.getValue()) { + ModuleManager.getModuleByName("DiscordSettings").setEnabled(true); } if (((AntiCompressionBan) ModuleManager.getModuleByName("AntiCompressionBan")).startupGlobal.getValue()) { ModuleManager.getModuleByName("AntiCompressionBan").setEnabled(true); diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/gui/InfoOverlay.java b/src/main/java/me/zeroeightsix/kami/module/modules/gui/InfoOverlay.java index ac0ceef0..57523094 100644 --- a/src/main/java/me/zeroeightsix/kami/module/modules/gui/InfoOverlay.java +++ b/src/main/java/me/zeroeightsix/kami/module/modules/gui/InfoOverlay.java @@ -70,7 +70,7 @@ public class InfoOverlay extends Module { infoContents.add(textColour(firstColour.getValue()) + KamiMod.KAMI_KANJI + textColour(secondColour.getValue()) + " " + KamiMod.MODVER); } if (username.getValue()) { - infoContents.add(textColour(firstColour.getValue()) + "Welcome" + textColour(secondColour.getValue()) + " " + mc.player.getName() + "!"); + infoContents.add(textColour(firstColour.getValue()) + "Welcome" + textColour(secondColour.getValue()) + " " + mc.getSession().getUsername() + "!"); } if (time.getValue()) { infoContents.add(textColour(firstColour.getValue()) + TimeUtil.getFinalTime(secondColour.getValue(), firstColour.getValue(), timeUnitSetting.getValue(), timeTypeSetting.getValue(), doLocale.getValue()) + TextFormatting.RESET); diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/misc/DiscordSettings.java b/src/main/java/me/zeroeightsix/kami/module/modules/misc/DiscordSettings.java index 070366e6..702a877d 100644 --- a/src/main/java/me/zeroeightsix/kami/module/modules/misc/DiscordSettings.java +++ b/src/main/java/me/zeroeightsix/kami/module/modules/misc/DiscordSettings.java @@ -11,7 +11,7 @@ import me.zeroeightsix.kami.setting.Settings; * @author S-B99 * Updated by S-B99 on 13/01/20 */ -@Module.Info(name = "DiscordRPC", category = Module.Category.MISC, description = "Discord Rich Presence") +@Module.Info(name = "DiscordSettings", category = Module.Category.MISC, description = "Discord Rich Presence") public class DiscordSettings extends Module { public Setting startupGlobal = register(Settings.b("Enable Automatically", true)); @@ -33,7 +33,7 @@ public class DiscordSettings extends Module { else if (mc.getCurrentServerData() != null) return "Multiplayer"; else return "Main Menu"; case USERNAME: - if (mc.player != null) return mc.player.getName(); + if (mc.player != null) return mc.getSession().getUsername(); else return "(Not logged in)"; case HEALTH: if (mc.player != null) return "(" + ((int) mc.player.getHealth()) + " hp)";