mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Don't pass null title to constructor
Fixes #83 Fix resetTitle() @Zbob750 shouldn't be doing these updates in the middle of the night
This commit is contained in:
parent
59ca434484
commit
a8d725eb23
1 changed files with 9 additions and 8 deletions
|
@ -100,26 +100,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
@Override
|
||||
@@ -0,0 +0,0 @@ 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
|
||||
|
|
Loading…
Reference in a new issue