1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00
setCustomName removes unnecesary ChatColor codes (e.g. &r that doesn't reset anything). Saving the true CustomName in BlockStorage resolves the issue.
This commit is contained in:
Kry-Vosa 2019-05-22 18:14:32 +02:00 committed by GitHub
parent 6df3f8dfe1
commit d9015cbbf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,7 @@ import me.mrCookieSlime.Slimefun.api.BlockStorage;
public class Projector {
public static ArmorStand getArmorStand(Block projector) {
String nametag = ChatColor.translateAlternateColorCodes('&', BlockStorage.getLocationInfo(projector.getLocation(), "text"));
String nametag = BlockStorage.getLocationInfo(projector.getLocation(), "text");
double offset = Double.valueOf(BlockStorage.getLocationInfo(projector.getLocation(), "offset"));
Location l = new Location(projector.getWorld(), projector.getX() + 0.5, projector.getY() + offset, projector.getZ() + 0.5);
@ -45,7 +45,7 @@ public class Projector {
MenuHelper.awaitChatInput(pl, (player, message) -> {
ArmorStand hologram = getArmorStand(projector);
hologram.setCustomName(ChatColor.translateAlternateColorCodes('&', message));
BlockStorage.addBlockInfo(projector, "text", message);
BlockStorage.addBlockInfo(projector, "text", hologram.getCustomName());
openEditor(player, projector);
return false;
});