aboutsummaryrefslogtreecommitdiff
path: root/fabric/src/main/java/de
diff options
context:
space:
mode:
authorhackthetime <l4bg0jb7@duck.com>2023-11-08 10:35:08 +0100
committerhackthetime <l4bg0jb7@duck.com>2023-11-08 10:35:08 +0100
commitc41eb7f730e7586a69dce21691083f4637c0e595 (patch)
tree45564770e7140e10be8f96c74850dbea06a3c3c5 /fabric/src/main/java/de
parent208ee28028e4a772a573a75f2aef6780304b3f53 (diff)
downloadBBsentials-c41eb7f730e7586a69dce21691083f4637c0e595.tar.gz
BBsentials-c41eb7f730e7586a69dce21691083f4637c0e595.tar.bz2
BBsentials-c41eb7f730e7586a69dce21691083f4637c0e595.zip
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.
Diffstat (limited to 'fabric/src/main/java/de')
-rw-r--r--fabric/src/main/java/de/hype/bbsentials/fabric/MCUtils.java2
-rw-r--r--fabric/src/main/java/de/hype/bbsentials/fabric/ModInitialiser.java1
2 files changed, 2 insertions, 1 deletions
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();
});