diff --git a/Plan/fabric/src/main/java/net/playeranalytics/plan/gathering/domain/FabricPlayerData.java b/Plan/fabric/src/main/java/net/playeranalytics/plan/gathering/domain/FabricPlayerData.java index e1e67c758d..8c88fe3325 100644 --- a/Plan/fabric/src/main/java/net/playeranalytics/plan/gathering/domain/FabricPlayerData.java +++ b/Plan/fabric/src/main/java/net/playeranalytics/plan/gathering/domain/FabricPlayerData.java @@ -21,6 +21,7 @@ import io.netty.channel.unix.DomainSocketAddress; import net.minecraft.server.dedicated.MinecraftDedicatedServer; import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.text.Text; import java.net.*; import java.util.Optional; @@ -45,12 +46,12 @@ public UUID getUUID() { @Override public String getName() { - return player.getNameForScoreboard(); + return player.getGameProfile().getName(); } @Override public Optional getDisplayName() { - return Optional.of(player.getDisplayName().getString()); + return Optional.ofNullable(player.getDisplayName()).map(Text::getString); } @Override diff --git a/Plan/fabric/src/main/java/net/playeranalytics/plan/gathering/listeners/events/mixin/ServerCommandSourceMixin.java b/Plan/fabric/src/main/java/net/playeranalytics/plan/gathering/listeners/events/mixin/ServerCommandSourceMixin.java index 7300b2b871..48aa7a21ca 100644 --- a/Plan/fabric/src/main/java/net/playeranalytics/plan/gathering/listeners/events/mixin/ServerCommandSourceMixin.java +++ b/Plan/fabric/src/main/java/net/playeranalytics/plan/gathering/listeners/events/mixin/ServerCommandSourceMixin.java @@ -17,6 +17,7 @@ package net.playeranalytics.plan.gathering.listeners.events.mixin; import com.djrapitops.plan.commands.use.*; +import com.mojang.authlib.GameProfile; import net.minecraft.entity.Entity; import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.network.ServerPlayerEntity; @@ -58,7 +59,7 @@ public MessageBuilder buildMessage() { @Override public Optional getPlayerName() { - return getPlayer().map(ServerPlayerEntity::getNameForScoreboard); + return getPlayer().map(ServerPlayerEntity::getGameProfile).map(GameProfile::getName); } @Override