OvercastNetwork / SportBukkit

CraftBukkit and Bukkit modifications that improve stability and add new features
100 stars 85 forks source link

Custom text rendering API #225

Open jedediah opened 7 years ago

jedediah commented 7 years ago

Implements https://github.com/OvercastNetwork/minecraft-api/pull/6

RenderableComponent holds an original BaseComponent and a map of UUID -> BaseComponent rendered for each viewer. It also implements IChatBaseComponent, so it can be smuggled through without adding any fields to packets. The packets that use it implement Renderable, which PlayerConnection calls to render the text for each viewer, on the main thread, just before sending the packet. The player's UUID is stored in PacketDataSerializer, and used to lookup the rendered text on the I/O thread.