SPIGOT-5829: RGB hex colours not supported in several places

Dieser Commit ist enthalten in:
md_5 2020-06-26 09:40:21 +10:00
Ursprung 6b20d04c71
Commit 174a2ee539
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: E8E901AC7C617C11
3 geänderte Dateien mit 6 neuen und 13 gelöschten Zeilen

Datei anzeigen

@ -45,6 +45,7 @@ import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer;
import org.bukkit.craftbukkit.inventory.CraftInventoryView;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.craftbukkit.inventory.CraftMerchantCustom;
import org.bukkit.craftbukkit.util.CraftChatMessage;
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
import org.bukkit.craftbukkit.util.CraftNamespacedKey;
import org.bukkit.entity.HumanEntity;
@ -317,7 +318,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
String title = container.getBukkitView().getTitle();
player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(container.windowId, windowType, new ChatComponentText(title)));
player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(container.windowId, windowType, CraftChatMessage.fromString(title)[0]));
getHandle().activeContainer = container;
getHandle().activeContainer.addSlotListener(player);
}
@ -387,7 +388,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
// Now open the window
Containers<?> windowType = CraftContainer.getNotchInventoryType(inventory.getTopInventory());
String title = inventory.getTitle();
player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(container.windowId, windowType, new ChatComponentText(title)));
player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(container.windowId, windowType, CraftChatMessage.fromString(title)[0]));
player.activeContainer = container;
player.activeContainer.addSlotListener(player);
}

Datei anzeigen

@ -758,7 +758,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Override
public final void setDisplayName(String name) {
this.displayName = CraftChatMessage.wrapOrNull(name);
this.displayName = CraftChatMessage.fromStringOrNull(name);
}
@Override
@ -773,7 +773,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Override
public void setLocalizedName(String name) {
this.locName = CraftChatMessage.wrapOrNull(name);
this.locName = CraftChatMessage.fromStringOrNull(name);
}
@Override
@ -1338,7 +1338,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
page = page.substring(0, maxItemLength);
}
addTo.add(CraftChatMessage.wrapOrEmpty(page));
addTo.add(CraftChatMessage.fromString(page)[0]);
}
}
}

Datei anzeigen

@ -153,14 +153,6 @@ public final class CraftChatMessage {
}
}
public static IChatBaseComponent wrapOrNull(String message) {
return (message == null || message.isEmpty()) ? null : new ChatComponentText(message);
}
public static IChatBaseComponent wrapOrEmpty(String message) {
return (message == null) ? new ChatComponentText("") : new ChatComponentText(message);
}
public static IChatBaseComponent fromStringOrNull(String message) {
return fromStringOrNull(message, false);
}