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/EntityPlayer.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/EntityPlayer.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityPlayer.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java index 99f12181..8d61ca63 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -15,6 +15,7 @@ import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.event.inventory.InventoryType; +import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; // CraftBukkit end public class EntityPlayer extends EntityHuman implements ICrafting { @@ -321,21 +322,27 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.viewingCredits = true; this.playerConnection.sendPacket(new Packet70Bed(4, 0)); } else { - this.a((Statistic) AchievementList.B); - /* CraftBukkit start - removed to fix our handling of The End portals - ChunkCoordinates chunkcoordinates = this.server.getWorldServer(i).getDimensionSpawn(); + if (this.dimension == 1 && i == 0) { + this.a((Statistic) AchievementList.B); + // CraftBukkit start - rely on custom portal management + /* + ChunkCoordinates chunkcoordinates = this.server.getWorldServer(i).getDimensionSpawn(); if (chunkcoordinates != null) { this.netServerHandler.a((double) chunkcoordinates.x, (double) chunkcoordinates.y, (double) chunkcoordinates.z, 0.0F, 0.0F); } i = 1; + */ + // CraftBukkit end } else { this.a((Statistic) AchievementList.x); } - // CraftBukkit end */ - this.server.getPlayerList().changeDimension(this, i); + // CraftBukkit start + TeleportCause cause = (this.dimension == 1 || i == 1) ? TeleportCause.END_PORTAL : TeleportCause.NETHER_PORTAL; + this.server.getPlayerList().changeDimension(this, i, cause); + // CraftBukkit end this.lastSentExp = -1; this.cl = -1; this.cm = -1; |