13
0
geforkt von Mirrors/Paper

Implement player.getCompassTarget

By: Erik Broes <erikbroes@grum.nl>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2011-03-25 21:22:03 +01:00
Ursprung 2b32c8242e
Commit 1a013161ec

Datei anzeigen

@ -125,7 +125,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void setCompassTarget(Location loc) {
getHandle().a.b(((Packet) (new Packet6SpawnPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()))));
// Do not directly assign here, from the packethandler we'll assign it.
getHandle().a.b((Packet) new Packet6SpawnPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
}
public Location getCompassTarget() {
return getHandle().compassTarget;
}
public void chat(String msg) {
@ -159,6 +164,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
newEntity.locX = location.getX();
newEntity.locY = location.getY();
newEntity.locZ = location.getZ();
newEntity.compassTarget = entity.compassTarget;
newWorld.u.d((int) location.getBlockX() >> 4, (int) location.getBlockZ() >> 4);
teleportSuccess = newEntity.a.teleport(location);
@ -176,6 +182,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
entity.a.e = newEntity;
this.entity = newEntity;
setCompassTarget(getCompassTarget());
}
return teleportSuccess;