Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void sendTitleAndSubTo(Player p, String title, String subtitle)
- {
- if (((CraftPlayer)p).getHandle().playerConnection.networkManager.getVersion() < 47) {
- return;
- }
- IChatBaseComponent chatTitle = ChatSerializer.a("{\"text\": \"" + title + "\"}");
- ProtocolInjector.PacketTitle t = new ProtocolInjector.PacketTitle(ProtocolInjector.PacketTitle.Action.TITLE, chatTitle);
- IChatBaseComponent subTitle = ChatSerializer.a("{\"text\": \"" + subtitle + "\"}");
- ProtocolInjector.PacketTitle sub = new ProtocolInjector.PacketTitle(ProtocolInjector.PacketTitle.Action.SUBTITLE, subTitle);
- ProtocolInjector.PacketTitle time = new ProtocolInjector.PacketTitle(ProtocolInjector.PacketTitle.Action.TIMES, 20, 120, 20);
- ((CraftPlayer)p).getHandle().playerConnection.sendPacket(time);
- ((CraftPlayer)p).getHandle().playerConnection.sendPacket(t);
- ((CraftPlayer)p).getHandle().playerConnection.sendPacket(sub);
- }
- public static void sendTitleTo(Player p, String title)
- {
- if (((CraftPlayer)p).getHandle().playerConnection.networkManager.getVersion() < 47) {
- return;
- }
- IChatBaseComponent chatTitle = ChatSerializer.a("{\"text\": \"" + title + "\"}");
- ProtocolInjector.PacketTitle t = new ProtocolInjector.PacketTitle(ProtocolInjector.PacketTitle.Action.TITLE, chatTitle);
- ProtocolInjector.PacketTitle time = new ProtocolInjector.PacketTitle(ProtocolInjector.PacketTitle.Action.TIMES, 20, 120, 20);
- ((CraftPlayer)p).getHandle().playerConnection.sendPacket(time);
- ((CraftPlayer)p).getHandle().playerConnection.sendPacket(t);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement