diff --git a/src/main/java/com/flemmli97/flan/commands/CommandClaim.java b/src/main/java/com/flemmli97/flan/commands/CommandClaim.java index fd00290..f5b8ad6 100644 --- a/src/main/java/com/flemmli97/flan/commands/CommandClaim.java +++ b/src/main/java/com/flemmli97/flan/commands/CommandClaim.java @@ -91,7 +91,7 @@ public class CommandClaim { private static int reloadConfig(CommandContext context) { ConfigHandler.reloadConfigs(); - context.getSource().sendFeedback(Text.of(ConfigHandler.lang.configReload), true); + context.getSource().sendFeedback(PermHelper.simpleColoredText(ConfigHandler.lang.configReload), true); return Command.SINGLE_SUCCESS; } @@ -149,7 +149,7 @@ public class CommandClaim { else if (!b.get()) player.sendMessage(PermHelper.simpleColoredText(ConfigHandler.lang.deleteClaimError, Formatting.DARK_RED), false); else - player.sendMessage(PermHelper.simpleColoredText(ConfigHandler.lang.deleteClaim, Formatting.DARK_RED), false); + player.sendMessage(PermHelper.simpleColoredText(ConfigHandler.lang.deleteClaim, Formatting.RED), false); }); if (!check) return 0; diff --git a/src/main/java/com/flemmli97/flan/gui/ClaimMenuScreenHandler.java b/src/main/java/com/flemmli97/flan/gui/ClaimMenuScreenHandler.java index 3d812f7..09b4643 100644 --- a/src/main/java/com/flemmli97/flan/gui/ClaimMenuScreenHandler.java +++ b/src/main/java/com/flemmli97/flan/gui/ClaimMenuScreenHandler.java @@ -2,6 +2,7 @@ package com.flemmli97.flan.gui; import com.flemmli97.flan.claim.Claim; import com.flemmli97.flan.claim.ClaimStorage; +import com.flemmli97.flan.claim.PermHelper; import com.flemmli97.flan.config.ConfigHandler; import com.flemmli97.flan.player.PlayerClaimData; import net.minecraft.entity.player.PlayerEntity; @@ -37,7 +38,7 @@ public class ClaimMenuScreenHandler extends ServerOnlyScreenHandler { @Override public Text getDisplayName() { - return Text.of(claim.parentClaim() != null ? "SubClaim-Menu" : "Claim-Menu"); + return PermHelper.simpleColoredText(claim.parentClaim() != null ? "SubClaim-Menu" : "Claim-Menu"); } }; player.openHandledScreen(fac); @@ -102,7 +103,7 @@ public class ClaimMenuScreenHandler extends ServerOnlyScreenHandler { ClaimStorage storage = ClaimStorage.get(player.getServerWorld()); storage.deleteClaim(this.claim, true, PlayerClaimData.get(player).getEditMode(), player.getServerWorld()); player.closeHandledScreen(); - player.sendMessage(Text.of(ConfigHandler.lang.deleteClaim), false); + player.sendMessage(PermHelper.simpleColoredText(ConfigHandler.lang.deleteClaim, Formatting.RED), false); ServerScreenHelper.playSongToPlayer(player, SoundEvents.BLOCK_ANVIL_PLACE, 1, 1f); } else { player.closeHandledScreen(); diff --git a/src/main/java/com/flemmli97/flan/gui/ConfirmScreenHandler.java b/src/main/java/com/flemmli97/flan/gui/ConfirmScreenHandler.java index 510159a..6fd930b 100644 --- a/src/main/java/com/flemmli97/flan/gui/ConfirmScreenHandler.java +++ b/src/main/java/com/flemmli97/flan/gui/ConfirmScreenHandler.java @@ -1,5 +1,6 @@ package com.flemmli97.flan.gui; +import com.flemmli97.flan.claim.PermHelper; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Inventory; @@ -34,7 +35,7 @@ public class ConfirmScreenHandler extends ServerOnlyScreenHandler { @Override public Text getDisplayName() { - return Text.of("Confirm"); + return PermHelper.simpleColoredText("Confirm"); } }; player.openHandledScreen(fac); diff --git a/src/main/java/com/flemmli97/flan/gui/GroupPlayerScreenHandler.java b/src/main/java/com/flemmli97/flan/gui/GroupPlayerScreenHandler.java index 6b06328..c1b7ae5 100644 --- a/src/main/java/com/flemmli97/flan/gui/GroupPlayerScreenHandler.java +++ b/src/main/java/com/flemmli97/flan/gui/GroupPlayerScreenHandler.java @@ -1,6 +1,7 @@ package com.flemmli97.flan.gui; import com.flemmli97.flan.claim.Claim; +import com.flemmli97.flan.claim.PermHelper; import com.flemmli97.flan.config.ConfigHandler; import com.mojang.authlib.GameProfile; import net.minecraft.block.entity.SkullBlockEntity; @@ -44,7 +45,7 @@ public class GroupPlayerScreenHandler extends ServerOnlyScreenHandler { @Override public Text getDisplayName() { - return Text.of(group + "-Players"); + return PermHelper.simpleColoredText(group + "-Players"); } }; player.openHandledScreen(fac); @@ -108,7 +109,7 @@ public class GroupPlayerScreenHandler extends ServerOnlyScreenHandler { if (fl) ServerScreenHelper.playSongToPlayer(player, SoundEvents.BLOCK_ANVIL_USE, 1, 1f); else { - player.sendMessage(Text.of(ConfigHandler.lang.playerGroupAddFail), false); + player.sendMessage(PermHelper.simpleColoredText(ConfigHandler.lang.playerGroupAddFail, Formatting.RED), false); ServerScreenHelper.playSongToPlayer(player, SoundEvents.ENTITY_VILLAGER_NO, 1, 1f); } }, () -> { diff --git a/src/main/java/com/flemmli97/flan/gui/GroupScreenHandler.java b/src/main/java/com/flemmli97/flan/gui/GroupScreenHandler.java index f17e701..458f82d 100644 --- a/src/main/java/com/flemmli97/flan/gui/GroupScreenHandler.java +++ b/src/main/java/com/flemmli97/flan/gui/GroupScreenHandler.java @@ -2,6 +2,7 @@ package com.flemmli97.flan.gui; import com.flemmli97.flan.claim.Claim; import com.flemmli97.flan.claim.EnumPermission; +import com.flemmli97.flan.claim.PermHelper; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Inventory; @@ -39,7 +40,7 @@ public class GroupScreenHandler extends ServerOnlyScreenHandler { @Override public Text getDisplayName() { - return Text.of("Claim-Groups"); + return PermHelper.simpleColoredText("Claim-Groups"); } }; player.openHandledScreen(fac); diff --git a/src/main/java/com/flemmli97/flan/gui/PermissionScreenHandler.java b/src/main/java/com/flemmli97/flan/gui/PermissionScreenHandler.java index ac2d359..d45fe0a 100644 --- a/src/main/java/com/flemmli97/flan/gui/PermissionScreenHandler.java +++ b/src/main/java/com/flemmli97/flan/gui/PermissionScreenHandler.java @@ -2,6 +2,7 @@ package com.flemmli97.flan.gui; import com.flemmli97.flan.claim.Claim; import com.flemmli97.flan.claim.EnumPermission; +import com.flemmli97.flan.claim.PermHelper; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Inventory; @@ -39,7 +40,7 @@ public class PermissionScreenHandler extends ServerOnlyScreenHandler { @Override public Text getDisplayName() { - return Text.of(group == null ? "Global-Permissions" : String.format("%s-Permissions", group)); + return PermHelper.simpleColoredText(group == null ? "Global-Permissions" : String.format("%s-Permissions", group)); } }; player.openHandledScreen(fac); @@ -54,7 +55,7 @@ public class PermissionScreenHandler extends ServerOnlyScreenHandler { @Override public Text getDisplayName() { - return Text.of(group == null ? "Global-Permissions" : String.format("%s-Permissions", group)); + return PermHelper.simpleColoredText(group == null ? "Global-Permissions" : String.format("%s-Permissions", group)); } }; player.openHandledScreen(fac); @@ -82,7 +83,7 @@ public class PermissionScreenHandler extends ServerOnlyScreenHandler { int row = i / 9 - 1; int id = (i % 9) + row * 7 - 1 + page * 28; if (id < EnumPermission.values().length) - inv.setStack(i, ServerScreenHelper.fromPermission((Claim) additionalData[0], EnumPermission.values()[id], additionalData[1]==null?null:additionalData[1].toString())); + inv.setStack(i, ServerScreenHelper.fromPermission((Claim) additionalData[0], EnumPermission.values()[id], additionalData[1] == null ? null : additionalData[1].toString())); } } } diff --git a/src/main/java/com/flemmli97/flan/gui/ServerScreenHelper.java b/src/main/java/com/flemmli97/flan/gui/ServerScreenHelper.java index 746125c..ce5ecee 100644 --- a/src/main/java/com/flemmli97/flan/gui/ServerScreenHelper.java +++ b/src/main/java/com/flemmli97/flan/gui/ServerScreenHelper.java @@ -2,6 +2,7 @@ package com.flemmli97.flan.gui; import com.flemmli97.flan.claim.Claim; import com.flemmli97.flan.claim.EnumPermission; +import com.flemmli97.flan.claim.PermHelper; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.nbt.ListTag; @@ -19,7 +20,7 @@ public class ServerScreenHelper { public static ItemStack emptyFiller() { ItemStack stack = new ItemStack(Items.GRAY_STAINED_GLASS_PANE); - stack.setCustomName(Text.of("")); + stack.setCustomName(PermHelper.simpleColoredText("")); return stack; } diff --git a/src/main/java/com/flemmli97/flan/gui/StringResultScreenHandler.java b/src/main/java/com/flemmli97/flan/gui/StringResultScreenHandler.java index 4bff617..1b8ec28 100644 --- a/src/main/java/com/flemmli97/flan/gui/StringResultScreenHandler.java +++ b/src/main/java/com/flemmli97/flan/gui/StringResultScreenHandler.java @@ -1,6 +1,7 @@ package com.flemmli97.flan.gui; import com.flemmli97.flan.claim.Claim; +import com.flemmli97.flan.claim.PermHelper; import com.flemmli97.flan.config.ConfigHandler; import com.google.common.collect.Lists; import net.minecraft.entity.player.PlayerEntity; @@ -33,10 +34,10 @@ public class StringResultScreenHandler extends AnvilScreenHandler { private StringResultScreenHandler(int syncId, PlayerInventory playerInventory, Consumer cons, Runnable ret) { super(syncId, playerInventory); ItemStack stack = new ItemStack(Items.PAPER); - stack.setCustomName(Text.of("")); + stack.setCustomName(PermHelper.simpleColoredText("")); this.input.setStack(0, stack); ItemStack out = new ItemStack(Items.BOOK); - out.setCustomName(Text.of(ConfigHandler.lang.stringScreenReturn)); + out.setCustomName(PermHelper.simpleColoredText(ConfigHandler.lang.stringScreenReturn)); this.output.setStack(0, out); this.cons = cons; this.ret = ret; @@ -52,7 +53,7 @@ public class StringResultScreenHandler extends AnvilScreenHandler { @Override public Text getDisplayName() { - return Text.of(""); + return PermHelper.simpleColoredText(""); } }; player.openHandledScreen(fac);