public VariablePacketModifier() {
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(CraftBookPlugin.inst(), PacketType.Play.Server.CHAT) {
@Override
public void onPacketSending(PacketEvent event) {
WrappedChatComponent chat = event.getPacket().getChatComponents().read(0);
chat.setJson(ParsingUtil.parseVariables(chat.getJson(), event.getPlayer()));
event.getPacket().getChatComponents().write(0, chat);
}
});
}