diff --git a/src/main/java/com/nexia/core/gui/PrefixGUI.java b/src/main/java/com/nexia/core/gui/PrefixGUI.java index fb992f5b..b99cb075 100644 --- a/src/main/java/com/nexia/core/gui/PrefixGUI.java +++ b/src/main/java/com/nexia/core/gui/PrefixGUI.java @@ -98,6 +98,7 @@ public boolean click(int index, ClickType clickType, net.minecraft.world.invento } if(name.equalsIgnoreCase("player")) name = "default"; + if(name.equalsIgnoreCase("nexia")) name = "supporter"; player.addTag(name.toLowerCase()); this.setMainLayout(this.player); diff --git a/src/main/java/com/nexia/core/listeners/nexus/PlayerRespawnListener.java b/src/main/java/com/nexia/core/listeners/nexus/PlayerRespawnListener.java index 75e92963..f573488e 100644 --- a/src/main/java/com/nexia/core/listeners/nexus/PlayerRespawnListener.java +++ b/src/main/java/com/nexia/core/listeners/nexus/PlayerRespawnListener.java @@ -40,7 +40,7 @@ public void registerListener() { boolean isPlaying = ((SkywarsPlayerData)PlayerDataManager.getDataManager(NexiaCore.SKYWARS_DATA_MANAGER).get(player)).gameMode == SkywarsGameMode.PLAYING; ServerPlayer serverPlayer = PlayerUtil.getPlayerAttacker(player.unwrap()); - if(serverPlayer != null && serverPlayer != player.unwrap() && isPlaying) { + if(serverPlayer != null && !serverPlayer.equals(player.unwrap()) && isPlaying) { respawn.setX(serverPlayer.getX()); respawn.setY(serverPlayer.getY()); respawn.setZ(serverPlayer.getZ()); diff --git a/src/main/java/com/nexia/core/mixin/player/PlayerListMixin.java b/src/main/java/com/nexia/core/mixin/player/PlayerListMixin.java index 50d8749c..42f2213f 100644 --- a/src/main/java/com/nexia/core/mixin/player/PlayerListMixin.java +++ b/src/main/java/com/nexia/core/mixin/player/PlayerListMixin.java @@ -167,7 +167,16 @@ private void checkIfBanned(SocketAddress socketAddress, GameProfile gameProfile, String textBanTime = banTimeToText(banTime); if(LocalDateTime.now().isBefore(banTime)){ - cir.setReturnValue(new TextComponent("§c§lYou have been banned.\n§7Duration: §d" + textBanTime + "\n§7Reason: §d" + reason + "\n§7You can appeal your ban at §d" + NexiaDiscord.config.discordLink)); + cir.setReturnValue(ObjectMappings.convertComponent( + net.kyori.adventure.text.Component.text("You have been banned.", ChatFormat.failColor) + .append(net.kyori.adventure.text.Component.text("\nDuration: ", ChatFormat.systemColor)) + .append(net.kyori.adventure.text.Component.text(textBanTime, ChatFormat.brandColor2)) + .append(net.kyori.adventure.text.Component.text("\nReason: ", ChatFormat.systemColor)) + .append(net.kyori.adventure.text.Component.text(reason, ChatFormat.brandColor2)) + .append(net.kyori.adventure.text.Component.text("\nYou can appeal your ban at ", ChatFormat.systemColor)) + .append(net.kyori.adventure.text.Component.text(NexiaDiscord.config.discordLink, ChatFormat.brandColor2)) + )); + } else { BanHandler.removeBanFromList(gameProfile); } diff --git a/src/main/java/com/nexia/core/utilities/player/BanHandler.java b/src/main/java/com/nexia/core/utilities/player/BanHandler.java index c26509a7..9f3add08 100644 --- a/src/main/java/com/nexia/core/utilities/player/BanHandler.java +++ b/src/main/java/com/nexia/core/utilities/player/BanHandler.java @@ -1,15 +1,14 @@ package com.nexia.core.utilities.player; -import com.nexia.nexus.api.command.CommandSourceInfo; import com.mojang.authlib.GameProfile; import com.mojang.brigadier.StringReader; import com.nexia.core.utilities.chat.ChatFormat; import com.nexia.core.utilities.time.ServerTime; import com.nexia.discord.NexiaDiscord; +import com.nexia.nexus.api.command.CommandSourceInfo; +import com.nexia.nexus.api.world.entity.player.Player; import net.fabricmc.loader.api.FabricLoader; import net.kyori.adventure.text.Component; -import net.minecraft.network.chat.TextComponent; -import net.minecraft.server.level.ServerPlayer; import org.apache.commons.lang3.time.DurationFormatUtils; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; @@ -121,10 +120,18 @@ public static void tryBan(CommandSourceInfo sender, Collection coll .append(Component.text(reason, ChatFormat.brandColor2)) ); - ServerPlayer banned = ServerTime.minecraftServer.getPlayerList().getPlayer(profile.getId()); + Player banned = ServerTime.nexusServer.getPlayer(profile.getId()); if (banned != null) { - banned.connection.disconnect(new TextComponent("§c§lYou have been banned.\n§7Duration: §d" + banTimeToText(banTime) + "\n§7Reason: §d" + reason + "\n§7You can appeal your ban at §d" + NexiaDiscord.config.discordLink)); + banned.disconnect( + net.kyori.adventure.text.Component.text("You have been banned.", ChatFormat.failColor) + .append(net.kyori.adventure.text.Component.text("\nDuration: ", ChatFormat.systemColor)) + .append(net.kyori.adventure.text.Component.text(banTimeToText(banTime), ChatFormat.brandColor2)) + .append(net.kyori.adventure.text.Component.text("\nReason: ", ChatFormat.systemColor)) + .append(net.kyori.adventure.text.Component.text(reason, ChatFormat.brandColor2)) + .append(net.kyori.adventure.text.Component.text("\nYou can appeal your ban at ", ChatFormat.systemColor)) + .append(net.kyori.adventure.text.Component.text(NexiaDiscord.config.discordLink, ChatFormat.brandColor2)) + ); } }