Force UTF-8 and replace § has hex value (\u00A7) to utf-8 §

This commit is contained in:
alexcrea 2024-08-08 01:39:43 +02:00
parent 7d20ea83c3
commit 3cc9c674f3
No known key found for this signature in database
GPG key ID: 43FD265DB0DBF91F
33 changed files with 279 additions and 272 deletions

View file

@ -23,7 +23,7 @@ public class MainConfigGui extends ChestGui {
}
private MainConfigGui() {
super(3, "\u00A78Anvil Config", CustomAnvil.instance);
super(3, "§8Anvil Config", CustomAnvil.instance);
}
public void init(PacketManager packetManager) {
@ -42,8 +42,8 @@ public class MainConfigGui extends ChestGui {
ItemMeta basicConfigMeta = basicConfigItemstack.getItemMeta();
assert basicConfigMeta != null;
basicConfigMeta.setDisplayName("\u00A7aBasic Config Menu");
basicConfigMeta.setLore(Collections.singletonList("\u00A77Click here to open basic config menu"));
basicConfigMeta.setDisplayName("§aBasic Config Menu");
basicConfigMeta.setLore(Collections.singletonList("§7Click here to open basic config menu"));
basicConfigItemstack.setItemMeta(basicConfigMeta);
GuiItem basicConfigItem = GuiGlobalItems.goToGuiItem(basicConfigItemstack, new BasicConfigGui(packetManager));
@ -54,8 +54,8 @@ public class MainConfigGui extends ChestGui {
ItemMeta enchantLimitMeta = enchantLimitItemstack.getItemMeta();
assert enchantLimitMeta != null;
enchantLimitMeta.setDisplayName("\u00A7aEnchantment Level Limit");
enchantLimitMeta.setLore(Collections.singletonList("\u00A77Click here to open enchantment level limit menu"));
enchantLimitMeta.setDisplayName("§aEnchantment Level Limit");
enchantLimitMeta.setLore(Collections.singletonList("§7Click here to open enchantment level limit menu"));
enchantLimitItemstack.setItemMeta(enchantLimitMeta);
GuiItem enchantLimitItem = GuiGlobalItems.goToGuiItem(enchantLimitItemstack, new EnchantLimitConfigGui());
@ -66,8 +66,8 @@ public class MainConfigGui extends ChestGui {
ItemMeta enchantCostMeta = enchantCostItemstack.getItemMeta();
assert enchantCostMeta != null;
enchantCostMeta.setDisplayName("\u00A7aEnchantment Cost");
enchantCostMeta.setLore(Collections.singletonList("\u00A77Click here to open enchantment costs menu"));
enchantCostMeta.setDisplayName("§aEnchantment Cost");
enchantCostMeta.setLore(Collections.singletonList("§7Click here to open enchantment costs menu"));
enchantCostItemstack.setItemMeta(enchantCostMeta);
GuiItem enchantCostItem = GuiGlobalItems.goToGuiItem(enchantCostItemstack, new EnchantCostConfigGui());
@ -78,8 +78,8 @@ public class MainConfigGui extends ChestGui {
ItemMeta enchantConflictMeta = enchantConflictItemstack.getItemMeta();
assert enchantConflictMeta != null;
enchantConflictMeta.setDisplayName("\u00A7aEnchantment Conflict");
enchantConflictMeta.setLore(Collections.singletonList("\u00A77Click here to open enchantment conflict menu"));
enchantConflictMeta.setDisplayName("§aEnchantment Conflict");
enchantConflictMeta.setLore(Collections.singletonList("§7Click here to open enchantment conflict menu"));
enchantConflictItemstack.setItemMeta(enchantConflictMeta);
GuiItem enchantConflictItem = GuiGlobalItems.goToGuiItem(enchantConflictItemstack, EnchantConflictGui.getInstance());
@ -90,8 +90,8 @@ public class MainConfigGui extends ChestGui {
ItemMeta groupMeta = groupItemstack.getItemMeta();
assert groupMeta != null;
groupMeta.setDisplayName("\u00A7aGroups");
groupMeta.setLore(Collections.singletonList("\u00A77Click here to open material group menu"));
groupMeta.setDisplayName("§aGroups");
groupMeta.setLore(Collections.singletonList("§7Click here to open material group menu"));
groupItemstack.setItemMeta(groupMeta);
GuiItem groupConfigItem = GuiGlobalItems.goToGuiItem(groupItemstack, GroupConfigGui.getInstance());
@ -103,8 +103,8 @@ public class MainConfigGui extends ChestGui {
ItemMeta unitRepairMeta = unirRepairItemstack.getItemMeta();
assert unitRepairMeta != null;
unitRepairMeta.setDisplayName("\u00A7aUnit Repair");
unitRepairMeta.setLore(Collections.singletonList("\u00A77Click here to open anvil unit repair menu"));
unitRepairMeta.setDisplayName("§aUnit Repair");
unitRepairMeta.setLore(Collections.singletonList("§7Click here to open anvil unit repair menu"));
unirRepairItemstack.setItemMeta(unitRepairMeta);
GuiItem unitRepairItem = GuiGlobalItems.goToGuiItem(unirRepairItemstack, UnitRepairConfigGui.getInstance());
@ -115,8 +115,8 @@ public class MainConfigGui extends ChestGui {
ItemMeta customRecipeMeta = customRecipeItemstack.getItemMeta();
assert customRecipeMeta != null;
customRecipeMeta.setDisplayName("\u00A7aCustom recipes");
customRecipeMeta.setLore(Collections.singletonList("\u00A77Click here to open anvil custom recipe menu"));
customRecipeMeta.setDisplayName("§aCustom recipes");
customRecipeMeta.setLore(Collections.singletonList("§7Click here to open anvil custom recipe menu"));
customRecipeItemstack.setItemMeta(customRecipeMeta);
GuiItem customRecipeItem = GuiGlobalItems.goToGuiItem(customRecipeItemstack, CustomRecipeConfigGui.getInstance());
@ -127,7 +127,7 @@ public class MainConfigGui extends ChestGui {
ItemMeta quitMeta = quitItemstack.getItemMeta();
assert quitMeta != null;
quitMeta.setDisplayName("\u00A7cQuit");
quitMeta.setDisplayName("§cQuit");
quitItemstack.setItemMeta(quitMeta);
GuiItem quitItem = new GuiItem(quitItemstack, event -> {

View file

@ -19,12 +19,12 @@ public interface SelectGroupContainer {
static List<String> getGroupLore(SelectGroupContainer container, String containerType, String groupAction){
// Prepare group lore
ArrayList<String> groupLore = new ArrayList<>();
groupLore.add("\u00A77Allow you to select a list of \u00A73Groups \u00A77that this " + containerType + " should " + groupAction);
groupLore.add("§7Allow you to select a list of §3Groups §7that this " + containerType + " should " + groupAction);
Set<AbstractMaterialGroup> grouos = container.getSelectedGroups();
if (grouos.isEmpty()) {
groupLore.add("\u00A77There is no "+groupAction+"d group for this "+containerType+".");
groupLore.add("§7There is no "+groupAction+"d group for this "+containerType+".");
} else {
groupLore.add("\u00A77List of "+groupAction+"d groups for this "+containerType+":");
groupLore.add("§7List of "+groupAction+"d groups for this "+containerType+":");
Iterator<AbstractMaterialGroup> groupIterator = grouos.iterator();
boolean greaterThanMax = grouos.size() > 5;
@ -32,11 +32,11 @@ public interface SelectGroupContainer {
for (int i = 0; i < maxindex; i++) {
// format string like "- Melee Weapons"
String formattedName = CasedStringUtil.snakeToUpperSpacedCase(groupIterator.next().getName());
groupLore.add("\u00A77- \u00A73" + formattedName);
groupLore.add("§7- §3" + formattedName);
}
if (greaterThanMax) {
groupLore.add("\u00A77And " + (grouos.size() - 4) + " more...");
groupLore.add("§7And " + (grouos.size() - 4) + " more...");
}
}
return groupLore;

View file

@ -16,12 +16,12 @@ public interface SelectMaterialContainer {
static List<String> getMaterialLore(SelectMaterialContainer container, String containerType, String action){
// Prepare material lore
ArrayList<String> groupLore = new ArrayList<>();
groupLore.add("\u00A77Allow you to select a list of \u00A7ematerials \u00A77that this " + containerType + " should " + action);
groupLore.add("§7Allow you to select a list of §ematerials §7that this " + containerType + " should " + action);
Set<Material> materialSet = container.getSelectedMaterials();
if (materialSet.isEmpty()) {
groupLore.add("\u00A77There is no "+action+"d material for this "+containerType+".");
groupLore.add("§7There is no "+action+"d material for this "+containerType+".");
} else {
groupLore.add("\u00A77List of "+action+"d materials for this "+containerType+":");
groupLore.add("§7List of "+action+"d materials for this "+containerType+":");
Iterator<Material> materialIterator = materialSet.iterator();
boolean greaterThanMax = materialSet.size() > 5;
@ -29,11 +29,11 @@ public interface SelectMaterialContainer {
for (int i = 0; i < maxindex; i++) {
// format string like "- Stone Sword"
String formattedName = CasedStringUtil.snakeToUpperSpacedCase(materialIterator.next().name().toLowerCase());
groupLore.add("\u00A77- \u00A7e" + formattedName);
groupLore.add("§7- §e" + formattedName);
}
if (greaterThanMax) {
groupLore.add("\u00A77And " + (materialSet.size() - 4) + " more...");
groupLore.add("§7And " + (materialSet.size() - 4) + " more...");
}
}
return groupLore;

View file

@ -45,7 +45,7 @@ public class ConfirmActionGui extends AbstractAskGui {
}
if (!success) {
event.getWhoClicked().sendMessage("\u00A7cAction could not be completed. ");
event.getWhoClicked().sendMessage("§cAction could not be completed. ");
}
backOnConfirm.show(player);
@ -55,7 +55,7 @@ public class ConfirmActionGui extends AbstractAskGui {
ItemStack infoItem = new ItemStack(Material.PAPER);
ItemMeta infoMeta = infoItem.getItemMeta();
infoMeta.setDisplayName("\u00A7eAre you sure ?");
infoMeta.setDisplayName("§eAre you sure ?");
if(actionDescription != null){
infoMeta.setLore(Arrays.asList(actionDescription.split("\n")));
}

View file

@ -80,7 +80,7 @@ public class SelectItemTypeGui extends AbstractAskGui {
private ItemStack setDisplayMeta(ItemStack item, String actionDescription){
ItemMeta meta = item.getItemMeta();
meta.setDisplayName("\u00A7ePlace an item here");
meta.setDisplayName("§ePlace an item here");
meta.setLore(Arrays.asList(actionDescription.split("\n")));
item.setItemMeta(meta);

View file

@ -44,7 +44,7 @@ public class BasicConfigGui extends ChestGui implements ValueUpdatableGui {
* Constructor of this Global gui for basic settings.
*/
public BasicConfigGui(PacketManager packetManager) {
super(4, "\u00A78Basic Config", CustomAnvil.instance);
super(4, "§8Basic Config", CustomAnvil.instance);
if(INSTANCE == null) INSTANCE = this;
this.packetManager = packetManager;
@ -99,33 +99,33 @@ public class BasicConfigGui extends ChestGui implements ValueUpdatableGui {
*/
protected void prepareValues() {
// cap anvil cost
this.capAnvilCost = BoolSettingsGui.boolFactory("\u00A78Cap Anvil Cost ?", this,
this.capAnvilCost = BoolSettingsGui.boolFactory("§8Cap Anvil Cost ?", this,
ConfigHolder.DEFAULT_CONFIG,
ConfigOptions.CAP_ANVIL_COST, ConfigOptions.DEFAULT_CAP_ANVIL_COST,
"\u00A77All anvil cost will be capped to \u00A7aMax Anvil Cost\u00A77 if enabled.",
"\u00A77In other words:",
"\u00A77For any anvil cost greater than \u00A7aMax Anvil Cost\u00A77, Cost will be set to \u00A7aMax Anvil Cost\u00A77.");
"§7All anvil cost will be capped to §aMax Anvil Cost§7 if enabled.",
"§7In other words:",
"§7For any anvil cost greater than §aMax Anvil Cost§7, Cost will be set to §aMax Anvil Cost§7.");
// cap anvil cost not needed
ItemStack item = new ItemStack(Material.BARRIER);
ItemMeta meta = item.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7cCap Anvil Cost ?");
meta.setLore(Collections.singletonList("\u00A77This config only work if \u00A7cLimit Repair Cost\u00A77 is disabled."));
meta.setDisplayName("§cCap Anvil Cost ?");
meta.setLore(Collections.singletonList("§7This config only work if §cLimit Repair Cost§7 is disabled."));
item.setItemMeta(meta);
this.noCapRepairItem = new GuiItem(item, GuiGlobalActions.stayInPlace, CustomAnvil.instance);
// repair cost item
IntRange range = ConfigOptions.MAX_ANVIL_COST_RANGE;
this.maxAnvilCost = IntSettingsGui.intFactory("\u00A78Max Anvil Cost", this,
this.maxAnvilCost = IntSettingsGui.intFactory("§8Max Anvil Cost", this,
ConfigOptions.MAX_ANVIL_COST, ConfigHolder.DEFAULT_CONFIG,
Arrays.asList(
"\u00A77Max cost the Anvil can get to.",
"\u00A77Valid values include \u00A7e0 \u00A77to \u00A7e1000\u00A77.",
"\u00A77Cost will be displayed as \u00A7cToo Expensive\u00A77:",
"\u00A77- If Cost is above \u00A7e39",
"\u00A77- And \u00A7eReplace Too Expensive\u00A77 is disabled"
"§7Max cost the Anvil can get to.",
"§7Valid values include §e0 §7to §e1000§7.",
"§7Cost will be displayed as §cToo Expensive§7:",
"§7- If Cost is above §e39",
"§7- And §eReplace Too Expensive§7 is disabled"
),
range.getFirst(), range.getLast(),
ConfigOptions.DEFAULT_MAX_ANVIL_COST,
@ -135,22 +135,22 @@ public class BasicConfigGui extends ChestGui implements ValueUpdatableGui {
meta = item.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7cMax Anvil Cost");
meta.setLore(Collections.singletonList("\u00A77This config only work if \u00A7cLimit Repair Cost\u00A77 is disabled."));
meta.setDisplayName("§cMax Anvil Cost");
meta.setLore(Collections.singletonList("§7This config only work if §cLimit Repair Cost§7 is disabled."));
item.setItemMeta(meta);
this.noMaxCostItem = new GuiItem(item, GuiGlobalActions.stayInPlace, CustomAnvil.instance);
// remove repair limit item
this.removeAnvilCostLimit = BoolSettingsGui.boolFactory("\u00A78Remove Anvil Cost Limit ?", this,
this.removeAnvilCostLimit = BoolSettingsGui.boolFactory("§8Remove Anvil Cost Limit ?", this,
ConfigHolder.DEFAULT_CONFIG,
ConfigOptions.REMOVE_ANVIL_COST_LIMIT, ConfigOptions.DEFAULT_REMOVE_ANVIL_COST_LIMIT,
"\u00A77Whether the anvil's cost limit should be removed entirely.",
"\u00A77The anvil will still visually display \u00A7cToo Expensive\u00A77 if \u00A7eReplace Too Expensive\u00A77 is disabled.",
"\u00A77However, the action will be completable if xp requirement is meet.");
"§7Whether the anvil's cost limit should be removed entirely.",
"§7The anvil will still visually display §cToo Expensive§7 if §eReplace Too Expensive§7 is disabled.",
"§7However, the action will be completable if xp requirement is meet.");
// replace too expensive item
this.replaceTooExpensive = BoolSettingsGui.boolFactory("\u00A78Replace Too Expensive ?", this,
this.replaceTooExpensive = BoolSettingsGui.boolFactory("§8Replace Too Expensive ?", this,
ConfigHolder.DEFAULT_CONFIG,
ConfigOptions.REPLACE_TOO_EXPENSIVE, ConfigOptions.DEFAULT_REPLACE_TOO_EXPENSIVE,
getReplaceToExpensiveLore());
@ -161,23 +161,23 @@ public class BasicConfigGui extends ChestGui implements ValueUpdatableGui {
// item repair cost
range = ConfigOptions.REPAIR_COST_RANGE;
this.itemRepairCost = IntSettingsGui.intFactory("\u00A78Item Repair Cost", this,
this.itemRepairCost = IntSettingsGui.intFactory("§8Item Repair Cost", this,
ConfigOptions.ITEM_REPAIR_COST, ConfigHolder.DEFAULT_CONFIG,
Arrays.asList(
"\u00A77XP Level amount added to the anvil when the item",
"\u00A77is repaired by another item of the same type."
"§7XP Level amount added to the anvil when the item",
"§7is repaired by another item of the same type."
),
range.getFirst(), range.getLast(),
ConfigOptions.DEFAULT_ITEM_REPAIR_COST,
1, 5, 10, 50, 100);
// unit repair cost
this.unitRepairCost = IntSettingsGui.intFactory("\u00A78Unit Repair Cost", this,
this.unitRepairCost = IntSettingsGui.intFactory("§8Unit Repair Cost", this,
ConfigOptions.UNIT_REPAIR_COST, ConfigHolder.DEFAULT_CONFIG,
Arrays.asList(
"\u00A77XP Level amount added to the anvil when the item is repaired by an \u00A7eunit\u00A77.",
"\u00A77For example: a Diamond on a Diamond Sword.",
"\u00A77What's considered unit for what can be edited on the unit repair configuration."
"§7XP Level amount added to the anvil when the item is repaired by an §eunit§7.",
"§7For example: a Diamond on a Diamond Sword.",
"§7What's considered unit for what can be edited on the unit repair configuration."
),
range.getFirst(), range.getLast(),
ConfigOptions.DEFAULT_UNIT_REPAIR_COST,
@ -185,10 +185,10 @@ public class BasicConfigGui extends ChestGui implements ValueUpdatableGui {
// item rename cost
range = ConfigOptions.ITEM_RENAME_COST_RANGE;
this.itemRenameCost = IntSettingsGui.intFactory("\u00A78Rename Cost", this,
this.itemRenameCost = IntSettingsGui.intFactory("§8Rename Cost", this,
ConfigOptions.ITEM_RENAME_COST, ConfigHolder.DEFAULT_CONFIG,
Arrays.asList(
"\u00A77XP Level amount added to the anvil when the item is renamed."
"§7XP Level amount added to the anvil when the item is renamed."
),
range.getFirst(), range.getLast(),
ConfigOptions.DEFAULT_ITEM_RENAME_COST,
@ -196,11 +196,11 @@ public class BasicConfigGui extends ChestGui implements ValueUpdatableGui {
// sacrifice illegal enchant cost
range = ConfigOptions.SACRIFICE_ILLEGAL_COST_RANGE;
this.sacrificeIllegalEnchantCost = IntSettingsGui.intFactory("\u00A78Sacrifice Illegal Enchant Cost", this,
this.sacrificeIllegalEnchantCost = IntSettingsGui.intFactory("§8Sacrifice Illegal Enchant Cost", this,
ConfigOptions.SACRIFICE_ILLEGAL_COST, ConfigHolder.DEFAULT_CONFIG,
Arrays.asList(
"\u00A77XP Level amount added to the anvil when a sacrifice enchantment",
"\u00A77conflict With one of the left item enchantment"
"§7XP Level amount added to the anvil when a sacrifice enchantment",
"§7conflict With one of the left item enchantment"
),
range.getFirst(), range.getLast(),
ConfigOptions.DEFAULT_SACRIFICE_ILLEGAL_COST,
@ -211,48 +211,48 @@ public class BasicConfigGui extends ChestGui implements ValueUpdatableGui {
// -------------
// Allow us of color code
this.allowColorCode = BoolSettingsGui.boolFactory("\u00A78Allow Use Of Color Code ?", this,
this.allowColorCode = BoolSettingsGui.boolFactory("§8Allow Use Of Color Code ?", this,
ConfigHolder.DEFAULT_CONFIG,
ConfigOptions.ALLOW_COLOR_CODE, ConfigOptions.DEFAULT_ALLOW_COLOR_CODE,
"\u00A77Whether players can use color code.",
"\u00A77Color code a formatted like \u00A7a&a\u00A77 and is used in the rename field of the anvil.",
"\u00A77Player may need permission to use color code if \u00A7ePlayer need permission to use color\u00A77 is enabled.");
"§7Whether players can use color code.",
"§7Color code a formatted like §a&a§7 and is used in the rename field of the anvil.",
"§7Player may need permission to use color code if §ePlayer need permission to use color§7 is enabled.");
// Allow us of hexadecimal color
this.allowHexColor = BoolSettingsGui.boolFactory("\u00A78Allow Use Of Hexadecimal Color ?", this,
this.allowHexColor = BoolSettingsGui.boolFactory("§8Allow Use Of Hexadecimal Color ?", this,
ConfigHolder.DEFAULT_CONFIG,
ConfigOptions.ALLOW_HEXADECIMAL_COLOR, ConfigOptions.DEFAULT_ALLOW_HEXADECIMAL_COLOR,
"\u00A77Whether players can use hexadecimal color.",
"\u00A77Color code a formatted like \u00A72#012345 \u00A77and is used in the rename field of the anvil.",
"\u00A77Player may need permission to use color code if \u00A7ePermission Needed For Color\u00A77 is enabled.");
"§7Whether players can use hexadecimal color.",
"§7Color code a formatted like §2#012345 §7and is used in the rename field of the anvil.",
"§7Player may need permission to use color code if §ePermission Needed For Color§7 is enabled.");
// Permission needed for color
this.permissionNeededForColor = BoolSettingsGui.boolFactory("\u00A78Need Permission To Use Color ?", this,
this.permissionNeededForColor = BoolSettingsGui.boolFactory("§8Need Permission To Use Color ?", this,
ConfigHolder.DEFAULT_CONFIG,
ConfigOptions.PERMISSION_NEEDED_FOR_COLOR, ConfigOptions.DEFAULT_PERMISSION_NEEDED_FOR_COLOR,
"\u00A77Whether players should have permission to be able to use colors.",
"\u00A77Give player \u00A7eca.color.code\u00A77 Permission to allow use of color code.",
"\u00A77Give player \u00A7eca.color.hex\u00A77 Permission to allow use of hexadecimal color.");
"§7Whether players should have permission to be able to use colors.",
"§7Give player §eca.color.code§7 Permission to allow use of color code.",
"§7Give player §eca.color.hex§7 Permission to allow use of hexadecimal color.");
// Permission needed for color not necessary
item = new ItemStack(Material.BARRIER);
meta = item.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7cNeed Permission To Use Color ?");
meta.setLore(Arrays.asList("\u00A77This config can do something only if one of the following config is enabled:",
"\u00A77- \u00A7aAllow Use Of Color Code",
"\u00A77- \u00A7aAllow Use Of Hexadecimal Color"));
meta.setDisplayName("§cNeed Permission To Use Color ?");
meta.setLore(Arrays.asList("§7This config can do something only if one of the following config is enabled:",
"§7- §aAllow Use Of Color Code",
"§7- §aAllow Use Of Hexadecimal Color"));
item.setItemMeta(meta);
this.noPermissionNeededItem = new GuiItem(item, GuiGlobalActions.stayInPlace, CustomAnvil.instance);
// Cost of using color
range = ConfigOptions.USE_OF_COLOR_COST_RANGE;
this.useOfColorCost = IntSettingsGui.intFactory("\u00A78Cost Of Using Color", this,
this.useOfColorCost = IntSettingsGui.intFactory("§8Cost Of Using Color", this,
ConfigOptions.USE_OF_COLOR_COST, ConfigHolder.DEFAULT_CONFIG,
Arrays.asList(
"\u00A77XP level cost when using color code or hexadecimal color using the anvil.",
"\u00A77conflict With one of the left item enchantment"
"§7XP level cost when using color code or hexadecimal color using the anvil.",
"§7conflict With one of the left item enchantment"
),
range.getFirst(), range.getLast(),
ConfigOptions.DEFAULT_USE_OF_COLOR_COST,
@ -263,10 +263,10 @@ public class BasicConfigGui extends ChestGui implements ValueUpdatableGui {
meta = item.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7cCost Of Using Color");
meta.setLore(Arrays.asList("\u00A77This config can do something only if one of the following config is enabled:",
"\u00A77- \u00A7aAllow Use Of Color Code",
"\u00A77- \u00A7aAllow Use Of Hexadecimal Color"));
meta.setDisplayName("§cCost Of Using Color");
meta.setLore(Arrays.asList("§7This config can do something only if one of the following config is enabled:",
"§7- §aAllow Use Of Color Code",
"§7- §aAllow Use Of Hexadecimal Color"));
item.setItemMeta(meta);
this.noColorCostItem = new GuiItem(item, GuiGlobalActions.stayInPlace, CustomAnvil.instance);
@ -275,15 +275,15 @@ public class BasicConfigGui extends ChestGui implements ValueUpdatableGui {
@NotNull
private String[] getReplaceToExpensiveLore() {
ArrayList<String> lore = new ArrayList<>();
lore.add("\u00A77Whenever anvil cost is above \u00A7e39\u00A77 should display the true price and not \u00A7cToo Expensive\u00A77.");
lore.add("\u00A77However, when bypassing \u00A7cToo Expensive\u00A77, anvil price will be displayed as \u00A7aGreen\u00A77.");
lore.add("\u00A77Even if cost is displayed as \u00A7aGreen\u00A77:");
lore.add("\u00A77If the player do not have the required xp level, the action will not be completable.");
lore.add("§7Whenever anvil cost is above §e39§7 should display the true price and not §cToo Expensive§7.");
lore.add("§7However, when bypassing §cToo Expensive§7, anvil price will be displayed as §aGreen§7.");
lore.add("§7Even if cost is displayed as §aGreen§7:");
lore.add("§7If the player do not have the required xp level, the action will not be completable.");
if(!this.packetManager.getCanSetInstantBuild()){
lore.add("");
lore.add("\u00A74/!\\\u00A7cCaution\u00A74/!\\ \u00A7cYou need ProtocoLib installed and working or a newer version of this plugin for this to work.");
lore.add("\u00A7cCurrently ProtocoLib is not detected.");
lore.add("§4/!\\§cCaution§4/!\\ §cYou need ProtocoLib installed and working or a newer version of this plugin for this to work.");
lore.add("§cCurrently ProtocoLib is not detected.");
}
String[] loreAsArray = new String[lore.size()];

View file

@ -10,6 +10,7 @@ import org.jetbrains.annotations.Nullable;
import xyz.alexcrea.cuanvil.config.ConfigHolder;
import xyz.alexcrea.cuanvil.gui.config.list.MappedGuiListConfigGui;
import xyz.alexcrea.cuanvil.gui.config.list.elements.CustomRecipeSubSettingGui;
import xyz.alexcrea.cuanvil.gui.util.GuiSharedConstant;
import xyz.alexcrea.cuanvil.recipe.AnvilCustomRecipe;
import xyz.alexcrea.cuanvil.util.CasedStringUtil;
@ -54,15 +55,15 @@ public class CustomRecipeConfigGui extends MappedGuiListConfigGui<AnvilCustomRec
ItemMeta meta = displaydItem.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7e" + CasedStringUtil.snakeToUpperSpacedCase(recipe.toString()) + " \u00A7fCustom recipe");
meta.setDisplayName("§e" + CasedStringUtil.snakeToUpperSpacedCase(recipe.toString()) + " §fCustom recipe");
meta.addItemFlags(ItemFlag.values());
boolean shouldWork = recipe.validate();
meta.setLore(Arrays.asList(
"\u00A77Should work: \u00A7"+(shouldWork ? "aYes" : "cNo"),
"\u00A77Exact count: \u00A7"+(recipe.getExactCount() ? "aYes" : "cNo"),
"\u00A77Recipe Xp Cost: \u00A7e"+recipe.getXpCostPerCraft()
"§7Should work: §"+(shouldWork ? "aYes" : "cNo"),
"§7Exact count: §"+(recipe.getExactCount() ? "aYes" : "cNo"),
"§7Recipe Xp Cost: §e"+recipe.getXpCostPerCraft()
));
@ -94,7 +95,7 @@ public class CustomRecipeConfigGui extends MappedGuiListConfigGui<AnvilCustomRec
ConfigHolder.CUSTOM_RECIPE_HOLDER.getRecipeManager().cleanAddNew(recipe);
// Save recipe to file
recipe.saveToFile();
recipe.saveToFile(GuiSharedConstant.TEMPORARY_DO_SAVE_TO_DISK_EVERY_CHANGE, GuiSharedConstant.TEMPORARY_DO_BACKUP_EVERY_SAVE);
return recipe;
}

View file

@ -74,11 +74,11 @@ public class EnchantConflictGui extends MappedGuiListConfigGui<EnchantConflictGr
assert meta != null;
meta.addItemFlags(ItemFlag.values());
meta.setDisplayName("\u00A7e" + CasedStringUtil.snakeToUpperSpacedCase(conflict.toString()) + " \u00A7fConflict");
meta.setDisplayName("§e" + CasedStringUtil.snakeToUpperSpacedCase(conflict.toString()) + " §fConflict");
meta.setLore(Arrays.asList(
"\u00A77Enchantment count: \u00A7e" + conflict.getEnchants().size(),
"\u00A77Group count: \u00A7e" + conflict.getCantConflictGroup().getGroups().size(),
"\u00A77Min enchantments count: \u00A7e" + conflict.getMinBeforeBlock()
"§7Enchantment count: §e" + conflict.getEnchants().size(),
"§7Group count: §e" + conflict.getCantConflictGroup().getGroups().size(),
"§7Min enchantments count: §e" + conflict.getMinBeforeBlock()
));
item.setItemMeta(meta);

View file

@ -36,7 +36,7 @@ public class EnchantCostConfigGui extends AbstractEnchantConfigGui<EnchantCostSe
* Constructor of this Global gui for enchantment cost settings.
*/
public EnchantCostConfigGui() {
super("\u00A78Enchantment Level Cost");
super("§8Enchantment Level Cost");
if(INSTANCE == null) INSTANCE = this;
init();
@ -57,8 +57,8 @@ public class EnchantCostConfigGui extends AbstractEnchantConfigGui<EnchantCostSe
return EnchantCostSettingsGui.enchantCostFactory(prettyKey + " Level Cost", this,
ConfigHolder.DEFAULT_CONFIG, SECTION_NAME + '.' + key,
Arrays.asList(
"\u00A77How many level should " + prettyKey,
"\u00A77cost when applied by book or by another item."
"§7How many level should " + prettyKey,
"§7cost when applied by book or by another item."
),
0, 255,
rarity.getItemValue(), rarity.getBookValue(),
@ -70,7 +70,7 @@ public class EnchantCostConfigGui extends AbstractEnchantConfigGui<EnchantCostSe
// Get item properties
int itemCost = factory.getConfiguredValue();
int bookCost = factory.getConfiguredBookValue();
String itemName = "\u00A7a" + factory.getTitle();
String itemName = "§a" + factory.getTitle();
// Create item
ItemStack item = new ItemStack(Material.ENCHANTED_BOOK);
ItemMeta itemMeta = item.getItemMeta();
@ -78,8 +78,8 @@ public class EnchantCostConfigGui extends AbstractEnchantConfigGui<EnchantCostSe
// Prepare lore
List<String> lore = new ArrayList<>();
lore.add("\u00A77Item Cost: \u00A7e" + itemCost);
lore.add("\u00A77Book Cost: \u00A7e" + bookCost);
lore.add("§7Item Cost: §e" + itemCost);
lore.add("§7Book Cost: §e" + bookCost);
List<String> displayLore = factory.getDisplayLore();
if(!displayLore.isEmpty()){

View file

@ -29,7 +29,7 @@ public class EnchantLimitConfigGui extends AbstractEnchantConfigGui<IntSettingsG
* Constructor of this Global gui for enchantment level limit settings.
*/
public EnchantLimitConfigGui() {
super("\u00A78Enchantment Level Limit");
super("§8Enchantment Level Limit");
if(INSTANCE == null) INSTANCE = this;
init();
@ -43,7 +43,7 @@ public class EnchantLimitConfigGui extends AbstractEnchantConfigGui<IntSettingsG
return IntSettingsGui.intFactory(prettyKey + " Level Limit", this,
SECTION_NAME + '.' + key, ConfigHolder.DEFAULT_CONFIG,
Collections.singletonList(
"\u00A77Maximum applied level of " + prettyKey
"§7Maximum applied level of " + prettyKey
),
0, 255,
enchant.defaultMaxLevel(),

View file

@ -49,12 +49,12 @@ public class GroupConfigGui extends MappedGuiListConfigGui<IncludeGroup, GroupCo
assert meta != null;
meta.addItemFlags(ItemFlag.values());
meta.setDisplayName("\u00A7e" + CasedStringUtil.snakeToUpperSpacedCase(group.getName())+ " \u00A7fGroup");
meta.setDisplayName("§e" + CasedStringUtil.snakeToUpperSpacedCase(group.getName())+ " §fGroup");
meta.setLore(Arrays.asList(
"\u00A77Number of selected groups : " + group.getGroups().size(),
"\u00A77Number of included material : " + group.getNonGroupInheritedMaterials().size(),
"§7Number of selected groups : " + group.getGroups().size(),
"§7Number of included material : " + group.getNonGroupInheritedMaterials().size(),
"",
"\u00A77Total number of included material "+group.getMaterials().size()));
"§7Total number of included material "+group.getMaterials().size()));
item.setItemMeta(meta);
return item;

View file

@ -62,10 +62,10 @@ public class UnitRepairConfigGui extends MappedGuiListConfigGui<Material, UnitRe
ItemMeta meta = item.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7eRepaired by " +materialName);
meta.setDisplayName("§eRepaired by " +materialName);
meta.setLore(Arrays.asList(
"\u00A77There is currently \u00A7e" +reparableItemCount+ " \u00A77reparable item with "+materialName,
"\u00A77Click here to open the menu to edit reparable item by " + materialName
"§7There is currently §e" +reparableItemCount+ " §7reparable item with "+materialName,
"§7Click here to open the menu to edit reparable item by " + materialName
));
item.setItemMeta(meta);
@ -93,10 +93,10 @@ public class UnitRepairConfigGui extends MappedGuiListConfigGui<Material, UnitRe
ItemMeta createMeta = createItem.getItemMeta();
assert createMeta != null;
createMeta.setDisplayName("\u00A7aSelect a new unit material");
createMeta.setDisplayName("§aSelect a new unit material");
createMeta.setLore(Arrays.asList(
"\u00A77Select a new unit material to be used.",
"\u00A77You will be asked the material to use."
"§7Select a new unit material to be used.",
"§7You will be asked the material to use."
));
createItem.setItemMeta(createMeta);
@ -106,8 +106,8 @@ public class UnitRepairConfigGui extends MappedGuiListConfigGui<Material, UnitRe
new SelectItemTypeGui(
"Select unit repair item.",
"\u00A77Click here with an item to set the item\n" +
"\u00A77You like to be an unit repair item",
"§7Click here with an item to set the item\n" +
"§7You like to be an unit repair item",
this,
(itemStack, player) -> {
Material type = itemStack.getType();

View file

@ -199,7 +199,7 @@ public abstract class ElementListConfigGui< T > extends ChestGui implements Valu
ItemStack leftItem = this.goLeftItem.getItem();
ItemMeta leftMeta = leftItem.getItemMeta();
leftMeta.setDisplayName("\u00A7eReturn to page " + (page));
leftMeta.setDisplayName("§eReturn to page " + (page));
leftItem.setItemMeta(leftMeta);
this.goLeftItem.setItem(leftItem);
@ -216,7 +216,7 @@ public abstract class ElementListConfigGui< T > extends ChestGui implements Valu
ItemStack rightItem = this.goRightItem.getItem();
ItemMeta rightMeta = rightItem.getItemMeta();
rightMeta.setDisplayName("\u00A7eGo to page " + (page + 2));
rightMeta.setDisplayName("§eGo to page " + (page + 2));
rightItem.setItemMeta(rightMeta);
this.goRightItem.setItem(rightItem);

View file

@ -29,11 +29,11 @@ public abstract class MappedElementListConfigGui< T, S > extends ElementListConf
ItemMeta createMeta = createItem.getItemMeta();
assert createMeta != null;
createMeta.setDisplayName("\u00A7aCreate new "+genericDisplayedName());
createMeta.setDisplayName("§aCreate new "+genericDisplayedName());
createMeta.setLore(Arrays.asList(
"\u00A77Create a new "+genericDisplayedName()+".",
"\u00A77You will be asked to name the "+genericDisplayedName()+" in chat.",
"\u00A77Then, you should edit the "+genericDisplayedName()+" config as you need"
"§7Create a new "+genericDisplayedName()+".",
"§7You will be asked to name the "+genericDisplayedName()+" in chat.",
"§7Then, you should edit the "+genericDisplayedName()+" config as you need"
));
createItem.setItemMeta(createMeta);
@ -50,8 +50,8 @@ public abstract class MappedElementListConfigGui< T, S > extends ElementListConf
}
player.closeInventory();
player.sendMessage("\u00A7eWrite the "+genericDisplayedName()+" name you want to create in the chat.\n" +
"\u00A7eOr write \u00A7ccancel \u00A7eto go back to "+genericDisplayedName()+" config menu");
player.sendMessage("§eWrite the "+genericDisplayedName()+" name you want to create in the chat.\n" +
"§eOr write §ccancel §eto go back to "+genericDisplayedName()+" config menu");
CustomAnvil.Companion.getChatListener().setListenedCallback(player, prepareCreateItemConsumer(player));

View file

@ -74,7 +74,7 @@ public abstract class MappedGuiListConfigGui< T, S extends ElementMappedToListGu
// Not the most efficient on large number of conflict, but it should not run often.
for (T generic : getEveryDisplayableInstanceOfGeneric()) {
if (generic.toString().equalsIgnoreCase(message)) {
player.sendMessage("\u00A7cPlease enter a "+genericDisplayedName()+" name that do not already exist...");
player.sendMessage("§cPlease enter a "+genericDisplayedName()+" name that do not already exist...");
// wait next message.
CustomAnvil.Companion.getChatListener().setListenedCallback(player, selfRef.get());
return;

View file

@ -35,7 +35,7 @@ public class UnitRepairElementListGui extends SettingGuiListConfigGui<String, Do
public UnitRepairElementListGui(@NotNull Material parentMaterial,
@NotNull UnitRepairConfigGui parentGui,
@NotNull GuiItem parentItem) {
super("\u00A7e" + CasedStringUtil.snakeToUpperSpacedCase(parentMaterial.name().toLowerCase()) + " \u00A7rUnit repair");
super("§e" + CasedStringUtil.snakeToUpperSpacedCase(parentMaterial.name().toLowerCase()) + " §rUnit repair");
this.parentItem = parentItem;
this.parentMaterial = parentMaterial;
this.parentGui = parentGui;
@ -48,8 +48,8 @@ public class UnitRepairElementListGui extends SettingGuiListConfigGui<String, Do
@Override
protected List<String> getCreateItemLore() {
return Arrays.asList(
"\u00A77Select a new item to be repairable.",
"\u00A77You will be asked the material to use."
"§7Select a new item to be repairable.",
"§7You will be asked the material to use."
);
}
@ -64,19 +64,19 @@ public class UnitRepairElementListGui extends SettingGuiListConfigGui<String, Do
new SelectItemTypeGui(
"Select item to be repaired.",
"\u00A77Click here with an item to set the item\n" +
"\u00A77You like to be repaired by " + this.materialName,
"§7Click here with an item to set the item\n" +
"§7You like to be repaired by " + this.materialName,
this,
(itemStack, player) -> {
ItemMeta meta = itemStack.getItemMeta();
Material type = itemStack.getType();
if(!(meta instanceof Damageable) || (type.getMaxDurability() <= 0)) {
player.sendMessage("\u00A7cThis item can't be damaged, so it can't be repaired.");
player.sendMessage("§cThis item can't be damaged, so it can't be repaired.");
return;
}
if(type == this.parentMaterial){
player.sendMessage("\u00A7cItem can't repair something of the same type.");
player.sendMessage("§cItem can't repair something of the same type.");
return;
}
@ -105,7 +105,7 @@ public class UnitRepairElementListGui extends SettingGuiListConfigGui<String, Do
@Override
protected String createItemName() {
return "\u00A7aAdd a new item reparable by " + this.materialName;
return "§aAdd a new item reparable by " + this.materialName;
}
@Override
@ -113,13 +113,13 @@ public class UnitRepairElementListGui extends SettingGuiListConfigGui<String, Do
String materialDisplayName = CasedStringUtil.snakeToUpperSpacedCase(materialName);
return DoubleSettingGui.doubleFactory(
"\u00A70%\u00A78" + materialDisplayName +" Repair",
"§0%§8" + materialDisplayName +" Repair",
this,
ConfigHolder.UNIT_REPAIR_HOLDER,
this.parentMaterial.name().toLowerCase()+"."+materialName,
Arrays.asList(
"\u00A77Click here to change how many \u00A7e% \u00A77of \u00A7a" + materialDisplayName,
"\u00A77Should get repaired by \u00A7e"+this.materialName
"§7Click here to change how many §e% §7of §a" + materialDisplayName,
"§7Should get repaired by §e"+this.materialName
),
2,
true, true,
@ -133,7 +133,7 @@ public class UnitRepairElementListGui extends SettingGuiListConfigGui<String, Do
@Override
protected GuiItem itemFromFactory(String materialName, DoubleSettingGui.DoubleSettingFactory factory) {
return factory.getItem(materialFromName(materialName),
"\u00A77%\u00A7a" + CasedStringUtil.snakeToUpperSpacedCase(materialName)+ " \u00A7erepaired by \u00A7a" + this.materialName);
"§7%§a" + CasedStringUtil.snakeToUpperSpacedCase(materialName)+ " §erepaired by §a" + this.materialName);
}
@Override

View file

@ -37,7 +37,7 @@ public class CustomRecipeSubSettingGui extends MappedToListSubSettingGui {
@NotNull CustomRecipeConfigGui parent,
@NotNull AnvilCustomRecipe anvilRecipe,
@NotNull GuiItem parentItemForThisGui) {
super(parentItemForThisGui, 3, "\u00A7e" + CasedStringUtil.snakeToUpperSpacedCase(anvilRecipe.toString()) + " \u00A78Config");
super(parentItemForThisGui, 3, "§e" + CasedStringUtil.snakeToUpperSpacedCase(anvilRecipe.toString()) + " §8Config");
this.parent = parent;
this.anvilRecipe = anvilRecipe;
@ -68,8 +68,8 @@ public class CustomRecipeSubSettingGui extends MappedToListSubSettingGui {
ItemMeta deleteMeta = deleteItem.getItemMeta();
assert deleteMeta != null;
deleteMeta.setDisplayName("\u00A74DELETE RECIPE");
deleteMeta.setLore(Collections.singletonList("\u00A7cCaution with this button !"));
deleteMeta.setDisplayName("§4DELETE RECIPE");
deleteMeta.setLore(Collections.singletonList("§cCaution with this button !"));
deleteItem.setItemMeta(deleteMeta);
this.pane.bindItem('D', new GuiItem(deleteItem, GuiGlobalActions.openGuiAction(createDeleteGui()), CustomAnvil.instance));
@ -77,33 +77,33 @@ public class CustomRecipeSubSettingGui extends MappedToListSubSettingGui {
// Displayed item will be updated later
IntRange costRange = AnvilCustomRecipe.Companion.getXP_COST_CONFIG_RANGE();
this.exactCountFactory = BoolSettingsGui.boolFactory("\u00A78Exact count ?", this,
this.exactCountFactory = BoolSettingsGui.boolFactory("§8Exact count ?", this,
ConfigHolder.DEFAULT_CONFIG,
this.anvilRecipe + "." + AnvilCustomRecipe.EXACT_COUNT_CONFIG, AnvilCustomRecipe.DEFAULT_EXACT_COUNT_CONFIG);
this.xpCostFactory = IntSettingsGui.intFactory("\u00A78Recipe Xp Cost", this,
this.xpCostFactory = IntSettingsGui.intFactory("§8Recipe Xp Cost", this,
this.anvilRecipe +"."+AnvilCustomRecipe.XP_COST_CONFIG, ConfigHolder.CUSTOM_RECIPE_HOLDER,
null,
costRange.getFirst(), costRange.getLast(), AnvilCustomRecipe.DEFAULT_XP_COST_CONFIG, 1, 5, 10);
this.leftItemFactory = ItemSettingGui.itemFactory("\u00A7eRecipe Left \u00A78Item", this,
this.leftItemFactory = ItemSettingGui.itemFactory("§eRecipe Left §8Item", this,
this.anvilRecipe + "." + AnvilCustomRecipe.LEFT_ITEM_CONFIG, ConfigHolder.CUSTOM_RECIPE_HOLDER,
AnvilCustomRecipe.Companion.getDEFAULT_LEFT_ITEM_CONFIG(),
"\u00A77Set the left item of the custom craft",
"\u00A77\u25A0 + \u25A1 = \u25A1");
"§7Set the left item of the custom craft",
"§7\u25A0 + \u25A1 = \u25A1");
this.rightItemFactory = ItemSettingGui.itemFactory("\u00A7eRecipe Right \u00A78Item", this,
this.rightItemFactory = ItemSettingGui.itemFactory("§eRecipe Right §8Item", this,
this.anvilRecipe + "." + AnvilCustomRecipe.RIGHT_ITEM_CONFIG, ConfigHolder.CUSTOM_RECIPE_HOLDER,
AnvilCustomRecipe.Companion.getDEFAULT_RIGHT_ITEM_CONFIG(),
"\u00A77Set the right item of the custom craft",
"\u00A77\u25A1 + \u25A0 = \u25A1");
"§7Set the right item of the custom craft",
"§7\u25A1 + \u25A0 = \u25A1");
this.resultItemFactory = ItemSettingGui.itemFactory("\u00A7aRecipe Result \u00A78Item", this,
this.resultItemFactory = ItemSettingGui.itemFactory("§aRecipe Result §8Item", this,
this.anvilRecipe + "." + AnvilCustomRecipe.RESULT_ITEM_CONFIG, ConfigHolder.CUSTOM_RECIPE_HOLDER,
AnvilCustomRecipe.Companion.getDEFAULT_RESULT_ITEM_CONFIG(),
"\u00A77Set the result item of the custom craft",
"\u00A77\u25A1 + \u25A1 = \u25A0");
"§7Set the result item of the custom craft",
"§7\u25A1 + \u25A1 = \u25A0");
}
private ConfirmActionGui createDeleteGui() {
@ -131,8 +131,8 @@ public class CustomRecipeSubSettingGui extends MappedToListSubSettingGui {
return success;
};
return new ConfirmActionGui("\u00A7cDelete \u00A7e" + CasedStringUtil.snakeToUpperSpacedCase(this.anvilRecipe.toString()) + "\u00A7c?",
"\u00A77Confirm that you want to delete this conflict.",
return new ConfirmActionGui("§cDelete §e" + CasedStringUtil.snakeToUpperSpacedCase(this.anvilRecipe.toString()) + "§c?",
"§7Confirm that you want to delete this conflict.",
this, this.parent, deleteSupplier
);
}

View file

@ -43,7 +43,7 @@ public class EnchantConflictSubSettingGui extends MappedToListSubSettingGui impl
@NotNull GuiItem parentItemForThisGui) {
super(parentItemForThisGui,
3,
"\u00A7e" + CasedStringUtil.snakeToUpperSpacedCase(enchantConflict.toString()) + " \u00A78Config");
"§e" + CasedStringUtil.snakeToUpperSpacedCase(enchantConflict.toString()) + " §8Config");
this.parent = parent;
this.enchantConflict = enchantConflict;
@ -72,8 +72,8 @@ public class EnchantConflictSubSettingGui extends MappedToListSubSettingGui impl
ItemMeta deleteMeta = deleteItem.getItemMeta();
assert deleteMeta != null;
deleteMeta.setDisplayName("\u00A74DELETE CONFLICT");
deleteMeta.setLore(Collections.singletonList("\u00A7cCaution with this button !"));
deleteMeta.setDisplayName("§4DELETE CONFLICT");
deleteMeta.setLore(Collections.singletonList("§cCaution with this button !"));
deleteItem.setItemMeta(deleteMeta);
this.pane.bindItem('D', new GuiItem(deleteItem, GuiGlobalActions.openGuiAction(createDeleteGui()), CustomAnvil.instance));
@ -82,7 +82,7 @@ public class EnchantConflictSubSettingGui extends MappedToListSubSettingGui impl
this.enchantSettingItem = new GuiItem(new ItemStack(Material.ENCHANTED_BOOK), event -> {
event.setCancelled(true);
EnchantSelectSettingGui enchantGui = new EnchantSelectSettingGui(
"\u00A7e" + CasedStringUtil.snakeToUpperSpacedCase(enchantConflict.toString()) + "\u00A75",
"§e" + CasedStringUtil.snakeToUpperSpacedCase(enchantConflict.toString()) + "§5",
this, this);
enchantGui.show(event.getWhoClicked());
}, CustomAnvil.instance);
@ -90,17 +90,17 @@ public class EnchantConflictSubSettingGui extends MappedToListSubSettingGui impl
this.groupSettingItem = new GuiItem(new ItemStack(Material.PAPER), event -> {
event.setCancelled(true);
GroupSelectSettingGui enchantGui = new GroupSelectSettingGui(
"\u00A7e" + CasedStringUtil.snakeToUpperSpacedCase(this.enchantConflict.toString()) + " \u00A73Groups",
"§e" + CasedStringUtil.snakeToUpperSpacedCase(this.enchantConflict.toString()) + " §3Groups",
this, this, 0);
enchantGui.show(event.getWhoClicked());
}, CustomAnvil.instance);
this.minBeforeActiveSettingFactory = IntSettingsGui.intFactory(
"\u00A78Minimum enchantment count",
"§8Minimum enchantment count",
this, this.enchantConflict + ".maxEnchantmentBeforeConflict", ConfigHolder.CONFLICT_HOLDER,
Arrays.asList(
"\u00A77Minimum enchantment count set to X mean only X enchantment can be put",
"\u00A77on an item before the conflict is active."
"§7Minimum enchantment count set to X mean only X enchantment can be put",
"§7on an item before the conflict is active."
),
0, 255, 0, 1
);
@ -138,8 +138,8 @@ public class EnchantConflictSubSettingGui extends MappedToListSubSettingGui impl
return success;
};
return new ConfirmActionGui("\u00A7cDelete \u00A7e" + CasedStringUtil.snakeToUpperSpacedCase(this.enchantConflict.toString()) + "\u00A7c?",
"\u00A77Confirm that you want to delete this conflict.",
return new ConfirmActionGui("§cDelete §e" + CasedStringUtil.snakeToUpperSpacedCase(this.enchantConflict.toString()) + "§c?",
"§7Confirm that you want to delete this conflict.",
this, this.parent, deleteSupplier
);
}
@ -160,12 +160,12 @@ public class EnchantConflictSubSettingGui extends MappedToListSubSettingGui impl
// Prepare enchantment lore
ArrayList<String> enchantLore = new ArrayList<>();
enchantLore.add("\u00A77Allow you to select a list of \u00A75Enchantments \u00A77that this conflict should include");
enchantLore.add("§7Allow you to select a list of §5Enchantments §7that this conflict should include");
Set<CAEnchantment> enchants = getSelectedEnchantments();
if (enchants.isEmpty()) {
enchantLore.add("\u00A77There is no included enchantment for this conflict.");
enchantLore.add("§7There is no included enchantment for this conflict.");
} else {
enchantLore.add("\u00A77List of included enchantment for this conflict:");
enchantLore.add("§7List of included enchantment for this conflict:");
Iterator<CAEnchantment> enchantIterator = enchants.iterator();
boolean greaterThanMax = enchants.size() > 5;
@ -173,10 +173,10 @@ public class EnchantConflictSubSettingGui extends MappedToListSubSettingGui impl
for (int i = 0; i < maxindex; i++) {
// format string like "- Fire Protection"
String formattedName = CasedStringUtil.snakeToUpperSpacedCase(enchantIterator.next().getKey().getKey());
enchantLore.add("\u00A77- \u00A75" + formattedName);
enchantLore.add("§7- §5" + formattedName);
}
if (greaterThanMax) {
enchantLore.add("\u00A77And " + (enchants.size() - 4) + " more...");
enchantLore.add("§7And " + (enchants.size() - 4) + " more...");
}
}
@ -189,7 +189,7 @@ public class EnchantConflictSubSettingGui extends MappedToListSubSettingGui impl
ItemMeta enchantMeta = enchantItem.getItemMeta();
assert enchantMeta != null;
enchantMeta.setDisplayName("\u00A7aSelect included \u00A75Enchantments \u00A7aSettings");
enchantMeta.setDisplayName("§aSelect included §5Enchantments §aSettings");
enchantMeta.setLore(enchantLore);
enchantItem.setItemMeta(enchantMeta);
@ -201,7 +201,7 @@ public class EnchantConflictSubSettingGui extends MappedToListSubSettingGui impl
ItemMeta groupMeta = groupItem.getItemMeta();
assert groupMeta != null;
groupMeta.setDisplayName("\u00A7aSelect Excluded \u00A73Groups \u00A7aSettings");
groupMeta.setDisplayName("§aSelect Excluded §3Groups §aSettings");
groupMeta.setLore(groupLore);
groupItem.setItemMeta(groupMeta);

View file

@ -65,8 +65,8 @@ public class GroupConfigSubSettingGui extends MappedToListSubSettingGui implemen
ItemStack deleteItem = new ItemStack(Material.RED_TERRACOTTA);
ItemMeta deleteMeta = deleteItem.getItemMeta();
deleteMeta.setDisplayName("\u00A74DELETE GROUP");
deleteMeta.setLore(Collections.singletonList("\u00A7cCaution with this button !"));
deleteMeta.setDisplayName("§4DELETE GROUP");
deleteMeta.setLore(Collections.singletonList("§cCaution with this button !"));
deleteItem.setItemMeta(deleteMeta);
this.pane.bindItem('D', new GuiItem(deleteItem, openGuiAndCheckAction(), CustomAnvil.instance));
@ -140,8 +140,8 @@ public class GroupConfigSubSettingGui extends MappedToListSubSettingGui implemen
return success;
};
return new ConfirmActionGui("\u00A7cDelete \u00A7e" + CasedStringUtil.snakeToUpperSpacedCase(this.group.toString()) + "\u00A7c?",
"\u00A77Confirm that you want to delete this group.",
return new ConfirmActionGui("§cDelete §e" + CasedStringUtil.snakeToUpperSpacedCase(this.group.toString()) + "§c?",
"§7Confirm that you want to delete this group.",
this, this.parent, deleteSupplier
);
}
@ -151,8 +151,8 @@ public class GroupConfigSubSettingGui extends MappedToListSubSettingGui implemen
if(usedLoc.isEmpty()){
return false;
}
StringBuilder stb = new StringBuilder("\u00A7cCan't delete group " +this.group.getName()+
"\n\u00A7eUsed by:");
StringBuilder stb = new StringBuilder("§cCan't delete group " +this.group.getName()+
"\n§eUsed by:");
int maxIndex = usedLoc.size();
int nbMore = 0;
if(maxIndex > 10){
@ -160,10 +160,10 @@ public class GroupConfigSubSettingGui extends MappedToListSubSettingGui implemen
maxIndex = 9;
}
for (int i = 0; i < maxIndex; i++) {
stb.append("\n\u00A7r-\u00A7e ").append(usedLoc.get(i));
stb.append("\n§r-§e ").append(usedLoc.get(i));
}
if(nbMore > 0){
stb.append("\u00A7cAnd ").append(nbMore).append(" More...");
stb.append("§cAnd ").append(nbMore).append(" More...");
}
player.sendMessage(stb.toString());
@ -214,7 +214,7 @@ public class GroupConfigSubSettingGui extends MappedToListSubSettingGui implemen
ItemStack matSelectItem = this.materialSelection.getItem();
ItemMeta matSelectMeta = matSelectItem.getItemMeta();
matSelectMeta.setDisplayName("\u00A7aSelect included \u00A7eMaterials \u00A7aSettings");
matSelectMeta.setDisplayName("§aSelect included §eMaterials §aSettings");
matSelectMeta.setLore(matLore);
matSelectMeta.addItemFlags(ItemFlag.values());
@ -226,7 +226,7 @@ public class GroupConfigSubSettingGui extends MappedToListSubSettingGui implemen
ItemStack groupSelectItem = this.groupSelection.getItem();
ItemMeta groupSelectMeta = groupSelectItem.getItemMeta();
groupSelectMeta.setDisplayName("\u00A7aSelect included \u00A73Groups \u00A7aSettings");
groupSelectMeta.setDisplayName("§aSelect included §3Groups §aSettings");
groupSelectMeta.setLore(groupLore);
groupSelectItem.setItemMeta(groupSelectMeta);

View file

@ -17,7 +17,7 @@ import xyz.alexcrea.cuanvil.gui.util.GuiGlobalItems;
*/
public abstract class AbstractSettingGui extends ChestGui implements SettingGui {
protected static final String CLICK_LORE = "\u00A77Click Here to change the value";
protected static final String CLICK_LORE = "§7Click Here to change the value";
private PatternPane pane;

View file

@ -66,9 +66,9 @@ public class BoolSettingsGui extends AbstractSettingGui {
// Prepare default Value text
String defaultValueLore;
if(holder.defaultVal){
defaultValueLore = "\u00A7aYes \u00A77Is the default value";
defaultValueLore = "§aYes §7Is the default value";
}else{
defaultValueLore = "\u00A7cNo \u00A77Is the default value";
defaultValueLore = "§cNo §7Is the default value";
}
// Create reset to default item
@ -76,7 +76,7 @@ public class BoolSettingsGui extends AbstractSettingGui {
ItemMeta meta = item.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7eReset to default value");
meta.setDisplayName("§eReset to default value");
meta.setLore(Collections.singletonList(defaultValueLore));
item.setItemMeta(meta);
returnToDefault = new GuiItem(item, event -> {
@ -97,10 +97,10 @@ public class BoolSettingsGui extends AbstractSettingGui {
String displayedName;
Material displayedMat;
if (now) {
displayedName = "\u00A7aYes";
displayedName = "§aYes";
displayedMat = Material.GREEN_TERRACOTTA;
} else {
displayedName = "\u00A7cNo";
displayedName = "§cNo";
displayedMat = Material.RED_TERRACOTTA;
}
@ -254,14 +254,14 @@ public class BoolSettingsGui extends AbstractSettingGui {
boolean value = getConfiguredValue();
Material itemMat;
StringBuilder itemName = new StringBuilder("\u00A7e");
StringBuilder itemName = new StringBuilder("§e");
String finalValue;
if (value) {
itemMat = Material.GREEN_TERRACOTTA;
finalValue = "\u00A7aYes";
finalValue = "§aYes";
} else {
itemMat = Material.RED_TERRACOTTA;
finalValue = "\u00A7cNo";
finalValue = "§cNo";
}
itemName.append(name);

View file

@ -68,9 +68,9 @@ public class DoubleSettingGui extends AbstractSettingGui {
ItemMeta meta = DELETE_ITEM_STACK.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7cDisable item being repaired ?");
meta.setLore(Arrays.asList("\u00A77Confirm disabling unit repair for this item..",
"\u00A74Cation: This action can't be canceled."));
meta.setDisplayName("§cDisable item being repaired ?");
meta.setLore(Arrays.asList("§7Confirm disabling unit repair for this item..",
"§4Cation: This action can't be canceled."));
DELETE_ITEM_STACK.setItemMeta(meta);
}
@ -121,8 +121,8 @@ public class DoubleSettingGui extends AbstractSettingGui {
ItemMeta meta = item.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7eReset to default value");
meta.setLore(Collections.singletonList("\u00A77Default value is \u00A7e" + displayValue(holder.defaultVal)));
meta.setDisplayName("§eReset to default value");
meta.setLore(Collections.singletonList("§7Default value is §e" + displayValue(holder.defaultVal)));
item.setItemMeta(meta);
returnToDefault = new GuiItem(item, event -> {
event.setCancelled(true);
@ -144,7 +144,7 @@ public class DoubleSettingGui extends AbstractSettingGui {
if (now.compareTo(holder.min) > 0) {
BigDecimal planned = holder.min.max(now.subtract(step));
minusItem = getSetValueItem(Material.RED_TERRACOTTA, planned, "\u00A7c-");
minusItem = getSetValueItem(Material.RED_TERRACOTTA, planned, "§c-");
} else {
minusItem = GuiGlobalItems.backgroundItem(Material.BARRIER);
}
@ -155,7 +155,7 @@ public class DoubleSettingGui extends AbstractSettingGui {
if (now.compareTo(holder.max) < 0) {
BigDecimal planned = holder.max.min(now.add(step));
plusItem = getSetValueItem(Material.GREEN_TERRACOTTA, planned, "\u00A7a+");
plusItem = getSetValueItem(Material.GREEN_TERRACOTTA, planned, "§a+");
} else {
plusItem = GuiGlobalItems.backgroundItem(Material.BARRIER);
}
@ -166,7 +166,7 @@ public class DoubleSettingGui extends AbstractSettingGui {
ItemMeta resultMeta = resultPaper.getItemMeta();
assert resultMeta != null;
resultMeta.setDisplayName("\u00A7fValue: \u00A7e" + displayValue(now));
resultMeta.setDisplayName("§fValue: §e" + displayValue(now));
resultPaper.setItemMeta(resultMeta);
GuiItem resultItem = new GuiItem(resultPaper, GuiGlobalActions.stayInPlace, CustomAnvil.instance);
@ -197,8 +197,8 @@ public class DoubleSettingGui extends AbstractSettingGui {
ItemMeta meta = item.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7e" + displayValue(now) + " \u00A7f-> \u00A7e" + displayValue(planned)
+ " \u00A7r(" + numberPrefix + (displayValue(planned.subtract(now).abs()) + "\u00A7r)"));
meta.setDisplayName("§e" + displayValue(now) + " §f-> §e" + displayValue(planned)
+ " §r(" + numberPrefix + (displayValue(planned.subtract(now).abs()) + "§r)"));
meta.setLore(setLoreItem);
item.setItemMeta(meta);
@ -271,21 +271,21 @@ public class DoubleSettingGui extends AbstractSettingGui {
// Get material properties
Material stepMat;
StringBuilder stepName = new StringBuilder("\u00A7");
StringBuilder stepName = new StringBuilder("§");
List<String> stepLore;
Consumer<InventoryClickEvent> clickEvent;
if (stepValue.compareTo(step) == 0) {
stepMat = Material.GREEN_STAINED_GLASS_PANE;
stepName.append('a');
stepLore = Collections.singletonList("\u00A77Value is changing by " + displayValue(stepValue));
stepLore = Collections.singletonList("§7Value is changing by " + displayValue(stepValue));
clickEvent = GuiGlobalActions.stayInPlace;
} else {
stepMat = Material.RED_STAINED_GLASS_PANE;
stepName.append('c');
stepLore = Collections.singletonList("\u00A77Click here to change the value by " + displayValue(stepValue));
stepLore = Collections.singletonList("§7Click here to change the value by " + displayValue(stepValue));
clickEvent = updateStepValue(stepValue);
}
stepName.append("Step of \u00A7e").append(displayValue(stepValue));
stepName.append("Step of §e").append(displayValue(stepValue));
// Create item stack then gui item
ItemStack item = new ItemStack(stepMat);
@ -487,10 +487,10 @@ public class DoubleSettingGui extends AbstractSettingGui {
public GuiItem getItem(Material itemMat, String name){
// Get item properties
BigDecimal value = getConfiguredValue();
StringBuilder itemName = new StringBuilder("\u00A7a").append(name);
StringBuilder itemName = new StringBuilder("§a").append(name);
return GuiGlobalItems.createGuiItemFromProperties(this, itemMat, itemName,
"\u00A7e" + displayValue(value, this.asPercentage),
"§e" + displayValue(value, this.asPercentage),
this.displayLore, true);
}

View file

@ -83,10 +83,10 @@ public class EnchantCostSettingsGui extends IntSettingsGui {
ItemMeta bookMeta = bookItemstack.getItemMeta();
assert bookMeta != null;
bookMeta.setDisplayName("\u00A7aCost of an Enchantment by Book");
bookMeta.setDisplayName("§aCost of an Enchantment by Book");
bookMeta.setLore(Arrays.asList(
"\u00A77Cost per result item level of an sacrifice enchantment",
"\u00A77Only apply if sacrificed item \u00A7cis \u00A77a book"));
"§7Cost per result item level of an sacrifice enchantment",
"§7Only apply if sacrificed item §cis §7a book"));
bookItemstack.setItemMeta(bookMeta);
// sword display
@ -95,10 +95,10 @@ public class EnchantCostSettingsGui extends IntSettingsGui {
assert swordMeta != null;
swordMeta.addItemFlags(ItemFlag.values());
swordMeta.setDisplayName("\u00A7aCost of an Enchantment by Item");
swordMeta.setDisplayName("§aCost of an Enchantment by Item");
swordMeta.setLore(Arrays.asList(
"\u00A77Cost per result item level of an sacrifice enchantment",
"\u00A77Only apply if sacrificed item \u00A7cis not \u00A77a book"));
"§7Cost per result item level of an sacrifice enchantment",
"§7Only apply if sacrificed item §cis not §7a book"));
swordItemstack.setItemMeta(swordMeta);
pane.bindItem('1', GuiGlobalItems.backgroundItem(Material.BLACK_STAINED_GLASS_PANE));
@ -115,10 +115,10 @@ public class EnchantCostSettingsGui extends IntSettingsGui {
// assume holder is an instance of EnchantCostSettingFactory
EnchantCostSettingFactory holder = (EnchantCostSettingFactory) this.holder;
meta.setDisplayName("\u00A7eReset to default value");
meta.setDisplayName("§eReset to default value");
meta.setLore(Arrays.asList(
"\u00A77Default item value is: \u00A7e" + holder.defaultVal,
"\u00A77Default book value is: \u00A7e" + holder.defaultBookVal));
"§7Default item value is: §e" + holder.defaultVal,
"§7Default book value is: §e" + holder.defaultBookVal));
item.setItemMeta(meta);
returnToDefault = new GuiItem(item, event -> {
event.setCancelled(true);
@ -147,7 +147,7 @@ public class EnchantCostSettingsGui extends IntSettingsGui {
ItemMeta meta = item.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7e" + nowBook + " \u00A7f-> \u00A7e" + planned + " \u00A7r(\u00A7c-" + (nowBook - planned) + "\u00A7r)");
meta.setDisplayName("§e" + nowBook + " §f-> §e" + planned + " §r(§c-" + (nowBook - planned) + "§r)");
meta.setLore(Collections.singletonList(AbstractSettingGui.CLICK_LORE));
item.setItemMeta(meta);
@ -165,7 +165,7 @@ public class EnchantCostSettingsGui extends IntSettingsGui {
ItemMeta meta = item.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7e" + nowBook + " \u00A7f-> \u00A7e" + planned + " \u00A7r(\u00A7a+" + (planned - nowBook) + "\u00A7r)");
meta.setDisplayName("§e" + nowBook + " §f-> §e" + planned + " §r(§a+" + (planned - nowBook) + "§r)");
meta.setLore(Collections.singletonList(AbstractSettingGui.CLICK_LORE));
item.setItemMeta(meta);
@ -180,7 +180,7 @@ public class EnchantCostSettingsGui extends IntSettingsGui {
ItemMeta nowMeta = nowPaper.getItemMeta();
assert nowMeta != null;
nowMeta.setDisplayName("\u00A7fValue: \u00A7e" + nowBook);
nowMeta.setDisplayName("§fValue: §e" + nowBook);
if(!holder.displayLore.isEmpty()){
nowMeta.setLore(holder.displayLore);
}

View file

@ -107,9 +107,9 @@ public class EnchantSelectSettingGui extends SettingGuiListConfigGui<CAEnchantme
ItemMeta meta = item.getItemMeta();
assert meta != null;
meta.setDisplayName((this.displayUnselected ? "\u00A7aEverything displayed" : "\u00A7eOnly selected displayed"));
meta.setDisplayName((this.displayUnselected ? "§aEverything displayed" : "§eOnly selected displayed"));
meta.setLore(Collections.singletonList(
"\u00A77Click here to see " +
"§7Click here to see " +
(this.displayUnselected ? "only selected" : "every") +
" enchantments"));
@ -124,8 +124,8 @@ public class EnchantSelectSettingGui extends SettingGuiListConfigGui<CAEnchantme
}, CustomAnvil.instance);
}
private static final List<String> TRUE_LORE = Collections.singletonList("\u00A77Value: \u00A7aSelected");
private static final List<String> FALSE_LORE = Collections.singletonList("\u00A77Value: \u00A7cNot Selected");
private static final List<String> TRUE_LORE = Collections.singletonList("§7Value: §aSelected");
private static final List<String> FALSE_LORE = Collections.singletonList("§7Value: §cNot Selected");
public void setEnchantItemMeta(ItemStack item, String name, boolean isIn) {
ItemMeta meta = item.getItemMeta();
@ -138,7 +138,7 @@ public class EnchantSelectSettingGui extends SettingGuiListConfigGui<CAEnchantme
assert meta != null;
}
meta.setDisplayName("\u00A7" + (isIn ? 'a' : 'c') + CasedStringUtil.snakeToUpperSpacedCase(name));
meta.setDisplayName("§" + (isIn ? 'a' : 'c') + CasedStringUtil.snakeToUpperSpacedCase(name));
if (isIn) {
meta.addEnchant(Enchantment.DAMAGE_UNDEAD, 1, true);
meta.setLore(TRUE_LORE);

View file

@ -91,8 +91,8 @@ public class GroupSelectSettingGui extends AbstractSettingGui {
return guiItem;
}
private static final List<String> TRUE_LORE = Collections.singletonList("\u00A77Value: \u00A7aSelected");
private static final List<String> FALSE_LORE = Collections.singletonList("\u00A77Value: \u00A7cNot Selected");
private static final List<String> TRUE_LORE = Collections.singletonList("§7Value: §aSelected");
private static final List<String> FALSE_LORE = Collections.singletonList("§7Value: §cNot Selected");
public void setGroupItemMeta(ItemStack item, String name, boolean isIn) {
ItemMeta meta = item.getItemMeta();
@ -105,7 +105,7 @@ public class GroupSelectSettingGui extends AbstractSettingGui {
assert meta != null;
}
meta.setDisplayName("\u00A7" + (isIn ? 'a' : 'c') + CasedStringUtil.snakeToUpperSpacedCase(name));
meta.setDisplayName("§" + (isIn ? 'a' : 'c') + CasedStringUtil.snakeToUpperSpacedCase(name));
if (isIn) {
meta.addEnchant(Enchantment.DAMAGE_UNDEAD, 1, true);
meta.setLore(TRUE_LORE);

View file

@ -71,8 +71,8 @@ public class IntSettingsGui extends AbstractSettingGui {
ItemMeta meta = item.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7eReset to default value");
meta.setLore(Collections.singletonList("\u00A77Default value is \u00A7e" + holder.defaultVal));
meta.setDisplayName("§eReset to default value");
meta.setLore(Collections.singletonList("§7Default value is §e" + holder.defaultVal));
item.setItemMeta(meta);
returnToDefault = new GuiItem(item, event -> {
event.setCancelled(true);
@ -97,7 +97,7 @@ public class IntSettingsGui extends AbstractSettingGui {
ItemMeta meta = item.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7e" + now + " \u00A7f-> \u00A7e" + planned + " \u00A7r(\u00A7c-" + (now - planned) + "\u00A7r)");
meta.setDisplayName("§e" + now + " §f-> §e" + planned + " §r(§c-" + (now - planned) + "§r)");
meta.setLore(Collections.singletonList(AbstractSettingGui.CLICK_LORE));
item.setItemMeta(meta);
@ -116,7 +116,7 @@ public class IntSettingsGui extends AbstractSettingGui {
ItemMeta meta = item.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7e" + now + " \u00A7f-> \u00A7e" + planned + " \u00A7r(\u00A7a+" + (planned - now) + "\u00A7r)");
meta.setDisplayName("§e" + now + " §f-> §e" + planned + " §r(§a+" + (planned - now) + "§r)");
meta.setLore(Collections.singletonList(AbstractSettingGui.CLICK_LORE));
item.setItemMeta(meta);
@ -131,7 +131,7 @@ public class IntSettingsGui extends AbstractSettingGui {
ItemMeta resultMeta = resultPaper.getItemMeta();
assert resultMeta != null;
resultMeta.setDisplayName("\u00A7fValue: \u00A7e" + now);
resultMeta.setDisplayName("§fValue: §e" + now);
resultMeta.setLore(holder.displayLore);
resultPaper.setItemMeta(resultMeta);
@ -218,21 +218,21 @@ public class IntSettingsGui extends AbstractSettingGui {
// Get material properties
Material stepMat;
StringBuilder stepName = new StringBuilder("\u00A7");
StringBuilder stepName = new StringBuilder("§");
List<String> stepLore;
Consumer<InventoryClickEvent> clickEvent;
if (stepValue == step) {
stepMat = Material.GREEN_STAINED_GLASS_PANE;
stepName.append('a');
stepLore = Collections.singletonList("\u00A77Value is changing by " + stepValue);
stepLore = Collections.singletonList("§7Value is changing by " + stepValue);
clickEvent = GuiGlobalActions.stayInPlace;
} else {
stepMat = Material.RED_STAINED_GLASS_PANE;
stepName.append('c');
stepLore = Collections.singletonList("\u00A77Click here to change the value by " + stepValue);
stepLore = Collections.singletonList("§7Click here to change the value by " + stepValue);
clickEvent = updateStepValue(stepValue);
}
stepName.append("Step of: \u00A7e").append(stepValue);
stepName.append("Step of: §e").append(stepValue);
// Create item stack then gui item
ItemStack item = new ItemStack(stepMat);
@ -393,10 +393,10 @@ public class IntSettingsGui extends AbstractSettingGui {
) {
// Get item properties
int value = getConfiguredValue();
StringBuilder itemName = new StringBuilder("\u00A7a").append(name);
StringBuilder itemName = new StringBuilder("§a").append(name);
return GuiGlobalItems.createGuiItemFromProperties(this, itemMat, itemName,
"\u00A7e" + value,
"§e" + value,
this.displayLore, true);
}

View file

@ -77,8 +77,8 @@ public class ItemSettingGui extends AbstractSettingGui {
ItemMeta meta = item.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7eReset to default value");
meta.setLore(Collections.singletonList("\u00A77Default value is \u00A7e" + holder.defaultVal));
meta.setDisplayName("§eReset to default value");
meta.setLore(Collections.singletonList("§7Default value is §e" + holder.defaultVal));
item.setItemMeta(meta);
returnToDefault = new GuiItem(item, event -> {
event.setCancelled(true);
@ -88,7 +88,7 @@ public class ItemSettingGui extends AbstractSettingGui {
}, CustomAnvil.instance);
}
protected final static List<String> CLICK_LORE = Collections.singletonList("\u00A77Click Here with an item to change the value");
protected final static List<String> CLICK_LORE = Collections.singletonList("§7Click Here with an item to change the value");
/**
* Update item using the setting value to match the new value
@ -105,7 +105,7 @@ public class ItemSettingGui extends AbstractSettingGui {
ItemMeta valueMeta = displayedItem.getItemMeta();
assert valueMeta != null;
valueMeta.setDisplayName("\u00A74NO ITEM SET");
valueMeta.setDisplayName("§4NO ITEM SET");
valueMeta.setLore(CLICK_LORE);
displayedItem.setItemMeta(valueMeta);
@ -266,7 +266,7 @@ public class ItemSettingGui extends AbstractSettingGui {
ItemMeta meta = item.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7a" + name);
meta.setDisplayName("§a" + name);
meta.setLore(getDisplayLore());
meta.addItemFlags(ItemFlag.values());

View file

@ -85,10 +85,10 @@ public class MaterialSelectSettingGui extends MappedElementListConfigGui<Materia
ItemMeta selectMeta = selectItem.getItemMeta();
assert selectMeta != null;
selectMeta.setDisplayName("\u00A7aAdd Item");
selectMeta.setDisplayName("§aAdd Item");
selectMeta.setLore(Arrays.asList(
"\u00A77Click here with an item to add",
"\u00A77it's Material to the list."));
"§7Click here with an item to add",
"§7it's Material to the list."));
selectItem.setItemMeta(selectMeta);
@ -105,9 +105,9 @@ public class MaterialSelectSettingGui extends MappedElementListConfigGui<Materia
ItemMeta instantRemoveOnMeta = instantRemoveOnItem.getItemMeta();
assert instantRemoveOnMeta != null;
instantRemoveOnMeta.setDisplayName("\u00A7eInstant remove is \u00A7aEnabled \u00A7e!");
instantRemoveOnMeta.setDisplayName("§eInstant remove is §aEnabled §e!");
instantRemoveOnMeta.setLore(
Collections.singletonList("\u00A77Click here to disable the instant remove"));
Collections.singletonList("§7Click here to disable the instant remove"));
instantRemoveOnItem.setItemMeta(instantRemoveOnMeta);
@ -116,9 +116,9 @@ public class MaterialSelectSettingGui extends MappedElementListConfigGui<Materia
ItemMeta instantRemoveOffMeta = instantRemoveOffItem.getItemMeta();
assert instantRemoveOffMeta != null;
instantRemoveOffMeta.setDisplayName("\u00A7eInstant remove is \u00A7cDisabled \u00A7e!");
instantRemoveOffMeta.setDisplayName("§eInstant remove is §cDisabled §e!");
instantRemoveOffMeta.setLore(
Collections.singletonList("\u00A77Click here to enable the instant remove"));
Collections.singletonList("§7Click here to enable the instant remove"));
instantRemoveOffItem.setItemMeta(instantRemoveOffMeta);
@ -143,7 +143,7 @@ public class MaterialSelectSettingGui extends MappedElementListConfigGui<Materia
ItemMeta saveMeta = saveItemStack.getItemMeta();
assert saveMeta != null;
saveMeta.setDisplayName("\u00A7aSave");
saveMeta.setDisplayName("§aSave");
saveItemStack.setItemMeta(saveMeta);
@ -165,7 +165,7 @@ public class MaterialSelectSettingGui extends MappedElementListConfigGui<Materia
result.addAll(this.elementGuiMap.keySet());
if(!this.selector.setSelectedMaterials(result)){
player.sendMessage("\u00A7cSomething went wrong while saving the change of value.");
player.sendMessage("§cSomething went wrong while saving the change of value.");
}
// Return to parent
@ -206,8 +206,8 @@ public class MaterialSelectSettingGui extends MappedElementListConfigGui<Materia
ItemMeta meta = item.getItemMeta();
if(meta == null) return item;
meta.setDisplayName("\u00A7a" + CasedStringUtil.snakeToUpperSpacedCase(material.name().toLowerCase()));
meta.setLore(Collections.singletonList("\u00A77Click here to remove this material from the list"));
meta.setDisplayName("§a" + CasedStringUtil.snakeToUpperSpacedCase(material.name().toLowerCase()));
meta.setLore(Collections.singletonList("§7Click here to remove this material from the list"));
meta.addItemFlags(ItemFlag.values());
item.setItemMeta(meta);
@ -236,7 +236,7 @@ public class MaterialSelectSettingGui extends MappedElementListConfigGui<Materia
// Create and show confirm remove gui.
ConfirmActionGui confirmGui = new ConfirmActionGui(
"Remove " + materialName,
"\u00A77Confirm Remove " + materialName.toLowerCase() + " from this list.",
"§7Confirm Remove " + materialName.toLowerCase() + " from this list.",
this, this,
() -> {
removeMaterial(material);

View file

@ -133,7 +133,7 @@ public class GuiGlobalActions {
// Save setting
if (!setting.onSave()) {
player.sendMessage("\u00A7cSomething went wrong while saving the change of value.");
player.sendMessage("§cSomething went wrong while saving the change of value.");
}
// Update gui for those who have it open.
goal.updateGuiValues();

View file

@ -30,7 +30,7 @@ public class GuiGlobalItems {
ItemMeta meta = BACK_ITEM.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7cBack");
meta.setDisplayName("§cBack");
BACK_ITEM.setItemMeta(meta);
}
@ -82,7 +82,7 @@ public class GuiGlobalItems {
ItemMeta meta = item.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7c");
meta.setDisplayName("§c");
item.setItemMeta(meta);
return new GuiItem(item, GuiGlobalActions.stayInPlace, CustomAnvil.instance);
}
@ -139,7 +139,7 @@ public class GuiGlobalItems {
ItemMeta meta = item.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7aSave");
meta.setDisplayName("§aSave");
item.setItemMeta(meta);
return new GuiItem(item,
GuiGlobalActions.saveSettingAction(setting, goal),
@ -154,7 +154,7 @@ public class GuiGlobalItems {
ItemMeta meta = item.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A77No change. can't save.");
meta.setDisplayName("§7No change. can't save.");
item.setItemMeta(meta);
NO_CHANGE_ITEM = new GuiItem(item, GuiGlobalActions.stayInPlace, CustomAnvil.instance);
}
@ -185,7 +185,7 @@ public class GuiGlobalItems {
}
// Prefix of the one line lore that will be added to setting's item.
public static final String SETTING_ITEM_LORE_PREFIX = "\u00A77value: ";
public static final String SETTING_ITEM_LORE_PREFIX = "§7value: ";
/**
* Create an arbitrary GuiItem from a unique setting and item's property.
@ -247,8 +247,8 @@ public class GuiGlobalItems {
ItemMeta meta = item.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7eTemporary close this menu");
meta.setLore(Collections.singletonList("\u00A77Allow you to chose other item then return here."));
meta.setDisplayName("§eTemporary close this menu");
meta.setLore(Collections.singletonList("§7Allow you to chose other item then return here."));
item.setItemMeta(meta);
return new GuiItem(item, event -> {
@ -263,7 +263,7 @@ public class GuiGlobalItems {
});
player.sendMessage("\u00A7eWrite something in chat to return to the item config menu.");
player.sendMessage("§eWrite something in chat to return to the item config menu.");
player.closeInventory();
}, CustomAnvil.instance);
}

View file

@ -53,25 +53,25 @@ public class GuiSharedConstant {
ItemMeta meta = CANCEL_ITEM.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7cCancel");
meta.setLore(Collections.singletonList("\u00A77Cancel current action and return to previous menu."));
meta.setDisplayName("§cCancel");
meta.setLore(Collections.singletonList("§7Cancel current action and return to previous menu."));
CANCEL_ITEM.setItemMeta(meta);
CONFIRM_ITEM = new ItemStack(Material.GREEN_TERRACOTTA);
meta = CONFIRM_ITEM.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7aConfirm");
meta.setLore(Collections.singletonList("\u00A77Confirm current action."));
meta.setDisplayName("§aConfirm");
meta.setLore(Collections.singletonList("§7Confirm current action."));
CONFIRM_ITEM.setItemMeta(meta);
CONFIRM_PERMANENT_ITEM = new ItemStack(Material.GREEN_TERRACOTTA);
meta = CONFIRM_PERMANENT_ITEM.getItemMeta();
assert meta != null;
meta.setDisplayName("\u00A7aConfirm");
meta.setLore(Arrays.asList("\u00A77Confirm current action.",
"\u00A74Cation: This action can't be canceled."));
meta.setDisplayName("§aConfirm");
meta.setLore(Arrays.asList("§7Confirm current action.",
"§4Cation: This action can't be canceled."));
CONFIRM_PERMANENT_ITEM.setItemMeta(meta);
}