diff options
author | Erik Broes <erikbroes@grum.nl> | 2011-03-25 21:22:03 +0100 |
---|---|---|
committer | Erik Broes <erikbroes@grum.nl> | 2011-03-25 21:22:03 +0100 |
commit | 9162a654c44801ee40e47a7dad94cc7a7c95afed (patch) | |
tree | 647e8ec79a227fbb0f8c3d4e3bba51cd5edfe2d8 /src/main/java/net | |
parent | 6fc4d9dcfe7a1eeeefd219aeee4a07f964b391d7 (diff) | |
download | craftbukkit-9162a654c44801ee40e47a7dad94cc7a7c95afed.tar craftbukkit-9162a654c44801ee40e47a7dad94cc7a7c95afed.tar.gz craftbukkit-9162a654c44801ee40e47a7dad94cc7a7c95afed.tar.lz craftbukkit-9162a654c44801ee40e47a7dad94cc7a7c95afed.tar.xz craftbukkit-9162a654c44801ee40e47a7dad94cc7a7c95afed.zip |
Implement player.getCompassTarget
Diffstat (limited to 'src/main/java/net')
3 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java index 1c532764..6ec75601 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -7,6 +7,8 @@ import java.util.Set; // CraftBukkit start import java.util.ArrayList; + +import org.bukkit.Location; import org.bukkit.Server; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.entity.CraftEntity; @@ -56,6 +58,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } public String displayName; + public Location compassTarget; // CraftBukkit end public void l() { diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 254c682d..fd17fd30 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -63,8 +63,6 @@ public class NetServerHandler extends NetHandler implements ICommandListener { Long lastPacket; // Store the last block right clicked and what type it was - private CraftBlock lastRightClicked; - private BlockFace lastRightClickedFace; private int lastMaterial; public CraftPlayer getPlayer() { @@ -513,6 +511,12 @@ public class NetServerHandler extends NetHandler implements ICommandListener { } public void b(Packet packet) { + // CraftBukkit + if (packet instanceof Packet6SpawnPosition) { + Packet6SpawnPosition packet6 = (Packet6SpawnPosition) packet; + this.e.compassTarget = new Location(getPlayer().getWorld(), packet6.a, packet6.b, packet6.c); + } + // CraftBukkit this.b.a(packet); this.g = this.f; } diff --git a/src/main/java/net/minecraft/server/ServerConfigurationManager.java b/src/main/java/net/minecraft/server/ServerConfigurationManager.java index f752e8b4..34ac6497 100644 --- a/src/main/java/net/minecraft/server/ServerConfigurationManager.java +++ b/src/main/java/net/minecraft/server/ServerConfigurationManager.java @@ -171,6 +171,7 @@ public class ServerConfigurationManager { entityplayer1.id = entityplayer.id; entityplayer1.a = entityplayer.a; entityplayer1.displayName = entityplayer.displayName; // CraftBukkit + entityplayer1.compassTarget = entityplayer.compassTarget; // CraftBukkit ((WorldServer) entityplayer.world).u.d((int) entityplayer1.locX >> 4, (int) entityplayer1.locZ >> 4); while (entityplayer.world.a(entityplayer1, entityplayer1.boundingBox).size() != 0) { |