diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-15 01:23:52 +0100 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-15 01:23:52 +0100 |
commit | 5b2c774edc069f70d1fa9940d96bb0b8705bef7a (patch) | |
tree | 79d1800e7154bba7b5fca4f8c8373ee4376cca89 /src/main/java/net/minecraft/server/NetLoginHandler.java | |
parent | 54bcd1c1f36691a714234e5ca2f30a20b3ad2816 (diff) | |
download | craftbukkit-5b2c774edc069f70d1fa9940d96bb0b8705bef7a.tar craftbukkit-5b2c774edc069f70d1fa9940d96bb0b8705bef7a.tar.gz craftbukkit-5b2c774edc069f70d1fa9940d96bb0b8705bef7a.tar.lz craftbukkit-5b2c774edc069f70d1fa9940d96bb0b8705bef7a.tar.xz craftbukkit-5b2c774edc069f70d1fa9940d96bb0b8705bef7a.zip |
Update for Minecraft 1.8
Diffstat (limited to 'src/main/java/net/minecraft/server/NetLoginHandler.java')
-rw-r--r-- | src/main/java/net/minecraft/server/NetLoginHandler.java | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/src/main/java/net/minecraft/server/NetLoginHandler.java b/src/main/java/net/minecraft/server/NetLoginHandler.java index 99e775b8..0b28759a 100644 --- a/src/main/java/net/minecraft/server/NetLoginHandler.java +++ b/src/main/java/net/minecraft/server/NetLoginHandler.java @@ -1,6 +1,7 @@ package net.minecraft.server; import java.net.Socket; +import java.util.Iterator; import java.util.Random; import java.util.logging.Logger; @@ -63,8 +64,8 @@ public class NetLoginHandler extends NetHandler { public void a(Packet1Login packet1login) { this.g = packet1login.name; - if (packet1login.a != 14) { - if (packet1login.a > 14) { + if (packet1login.a != 17) { + if (packet1login.a > 17) { this.disconnect("Outdated server!"); } else { this.disconnect("Outdated client!"); @@ -85,12 +86,24 @@ public class NetLoginHandler extends NetHandler { this.server.serverConfigurationManager.b(entityplayer); // entityplayer.a((World) this.server.a(entityplayer.dimension)); // CraftBukkit - set by Entity // CraftBukkit - add world and location to 'logged in' message. + entityplayer.itemInWorldManager.a((WorldServer) entityplayer.world); a.info(this.b() + " logged in with entity id " + entityplayer.id + " at ([" + entityplayer.world.worldData.name + "] " + entityplayer.locX + ", " + entityplayer.locY + ", " + entityplayer.locZ + ")"); WorldServer worldserver = (WorldServer) entityplayer.world; // CraftBukkit ChunkCoordinates chunkcoordinates = worldserver.getSpawn(); + + entityplayer.itemInWorldManager.b(worldserver.p().n()); NetServerHandler netserverhandler = new NetServerHandler(this.server, this.networkManager, entityplayer); - netserverhandler.sendPacket(new Packet1Login("", entityplayer.id, worldserver.getSeed(), (byte) worldserver.worldProvider.dimension)); + int i = entityplayer.id; + long j = worldserver.getSeed(); + int k = entityplayer.itemInWorldManager.a(); + byte b0 = (byte) worldserver.worldProvider.dimension; + byte b1 = (byte) worldserver.spawnMonsters; + + worldserver.getClass(); + Packet1Login packet1login1 = new Packet1Login("", i, j, k, b0, b1, (byte) -128, (byte) this.server.serverConfigurationManager.h()); + + netserverhandler.sendPacket(packet1login1); netserverhandler.sendPacket(new Packet6SpawnPosition(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z)); this.server.serverConfigurationManager.a(entityplayer, worldserver); // this.server.serverConfigurationManager.sendAll(new Packet3Chat("\u00A7e" + entityplayer.name + " joined the game.")); // CraftBukkit - message moved to join event @@ -98,6 +111,14 @@ public class NetLoginHandler extends NetHandler { netserverhandler.a(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch); this.server.networkListenThread.a(netserverhandler); netserverhandler.sendPacket(new Packet4UpdateTime(entityplayer.getPlayerTime())); // CraftBukkit - add support for player specific time + Iterator iterator = entityplayer.ak().iterator(); + + while (iterator.hasNext()) { + MobEffect mobeffect = (MobEffect) iterator.next(); + + netserverhandler.sendPacket(new Packet41MobEffect(entityplayer.id, mobeffect)); + } + entityplayer.syncInventory(); } @@ -109,6 +130,19 @@ public class NetLoginHandler extends NetHandler { this.c = true; } + public void a(Packet254GetInfo packet254getinfo) { + try { + String s = this.server.p + "\u00A7" + this.server.serverConfigurationManager.g() + "\u00A7" + this.server.serverConfigurationManager.h(); + + this.networkManager.queue(new Packet255KickDisconnect(s)); + this.networkManager.d(); + this.server.networkListenThread.a(this.networkManager.f()); + this.c = true; + } catch (Exception exception) { + exception.printStackTrace(); + } + } + public void a(Packet packet) { this.disconnect("Protocol error"); } |