From e8e7581446b5cb27b513932a81769921b9c9e1a7 Mon Sep 17 00:00:00 2001 From: Erik Broes Date: Wed, 23 Mar 2011 18:42:36 +0100 Subject: [PATCH] Small cleanup for the last commit --- .../net/minecraft/server/NetServerHandler.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index a3bd30d95a..048a223fbf 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -258,7 +258,11 @@ public class NetServerHandler extends NetHandler implements ICommandListener { } } - // CraftBukkit start -- Delegate for a(double, double, double, float, float) + public void a(double d0, double d1, double d2, float f, float f1) { + // CraftBukkit start -- Delegate to teleport(Location) + teleport(new Location(getPlayer().getWorld(), d0, d1, d2, f, f1)); + } + public boolean teleport(Location dest) { // Note: the world in location is used only for the event // Inter-world teleportation is handled in CraftPlayer.teleport() @@ -280,26 +284,18 @@ public class NetServerHandler extends NetHandler implements ICommandListener { d2 = to.getZ(); f = to.getYaw(); f1 = to.getPitch(); + // CraftBukkit end - // net.minecraft.server start this.l = false; this.i = d0; this.j = d1; this.k = d2; this.e.b(d0, d1, d2, f, f1); this.e.a.b((Packet) (new Packet13PlayerLookMove(d0, d1 + 1.6200000047683716D, d1, d2, f, f1, false))); - // net.minecraft.server end - // Returns TRUE if the teleport was successful + // CraftBukkit -- Returns TRUE if the teleport was successful return !event.isCancelled(); } - // CraftBukkit end - - public void a(double d0, double d1, double d2, float f, float f1) { - // CraftBukkit start -- Delegate to teleport(Location) - teleport(new Location(getPlayer().getWorld(), d0, d1, d2, f, f1)); - // CraftBukkit end - } public void a(Packet14BlockDig packet14blockdig) { if (packet14blockdig.e == 4) {