Update CraftBukkit to Minecraft 1.4.6

This commit is contained in:
feildmaster
2012-12-19 22:03:52 -06:00
parent 9f1bf124ee
commit 23b6764374
115 changed files with 1930 additions and 1426 deletions

View File

@@ -31,7 +31,7 @@ public class NetworkManager implements INetworkManager {
private java.util.Queue inboundQueue = new java.util.concurrent.ConcurrentLinkedQueue(); // CraftBukkit - Concurrent linked queue
private List highPriorityQueue = Collections.synchronizedList(new ArrayList());
private List lowPriorityQueue = Collections.synchronizedList(new ArrayList());
private NetHandler packetListener;
private Connection connection;
private boolean s = false;
private Thread t;
private Thread u;
@@ -48,11 +48,11 @@ public class NetworkManager implements INetworkManager {
private PrivateKey A = null;
private int lowPriorityQueueDelay = 50;
public NetworkManager(Socket socket, String s, NetHandler nethandler, PrivateKey privatekey) throws IOException { // CraftBukkit - throws IOException
public NetworkManager(Socket socket, String s, Connection connection, PrivateKey privatekey) throws IOException { // CraftBukkit - throws IOException
this.A = privatekey;
this.socket = socket;
this.j = socket.getRemoteSocketAddress();
this.packetListener = nethandler;
this.connection = connection;
try {
socket.setSoTimeout(30000);
@@ -69,8 +69,8 @@ public class NetworkManager implements INetworkManager {
this.t.start();
}
public void a(NetHandler nethandler) {
this.packetListener = nethandler;
public void a(Connection connection) {
this.connection = connection;
}
public void queue(Packet packet) {
@@ -97,7 +97,7 @@ public class NetworkManager implements INetworkManager {
if (packet != null) {
Packet.a(packet, this.output);
if (packet instanceof Packet252KeyResponse && !this.g) {
if (!this.packetListener.a()) {
if (!this.connection.a()) {
this.z = ((Packet252KeyResponse) packet).d();
}
@@ -187,11 +187,11 @@ public class NetworkManager implements INetworkManager {
boolean flag = false;
try {
Packet packet = Packet.a(this.input, this.packetListener.a(), this.socket);
Packet packet = Packet.a(this.input, this.connection.a(), this.socket);
if (packet != null) {
if (packet instanceof Packet252KeyResponse && !this.f) {
if (this.packetListener.a()) {
if (this.connection.a()) {
this.z = ((Packet252KeyResponse) packet).a(this.A);
}
@@ -203,9 +203,9 @@ public class NetworkManager implements INetworkManager {
aint[i] += packet.a() + 1;
if (!this.s) {
if (packet.a_() && this.packetListener.b()) {
if (packet.a_() && this.connection.b()) {
this.x = 0;
packet.handle(this.packetListener);
packet.handle(this.connection);
} else {
this.inboundQueue.add(packet);
}
@@ -282,17 +282,17 @@ public class NetworkManager implements INetworkManager {
Packet packet = (Packet) this.inboundQueue.poll(); // CraftBukkit - remove -> poll
// CraftBukkit start
if (this.packetListener instanceof NetLoginHandler ? ((NetLoginHandler) this.packetListener).c : ((NetServerHandler) this.packetListener).disconnected) {
if (this.connection instanceof PendingConnection ? ((PendingConnection) this.connection).c : ((PlayerConnection) this.connection).disconnected) {
continue;
}
// CraftBukkit end
packet.handle(this.packetListener);
packet.handle(this.connection);
}
this.a();
if (this.n && this.inboundQueue.isEmpty()) {
this.packetListener.a(this.v, this.w);
this.connection.a(this.v, this.w);
}
}