fix command feedback for enter/leave message

This commit is contained in:
Flemmli97 2022-02-07 12:21:26 +01:00
parent e6061573d8
commit b70246e1d4
2 changed files with 3 additions and 6 deletions

View File

@ -35,6 +35,7 @@ import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.network.chat.Style;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
@ -792,11 +793,7 @@ public class CommandClaim {
feedback = ConfigHandler.langManager.get("setLeaveMessage");
}
}
String[] unf = feedback.split("%s", 2);
MutableComponent cmdFeed = new TextComponent(unf[0]).withStyle(ChatFormatting.GOLD)
.append(text);
if (unf.length > 1)
cmdFeed.append(new TextComponent(unf[1])).withStyle(ChatFormatting.GOLD);
MutableComponent cmdFeed = new TranslatableComponent(feedback, text).withStyle(ChatFormatting.GOLD);
context.getSource().sendSuccess(cmdFeed, false);
return Command.SINGLE_SUCCESS;
}

View File

@ -38,7 +38,7 @@ public class BuySellHandler {
return false;
}
PlayerClaimData data = PlayerClaimData.get(player);
if(ConfigHandler.config.maxBuyBlocks >= 0 && data.getAdditionalClaims() + blocks > ConfigHandler.config.maxBuyBlocks) {
if (ConfigHandler.config.maxBuyBlocks >= 0 && data.getAdditionalClaims() + blocks > ConfigHandler.config.maxBuyBlocks) {
message.accept(PermHelper.simpleColoredText(ConfigHandler.langManager.get("buyLimit"), ChatFormatting.DARK_RED));
return false;
}