Fix title swapping fadeIn and stay

This commit is contained in:
Riley Park 2021-03-08 12:36:03 -08:00
parent 2fffeb4a36
commit b154b7f941
2 changed files with 3 additions and 3 deletions

View file

@ -1445,7 +1445,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- server.getPlayerList().sendAll(new PacketPlayOutChat(line, ChatMessageType.SYSTEM, SystemUtils.b));
- }
+ if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure
+ joinMessage = PaperAdventure.asVanilla(playerJoinEvent.joinMessage()); // Paper - Adventure
+ joinMessage = PaperAdventure.asVanilla(jm); // Paper - Adventure
+ server.getPlayerList().sendAll(new PacketPlayOutChat(joinMessage, ChatMessageType.SYSTEM, SystemUtils.b)); // Paper - Adventure
}
// CraftBukkit end
@ -2225,7 +2225,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ final PlayerConnection connection = this.getHandle().playerConnection;
+ final net.kyori.adventure.title.Title.Times times = title.times();
+ if (times != null) {
+ connection.sendPacket(new PacketPlayOutTitle(ticks(times.fadeIn()), ticks(times.fadeOut()), ticks(times.stay())));
+ connection.sendPacket(new PacketPlayOutTitle(ticks(times.fadeIn()), ticks(times.stay()), ticks(times.fadeOut())));
+ }
+ final PacketPlayOutTitle sp = new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.SUBTITLE, null);
+ sp.adventure$text = title.subtitle();

View file

@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class PlayerList {
if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure
joinMessage = PaperAdventure.asVanilla(playerJoinEvent.joinMessage()); // Paper - Adventure
joinMessage = PaperAdventure.asVanilla(jm); // Paper - Adventure
- server.getPlayerList().sendAll(new PacketPlayOutChat(joinMessage, ChatMessageType.SYSTEM, SystemUtils.b)); // Paper - Adventure
+ // Paper start - Removed sendAll for loop and broadcasted to console also
+ server.getPlayerList().sendMessage(joinMessage); // Paper - Adventure