Clean up title and tab list patch

Remember kids, the Ballmer peak is hard to hit https://xkcd.com/323/
Finally fixes #126 and #94 (I tested, it does, please, really, promise)
This commit is contained in:
Zach Brown 2016-03-23 01:05:09 -05:00
parent 7ab893447a
commit d1afdd87f4
2 changed files with 247 additions and 350 deletions

View File

@ -4,6 +4,108 @@ Date: Thu, 3 Mar 2016 02:32:10 -0600
Subject: [PATCH] Player Tab List and Title APIs
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutPlayerListHeaderFooter.java b/src/main/java/net/minecraft/server/PacketPlayOutPlayerListHeaderFooter.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutPlayerListHeaderFooter.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutPlayerListHeaderFooter.java
@@ -0,0 +0,0 @@
package net.minecraft.server;
-import net.minecraft.server.IChatBaseComponent;
-import net.minecraft.server.Packet;
-import net.minecraft.server.PacketDataSerializer;
-import net.minecraft.server.PacketListenerPlayOut;
-
import java.io.IOException;
public class PacketPlayOutPlayerListHeaderFooter implements Packet<PacketListenerPlayOut> {
+ public net.md_5.bungee.api.chat.BaseComponent[] header, footer; // Paper
+
private IChatBaseComponent a;
private IChatBaseComponent b;
@@ -0,0 +0,0 @@ public class PacketPlayOutPlayerListHeaderFooter implements Packet<PacketListene
}
public void a(PacketDataSerializer packetdataserializer) throws IOException {
- this.a = packetdataserializer.f();
- this.b = packetdataserializer.f();
+ // Paper start
+ if (this.header != null) {
+ packetdataserializer.a(net.md_5.bungee.chat.ComponentSerializer.toString(this.header));
+ } else {
+ packetdataserializer.a(this.a);
+ }
+
+ if (this.footer != null) {
+ packetdataserializer.a(net.md_5.bungee.chat.ComponentSerializer.toString(this.footer));
+ } else {
+ packetdataserializer.a(this.b);
+ }
+ // Paper end
}
public void b(PacketDataSerializer packetdataserializer) throws IOException {
@@ -0,0 +0,0 @@ public class PacketPlayOutPlayerListHeaderFooter implements Packet<PacketListene
packetdataserializer.a(this.b);
}
+ // PaperSpigot - Fix compile error
public void a(PacketListenerPlayOut packetlistenerplayout) {
- packetlistenerplayout.a(this);
+ packetlistenerplayout.a((IChatBaseComponent) this);
}
}
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutTitle.java b/src/main/java/net/minecraft/server/PacketPlayOutTitle.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutTitle.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutTitle.java
@@ -0,0 +0,0 @@ public class PacketPlayOutTitle implements Packet<PacketListenerPlayOut> {
private int d;
private int e;
+ // Paper start
+ public net.md_5.bungee.api.chat.BaseComponent[] components;
+
+ public PacketPlayOutTitle(EnumTitleAction action, net.md_5.bungee.api.chat.BaseComponent[] components, int fadeIn, int stay, int fadeOut) {
+ this.a = action;
+ this.components = components;
+ this.c = fadeIn;
+ this.d = stay;
+ this.e = fadeOut;
+ }
+ // Paper end
+
public PacketPlayOutTitle() {}
public PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction packetplayouttitle_enumtitleaction, IChatBaseComponent ichatbasecomponent) {
@@ -0,0 +0,0 @@ public class PacketPlayOutTitle implements Packet<PacketListenerPlayOut> {
public void b(PacketDataSerializer packetdataserializer) throws IOException {
packetdataserializer.a((Enum) this.a);
if (this.a == PacketPlayOutTitle.EnumTitleAction.TITLE || this.a == PacketPlayOutTitle.EnumTitleAction.SUBTITLE) {
- packetdataserializer.a(this.b);
+ // Paper start
+ if (this.components != null) {
+ packetdataserializer.a(net.md_5.bungee.chat.ComponentSerializer.toString(components));
+ } else {
+ packetdataserializer.a(this.b);
+ }
+ // Paper end
}
if (this.a == PacketPlayOutTitle.EnumTitleAction.TIMES) {
@@ -0,0 +0,0 @@ public class PacketPlayOutTitle implements Packet<PacketListenerPlayOut> {
}
+ // Paper - Fix compile error
public void a(PacketListenerPlayOut packetlistenerplayout) {
- packetlistenerplayout.a(this);
+ packetlistenerplayout.a((IChatBaseComponent) this);
}
public static enum EnumTitleAction {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@ -99,209 +201,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// Paper end
@Override
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void sendTitle(String title, String subtitle) {
if (title != null) {
- PacketPlayOutTitle packetTitle = new PacketPlayOutTitle(EnumTitleAction.TITLE, CraftChatMessage.fromString(title)[0]);
+ PacketPlayOutTitle packetTitle = new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.TITLE, CraftChatMessage.fromString(title)[0]);
getHandle().playerConnection.sendPacket(packetTitle);
}
if (subtitle != null) {
- PacketPlayOutTitle packetSubtitle = new PacketPlayOutTitle(EnumTitleAction.SUBTITLE, CraftChatMessage.fromString(subtitle)[0]);
+ PacketPlayOutTitle packetSubtitle = new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.SUBTITLE, CraftChatMessage.fromString(subtitle)[0]);
getHandle().playerConnection.sendPacket(packetSubtitle);
}
}
@Override
public void resetTitle() {
- PacketPlayOutTitle packetReset = new PacketPlayOutTitle(EnumTitleAction.RESET, null);
+ PacketPlayOutTitle packetReset = new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.RESET, null);
getHandle().playerConnection.sendPacket(packetReset);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/PacketPlayOutPlayerListHeaderFooter.java b/src/main/java/org/bukkit/craftbukkit/entity/PacketPlayOutPlayerListHeaderFooter.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/PacketPlayOutPlayerListHeaderFooter.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/PacketPlayOutPlayerListHeaderFooter.java
@@ -0,0 +0,0 @@ import java.io.IOException;
public class PacketPlayOutPlayerListHeaderFooter implements Packet<PacketListenerPlayOut> {
+ public net.md_5.bungee.api.chat.BaseComponent[] header, footer; // Paper
+
private IChatBaseComponent a;
private IChatBaseComponent b;
@@ -0,0 +0,0 @@ public class PacketPlayOutPlayerListHeaderFooter implements Packet<PacketListene
}
public void a(PacketDataSerializer packetdataserializer) throws IOException {
- this.a = packetdataserializer.f();
- this.b = packetdataserializer.f();
+ // Paper start
+ if (this.header != null) {
+ packetdataserializer.a(net.md_5.bungee.chat.ComponentSerializer.toString(this.header));
+ } else {
+ packetdataserializer.a(this.a);
+ }
+
+ if (this.footer != null) {
+ packetdataserializer.a(net.md_5.bungee.chat.ComponentSerializer.toString(this.footer));
+ } else {
+ packetdataserializer.a(this.b);
+ }
+ // Paper end
}
public void b(PacketDataSerializer packetdataserializer) throws IOException {
@@ -0,0 +0,0 @@ public class PacketPlayOutPlayerListHeaderFooter implements Packet<PacketListene
packetdataserializer.a(this.b);
}
+ // PaperSpigot - Fix compile error
public void a(PacketListenerPlayOut packetlistenerplayout) {
- packetlistenerplayout.a(this);
+ packetlistenerplayout.a((IChatBaseComponent) this);
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/PacketPlayOutTitle.java b/src/main/java/org/bukkit/craftbukkit/entity/PacketPlayOutTitle.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/PacketPlayOutTitle.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/PacketPlayOutTitle.java
@@ -0,0 +0,0 @@
-package net.minecraft.server;
+package org.bukkit.craftbukkit.entity;
+
+import net.minecraft.server.IChatBaseComponent;
+import net.minecraft.server.Packet;
+import net.minecraft.server.PacketDataSerializer;
+import net.minecraft.server.PacketListenerPlayOut;
import java.io.IOException;
public class PacketPlayOutTitle implements Packet<PacketListenerPlayOut> {
- private PacketPlayOutTitle.EnumTitleAction a;
+ private EnumTitleAction a;
private IChatBaseComponent b;
private int c;
private int d;
private int e;
+ // Paper start
+ public net.md_5.bungee.api.chat.BaseComponent[] components;
+
+ public PacketPlayOutTitle(EnumTitleAction action, net.md_5.bungee.api.chat.BaseComponent[] components, int fadeIn, int stay, int fadeOut) {
+ this.a = action;
+ this.components = components;
+ this.c = fadeIn;
+ this.d = stay;
+ this.e = fadeOut;
+ }
+ // Paper end
+
public PacketPlayOutTitle() {}
- public PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction packetplayouttitle_enumtitleaction, IChatBaseComponent ichatbasecomponent) {
+ public PacketPlayOutTitle(EnumTitleAction packetplayouttitle_enumtitleaction, IChatBaseComponent ichatbasecomponent) {
this(packetplayouttitle_enumtitleaction, ichatbasecomponent, -1, -1, -1);
}
public PacketPlayOutTitle(int i, int j, int k) {
- this(PacketPlayOutTitle.EnumTitleAction.TIMES, (IChatBaseComponent) null, i, j, k);
+ this(EnumTitleAction.TIMES, (IChatBaseComponent) null, i, j, k);
}
- public PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction packetplayouttitle_enumtitleaction, IChatBaseComponent ichatbasecomponent, int i, int j, int k) {
+ public PacketPlayOutTitle(EnumTitleAction packetplayouttitle_enumtitleaction, IChatBaseComponent ichatbasecomponent, int i, int j, int k) {
this.a = packetplayouttitle_enumtitleaction;
this.b = ichatbasecomponent;
this.c = i;
@@ -0,0 +0,0 @@ public class PacketPlayOutTitle implements Packet<PacketListenerPlayOut> {
}
public void a(PacketDataSerializer packetdataserializer) throws IOException {
- this.a = (PacketPlayOutTitle.EnumTitleAction) packetdataserializer.a(PacketPlayOutTitle.EnumTitleAction.class);
- if (this.a == PacketPlayOutTitle.EnumTitleAction.TITLE || this.a == PacketPlayOutTitle.EnumTitleAction.SUBTITLE) {
+ this.a = (EnumTitleAction) packetdataserializer.a(EnumTitleAction.class);
+ if (this.a == EnumTitleAction.TITLE || this.a == EnumTitleAction.SUBTITLE) {
this.b = packetdataserializer.f();
}
- if (this.a == PacketPlayOutTitle.EnumTitleAction.TIMES) {
+ if (this.a == EnumTitleAction.TIMES) {
this.c = packetdataserializer.readInt();
this.d = packetdataserializer.readInt();
this.e = packetdataserializer.readInt();
@@ -0,0 +0,0 @@ public class PacketPlayOutTitle implements Packet<PacketListenerPlayOut> {
public void b(PacketDataSerializer packetdataserializer) throws IOException {
packetdataserializer.a((Enum) this.a);
- if (this.a == PacketPlayOutTitle.EnumTitleAction.TITLE || this.a == PacketPlayOutTitle.EnumTitleAction.SUBTITLE) {
- packetdataserializer.a(this.b);
+ if (this.a == EnumTitleAction.TITLE || this.a == EnumTitleAction.SUBTITLE) {
+ // Paper start
+ if (this.components != null) {
+ packetdataserializer.a(net.md_5.bungee.chat.ComponentSerializer.toString(components));
+ } else {
+ packetdataserializer.a(this.b);
+ }
+ // Paper end
}
- if (this.a == PacketPlayOutTitle.EnumTitleAction.TIMES) {
+ if (this.a == EnumTitleAction.TIMES) {
packetdataserializer.writeInt(this.c);
packetdataserializer.writeInt(this.d);
packetdataserializer.writeInt(this.e);
@@ -0,0 +0,0 @@ public class PacketPlayOutTitle implements Packet<PacketListenerPlayOut> {
}
+ // Paper - Fix compile error
public void a(PacketListenerPlayOut packetlistenerplayout) {
- packetlistenerplayout.a(this);
+ packetlistenerplayout.a((IChatBaseComponent) this);
}
public static enum EnumTitleAction {
@@ -0,0 +0,0 @@ public class PacketPlayOutTitle implements Packet<PacketListenerPlayOut> {
private EnumTitleAction() {}
- public static PacketPlayOutTitle.EnumTitleAction a(String s) {
- PacketPlayOutTitle.EnumTitleAction[] apacketplayouttitle_enumtitleaction = values();
+ public static EnumTitleAction a(String s) {
+ EnumTitleAction[] apacketplayouttitle_enumtitleaction = values();
int i = apacketplayouttitle_enumtitleaction.length;
for (int j = 0; j < i; ++j) {
- PacketPlayOutTitle.EnumTitleAction packetplayouttitle_enumtitleaction = apacketplayouttitle_enumtitleaction[j];
+ EnumTitleAction packetplayouttitle_enumtitleaction = apacketplayouttitle_enumtitleaction[j];
if (packetplayouttitle_enumtitleaction.name().equalsIgnoreCase(s)) {
return packetplayouttitle_enumtitleaction;
}
}
- return PacketPlayOutTitle.EnumTitleAction.TITLE;
+ return EnumTitleAction.TITLE;
}
public static String[] a() {
String[] astring = new String[values().length];
int i = 0;
- PacketPlayOutTitle.EnumTitleAction[] apacketplayouttitle_enumtitleaction = values();
+ EnumTitleAction[] apacketplayouttitle_enumtitleaction = values();
int j = apacketplayouttitle_enumtitleaction.length;
for (int k = 0; k < j; ++k) {
- PacketPlayOutTitle.EnumTitleAction packetplayouttitle_enumtitleaction = apacketplayouttitle_enumtitleaction[k];
+ EnumTitleAction packetplayouttitle_enumtitleaction = apacketplayouttitle_enumtitleaction[k];
astring[i++] = packetplayouttitle_enumtitleaction.name().toLowerCase();
}
--

View File

@ -5037,6 +5037,151 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private EnumResourcePackStatus() {}
+ }
+}
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutPlayerListHeaderFooter.java b/src/main/java/net/minecraft/server/PacketPlayOutPlayerListHeaderFooter.java
new file mode 100644
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
--- /dev/null
+++ b/src/main/java/net/minecraft/server/PacketPlayOutPlayerListHeaderFooter.java
@@ -0,0 +0,0 @@
+package net.minecraft.server;
+
+import net.minecraft.server.IChatBaseComponent;
+import net.minecraft.server.Packet;
+import net.minecraft.server.PacketDataSerializer;
+import net.minecraft.server.PacketListenerPlayOut;
+
+import java.io.IOException;
+
+public class PacketPlayOutPlayerListHeaderFooter implements Packet<PacketListenerPlayOut> {
+
+ private IChatBaseComponent a;
+ private IChatBaseComponent b;
+
+ public PacketPlayOutPlayerListHeaderFooter() {}
+
+ public PacketPlayOutPlayerListHeaderFooter(IChatBaseComponent ichatbasecomponent) {
+ this.a = ichatbasecomponent;
+ }
+
+ public void a(PacketDataSerializer packetdataserializer) throws IOException {
+ this.a = packetdataserializer.f();
+ this.b = packetdataserializer.f();
+ }
+
+ public void b(PacketDataSerializer packetdataserializer) throws IOException {
+ packetdataserializer.a(this.a);
+ packetdataserializer.a(this.b);
+ }
+
+ public void a(PacketListenerPlayOut packetlistenerplayout) {
+ packetlistenerplayout.a(this);
+ }
+}
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutTitle.java b/src/main/java/net/minecraft/server/PacketPlayOutTitle.java
new file mode 100644
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
--- /dev/null
+++ b/src/main/java/net/minecraft/server/PacketPlayOutTitle.java
@@ -0,0 +0,0 @@
+package net.minecraft.server;
+
+import java.io.IOException;
+
+public class PacketPlayOutTitle implements Packet<PacketListenerPlayOut> {
+
+ private PacketPlayOutTitle.EnumTitleAction a;
+ private IChatBaseComponent b;
+ private int c;
+ private int d;
+ private int e;
+
+ public PacketPlayOutTitle() {}
+
+ public PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction packetplayouttitle_enumtitleaction, IChatBaseComponent ichatbasecomponent) {
+ this(packetplayouttitle_enumtitleaction, ichatbasecomponent, -1, -1, -1);
+ }
+
+ public PacketPlayOutTitle(int i, int j, int k) {
+ this(PacketPlayOutTitle.EnumTitleAction.TIMES, (IChatBaseComponent) null, i, j, k);
+ }
+
+ public PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction packetplayouttitle_enumtitleaction, IChatBaseComponent ichatbasecomponent, int i, int j, int k) {
+ this.a = packetplayouttitle_enumtitleaction;
+ this.b = ichatbasecomponent;
+ this.c = i;
+ this.d = j;
+ this.e = k;
+ }
+
+ public void a(PacketDataSerializer packetdataserializer) throws IOException {
+ this.a = (PacketPlayOutTitle.EnumTitleAction) packetdataserializer.a(PacketPlayOutTitle.EnumTitleAction.class);
+ if (this.a == PacketPlayOutTitle.EnumTitleAction.TITLE || this.a == PacketPlayOutTitle.EnumTitleAction.SUBTITLE) {
+ this.b = packetdataserializer.f();
+ }
+
+ if (this.a == PacketPlayOutTitle.EnumTitleAction.TIMES) {
+ this.c = packetdataserializer.readInt();
+ this.d = packetdataserializer.readInt();
+ this.e = packetdataserializer.readInt();
+ }
+
+ }
+
+ public void b(PacketDataSerializer packetdataserializer) throws IOException {
+ packetdataserializer.a((Enum) this.a);
+ if (this.a == PacketPlayOutTitle.EnumTitleAction.TITLE || this.a == PacketPlayOutTitle.EnumTitleAction.SUBTITLE) {
+ packetdataserializer.a(this.b);
+ }
+
+ if (this.a == PacketPlayOutTitle.EnumTitleAction.TIMES) {
+ packetdataserializer.writeInt(this.c);
+ packetdataserializer.writeInt(this.d);
+ packetdataserializer.writeInt(this.e);
+ }
+
+ }
+
+ public void a(PacketListenerPlayOut packetlistenerplayout) {
+ packetlistenerplayout.a(this);
+ }
+
+ public static enum EnumTitleAction {
+
+ TITLE, SUBTITLE, TIMES, CLEAR, RESET;
+
+ private EnumTitleAction() {}
+
+ public static PacketPlayOutTitle.EnumTitleAction a(String s) {
+ PacketPlayOutTitle.EnumTitleAction[] apacketplayouttitle_enumtitleaction = values();
+ int i = apacketplayouttitle_enumtitleaction.length;
+
+ for (int j = 0; j < i; ++j) {
+ PacketPlayOutTitle.EnumTitleAction packetplayouttitle_enumtitleaction = apacketplayouttitle_enumtitleaction[j];
+
+ if (packetplayouttitle_enumtitleaction.name().equalsIgnoreCase(s)) {
+ return packetplayouttitle_enumtitleaction;
+ }
+ }
+
+ return PacketPlayOutTitle.EnumTitleAction.TITLE;
+ }
+
+ public static String[] a() {
+ String[] astring = new String[values().length];
+ int i = 0;
+ PacketPlayOutTitle.EnumTitleAction[] apacketplayouttitle_enumtitleaction = values();
+ int j = apacketplayouttitle_enumtitleaction.length;
+
+ for (int k = 0; k < j; ++k) {
+ PacketPlayOutTitle.EnumTitleAction packetplayouttitle_enumtitleaction = apacketplayouttitle_enumtitleaction[k];
+
+ astring[i++] = packetplayouttitle_enumtitleaction.name().toLowerCase();
+ }
+
+ return astring;
+ }
+ }
+}
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutUpdateTime.java b/src/main/java/net/minecraft/server/PacketPlayOutUpdateTime.java
new file mode 100644
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
@ -5474,149 +5619,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return this.world.getTileEntity(this.position) != this ? false : entityhuman.e((double) this.position.getX() + 0.5D, (double) this.position.getY() + 0.5D, (double) this.position.getZ() + 0.5D) <= 64.0D;
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/PacketPlayOutPlayerListHeaderFooter.java b/src/main/java/org/bukkit/craftbukkit/entity/PacketPlayOutPlayerListHeaderFooter.java
new file mode 100644
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
--- /dev/null
+++ b/src/main/java/org/bukkit/craftbukkit/entity/PacketPlayOutPlayerListHeaderFooter.java
@@ -0,0 +0,0 @@
+package org.bukkit.craftbukkit.entity;
+
+import net.minecraft.server.IChatBaseComponent;
+import net.minecraft.server.Packet;
+import net.minecraft.server.PacketDataSerializer;
+import net.minecraft.server.PacketListenerPlayOut;
+
+import java.io.IOException;
+
+public class PacketPlayOutPlayerListHeaderFooter implements Packet<PacketListenerPlayOut> {
+
+ private IChatBaseComponent a;
+ private IChatBaseComponent b;
+
+ public PacketPlayOutPlayerListHeaderFooter() {}
+
+ public PacketPlayOutPlayerListHeaderFooter(IChatBaseComponent ichatbasecomponent) {
+ this.a = ichatbasecomponent;
+ }
+
+ public void a(PacketDataSerializer packetdataserializer) throws IOException {
+ this.a = packetdataserializer.f();
+ this.b = packetdataserializer.f();
+ }
+
+ public void b(PacketDataSerializer packetdataserializer) throws IOException {
+ packetdataserializer.a(this.a);
+ packetdataserializer.a(this.b);
+ }
+
+ public void a(PacketListenerPlayOut packetlistenerplayout) {
+ packetlistenerplayout.a(this);
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/PacketPlayOutTitle.java b/src/main/java/org/bukkit/craftbukkit/entity/PacketPlayOutTitle.java
new file mode 100644
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
--- /dev/null
+++ b/src/main/java/org/bukkit/craftbukkit/entity/PacketPlayOutTitle.java
@@ -0,0 +0,0 @@
+package net.minecraft.server;
+
+import java.io.IOException;
+
+public class PacketPlayOutTitle implements Packet<PacketListenerPlayOut> {
+
+ private PacketPlayOutTitle.EnumTitleAction a;
+ private IChatBaseComponent b;
+ private int c;
+ private int d;
+ private int e;
+
+ public PacketPlayOutTitle() {}
+
+ public PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction packetplayouttitle_enumtitleaction, IChatBaseComponent ichatbasecomponent) {
+ this(packetplayouttitle_enumtitleaction, ichatbasecomponent, -1, -1, -1);
+ }
+
+ public PacketPlayOutTitle(int i, int j, int k) {
+ this(PacketPlayOutTitle.EnumTitleAction.TIMES, (IChatBaseComponent) null, i, j, k);
+ }
+
+ public PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction packetplayouttitle_enumtitleaction, IChatBaseComponent ichatbasecomponent, int i, int j, int k) {
+ this.a = packetplayouttitle_enumtitleaction;
+ this.b = ichatbasecomponent;
+ this.c = i;
+ this.d = j;
+ this.e = k;
+ }
+
+ public void a(PacketDataSerializer packetdataserializer) throws IOException {
+ this.a = (PacketPlayOutTitle.EnumTitleAction) packetdataserializer.a(PacketPlayOutTitle.EnumTitleAction.class);
+ if (this.a == PacketPlayOutTitle.EnumTitleAction.TITLE || this.a == PacketPlayOutTitle.EnumTitleAction.SUBTITLE) {
+ this.b = packetdataserializer.f();
+ }
+
+ if (this.a == PacketPlayOutTitle.EnumTitleAction.TIMES) {
+ this.c = packetdataserializer.readInt();
+ this.d = packetdataserializer.readInt();
+ this.e = packetdataserializer.readInt();
+ }
+
+ }
+
+ public void b(PacketDataSerializer packetdataserializer) throws IOException {
+ packetdataserializer.a((Enum) this.a);
+ if (this.a == PacketPlayOutTitle.EnumTitleAction.TITLE || this.a == PacketPlayOutTitle.EnumTitleAction.SUBTITLE) {
+ packetdataserializer.a(this.b);
+ }
+
+ if (this.a == PacketPlayOutTitle.EnumTitleAction.TIMES) {
+ packetdataserializer.writeInt(this.c);
+ packetdataserializer.writeInt(this.d);
+ packetdataserializer.writeInt(this.e);
+ }
+
+ }
+
+ public void a(PacketListenerPlayOut packetlistenerplayout) {
+ packetlistenerplayout.a(this);
+ }
+
+ public static enum EnumTitleAction {
+
+ TITLE, SUBTITLE, TIMES, CLEAR, RESET;
+
+ private EnumTitleAction() {}
+
+ public static PacketPlayOutTitle.EnumTitleAction a(String s) {
+ PacketPlayOutTitle.EnumTitleAction[] apacketplayouttitle_enumtitleaction = values();
+ int i = apacketplayouttitle_enumtitleaction.length;
+
+ for (int j = 0; j < i; ++j) {
+ PacketPlayOutTitle.EnumTitleAction packetplayouttitle_enumtitleaction = apacketplayouttitle_enumtitleaction[j];
+
+ if (packetplayouttitle_enumtitleaction.name().equalsIgnoreCase(s)) {
+ return packetplayouttitle_enumtitleaction;
+ }
+ }
+
+ return PacketPlayOutTitle.EnumTitleAction.TITLE;
+ }
+
+ public static String[] a() {
+ String[] astring = new String[values().length];
+ int i = 0;
+ PacketPlayOutTitle.EnumTitleAction[] apacketplayouttitle_enumtitleaction = values();
+ int j = apacketplayouttitle_enumtitleaction.length;
+
+ for (int k = 0; k < j; ++k) {
+ PacketPlayOutTitle.EnumTitleAction packetplayouttitle_enumtitleaction = apacketplayouttitle_enumtitleaction[k];
+
+ astring[i++] = packetplayouttitle_enumtitleaction.name().toLowerCase();
+ }
+
+ return astring;
+ }
+ }
+}
--