diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2014-04-10 20:04:38 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2014-04-11 22:28:35 -0500 |
commit | 8f771c737850130534b0fade70494f7ce3cbc8fd (patch) | |
tree | e4180121cdaf4f15b325aa059469b44975fca8a4 /src/main/java/net/minecraft/server/PlayerConnection.java | |
parent | 0df7555cecff17ffab68b8280dcf8471b10f020c (diff) | |
download | craftbukkit-8f771c737850130534b0fade70494f7ce3cbc8fd.tar craftbukkit-8f771c737850130534b0fade70494f7ce3cbc8fd.tar.gz craftbukkit-8f771c737850130534b0fade70494f7ce3cbc8fd.tar.lz craftbukkit-8f771c737850130534b0fade70494f7ce3cbc8fd.tar.xz craftbukkit-8f771c737850130534b0fade70494f7ce3cbc8fd.zip |
Update CraftBukkit to Minecraft 1.7.8
Diffstat (limited to 'src/main/java/net/minecraft/server/PlayerConnection.java')
-rw-r--r-- | src/main/java/net/minecraft/server/PlayerConnection.java | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java index be2bca23..946681d3 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -4,6 +4,7 @@ import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.IOException; import java.util.ArrayList; +import java.util.Date; import java.util.Iterator; import java.util.Random; import java.util.concurrent.Callable; @@ -356,7 +357,7 @@ public class PlayerConnection implements PacketPlayInListener { // CraftBukkit end double d10 = d7 * d7 + d8 * d8 + d9 * d9; - if (d10 > 100.0D && this.checkMovement && (!this.minecraftServer.M() || !this.minecraftServer.L().equals(this.player.getName()))) { // CraftBukkit - Added this.checkMovement condition to solve this check being triggered by teleports + if (d10 > 100.0D && this.checkMovement && (!this.minecraftServer.N() || !this.minecraftServer.M().equals(this.player.getName()))) { // CraftBukkit - Added this.checkMovement condition to solve this check being triggered by teleports c.warn(this.player.getName() + " moved too quickly! " + d4 + "," + d5 + "," + d6 + " (" + d7 + ", " + d8 + ", " + d9 + ")"); this.a(this.y, this.z, this.q, this.player.yaw, this.player.pitch); return; @@ -689,7 +690,7 @@ public class PlayerConnection implements PacketPlayInListener { } // CraftBukkit end c.info(this.player.getName() + " lost connection: " + ichatbasecomponent.c()); // CraftBukkit - Don't toString the component - this.minecraftServer.av(); + this.minecraftServer.az(); // CraftBukkit start - Replace vanilla quit message handling with our own. /* ChatMessage chatmessage = new ChatMessage("multiplayer.player.left", new Object[] { this.player.getScoreboardDisplayName()}); @@ -704,7 +705,7 @@ public class PlayerConnection implements PacketPlayInListener { this.minecraftServer.getPlayerList().sendMessage(CraftChatMessage.fromString(quitMessage)); } // CraftBukkit end - if (this.minecraftServer.M() && this.player.getName().equals(this.minecraftServer.L())) { + if (this.minecraftServer.N() && this.player.getName().equals(this.minecraftServer.M())) { c.info("Stopping singleplayer server as player logged out"); this.minecraftServer.safeShutdown(); } @@ -835,7 +836,7 @@ public class PlayerConnection implements PacketPlayInListener { // CraftBukkit start - replaced with thread safe throttle // this.chatThrottle += 20; - if (chatSpamField.addAndGet(this, 20) > 200 && !this.minecraftServer.getPlayerList().isOp(this.player.getName())) { + if (chatSpamField.addAndGet(this, 20) > 200 && !this.minecraftServer.getPlayerList().isOp(this.player.getProfile())) { if (packetplayinchat.a()) { Waitable waitable = new Waitable() { @Override @@ -1120,14 +1121,13 @@ public class PlayerConnection implements PacketPlayInListener { if (this.player.viewingCredits) { this.minecraftServer.getPlayerList().changeDimension(this.player, 0, PlayerTeleportEvent.TeleportCause.END_PORTAL); // CraftBukkit - reroute logic through custom portal management } else if (this.player.r().getWorldData().isHardcore()) { - if (this.minecraftServer.M() && this.player.getName().equals(this.minecraftServer.L())) { + if (this.minecraftServer.N() && this.player.getName().equals(this.minecraftServer.M())) { this.player.playerConnection.disconnect("You have died. Game over, man, it\'s game over!"); - this.minecraftServer.T(); + this.minecraftServer.U(); } else { - BanEntry banentry = new BanEntry(this.player.getName()); + GameProfileBanEntry gameprofilebanentry = new GameProfileBanEntry(this.player.getProfile(), (Date) null, "(You just lost the game)", (Date) null, "Death in Hardcore"); - banentry.setReason("Death in Hardcore"); - this.minecraftServer.getPlayerList().getNameBans().add(banentry); + this.minecraftServer.getPlayerList().getProfileBans().add(gameprofilebanentry); this.player.playerConnection.disconnect("You have died. Game over, man, it\'s game over!"); } } else { @@ -1654,16 +1654,16 @@ public class PlayerConnection implements PacketPlayInListener { try { itemstack = packetdataserializer.c(); - if (itemstack != null) { - if (!ItemBookAndQuill.a(itemstack.getTag())) { - throw new IOException("Invalid book tag!"); - } + if (itemstack == null) { + return; + } - itemstack1 = this.player.inventory.getItemInHand(); - if (itemstack1 == null) { - return; - } + if (!ItemBookAndQuill.a(itemstack.getTag())) { + throw new IOException("Invalid book tag!"); + } + itemstack1 = this.player.inventory.getItemInHand(); + if (itemstack1 != null) { if (itemstack.getItem() == Items.BOOK_AND_QUILL && itemstack.getItem() == itemstack1.getItem()) { itemstack1.a("pages", (NBTBase) itemstack.getTag().getList("pages", 8)); } @@ -1686,18 +1686,18 @@ public class PlayerConnection implements PacketPlayInListener { try { itemstack = packetdataserializer.c(); - if (itemstack == null) { - return; - } + if (itemstack != null) { + if (!ItemWrittenBook.a(itemstack.getTag())) { + throw new IOException("Invalid book tag!"); + } - if (!ItemWrittenBook.a(itemstack.getTag())) { - throw new IOException("Invalid book tag!"); - } + itemstack1 = this.player.inventory.getItemInHand(); + if (itemstack1 == null) { + return; + } - itemstack1 = this.player.inventory.getItemInHand(); - if (itemstack1 != null) { if (itemstack.getItem() == Items.WRITTEN_BOOK && itemstack1.getItem() == Items.BOOK_AND_QUILL) { - CraftEventFactory.handleEditBookEvent(player, itemstack); // CraftBukkit + CraftEventFactory.handleEditBookEvent(player, itemstack); // CraftBukkit } return; |