Skip to content

Commit

Permalink
replace & to §
Browse files Browse the repository at this point in the history
  • Loading branch information
mcchampions committed Oct 5, 2024
1 parent ccd093a commit 1734993
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class CrafterSmartPort extends SlimefunItem {
public CrafterSmartPort(ItemGroup category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
super(category, item, recipeType, recipe);

new BlockMenuPreset("CRAFTER_SMART_PORT", "&a合成机智能交互接口") {
new BlockMenuPreset("CRAFTER_SMART_PORT", "§a合成机智能交互接口") {
@Override
public void init() {
addItem(6, getCountItem(), (p, slot, item, action) -> false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ public void scan(Player p, Block block, int page) {
HeadTexture.MINECRAFT_CHUNK.getAsItemStack(),
ChatColor.YELLOW + Slimefun.getLocalization().getResourceString(p, "tooltips.chunk"),
"",
"§8\u21E8 &7"
"§8\u21E8 §7"
+ Slimefun.getLocalization().getResourceString(p, "tooltips.world")
+ ": "
+ block.getWorld().getName(),
"§8\u21E8 &7X: " + x + " Z: " + z),
"§8\u21E8 §7X: " + x + " Z: " + z),
ChestMenuUtils.getEmptyClickHandler());
List<GEOResource> resources =
new ArrayList<>(Slimefun.getRegistry().getGEOResources().values());
Expand All @@ -266,7 +266,7 @@ public void scan(Player p, Block block, int page) {
.getResourceString(p, ChatUtils.checkPlurality("tooltips.unit", supplies));

ItemStack item = new CustomItemStack(
resource.getItem(), "&f" + resource.getName(p), "§8\u21E8 &e" + supplies + ' ' + suffix);
resource.getItem(), "§f" + resource.getName(p), "§8\u21E8 §e" + supplies + ' ' + suffix);

if (supplies > 1) {
item.setAmount(Math.min(supplies, item.getMaxStackSize()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,17 @@ public void openTransmitterControlPanel(Player p) {
4,
new CustomItemStack(
SlimefunItems.GPS_CONTROL_PANEL,
"&7网络信息",
"§7网络信息",
"",
"§8\u21E8 &7状态: " + getStatusText(p, complexity),
"§8\u21E8 &7复杂度: &f" + complexity));
"§8\u21E8 §7状态: " + getStatusText(p, complexity),
"§8\u21E8 §7复杂度: §f" + complexity));
menu.addMenuClickHandler(4, ChestMenuUtils.getEmptyClickHandler());

menu.addItem(
6,
new CustomItemStack(
HeadTexture.GLOBE_OVERWORLD.getAsItemStack(),
"&7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints"),
"§7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints"),
"",
ChatColor.GRAY
+ "\u21E8 "
Expand All @@ -196,14 +196,14 @@ public void openTransmitterControlPanel(Player p) {
slot,
new CustomItemStack(
SlimefunItems.GPS_TRANSMITTER,
"&bGPS 发射器",
"§8\u21E8 &7世界: &f" + l.getWorld().getName(),
"§8\u21E8 &7X: &f" + l.getX(),
"§8\u21E8 &7Y: &f" + l.getY(),
"§8\u21E8 &7Z: &f" + l.getZ(),
"§bGPS 发射器",
"§8\u21E8 §7世界: §f" + l.getWorld().getName(),
"§8\u21E8 §7X: §f" + l.getX(),
"§8\u21E8 §7Y: §f" + l.getY(),
"§8\u21E8 §7Z: §f" + l.getZ(),
"",
"§8\u21E8 &7信号强度: &f" + transmitter.getMultiplier(l.getBlockY()),
"§8\u21E8 &7延迟: &f" + NumberUtils.roundDecimalNumber(1000D / l.getY()) + "ms"));
"§8\u21E8 §7信号强度: §f" + transmitter.getMultiplier(l.getBlockY()),
"§8\u21E8 §7延迟: §f" + NumberUtils.roundDecimalNumber(1000D / l.getY()) + "ms"));
menu.addMenuClickHandler(slot, ChestMenuUtils.getEmptyClickHandler());

index++;
Expand Down Expand Up @@ -242,9 +242,9 @@ public ItemStack getIcon(String name, Environment environment) {

private String getStatusText(Player player, int complexity) {
if (complexity > 0) {
return "&2&l" + Slimefun.getLocalization().getMessage(player, "gps.status-online");
return "§2§l" + Slimefun.getLocalization().getMessage(player, "gps.status-online");
} else {
return "§4&l" + Slimefun.getLocalization().getMessage(player, "gps.status-offline");
return "§4§l" + Slimefun.getLocalization().getMessage(player, "gps.status-offline");
}
}

Expand All @@ -261,7 +261,7 @@ public void openWaypointControlPanel(Player p) {
2,
new CustomItemStack(
SlimefunItems.GPS_TRANSMITTER,
"&7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.transmitters"),
"§7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.transmitters"),
"",
ChatColor.GRAY
+ "\u21E8 "
Expand All @@ -276,17 +276,17 @@ public void openWaypointControlPanel(Player p) {
4,
new CustomItemStack(
SlimefunItems.GPS_CONTROL_PANEL,
"&7网络信息",
"§7网络信息",
"",
"§8\u21E8 &7状态: " + (complexity > 0 ? "&2&l在线" : "§4&l离线"),
"§8\u21E8 &7复杂度: &f" + complexity));
"§8\u21E8 §7状态: " + (complexity > 0 ? "§2§l在线" : "§4§l离线"),
"§8\u21E8 §7复杂度: §f" + complexity));
menu.addMenuClickHandler(4, ChestMenuUtils.getEmptyClickHandler());

menu.addItem(
6,
new CustomItemStack(
HeadTexture.GLOBE_OVERWORLD.getAsItemStack(),
"&7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints")));
"§7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints")));
menu.addMenuClickHandler(6, ChestMenuUtils.getEmptyClickHandler());

