Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
521
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. package me.kiffiplays.gastuploadfb;
  2.  
  3. import org.bukkit.command.Command;
  4. import org.bukkit.command.CommandSender;
  5. import org.bukkit.entity.Player;
  6. import org.bukkit.plugin.java.JavaPlugin;
  7.  
  8. public class main extends JavaPlugin {
  9.  
  10. @SuppressWarnings("deprecation")
  11. @Override
  12. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  13.  
  14. if (!(sender instanceof Player)) {
  15. sender.sendMessage("Du musst ein Spieler sein!");
  16. }
  17.  
  18. Player p = (Player) sender;
  19.  
  20. if (cmd.getName().equalsIgnoreCase("fallingblock")) {
  21. if (args.length == 1) {
  22. try {
  23. String[] string = args[0].split(":");
  24. int ID = Integer.valueOf(string[0]);
  25. int Byte = Integer.valueOf(string[1]);
  26.  
  27. p.getWorld().spawnFallingBlock(p.getLocation(), ID, (byte) Byte);
  28. p.sendMessage("§aDu hast den Block mit der ID §b" + ID + ":" + Byte + " §agespawnt!");
  29. } catch (NumberFormatException ex) {
  30. p.sendMessage("§aDu musst eine Zahl angeben!");
  31. }
  32. }
  33. }
  34. return true;
  35. }
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement