CommandPosition.java 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package me.km.commands;
  2. import me.kt.api.Utils;
  3. import me.kt.api.GlobalText;
  4. import me.kt.api.Module;
  5. import me.kt.api.ModuleCommand;
  6. import org.bukkit.Location;
  7. import org.bukkit.block.Block;
  8. import org.bukkit.command.CommandSender;
  9. import org.bukkit.entity.Player;
  10. public class CommandPosition extends ModuleCommand
  11. {
  12. public CommandPosition(Module m)
  13. {
  14. super("position", m);
  15. this.setDescription("Zeigt deine Position an");
  16. this.setUsage("/position");
  17. this.setPermission("kt.position");
  18. }
  19. @Override
  20. public boolean execute(CommandSender cs, String string, String[] arg)
  21. {
  22. if(!(cs instanceof Player))
  23. {
  24. this.getModule().send(cs, GlobalText.onlyPlayer());
  25. return true;
  26. }
  27. Player p = (Player) cs;
  28. Module m = this.getModule();
  29. m.send(cs, "Welt: " + p.getWorld().getName());
  30. Location l = p.getLocation();
  31. m.send(cs, "Koordinaten: " + l.getX() + " | " + l.getY() + " | " + l.getZ());
  32. m.send(cs, "Yaw: " + l.getYaw());
  33. m.send(cs, "Pitch: " + l.getPitch());
  34. return true;
  35. }
  36. }