ability to remove claim enter/leave messages
This commit is contained in:
parent
2d4bfdeb18
commit
b093df0425
@ -528,12 +528,20 @@ public class Claim implements IPermissionContainer {
|
||||
}
|
||||
|
||||
public void setEnterTitle(Component title, Component sub) {
|
||||
if(title != null && title.getContents().equals("$empty"))
|
||||
title = null;
|
||||
if(sub != null && sub.getContents().equals("$empty"))
|
||||
title = null;
|
||||
this.enterTitle = title;
|
||||
this.enterSubtitle = sub;
|
||||
this.setDirty(true);
|
||||
}
|
||||
|
||||
public void setLeaveTitle(Component title, Component sub) {
|
||||
if(title != null && title.getContents().equals("$empty"))
|
||||
title = null;
|
||||
if(sub != null && sub.getContents().equals("$empty"))
|
||||
title = null;
|
||||
this.leaveTitle = title;
|
||||
this.leaveSubtitle = sub;
|
||||
this.setDirty(true);
|
||||
|
@ -144,6 +144,7 @@ public class LangManager {
|
||||
this.defaultTranslation.put("screenEnterSubText", "Edit subtitle text on enter. (Right-Click to use JSON text. See MC Wiki for that)");
|
||||
this.defaultTranslation.put("screenLeaveText", "Edit title text on leave. (Right-Click to use JSON text. See MC Wiki for that)");
|
||||
this.defaultTranslation.put("screenLeaveSubText", "Edit subtitle text on enter. (Right-Click to use JSON text. See MC Wiki for that)");
|
||||
this.defaultTranslation.put("screenDelete", "Use \"$empty\" to delete the message");
|
||||
|
||||
this.defaultTranslation.put("chatClaimTextEdit", "[Click for command]");
|
||||
|
||||
@ -202,6 +203,7 @@ public class LangManager {
|
||||
this.defaultTranslationArray.put("command.setHome", new String[]{"setHome", "Standing in a claim with sufficient permission sets that claims home to the players position"});
|
||||
this.defaultTranslationArray.put("command.teleport", new String[]{"teleport self | admin | (other <player>) (<claim name> | <claim uuid>)", "Teleport to the given claims home position. Use admin to teleport to admin claims"});
|
||||
this.defaultTranslationArray.put("command.name", new String[]{"name self <name>", "Sets the current claims name"});
|
||||
this.defaultTranslationArray.put("command.claimMessage", new String[]{"claimMessage (enter | leave) (title | subtitle) (string | text) <value>", "Sets the claims message. Use \"$empty\" to remove the message"});
|
||||
|
||||
this.defaultTranslationArray.put("command.reload", new String[]{"reload", "Reloads the config ingame."});
|
||||
this.defaultTranslationArray.put("command.adminMode", new String[]{"adminMode", "Switches to admin mode ignoring all claims."});
|
||||
|
@ -59,6 +59,7 @@ public class ClaimTextHandler extends ServerOnlyScreenHandler<Claim> {
|
||||
case 2 -> {
|
||||
ItemStack stack = new ItemStack(Items.OAK_SIGN);
|
||||
stack.setHoverName(ServerScreenHelper.coloredGuiText(ConfigHandler.langManager.get("screenEnterText"), ChatFormatting.GOLD));
|
||||
ServerScreenHelper.addLore(stack, ServerScreenHelper.coloredGuiText(ConfigHandler.langManager.get("screenDelete"), ChatFormatting.DARK_RED));
|
||||
if (claim.enterTitle != null)
|
||||
ServerScreenHelper.addLore(stack, claim.enterTitle);
|
||||
inv.updateStack(i, stack);
|
||||
@ -66,6 +67,7 @@ public class ClaimTextHandler extends ServerOnlyScreenHandler<Claim> {
|
||||
case 3 -> {
|
||||
ItemStack stack2 = new ItemStack(Items.OAK_SIGN);
|
||||
stack2.setHoverName(ServerScreenHelper.coloredGuiText(ConfigHandler.langManager.get("screenEnterSubText"), ChatFormatting.GOLD));
|
||||
ServerScreenHelper.addLore(stack2, ServerScreenHelper.coloredGuiText(ConfigHandler.langManager.get("screenDelete"), ChatFormatting.DARK_RED));
|
||||
if (claim.enterSubtitle != null)
|
||||
ServerScreenHelper.addLore(stack2, claim.enterSubtitle);
|
||||
inv.updateStack(i, stack2);
|
||||
@ -73,6 +75,7 @@ public class ClaimTextHandler extends ServerOnlyScreenHandler<Claim> {
|
||||
case 4 -> {
|
||||
ItemStack stack3 = new ItemStack(Items.OAK_SIGN);
|
||||
stack3.setHoverName(ServerScreenHelper.coloredGuiText(ConfigHandler.langManager.get("screenLeaveText"), ChatFormatting.GOLD));
|
||||
ServerScreenHelper.addLore(stack3, ServerScreenHelper.coloredGuiText(ConfigHandler.langManager.get("screenDelete"), ChatFormatting.DARK_RED));
|
||||
if (claim.leaveTitle != null)
|
||||
ServerScreenHelper.addLore(stack3, claim.leaveTitle);
|
||||
inv.updateStack(i, stack3);
|
||||
@ -80,6 +83,7 @@ public class ClaimTextHandler extends ServerOnlyScreenHandler<Claim> {
|
||||
case 5 -> {
|
||||
ItemStack stack4 = new ItemStack(Items.OAK_SIGN);
|
||||
stack4.setHoverName(ServerScreenHelper.coloredGuiText(ConfigHandler.langManager.get("screenLeaveSubText"), ChatFormatting.GOLD));
|
||||
ServerScreenHelper.addLore(stack4, ServerScreenHelper.coloredGuiText(ConfigHandler.langManager.get("screenDelete"), ChatFormatting.DARK_RED));
|
||||
if (claim.leaveSubtitle != null)
|
||||
ServerScreenHelper.addLore(stack4, claim.leaveSubtitle);
|
||||
inv.updateStack(i, stack4);
|
||||
|
Loading…
x
Reference in New Issue
Block a user