mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-09 04:20:42 +01:00
Notch decided that the sun rises north and sets south.
"Corrected" values for /getpos and /compass
This commit is contained in:
parent
d658c75cec
commit
164070b487
@ -17,15 +17,6 @@ public class PlayerExtension extends PlayerWrapper
|
|||||||
this.ess = ess;
|
this.ess = ess;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getCorrectedYaw()
|
|
||||||
{
|
|
||||||
float angle = (getLocation().getYaw() - 90.0f) % 360.0f;
|
|
||||||
if (angle < 0) {
|
|
||||||
angle += 360.0f;
|
|
||||||
}
|
|
||||||
return angle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void showInventory(IInventory inventory)
|
public void showInventory(IInventory inventory)
|
||||||
{
|
{
|
||||||
getHandle().a(inventory);
|
getHandle().a(inventory);
|
||||||
|
@ -15,7 +15,7 @@ public class Commandcompass extends EssentialsCommand
|
|||||||
@Override
|
@Override
|
||||||
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
|
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
|
||||||
{
|
{
|
||||||
int r = (int)user.getCorrectedYaw();
|
int r = (int)user.getLocation().getYaw();
|
||||||
String dir;
|
String dir;
|
||||||
if (r < 23) dir = "N";
|
if (r < 23) dir = "N";
|
||||||
else if (r < 68) dir = "NE";
|
else if (r < 68) dir = "NE";
|
||||||
|
@ -19,7 +19,7 @@ public class Commandgetpos extends EssentialsCommand
|
|||||||
user.sendMessage("§7X: " + coords.getBlockX() + " (-North <-> +South)");
|
user.sendMessage("§7X: " + coords.getBlockX() + " (-North <-> +South)");
|
||||||
user.sendMessage("§7Y: " + coords.getBlockY() + " (+Up <-> -Down)");
|
user.sendMessage("§7Y: " + coords.getBlockY() + " (+Up <-> -Down)");
|
||||||
user.sendMessage("§7Z: " + coords.getBlockZ() + " (+East <-> -West)");
|
user.sendMessage("§7Z: " + coords.getBlockZ() + " (+East <-> -West)");
|
||||||
user.sendMessage("§7Yaw: " + user.getCorrectedYaw() + " (Rotation)");
|
user.sendMessage("§7Yaw: " + coords.getYaw() + " (Rotation)");
|
||||||
user.sendMessage("§7Pitch: " + coords.getPitch() + " (Head angle)");
|
user.sendMessage("§7Pitch: " + coords.getPitch() + " (Head angle)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user