Update to Minecraft 1.12-pre6

This commit is contained in:
md_5
2017-05-30 21:25:59 +10:00
parent c155d8dd32
commit e13d119686
35 changed files with 297 additions and 260 deletions

View File

@@ -20,7 +20,7 @@
@@ -16,6 +26,41 @@
this.b.setProtocol(EnumProtocol.LOGIN);
ChatComponentText chatcomponenttext;
ChatMessage chatmessage;
+ // CraftBukkit start - Connection throttle
+ try {
@@ -31,9 +31,9 @@
+ synchronized (throttleTracker) {
+ if (throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - throttleTracker.get(address) < connectionThrottle) {
+ throttleTracker.put(address, currentTime);
+ chatcomponenttext = new ChatComponentText("Connection throttled! Please wait before reconnecting.");
+ this.b.sendPacket(new PacketLoginOutDisconnect(chatcomponenttext));
+ this.b.close(chatcomponenttext);
+ chatmessage = new ChatMessage("Connection throttled! Please wait before reconnecting.");
+ this.b.sendPacket(new PacketLoginOutDisconnect(chatmessage));
+ this.b.close(chatmessage);
+ return;
+ }
+
@@ -57,11 +57,11 @@
+ }
+ // CraftBukkit end
+
if (packethandshakinginsetprotocol.b() > 332) {
chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.12-pre5");
this.b.sendPacket(new PacketLoginOutDisconnect(chatcomponenttext));
if (packethandshakinginsetprotocol.b() > 333) {
chatmessage = new ChatMessage("multiplayer.disconnect.outdated_server", new Object[] { "1.12-pre6"});
this.b.sendPacket(new PacketLoginOutDisconnect(chatmessage));
@@ -26,6 +71,7 @@
this.b.close(chatcomponenttext);
this.b.close(chatmessage);
} else {
this.b.setPacketListener(new LoginListener(this.a, this.b));
+ ((LoginListener) this.b.i()).hostname = packethandshakinginsetprotocol.hostname + ":" + packethandshakinginsetprotocol.port; // CraftBukkit - set hostname