int index = 0;
Expand All @@ -303,12 +303,12 @@ public void openWaypointControlPanel(Player p) {
new CustomItemStack(
waypoint.getIcon(),
waypoint.getName().replace("player:death ", ""),
"§8\u21E8 &7世界: &f" + l.getWorld().getName(),
"§8\u21E8 &7X: &f" + l.getX(),
"§8\u21E8 &7Y: &f" + l.getY(),
"§8\u21E8 &7Z: &f" + l.getZ(),
"§8\u21E8 §7世界: §f" + l.getWorld().getName(),
"§8\u21E8 §7X: §f" + l.getX(),
"§8\u21E8 §7Y: §f" + l.getY(),
"§8\u21E8 §7Z: §f" + l.getZ(),
"",
"§8\u21E8 &cClick to delete"));
"§8\u21E8 §cClick to delete"));
menu.addMenuClickHandler(slot, (pl, s, item, action) -> {
profile.removeWaypoint(waypoint);
SoundEffect.GPS_NETWORK_OPEN_PANEL_SOUND.playFor(p);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* @see BackpackListener
*/
public class PlayerBackpack extends SlimefunInventoryHolder {
public static final String LORE_OWNER = "&7所有者: ";
public static final String LORE_OWNER = "§7所有者: ";
private static final String COLORED_LORE_OWNER = ChatColors.color(LORE_OWNER);
private static final String PLAIN_LORE_OWNER = "所有者: ";
private static final NamespacedKey KEY_BACKPACK_UUID = new NamespacedKey(Slimefun.instance(), "B_UUID");
Expand Down Expand Up @@ -88,11 +88,11 @@ public void onResult(PlayerBackpack result) {
String uuid = "";

for (String line : item.getItemMeta().getLore()) {
if (line.startsWith(ChatColors.color("&7ID: ")) && line.indexOf('#') != -1) {
if (line.startsWith(7ID: ") && line.indexOf('#') != -1) {
String[] splitLine = CommonPatterns.HASH.split(line);

if (CommonPatterns.NUMERIC.matcher(splitLine[1]).matches()) {
uuid = splitLine[0].replace(ChatColors.color("&7ID: "), "");
uuid = splitLine[0].replace(7ID: ", "");
id = OptionalInt.of(Integer.parseInt(splitLine[1]));
}
}
Expand Down Expand Up @@ -142,10 +142,10 @@ public static OptionalInt getBackpackID(ItemMeta meta) {
}

for (String line : meta.getLore()) {
if (line.startsWith(ChatColors.color("&7ID: ")) && line.contains("#")) {
if (line.startsWith(7ID: ") && line.contains("#")) {
try {
return OptionalInt.of(Integer.parseInt(
CommonPatterns.HASH.split(line.replace(ChatColors.color("&7ID: "), ""))[1]));
CommonPatterns.HASH.split(line.replace(7ID: "), "")[1]));
} catch (NumberFormatException e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -296,7 +296,7 @@ public boolean isInvalid() {
*/
private Inventory newInv() {
return Bukkit.createInventory(
this, size, (name.isEmpty() ? "背包" : ChatColors.color(name + "&r")) + " [大小 " + size + "]");
this, size, (name.isEmpty() ? "背包" : name + "§r") + " [大小 " + size + "]");
}

private void updateInv() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package io.github.thebusybiscuit.slimefun4.core.attributes;

public enum MachineTier {
BASIC("&e基础"),
AVERAGE("&6普通"),
MEDIUM("&a中型"),
GOOD("&2优秀"),
ADVANCED("&6高级"),
BASIC("§e基础"),
AVERAGE("§6普通"),
MEDIUM("§a中型"),
GOOD("§2优秀"),
ADVANCED("§6高级"),
END_GAME("§4终极");

private final String prefix;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ default String getLabelLocalPath() {


default String getRecipeSectionLabel(Player p) {
return "&7\u21E9 " + Slimefun.getLocalization().getMessage(p, getLabelLocalPath()) + " \u21E9";
return "§7\u21E9 " + Slimefun.getLocalization().getMessage(p, getLabelLocalPath()) + " \u21E9";
}
}

0 comments on commit 1734993

Please sign in to comment.