diff options
author | EdGruberman <ed@rjump.com> | 2012-12-22 11:46:24 -0700 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2013-01-19 06:20:33 -0600 |
commit | d834ca4c6c6dd051e49ee177eb527c7494bd47bc (patch) | |
tree | 858188f8ab16717870890dbf2a3d3e7695526731 /src/main/java/net/minecraft/server/PlayerConnection.java | |
parent | 9cb320654de9b90b4ee2f39e5909afac49ce044c (diff) | |
download | craftbukkit-d834ca4c6c6dd051e49ee177eb527c7494bd47bc.tar craftbukkit-d834ca4c6c6dd051e49ee177eb527c7494bd47bc.tar.gz craftbukkit-d834ca4c6c6dd051e49ee177eb527c7494bd47bc.tar.lz craftbukkit-d834ca4c6c6dd051e49ee177eb527c7494bd47bc.tar.xz craftbukkit-d834ca4c6c6dd051e49ee177eb527c7494bd47bc.zip |
[Bleeding] Add experimental support for entity portal traveling
Diffstat (limited to 'src/main/java/net/minecraft/server/PlayerConnection.java')
-rw-r--r-- | src/main/java/net/minecraft/server/PlayerConnection.java | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java index 94b62ac9..fac9ea5e 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -37,6 +37,7 @@ import org.bukkit.event.player.PlayerItemHeldEvent; import org.bukkit.event.player.PlayerKickEvent; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerTeleportEvent; +import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; import org.bukkit.event.player.PlayerToggleSneakEvent; import org.bukkit.event.player.PlayerToggleSprintEvent; import org.bukkit.event.inventory.*; @@ -1126,26 +1127,7 @@ public class PlayerConnection extends Connection { public void a(Packet205ClientCommand packet205clientcommand) { if (packet205clientcommand.a == 1) { if (this.player.viewingCredits) { - // CraftBukkit start - org.bukkit.craftbukkit.PortalTravelAgent pta = new org.bukkit.craftbukkit.PortalTravelAgent(); - Location toLocation; - - if (this.player.getBukkitEntity().getBedSpawnLocation() == null) { - CraftWorld cworld = (CraftWorld) this.server.getWorlds().get(0); - ChunkCoordinates chunkcoordinates = cworld.getHandle().getSpawn(); - toLocation = new Location(cworld, chunkcoordinates.x + 0.5, chunkcoordinates.y, chunkcoordinates.z + 0.5); - this.player.playerConnection.sendPacket(new Packet70Bed(0, 0)); - } else { - toLocation = this.player.getBukkitEntity().getBedSpawnLocation(); - toLocation = new Location(toLocation.getWorld(), toLocation.getX() + 0.5, toLocation.getY(), toLocation.getZ() + 0.5); - } - - PlayerPortalEvent event = new PlayerPortalEvent(this.player.getBukkitEntity(), this.player.getBukkitEntity().getLocation(), toLocation, pta, PlayerPortalEvent.TeleportCause.END_PORTAL); - event.useTravelAgent(false); - - Bukkit.getServer().getPluginManager().callEvent(event); - this.player = this.minecraftServer.getPlayerList().moveToWorld(this.player, 0, true, event.getTo()); - // CraftBukkit end + this.minecraftServer.getPlayerList().changeDimension(this.player, 0, TeleportCause.END_PORTAL); // CraftBukkit - reroute logic through custom portal management } else if (this.player.p().getWorldData().isHardcore()) { if (this.minecraftServer.I() && this.player.name.equals(this.minecraftServer.H())) { this.player.playerConnection.disconnect("You have died. Game over, man, it\'s game over!"); |