[SPIGOT-4239] Prefix suffix max. character problem Created: 07/Aug/18  Updated: 07/Aug/18  Resolved: 07/Aug/18

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: montlikadani Assignee: Unassigned
Resolution: Invalid Votes: 0
Labels: 1.13, Spigot
Environment:

Windows 7, Java 8


Attachments: PNG File image-2018-08-07-10-13-12-491.png     PNG File image-2018-08-07-10-13-35-403.png     PNG File image-2018-08-07-10-29-11-948.png    
Version: 1.13 (Latest)
Guidelines Read: Yes

 Description   

As in the title, there was a problem setting up the group and the problem is that when I set the name color and reload the server (I stopped it), my name is still white, why? I believe and see that the max. character in 1.13 is 64 in Spigot and I use it too. The basics (like configuration creating, plugin.yml correctness) do not have to be all right.
Here are the pictures and codes:

In config:

In code:

	private void setTeam(Player player, String prefix, String suffix) {
		Scoreboard tboard = config.getBoolean("change-prefix-suffix-in-tablist.use-external-scoreboard") ? player.getScoreboard() : Bukkit.getScoreboardManager().getNewScoreboard();
		String version = Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3];
		for (String num : groups.getConfigurationSection("groups").getKeys(false)) {
			Team team = getTeam(num, tboard);
			if (version.equals("v1_8_R3")) {
				if (prefix.length() > 15) prefix = prefix.substring(0, 16);
				if (suffix.length() > 15) suffix = suffix.substring(0, 16);
			} else if (version.equals("v1_9_R2")) {
				if (prefix.length() > 15) prefix = prefix.substring(0, 16);
				if (suffix.length() > 15) suffix = suffix.substring(0, 16);
			} else if (version.equals("v1_10_R1")) {
				if (prefix.length() > 15) prefix = prefix.substring(0, 16);
				if (suffix.length() > 15) suffix = suffix.substring(0, 16);
			} else if (version.equals("v1_11_R1")) {
				if (prefix.length() > 15) prefix = prefix.substring(0, 16);
				if (suffix.length() > 15) suffix = suffix.substring(0, 16);
			} else if (version.equals("v1_12_R1")) {
				if (prefix.length() > 15) prefix = prefix.substring(0, 16);
				if (suffix.length() > 15) suffix = suffix.substring(0, 16);
			} else if (version.equals("v1_13_R1")) {
				if (prefix.length() > 63) prefix = prefix.substring(0, 64);
				if (suffix.length() > 63) suffix = suffix.substring(0, 64);
			}
			team.addPlayer(player);
			team.setPrefix(prefix);
			team.setSuffix(suffix);
		}
		player.setScoreboard(tboard);
	}

	private int getSortNum(String group) {
		List<String> listGroups = groups.getStringList("group-sort-number-list");
		for (int i = 0; i < listGroups.size(); i++) {
			if (listGroups.get(i).equalsIgnoreCase(group)) {
				return i;
			}
		}
		return 99;
	}

	private Team getTeam(String num, Scoreboard tboard) {
		int sortID = getSortNum(num);
		String groupNameSort = "0" + (sortID < 10 ? ("0" + sortID) : sortID) + num;
		Team team = tboard.getTeam(groupNameSort) == null ? tboard.registerNewTeam(groupNameSort) : tboard.getTeam(groupNameSort);
		return team;
	}

In Spigot code:



 Comments   
Comment by md_5 [ 07/Aug/18 ]

It hasn't changed in 1.13 versions.

What exact version do you suggest it did work in?

Comment by montlikadani [ 07/Aug/18 ]

It has recently worked well for all versions (1.8-1.13), but not now. I do not want to use the /scoreboard command because I want to do it individually.

Comment by md_5 [ 07/Aug/18 ]

Also it looks like you just want to set the player's tab list name, which has a separate api

Comment by md_5 [ 07/Aug/18 ]

The client likely does not render colour codes across prefixes with the move to component formatting.
Please use the /scoreboard command in Vanilla to see if the behaviour you want is possible at all.

Generated at Tue Apr 22 04:54:54 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.