Fix title swapping fadeIn and stay

This commit is contained in:
Riley Park 2021-03-08 12:36:03 -08:00
parent 54ec85949d
commit a52b30814f
No known key found for this signature in database
GPG key ID: D831AF236C834E45
2 changed files with 6 additions and 6 deletions

View file

@ -1397,7 +1397,7 @@ index d34e91887cd73009bf852fb849e495a8affed7a9..5636a76f1a893dc0609f16a240ae5593
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 5b49047b820dbe1f326320b71445ac216bf688b5..005ea84b8ebaa66c6a3db428efb0a002d5faf807 100644
index 5b49047b820dbe1f326320b71445ac216bf688b5..614477b047579afafb88b2ca2a03254ebb31fe1f 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -8,6 +8,7 @@ import com.mojang.authlib.GameProfile;
@ -1445,7 +1445,7 @@ index 5b49047b820dbe1f326320b71445ac216bf688b5..005ea84b8ebaa66c6a3db428efb0a002
- 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
@ -1978,7 +1978,7 @@ index 3ea267a786f8f047767cace4dc59951b28a615a6..19cdff6eebb7c07d75b515dfa0d47bb7
player.activeContainer.addSlotListener(player);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4bfdd900bae4c886360b24fcc8563e1d2e73ebf0..c0154a14a4da53b933b121fea585d1c1e4d0e87f 100644
index 4bfdd900bae4c886360b24fcc8563e1d2e73ebf0..8e5fd03036282a9f329529a1f355ae73486651af 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -240,14 +240,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -2225,7 +2225,7 @@ index 4bfdd900bae4c886360b24fcc8563e1d2e73ebf0..c0154a14a4da53b933b121fea585d1c1
+ 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

@ -5,13 +5,13 @@ Subject: [PATCH] Broadcast join message to console
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index ef7af4c6b9290ef18977e1aebd57621838685a5a..80f549ab92e244478aa12e7113e8f6bf28729f7d 100644
index d6c2fe9a339db4c241950f43fb4ee51abb0b9420..786f18d49da29ab96d1810072ff90072a2c12d82 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -214,7 +214,9 @@ 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