From 7a108da7f391babab28590c54bc01302453733f6 Mon Sep 17 00:00:00 2001
From: md_5
Date: Sat, 12 Apr 2014 14:01:22 +1000
Subject: [PATCH] Remove some snapshot related patches in preparation for
update.
---
...> 0123-Enable-Improved-Ping-Sending.patch} | 8 +-
...ix-several-occurances-of-missed-diff.patch | 136 -
...etOfflinePlayer-UUID-on-main-thread.patch} | 4 +-
...ragon-death-and-wither-spawn-sounds.patch} | 4 +-
...getting-ticked-after-being-queued-f.patch} | 2 +-
...-client-crashes-server-lists-and-Mo.patch} | 8 +-
CraftBukkit-Patches/0128-1.7.8-support.patch | 3223 -----------------
.../0129-Convert-player-heads-async.patch | 316 --
8 files changed, 13 insertions(+), 3688 deletions(-)
rename CraftBukkit-Patches/{0124-Enable-Improved-Ping-Sending.patch => 0123-Enable-Improved-Ping-Sending.patch} (94%)
delete mode 100644 CraftBukkit-Patches/0123-Fix-several-occurances-of-missed-diff.patch
rename CraftBukkit-Patches/{0125-Prevent-getOfflinePlayer-UUID-on-main-thread.patch => 0124-Prevent-getOfflinePlayer-UUID-on-main-thread.patch} (90%)
rename CraftBukkit-Patches/{0126-Configurable-dragon-death-and-wither-spawn-sounds.patch => 0125-Configurable-dragon-death-and-wither-spawn-sounds.patch} (97%)
rename CraftBukkit-Patches/{0127-Fix-TileEntities-getting-ticked-after-being-queued-f.patch => 0126-Fix-TileEntities-getting-ticked-after-being-queued-f.patch} (95%)
rename CraftBukkit-Patches/{0130-Display-Spigot-in-client-crashes-server-lists-and-Mo.patch => 0127-Display-Spigot-in-client-crashes-server-lists-and-Mo.patch} (80%)
delete mode 100644 CraftBukkit-Patches/0128-1.7.8-support.patch
delete mode 100644 CraftBukkit-Patches/0129-Convert-player-heads-async.patch
diff --git a/CraftBukkit-Patches/0124-Enable-Improved-Ping-Sending.patch b/CraftBukkit-Patches/0123-Enable-Improved-Ping-Sending.patch
similarity index 94%
rename from CraftBukkit-Patches/0124-Enable-Improved-Ping-Sending.patch
rename to CraftBukkit-Patches/0123-Enable-Improved-Ping-Sending.patch
index c9d1f23718..7415d8016b 100644
--- a/CraftBukkit-Patches/0124-Enable-Improved-Ping-Sending.patch
+++ b/CraftBukkit-Patches/0123-Enable-Improved-Ping-Sending.patch
@@ -1,11 +1,11 @@
-From 0667d6da84d92d80b6be70145083fa4cc5bd913c Mon Sep 17 00:00:00 2001
+From cf42ff147f5671741937ce529c714d39aeadc797 Mon Sep 17 00:00:00 2001
From: Aikar
Date: Sun, 24 Feb 2013 20:45:20 +1100
Subject: [PATCH] Enable Improved Ping Sending
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
-index 27f9dc9..5788872 100644
+index ca06f60..787c764 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -62,6 +62,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -17,7 +17,7 @@ index 27f9dc9..5788872 100644
// Spigot start
public boolean collidesWithEntities = true;
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
-index 25810d3..bf353e0 100644
+index c4698d4..59ba67c 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -784,6 +784,8 @@ public abstract class PlayerList {
@@ -61,5 +61,5 @@ index 25810d3..bf353e0 100644
public void sendAll(Packet packet) {
--
-1.8.5.2.msysgit.0
+1.8.3.2
diff --git a/CraftBukkit-Patches/0123-Fix-several-occurances-of-missed-diff.patch b/CraftBukkit-Patches/0123-Fix-several-occurances-of-missed-diff.patch
deleted file mode 100644
index c896e6fb33..0000000000
--- a/CraftBukkit-Patches/0123-Fix-several-occurances-of-missed-diff.patch
+++ /dev/null
@@ -1,136 +0,0 @@
-From 433062e42e703ec2032fcdef0845b3569c8635a7 Mon Sep 17 00:00:00 2001
-From: md_5
-Date: Wed, 26 Mar 2014 21:21:35 +1100
-Subject: [PATCH] Fix several occurances of missed diff.
-
-
-diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
-index e91d53f..22becf7 100644
---- a/src/main/java/net/minecraft/server/DedicatedServer.java
-+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
-@@ -182,7 +182,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
- this.c((this.getMaxBuildHeight() + 8) / 16 * 16);
- this.c(MathHelper.a(this.getMaxBuildHeight(), 64, 256));
- this.propertyManager.a("max-build-height", Integer.valueOf(this.getMaxBuildHeight()));
-- h.info("Preparing level \"" + this.M() + "\"");
-+ h.info("Preparing level \"" + this.N() + "\"");
- this.a(this.N(), this.N(), k, worldtype, s2);
- long i1 = System.nanoTime() - j;
- String s3 = String.format("%.3fs", new Object[] { Double.valueOf((double) i1 / 1.0E9D)});
-diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java
-index f53b183..dbf30cb 100644
---- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
-+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
-@@ -135,7 +135,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
- d2 = this.locZ + (this.bj - this.locZ) / (double) this.bg;
- d3 = MathHelper.g(this.bk - (double) this.yaw);
- this.yaw = (float) ((double) this.yaw + d3 / (double) this.bg);
-- this.pitch = (float) ((double) this.pitch + (this.bm - (double) this.pitch) / (double) this.bg);
-+ this.pitch = (float) ((double) this.pitch + (this.bl - (double) this.pitch) / (double) this.bg);
- --this.bg;
- this.setPosition(d0, d1, d2);
- this.b(this.yaw, this.pitch);
-diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
-index 1f0e29a..b0b1462 100644
---- a/src/main/java/net/minecraft/server/EntityHuman.java
-+++ b/src/main/java/net/minecraft/server/EntityHuman.java
-@@ -78,7 +78,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
- ChunkCoordinates chunkcoordinates = world.getSpawn();
-
- this.setPositionRotation((double) chunkcoordinates.x + 0.5D, (double) (chunkcoordinates.y + 1), (double) chunkcoordinates.z + 0.5D, 0.0F, 0.0F);
-- this.az = 180.0F;
-+ this.aZ = 180.0F;
- this.maxFireTicks = 20;
- }
-
-@@ -190,7 +190,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
- }
-
- if (d0 < -d3) {
-- this.bu = this.by = this.locX;
-+ this.bu = this.bx = this.locX;
- }
-
- if (d2 < -d3) {
-@@ -198,7 +198,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
- }
-
- if (d1 < -d3) {
-- this.bv = this.bz = this.locY;
-+ this.bv = this.by = this.locY;
- }
-
- this.bx += d0 * 0.25D;
-diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java
-index 0f1bcc7..5eb893f 100644
---- a/src/main/java/net/minecraft/server/EntityItem.java
-+++ b/src/main/java/net/minecraft/server/EntityItem.java
-@@ -320,7 +320,7 @@ public class EntityItem extends Entity {
- public ItemStack getItemStack() {
- ItemStack itemstack = this.getDataWatcher().getItemStack(10);
-
-- return itemstack == null ? new ItemStack(Blocks.STONE) : itemstack;
-+ return itemstack == null ? new ItemStack(Blocks.STONE) : itemstack;
- }
-
- public void setItemStack(ItemStack itemstack) {
-diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
-index f565028..166206c 100644
---- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
-+++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
-@@ -199,7 +199,7 @@ public abstract class EntityMinecartAbstract extends Entity {
- }
-
- if (this.locY < -64.0D) {
-- this.G();
-+ this.F();
- }
-
- int i;
-diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
-index b2cde75..b8d08e2 100644
---- a/src/main/java/net/minecraft/server/PlayerConnection.java
-+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
-@@ -353,7 +353,7 @@ public class PlayerConnection implements PacketPlayInListener {
- }
-
- this.player.i();
-- this.player.W = 0.0F;
-+ this.player.V = 0.0F;
- this.player.setLocation(this.y, this.z, this.q, f2, f3);
- if (!this.checkMovement) {
- return;
-diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
-index c4698d4..25810d3 100644
---- a/src/main/java/net/minecraft/server/PlayerList.java
-+++ b/src/main/java/net/minecraft/server/PlayerList.java
-@@ -51,7 +51,7 @@ public abstract class PlayerList {
- public IPlayerFileData playerFileData; // CraftBukkit - private -> public
- public boolean hasWhitelist; // CraftBukkit - private -> public
- protected int maxPlayers;
-- protected int m;
-+ private int m;
- private EnumGamemode n;
- private boolean o;
- private int p;
-diff --git a/src/main/java/net/minecraft/server/StatisticManager.java b/src/main/java/net/minecraft/server/StatisticManager.java
-index e86e21b..418ec40 100644
---- a/src/main/java/net/minecraft/server/StatisticManager.java
-+++ b/src/main/java/net/minecraft/server/StatisticManager.java
-@@ -8,11 +8,10 @@ public class StatisticManager {
-
- protected final Map a = Maps.newConcurrentMap();
-
-- public StatisticManager() {
-- }
-+ public StatisticManager() {}
-
- public boolean a(Achievement achievement) {
-- return this.getStatisticValue((Statistic) achievement) > 0;
-+ return this.getStatisticValue(achievement) > 0;
- }
-
- public boolean b(Achievement achievement) {
---
-1.8.5.2.msysgit.0
-
diff --git a/CraftBukkit-Patches/0125-Prevent-getOfflinePlayer-UUID-on-main-thread.patch b/CraftBukkit-Patches/0124-Prevent-getOfflinePlayer-UUID-on-main-thread.patch
similarity index 90%
rename from CraftBukkit-Patches/0125-Prevent-getOfflinePlayer-UUID-on-main-thread.patch
rename to CraftBukkit-Patches/0124-Prevent-getOfflinePlayer-UUID-on-main-thread.patch
index 70a33f94c9..1e0bceb45a 100644
--- a/CraftBukkit-Patches/0125-Prevent-getOfflinePlayer-UUID-on-main-thread.patch
+++ b/CraftBukkit-Patches/0124-Prevent-getOfflinePlayer-UUID-on-main-thread.patch
@@ -1,11 +1,11 @@
-From 199e63f001def1fb39642d5f6448544493ec37c7 Mon Sep 17 00:00:00 2001
+From 3f5a0704fe6de51b06e554c07f37237240d4022e Mon Sep 17 00:00:00 2001
From: md_5
Date: Sun, 30 Mar 2014 09:15:35 +1100
Subject: [PATCH] Prevent getOfflinePlayer(UUID) on main thread.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 4c089ea..8961015 100644
+index 707410b..446b046 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1341,6 +1341,7 @@ public final class CraftServer implements Server {
diff --git a/CraftBukkit-Patches/0126-Configurable-dragon-death-and-wither-spawn-sounds.patch b/CraftBukkit-Patches/0125-Configurable-dragon-death-and-wither-spawn-sounds.patch
similarity index 97%
rename from CraftBukkit-Patches/0126-Configurable-dragon-death-and-wither-spawn-sounds.patch
rename to CraftBukkit-Patches/0125-Configurable-dragon-death-and-wither-spawn-sounds.patch
index b2c76976f4..0da0425eea 100644
--- a/CraftBukkit-Patches/0126-Configurable-dragon-death-and-wither-spawn-sounds.patch
+++ b/CraftBukkit-Patches/0125-Configurable-dragon-death-and-wither-spawn-sounds.patch
@@ -1,11 +1,11 @@
-From 8c8e29dbb30f6945a78a1a215a1e866421013bcf Mon Sep 17 00:00:00 2001
+From 3acd3a83d766bdd1a50b42110532e56131a5716c Mon Sep 17 00:00:00 2001
From: drXor
Date: Sat, 29 Mar 2014 13:44:25 -0400
Subject: [PATCH] Configurable dragon death and wither spawn sounds
diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java
-index dbf30cb..64b0992 100644
+index f53b183..9a8408c 100644
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
@@ -550,7 +550,14 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
diff --git a/CraftBukkit-Patches/0127-Fix-TileEntities-getting-ticked-after-being-queued-f.patch b/CraftBukkit-Patches/0126-Fix-TileEntities-getting-ticked-after-being-queued-f.patch
similarity index 95%
rename from CraftBukkit-Patches/0127-Fix-TileEntities-getting-ticked-after-being-queued-f.patch
rename to CraftBukkit-Patches/0126-Fix-TileEntities-getting-ticked-after-being-queued-f.patch
index 85433c7ea2..1661a92fd2 100644
--- a/CraftBukkit-Patches/0127-Fix-TileEntities-getting-ticked-after-being-queued-f.patch
+++ b/CraftBukkit-Patches/0126-Fix-TileEntities-getting-ticked-after-being-queued-f.patch
@@ -1,4 +1,4 @@
-From 21c02e2e18bf05f41a934f259d3c80547d5c24fb Mon Sep 17 00:00:00 2001
+From 4a11712fc763f0233db7c951d714cfb1b41e8555 Mon Sep 17 00:00:00 2001
From: FrozenBrain
Date: Sun, 23 Mar 2014 01:49:13 +0100
Subject: [PATCH] Fix TileEntities getting ticked after being queued for
diff --git a/CraftBukkit-Patches/0130-Display-Spigot-in-client-crashes-server-lists-and-Mo.patch b/CraftBukkit-Patches/0127-Display-Spigot-in-client-crashes-server-lists-and-Mo.patch
similarity index 80%
rename from CraftBukkit-Patches/0130-Display-Spigot-in-client-crashes-server-lists-and-Mo.patch
rename to CraftBukkit-Patches/0127-Display-Spigot-in-client-crashes-server-lists-and-Mo.patch
index 852c40bb56..a15c63dceb 100644
--- a/CraftBukkit-Patches/0130-Display-Spigot-in-client-crashes-server-lists-and-Mo.patch
+++ b/CraftBukkit-Patches/0127-Display-Spigot-in-client-crashes-server-lists-and-Mo.patch
@@ -1,4 +1,4 @@
-From ed6e47fa12d55ee06fcb40251756390f3e8fb6c3 Mon Sep 17 00:00:00 2001
+From 4b7d88914d7e2c7ec619697ee2d60dabea61aeb7 Mon Sep 17 00:00:00 2001
From: Thinkofdeath
Date: Fri, 11 Apr 2014 11:16:34 +0100
Subject: [PATCH] Display 'Spigot' in client crashes, server lists and Mojang
@@ -6,10 +6,10 @@ Subject: [PATCH] Display 'Spigot' in client crashes, server lists and Mojang
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 96b904c..b314181 100644
+index 8ce9dd7..cbf4ade 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -957,7 +957,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
+@@ -955,7 +955,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
}
public String getServerModName() {
@@ -19,5 +19,5 @@ index 96b904c..b314181 100644
public CrashReport b(CrashReport crashreport) {
--
-1.8.5.2.msysgit.0
+1.8.3.2
diff --git a/CraftBukkit-Patches/0128-1.7.8-support.patch b/CraftBukkit-Patches/0128-1.7.8-support.patch
deleted file mode 100644
index 31ad58d6e4..0000000000
--- a/CraftBukkit-Patches/0128-1.7.8-support.patch
+++ /dev/null
@@ -1,3223 +0,0 @@
-From 809c29fa77ca09648e0035f1b1861a13dace5442 Mon Sep 17 00:00:00 2001
-From: Thinkofdeath
-Date: Thu, 3 Apr 2014 17:04:18 +0100
-Subject: [PATCH] 1.7.8 support
-
-
-diff --git a/pom.xml b/pom.xml
-index c8285e0..24d101c 100644
---- a/pom.xml
-+++ b/pom.xml
-@@ -31,6 +31,10 @@
- repobo-snap
- http://repo.bukkit.org/content/groups/public
-
-+
-+ vanilla
-+ https://libraries.minecraft.net/
-+
-
-
-
-@@ -114,6 +118,21 @@
- trove4j
- 3.0.3
-
-+
-+ org.apache.commons
-+ commons-lang3
-+ 3.2.1
-+
-+
-+ commons-io
-+ commons-io
-+ 2.4
-+
-+
-+ commons-codec
-+ commons-codec
-+ 1.6
-+
-
-
-
-diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java
-index 42539b4..490123f 100644
---- a/src/main/java/net/minecraft/server/HandshakeListener.java
-+++ b/src/main/java/net/minecraft/server/HandshakeListener.java
-@@ -1,5 +1,6 @@
- package net.minecraft.server;
-
-+import net.minecraft.util.io.netty.util.AttributeKey;
- import net.minecraft.util.io.netty.util.concurrent.GenericFutureListener;
-
- // CraftBukkit start
-@@ -13,6 +14,7 @@ public class HandshakeListener implements PacketHandshakingInListener {
- private static final HashMap throttleTracker = new HashMap();
- private static int throttleCounter = 0;
- // CraftBukkit end
-+ public static final AttributeKey protocolVersion = new AttributeKey( "protocolVersion" ); // Spigot
-
- private final MinecraftServer a;
- private final NetworkManager b;
-@@ -23,6 +25,12 @@ public class HandshakeListener implements PacketHandshakingInListener {
- }
-
- public void a(PacketHandshakingInSetProtocol packethandshakinginsetprotocol) {
-+ // Spigot start
-+ b.m.attr( protocolVersion ).set( 4 );
-+ if (packethandshakinginsetprotocol.d() == 5) {
-+ b.m.attr( protocolVersion ).set( 5 );
-+ }
-+ // Spigot end
- switch (ProtocolOrdinalWrapper.a[packethandshakinginsetprotocol.c().ordinal()]) {
- case 1:
- this.b.a(EnumProtocol.LOGIN);
-@@ -62,8 +70,7 @@ public class HandshakeListener implements PacketHandshakingInListener {
- org.apache.logging.log4j.LogManager.getLogger().debug("Failed to check connection throttle", t);
- }
- // CraftBukkit end
--
-- if (packethandshakinginsetprotocol.d() > 4) {
-+ if (packethandshakinginsetprotocol.d() > 5) { // Spigot
- chatcomponenttext = new ChatComponentText( org.spigotmc.SpigotConfig.outdatedServerMessage ); // Spigot
- this.b.handle(new PacketLoginOutDisconnect(chatcomponenttext), new GenericFutureListener[0]);
- this.b.close(chatcomponenttext);
-diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 8ce9dd7..34c0703 100644
---- a/src/main/java/net/minecraft/server/MinecraftServer.java
-+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -10,13 +10,13 @@ import java.util.ArrayList;
- import java.util.Arrays;
- import java.util.Collections;
- import java.util.Date;
--import java.util.Iterator;
- import java.util.List;
- import java.util.Random;
- import java.util.UUID;
- import java.util.concurrent.Callable;
- import javax.imageio.ImageIO;
-
-+import org.spigotmc.authlib.yggdrasil.YggdrasilMinecraftSessionService;
- import net.minecraft.util.com.google.common.base.Charsets;
- import net.minecraft.util.com.mojang.authlib.GameProfile;
- import net.minecraft.util.com.mojang.authlib.minecraft.MinecraftSessionService;
-@@ -107,6 +107,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
- private static final int TICK_TIME = 1000000000 / TPS;
- private static final int SAMPLE_INTERVAL = 100;
- public final double[] recentTps = new double[ 3 ];
-+ public final org.spigotmc.authlib.minecraft.MinecraftSessionService newSessionService;
- // Spigot end
-
- public MinecraftServer(OptionSet options, Proxy proxy) { // CraftBukkit - signature file -> OptionSet
-@@ -117,6 +118,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
- this.n = new CommandDispatcher();
- // this.convertable = new WorldLoaderServer(file1); // CraftBukkit - moved to DedicatedServer.init
- this.S = (new YggdrasilAuthenticationService(proxy, UUID.randomUUID().toString())).createMinecraftSessionService();
-+ newSessionService = new org.spigotmc.authlib.yggdrasil.YggdrasilAuthenticationService(proxy, UUID.randomUUID().toString()).createMinecraftSessionService();
-
- // CraftBukkit start
- this.options = options;
-@@ -871,7 +873,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
- }
-
- public String getVersion() {
-- return "1.7.5";
-+ return "1.7.8";
- }
-
- public int C() {
-diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
-index f6cca80..56bfe34 100644
---- a/src/main/java/net/minecraft/server/NetworkManager.java
-+++ b/src/main/java/net/minecraft/server/NetworkManager.java
-@@ -35,7 +35,7 @@ public class NetworkManager extends SimpleChannelInboundHandler {
- private final boolean j;
- private final Queue k = Queues.newConcurrentLinkedQueue();
- private final Queue l = Queues.newConcurrentLinkedQueue();
-- private Channel m;
-+ public Channel m; // Spigot
- public SocketAddress n; // Spigot
- public String spoofedUUID; // Spigot
- private PacketListener o;
-diff --git a/src/main/java/net/minecraft/server/Packet.java b/src/main/java/net/minecraft/server/Packet.java
-index 592ffc5..190da32 100644
---- a/src/main/java/net/minecraft/server/Packet.java
-+++ b/src/main/java/net/minecraft/server/Packet.java
-@@ -47,6 +47,12 @@ public abstract class Packet {
-
- public abstract void b(PacketDataSerializer packetdataserializer) throws IOException; // CraftBukkit - added throws
-
-+ // Spigot start
-+ public void writeSnapshot(PacketDataSerializer packetDataSerializer) throws IOException {
-+ b( packetDataSerializer );
-+ }
-+ // Spigot end
-+
- public abstract void handle(PacketListener packetlistener);
-
- public boolean a() {
-diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java
-new file mode 100644
-index 0000000..ab00152
---- /dev/null
-+++ b/src/main/java/net/minecraft/server/PacketEncoder.java
-@@ -0,0 +1,52 @@
-+package net.minecraft.server;
-+
-+import java.io.IOException;
-+
-+import net.minecraft.util.com.google.common.collect.BiMap;
-+import net.minecraft.util.io.netty.buffer.ByteBuf;
-+import net.minecraft.util.io.netty.channel.ChannelHandlerContext;
-+import net.minecraft.util.io.netty.handler.codec.MessageToByteEncoder;
-+import org.apache.logging.log4j.LogManager;
-+import org.apache.logging.log4j.Logger;
-+import org.apache.logging.log4j.Marker;
-+import org.apache.logging.log4j.MarkerManager;
-+
-+public class PacketEncoder extends MessageToByteEncoder {
-+
-+ private static final Logger a = LogManager.getLogger();
-+ private static final Marker b = MarkerManager.getMarker("PACKET_SENT", NetworkManager.b);
-+ private final NetworkStatistics c;
-+
-+ public PacketEncoder(NetworkStatistics networkstatistics) {
-+ this.c = networkstatistics;
-+ }
-+
-+ protected void a(ChannelHandlerContext channelhandlercontext, Packet packet, ByteBuf bytebuf) throws IOException
-+ {
-+ Integer integer = (Integer) ((BiMap) channelhandlercontext.channel().attr(NetworkManager.f).get()).inverse().get(packet.getClass());
-+
-+ if (a.isDebugEnabled()) {
-+ a.debug(b, "OUT: [{}:{}] {}[{}]", new Object[] { channelhandlercontext.channel().attr(NetworkManager.d).get(), integer, packet.getClass().getName(), packet.b()});
-+ }
-+
-+ if (integer == null) {
-+ throw new IOException("Can\'t serialize unregistered packet");
-+ } else {
-+ PacketDataSerializer packetdataserializer = new PacketDataSerializer(bytebuf);
-+
-+ packetdataserializer.b(integer.intValue());
-+ if ( channelhandlercontext.channel().attr( HandshakeListener.protocolVersion ).get() == 4)
-+ {
-+ packet.b( packetdataserializer );
-+ } else {
-+ packet.writeSnapshot( packetdataserializer );
-+ }
-+ this.c.b(integer.intValue(), (long) packetdataserializer.readableBytes());
-+ }
-+ }
-+
-+ protected void encode(ChannelHandlerContext channelhandlercontext, Object object, ByteBuf bytebuf) throws IOException
-+ {
-+ this.a(channelhandlercontext, (Packet) object, bytebuf);
-+ }
-+}
-diff --git a/src/main/java/net/minecraft/server/PacketLoginOutSuccess.java b/src/main/java/net/minecraft/server/PacketLoginOutSuccess.java
-new file mode 100644
-index 0000000..3aa93cd
---- /dev/null
-+++ b/src/main/java/net/minecraft/server/PacketLoginOutSuccess.java
-@@ -0,0 +1,51 @@
-+package net.minecraft.server;
-+
-+import net.minecraft.util.com.mojang.authlib.GameProfile;
-+
-+import java.io.IOException;
-+
-+public class PacketLoginOutSuccess extends Packet {
-+
-+ private GameProfile a;
-+
-+ public PacketLoginOutSuccess() {}
-+
-+ public PacketLoginOutSuccess(GameProfile gameprofile) {
-+ this.a = gameprofile;
-+ }
-+
-+ public void a(PacketDataSerializer packetdataserializer) throws IOException
-+ {
-+ String s = packetdataserializer.c(36);
-+ String s1 = packetdataserializer.c(16);
-+
-+ this.a = new GameProfile(s, s1);
-+ }
-+
-+ public void b(PacketDataSerializer packetdataserializer) throws IOException
-+ {
-+ packetdataserializer.a(this.a.getId());
-+ packetdataserializer.a(this.a.getName());
-+ }
-+
-+ // Spigot start
-+ @Override
-+ public void writeSnapshot(PacketDataSerializer packetdataserializer) throws IOException
-+ {
-+ packetdataserializer.a( EntityHuman.a( this.a ).toString() );
-+ packetdataserializer.a( this.a.getName());
-+ }
-+ // Spigot end
-+
-+ public void a(PacketLoginOutListener packetloginoutlistener) {
-+ packetloginoutlistener.a(this);
-+ }
-+
-+ public boolean a() {
-+ return true;
-+ }
-+
-+ public void handle(PacketListener packetlistener) {
-+ this.a((PacketLoginOutListener) packetlistener);
-+ }
-+}
-diff --git a/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java b/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java
-index 8bab528..0884047 100644
---- a/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java
-+++ b/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java
-@@ -2,6 +2,7 @@ package net.minecraft.server;
-
- import java.util.List;
-
-+import org.spigotmc.authlib.properties.Property;
- import net.minecraft.util.com.mojang.authlib.GameProfile;
-
- import java.io.IOException; // CraftBukkit
-@@ -60,6 +61,41 @@ public class PacketPlayOutNamedEntitySpawn extends Packet {
- this.i.a(packetdataserializer);
- }
-
-+ // Spigot start
-+ @Override
-+ public void writeSnapshot(PacketDataSerializer packetdataserializer) throws IOException
-+ { // CraftBukkit - added throws
-+ packetdataserializer.b( this.a );
-+ packetdataserializer.a( EntityHuman.a( this.b ).toString() );
-+ packetdataserializer.a( this.b.getName().length() > 16 ? this.b.getName().substring( 0, 16 ) : this.b.getName() ); // CraftBukkit - Limit name length to 16 characters
-+
-+ if ( this.b instanceof ThreadPlayerLookupUUID.NewGameProfileWrapper )
-+ {
-+ org.spigotmc.authlib.GameProfile newProfile = ((ThreadPlayerLookupUUID.NewGameProfileWrapper) b).newProfile;
-+ packetdataserializer.b( newProfile.getProperties().size() );
-+ for ( String key : newProfile.getProperties().keys() )
-+ {
-+ for ( Property prop : newProfile.getProperties().get( key ) )
-+ {
-+ packetdataserializer.a( prop.getName() );
-+ packetdataserializer.a( prop.getValue() );
-+ packetdataserializer.a( prop.getSignature() );
-+ }
-+ }
-+ } else {
-+ packetdataserializer.b( 0 );
-+ }
-+ packetdataserializer.writeInt( this.c );
-+ packetdataserializer.writeInt( this.d );
-+ packetdataserializer.writeInt( this.e );
-+ packetdataserializer.writeByte( this.f );
-+ packetdataserializer.writeByte( this.g );
-+ packetdataserializer.writeShort( this.h );
-+ this.i.a( packetdataserializer );
-+ }
-+
-+ // Spigot end
-+
- public void a(PacketPlayOutListener packetplayoutlistener) {
- packetplayoutlistener.a(this);
- }
-diff --git a/src/main/java/net/minecraft/server/PacketPlayOutTileEntityData.java b/src/main/java/net/minecraft/server/PacketPlayOutTileEntityData.java
-new file mode 100644
-index 0000000..005f1fe
---- /dev/null
-+++ b/src/main/java/net/minecraft/server/PacketPlayOutTileEntityData.java
-@@ -0,0 +1,61 @@
-+package net.minecraft.server;
-+
-+public class PacketPlayOutTileEntityData extends Packet {
-+
-+ private int a;
-+ private int b;
-+ private int c;
-+ private int d;
-+ private NBTTagCompound e;
-+
-+ public PacketPlayOutTileEntityData() {}
-+
-+ public PacketPlayOutTileEntityData(int i, int j, int k, int l, NBTTagCompound nbttagcompound) {
-+ this.a = i;
-+ this.b = j;
-+ this.c = k;
-+ this.d = l;
-+ this.e = nbttagcompound;
-+ }
-+
-+ public void a(PacketDataSerializer packetdataserializer) {
-+ this.a = packetdataserializer.readInt();
-+ this.b = packetdataserializer.readShort();
-+ this.c = packetdataserializer.readInt();
-+ this.d = packetdataserializer.readUnsignedByte();
-+ this.e = packetdataserializer.b();
-+ }
-+
-+ public void b(PacketDataSerializer packetdataserializer) {
-+ packetdataserializer.writeInt(this.a);
-+ packetdataserializer.writeShort(this.b);
-+ packetdataserializer.writeInt(this.c);
-+ packetdataserializer.writeByte((byte) this.d);
-+ packetdataserializer.a(this.e);
-+ }
-+
-+ @Override
-+ public void writeSnapshot(PacketDataSerializer packetdataserializer)
-+ {
-+ packetdataserializer.writeInt(this.a);
-+ packetdataserializer.writeShort(this.b);
-+ packetdataserializer.writeInt(this.c);
-+ packetdataserializer.writeByte((byte) this.d);
-+ if ( this.e.hasKey( "ExtraType" ) )
-+ {
-+ NBTTagCompound profile = new NBTTagCompound();
-+ profile.setString( "Name", this.e.getString( "ExtraType" ) );
-+ profile.setString( "Id", "" );
-+ this.e.set( "Owner", profile );
-+ }
-+ packetdataserializer.a(this.e);
-+ }
-+
-+ public void a(PacketPlayOutListener packetplayoutlistener) {
-+ packetplayoutlistener.a(this);
-+ }
-+
-+ public void handle(PacketListener packetlistener) {
-+ this.a((PacketPlayOutListener) packetlistener);
-+ }
-+}
-diff --git a/src/main/java/net/minecraft/server/PacketStatusListener.java b/src/main/java/net/minecraft/server/PacketStatusListener.java
-index f9da452..fa493ca 100644
---- a/src/main/java/net/minecraft/server/PacketStatusListener.java
-+++ b/src/main/java/net/minecraft/server/PacketStatusListener.java
-@@ -4,6 +4,7 @@ import java.net.InetSocketAddress;
-
- // CraftBukkit start
- import java.util.Iterator;
-+import java.util.UUID;
-
- import org.bukkit.craftbukkit.util.CraftIconCache;
- import org.bukkit.entity.Player;
-@@ -117,13 +118,22 @@ public class PacketStatusListener implements PacketStatusInListener {
- profiles = profiles.subList( 0, Math.min( profiles.size(), org.spigotmc.SpigotConfig.playerSample ) ); // Cap the sample to n (or less) displayed players, ie: Vanilla behaviour
- }
- // Spigot End
-- playerSample.a(profiles.toArray(new GameProfile[profiles.size()]));
-+ // Spigot start
-+ GameProfile[] aProfiles = profiles.toArray( new GameProfile[ profiles.size() ] );
-+ if ( networkManager.m.attr( HandshakeListener.protocolVersion ).get() == 5 )
-+ {
-+ for (int i = 0; i < aProfiles.length; i++) {
-+ aProfiles[i] = new GameProfileWrapper( EntityHuman.a( aProfiles[i] ), aProfiles[i].getName() );
-+ }
-+ }
-+ // Spigot end
-+ playerSample.a(aProfiles);
-
- ServerPing ping = new ServerPing();
- ping.setFavicon(event.icon.value);
- ping.setMOTD(new ChatComponentText(event.getMotd()));
- ping.setPlayerSample(playerSample);
-- ping.setServerInfo(new ServerPingServerData(minecraftServer.getServerModName() + " " + minecraftServer.getVersion(), 4)); // TODO: Update when protocol changes
-+ ping.setServerInfo(new ServerPingServerData(minecraftServer.getServerModName() + " " + minecraftServer.getVersion(), networkManager.m.attr( HandshakeListener.protocolVersion ).get())); // Spigot // TODO: Update when protocol changes
-
- this.networkManager.handle(new PacketStatusOutServerInfo(ping), new GenericFutureListener[0]);
- // CraftBukkit end
-@@ -132,4 +142,23 @@ public class PacketStatusListener implements PacketStatusInListener {
- public void a(PacketStatusInPing packetstatusinping) {
- this.networkManager.handle(new PacketStatusOutPong(packetstatusinping.c()), new GenericFutureListener[0]);
- }
-+
-+
-+ // Spigot start
-+ private static class GameProfileWrapper extends GameProfile {
-+
-+ private final UUID uuid;
-+
-+ public GameProfileWrapper(UUID uuid, String name) {
-+ super("", name);
-+ this.uuid = uuid;
-+ }
-+
-+ @Override
-+ public String getId() {
-+ return uuid.toString();
-+ }
-+ }
-+
-+ // Spigot end
- }
-diff --git a/src/main/java/net/minecraft/server/ThreadPlayerLookupUUID.java b/src/main/java/net/minecraft/server/ThreadPlayerLookupUUID.java
-index fe4502a..63101fb 100644
---- a/src/main/java/net/minecraft/server/ThreadPlayerLookupUUID.java
-+++ b/src/main/java/net/minecraft/server/ThreadPlayerLookupUUID.java
-@@ -33,7 +33,9 @@ class ThreadPlayerLookupUUID extends Thread {
- }
- // Spigot End
- String s = (new BigInteger(MinecraftEncryption.a(LoginListener.a(this.a), LoginListener.b(this.a).J().getPublic(), LoginListener.c(this.a)))).toString(16);
-- LoginListener.a(this.a, LoginListener.b(this.a).at().hasJoinedServer(new GameProfile((String) null, LoginListener.d(this.a).getName()), s));
-+ //LoginListener.a(this.a, LoginListener.b(this.a).at().hasJoinedServer(new GameProfile((String) null, LoginListener.d(this.a).getName()), s));
-+ org.spigotmc.authlib.GameProfile profile = LoginListener.b(this.a).newSessionService.hasJoinedServer( new org.spigotmc.authlib.GameProfile( null, LoginListener.d(this.a).getName() ), s );
-+ LoginListener.a(this.a, new NewGameProfileWrapper( profile ) );
- if (LoginListener.d(this.a) != null) {
- // Spigot Start
- fireLoginEvents();
-@@ -95,4 +97,15 @@ class ThreadPlayerLookupUUID extends Thread {
- }
- // CraftBukkit end
- }
-+
-+ public static class NewGameProfileWrapper extends GameProfile {
-+
-+ public org.spigotmc.authlib.GameProfile newProfile;
-+
-+ public NewGameProfileWrapper(org.spigotmc.authlib.GameProfile newProfile)
-+ {
-+ super( newProfile.getId().toString().replaceAll( "-", "" ), newProfile.getName() );
-+ this.newProfile = newProfile;
-+ }
-+ }
- }
-diff --git a/src/main/java/org/spigotmc/authlib/Agent.java b/src/main/java/org/spigotmc/authlib/Agent.java
-new file mode 100644
-index 0000000..873743d
---- /dev/null
-+++ b/src/main/java/org/spigotmc/authlib/Agent.java
-@@ -0,0 +1,30 @@
-+package org.spigotmc.authlib;
-+
-+public class Agent {
-+ public static final Agent MINECRAFT = new Agent("Minecraft", 1);
-+ public static final Agent SCROLLS = new Agent("Scrolls", 1);
-+
-+ private final String name;
-+ private final int version;
-+
-+ public Agent(String name, int version) {
-+ this.name = name;
-+ this.version = version;
-+ }
-+
-+ public String getName() {
-+ return name;
-+ }
-+
-+ public int getVersion() {
-+ return version;
-+ }
-+
-+ @Override
-+ public String toString() {
-+ return "Agent{" +
-+ "name='" + name + '\'' +
-+ ", version=" + version +
-+ '}';
-+ }
-+}
-diff --git a/src/main/java/org/spigotmc/authlib/AuthenticationService.java b/src/main/java/org/spigotmc/authlib/AuthenticationService.java
-new file mode 100644
-index 0000000..4110e53
---- /dev/null
-+++ b/src/main/java/org/spigotmc/authlib/AuthenticationService.java
-@@ -0,0 +1,33 @@
-+package org.spigotmc.authlib;
-+
-+import org.spigotmc.authlib.minecraft.MinecraftSessionService;
-+
-+public interface AuthenticationService {
-+ /**
-+ * Creates a relevant {@link org.spigotmc.authlib.UserAuthentication} designed for this authentication service.
-+ *
-+ * Certain Authentication Services may have restrictions as to which {@link Agent}s are supported.
-+ * Please consult their javadoc for more information.
-+ *
-+ * @param agent Game agent to authenticate for
-+ * @throws java.lang.IllegalArgumentException Agent is null or not allowed for this AuthenticationService
-+ * @return New user authenticator
-+ */
-+ public UserAuthentication createUserAuthentication(Agent agent);
-+
-+ /**
-+ * Creates a relevant {@link org.spigotmc.authlib.minecraft.MinecraftSessionService} designed for this authentication service.
-+ *
-+ * This is a Minecraft specific service and is not relevant to any other game agent.
-+ *
-+ * @return New minecraft session service
-+ */
-+ public MinecraftSessionService createMinecraftSessionService();
-+
-+ /**
-+ * Creates a relevant {@link org.spigotmc.authlib.GameProfileRepository} designed for this authentication service.
-+ *
-+ * @return New profile repository
-+ */
-+ public GameProfileRepository createProfileRepository();
-+}
-diff --git a/src/main/java/org/spigotmc/authlib/BaseAuthenticationService.java b/src/main/java/org/spigotmc/authlib/BaseAuthenticationService.java
-new file mode 100644
-index 0000000..b3cb3bb
---- /dev/null
-+++ b/src/main/java/org/spigotmc/authlib/BaseAuthenticationService.java
-@@ -0,0 +1,4 @@
-+package org.spigotmc.authlib;
-+
-+public abstract class BaseAuthenticationService implements AuthenticationService {
-+}
-diff --git a/src/main/java/org/spigotmc/authlib/BaseUserAuthentication.java b/src/main/java/org/spigotmc/authlib/BaseUserAuthentication.java
-new file mode 100644
-index 0000000..3bdcea2
---- /dev/null
-+++ b/src/main/java/org/spigotmc/authlib/BaseUserAuthentication.java
-@@ -0,0 +1,268 @@
-+package org.spigotmc.authlib;
-+
-+import org.spigotmc.authlib.properties.Property;
-+import org.spigotmc.authlib.properties.PropertyMap;
-+import org.spigotmc.authlib.util.UUIDTypeAdapter;
-+import org.apache.commons.lang3.StringUtils;
-+import org.apache.commons.lang3.Validate;
-+import org.apache.logging.log4j.LogManager;
-+import org.apache.logging.log4j.Logger;
-+
-+import java.util.ArrayList;
-+import java.util.HashMap;
-+import java.util.List;
-+import java.util.Map;
-+
-+public abstract class BaseUserAuthentication implements UserAuthentication {
-+ private static final Logger LOGGER = LogManager.getLogger();
-+
-+ protected static final String STORAGE_KEY_PROFILE_NAME = "displayName";
-+ protected static final String STORAGE_KEY_PROFILE_ID = "uuid";
-+ protected static final String STORAGE_KEY_PROFILE_PROPERTIES = "profileProperties";
-+ protected static final String STORAGE_KEY_USER_NAME = "username";
-+ protected static final String STORAGE_KEY_USER_ID = "userid";
-+ protected static final String STORAGE_KEY_USER_PROPERTIES = "userProperties";
-+
-+ private final AuthenticationService authenticationService;
-+ private final PropertyMap userProperties = new PropertyMap();
-+ private String userid;
-+ private String username;
-+ private String password;
-+ private GameProfile selectedProfile;
-+ private UserType userType;
-+
-+ protected BaseUserAuthentication(AuthenticationService authenticationService) {
-+ Validate.notNull(authenticationService);
-+ this.authenticationService = authenticationService;
-+ }
-+
-+ @Override
-+ public boolean canLogIn() {
-+ return !canPlayOnline() && StringUtils.isNotBlank(getUsername()) && StringUtils.isNotBlank(getPassword());
-+ }
-+
-+ @Override
-+ public void logOut() {
-+ password = null;
-+ userid = null;
-+ setSelectedProfile(null);
-+ getModifiableUserProperties().clear();
-+ setUserType(null);
-+ }
-+
-+ @Override
-+ public boolean isLoggedIn() {
-+ return getSelectedProfile() != null;
-+ }
-+
-+ @Override
-+ public void setUsername(String username) {
-+ if (isLoggedIn() && canPlayOnline()) {
-+ throw new IllegalStateException("Cannot change username whilst logged in & online");
-+ }
-+
-+ this.username = username;
-+ }
-+
-+ @Override
-+ public void setPassword(String password) {
-+ if (isLoggedIn() && canPlayOnline() && StringUtils.isNotBlank(password)) {
-+ throw new IllegalStateException("Cannot set password whilst logged in & online");
-+ }
-+
-+ this.password = password;
-+ }
-+
-+ protected String getUsername() {
-+ return username;
-+ }
-+
-+ protected String getPassword() {
-+ return password;
-+ }
-+
-+ @SuppressWarnings("unchecked")
-+ @Override
-+ public void loadFromStorage(Map credentials) {
-+ logOut();
-+
-+ setUsername(String.valueOf(credentials.get(STORAGE_KEY_USER_NAME)));
-+
-+ if (credentials.containsKey(STORAGE_KEY_USER_ID)) {
-+ userid = String.valueOf(credentials.get(STORAGE_KEY_USER_ID));
-+ } else {
-+ userid = username;
-+ }
-+
-+ if (credentials.containsKey(STORAGE_KEY_USER_PROPERTIES)) {
-+ try {
-+ List