From c2c40a2562e1ef1fee2641412fde6a69f4b20977 Mon Sep 17 00:00:00 2001 From: Techcable Date: Wed, 16 Mar 2016 18:58:48 -0700 Subject: [PATCH] Don't pass null title to constructor Fixes #83 Fix resetTitle() @Zbob750 shouldn't be doing these updates in the middle of the night --- .../0069-Player-Tab-List-and-Title-APIs.patch | 23 ++++++++++--------- .../0081-Complete-resource-pack-API.patch | 6 ++--- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Spigot-Server-Patches/0069-Player-Tab-List-and-Title-APIs.patch b/Spigot-Server-Patches/0069-Player-Tab-List-and-Title-APIs.patch index 8566db6a8a..2d64790d20 100644 --- a/Spigot-Server-Patches/0069-Player-Tab-List-and-Title-APIs.patch +++ b/Spigot-Server-Patches/0069-Player-Tab-List-and-Title-APIs.patch @@ -1,11 +1,11 @@ -From 5c9387d5adf82c863c02ba4dd4e4f1d733fe5213 Mon Sep 17 00:00:00 2001 +From 17182b51ae5cd672659b0a43455af918e8bb60c9 Mon Sep 17 00:00:00 2001 From: Techcable Date: Thu, 3 Mar 2016 02:32:10 -0600 Subject: [PATCH] Player Tab List and Title APIs diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 10bf160..d9fab10 100644 +index 10bf160..0c2d2c6 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1,5 +1,6 @@ @@ -99,27 +99,28 @@ index 10bf160..d9fab10 100644 // Paper end @Override -@@ -1342,20 +1420,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1341,21 +1419,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + @Override public void sendTitle(String title, String subtitle) { - if (title != null) { +- if (title != null) { - PacketPlayOutTitle packetTitle = new PacketPlayOutTitle(EnumTitleAction.TITLE, CraftChatMessage.fromString(title)[0]); - getHandle().playerConnection.sendPacket(packetTitle); -+ this.sendTitle(new Title(title)); // TODO: Paper - Double check these - } - - if (subtitle != null) { +- } +- +- if (subtitle != null) { - PacketPlayOutTitle packetSubtitle = new PacketPlayOutTitle(EnumTitleAction.SUBTITLE, CraftChatMessage.fromString(subtitle)[0]); - getHandle().playerConnection.sendPacket(packetSubtitle); -+ this.sendTitle(new Title(null, subtitle)); // TODO: Paper - Double check these - } +- } ++ Preconditions.checkNotNull(title, "Null title"); ++ this.sendTitle(new Title(title, subtitle)); } @Override public void resetTitle() { - PacketPlayOutTitle packetReset = new PacketPlayOutTitle(EnumTitleAction.RESET, null); - getHandle().playerConnection.sendPacket(packetReset); -+ this.hideTitle(); // TODO: Paper - Double check these ++ getHandle().playerConnection.sendPacket(new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.RESET, (BaseComponent[]) null, 0, 0, 0)); } @Override diff --git a/Spigot-Server-Patches/0081-Complete-resource-pack-API.patch b/Spigot-Server-Patches/0081-Complete-resource-pack-API.patch index 4bacd7e4fb..325c613cc8 100644 --- a/Spigot-Server-Patches/0081-Complete-resource-pack-API.patch +++ b/Spigot-Server-Patches/0081-Complete-resource-pack-API.patch @@ -1,4 +1,4 @@ -From 6894cfddcaf208b675684d39f80fa314867c10aa Mon Sep 17 00:00:00 2001 +From bf6283b5e4de9efb88ab98d75a5ccc628997f268 Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Sat, 4 Apr 2015 23:17:52 -0400 Subject: [PATCH] Complete resource pack API @@ -37,7 +37,7 @@ index 27f78ab..1b16b54 100644 // CraftBukkit end diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 51c971f..fd17df9 100644 +index 4be2653..b2b2bf4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -72,6 +72,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -51,7 +51,7 @@ index 51c971f..fd17df9 100644 public CraftPlayer(CraftServer server, EntityPlayer entity) { super(server, entity); -@@ -1519,6 +1523,33 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1514,6 +1518,33 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void setViewDistance(int viewDistance) { ((WorldServer) getHandle().world).getPlayerChunkMap().updateViewDistance(getHandle(), viewDistance); }