From c41eb7f730e7586a69dce21691083f4637c0e595 Mon Sep 17 00:00:00 2001 From: hackthetime Date: Wed, 8 Nov 2023 10:35:08 +0100 Subject: found a solution to solve the bug that crashed the mod when initialising the config at startup. No automatically loads the config at start by using a different source for the username. getUsername did not change. --- fabric/src/main/java/de/hype/bbsentials/fabric/MCUtils.java | 2 +- fabric/src/main/java/de/hype/bbsentials/fabric/ModInitialiser.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'fabric') diff --git a/fabric/src/main/java/de/hype/bbsentials/fabric/MCUtils.java b/fabric/src/main/java/de/hype/bbsentials/fabric/MCUtils.java index a0f04d2..4fea7fd 100644 --- a/fabric/src/main/java/de/hype/bbsentials/fabric/MCUtils.java +++ b/fabric/src/main/java/de/hype/bbsentials/fabric/MCUtils.java @@ -22,7 +22,7 @@ public class MCUtils implements de.hype.bbsentials.common.mclibraries.MCUtils { } public String getUsername() { - return MinecraftClient.getInstance().player.getName().getString(); + return MinecraftClient.getInstance().getSession().getUsername(); } public String getMCUUID() { diff --git a/fabric/src/main/java/de/hype/bbsentials/fabric/ModInitialiser.java b/fabric/src/main/java/de/hype/bbsentials/fabric/ModInitialiser.java index c94202b..3d3b42c 100644 --- a/fabric/src/main/java/de/hype/bbsentials/fabric/ModInitialiser.java +++ b/fabric/src/main/java/de/hype/bbsentials/fabric/ModInitialiser.java @@ -229,6 +229,7 @@ public class ModInitialiser implements ClientModInitializer { public void onInitializeClient() { EnvironmentCore core = new EnvironmentCore(new BBUtils(), new FabricChat(), new MCUtils(), new Commands(), new Options(), new DebugThread()); codes = new NumPadCodes(); + BBsentials.init(); ClientPlayConnectionEvents.JOIN.register((a, b, c) -> { BBsentials.onServerSwap(); }); -- cgit