Advertisement
Bluethekiller

Main

Apr 30th, 2016
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. package de.Jonas.fly;
  2.  
  3.  
  4.  
  5. import org.bukkit.Bukkit;
  6. import org.bukkit.command.Command;
  7. import org.bukkit.command.CommandSender;
  8. import org.bukkit.entity.Player;
  9. import org.bukkit.plugin.PluginManager;
  10. import org.bukkit.plugin.java.JavaPlugin;
  11.  
  12. import Commands.fly;
  13. import Commands.gamemode;
  14. import Commands.heal;
  15. import Commands.waffe;
  16. import Commands.waffenliste;
  17. import Listener.JoinListener;
  18. import Listener.Waffen;
  19.  
  20. public class main extends JavaPlugin{
  21.  
  22. public static String fly = "fly.use";
  23. public static String gm = "fly.gamemode";
  24. String world = getConfig().getString("Config.world");
  25. String world2 = getConfig().getString("Config.world2");
  26. public static String fehler = "§cBenutze </fly> <on|off|author>!";
  27.  
  28.  
  29.  
  30. @Override
  31. public void onEnable() {
  32.  
  33. loadConfig();
  34. getCommand("fly").setExecutor(new fly());
  35. getCommand("gma").setExecutor(new gamemode());
  36. getCommand("gmc").setExecutor(new gamemode());
  37. getCommand("gms").setExecutor(new gamemode());
  38. getCommand("waffe").setExecutor(new waffe());
  39. getCommand("waffenliste").setExecutor(new waffenliste());
  40. getCommand("heal").setExecutor(new heal());
  41.  
  42. PluginManager pm = this.getServer().getPluginManager();
  43. pm.registerEvents(new Waffen(), this);
  44. pm.registerEvents(new JoinListener(), this);
  45.  
  46. System.out.println("[FLY] wurde erfolgreich gestartet");
  47. }
  48. @Override
  49. public void onDisable() {
  50. System.out.println("[FLY] wurde erfolgreich gestoppt");
  51. }
  52. public void loadConfig() {
  53. getConfig().options().copyDefaults(true);
  54. saveConfig();
  55.  
  56. }
  57. @Override
  58. public boolean onCommand(CommandSender s, Command c, String label, String[] args) {
  59.  
  60. Player p = (Player) s;
  61. if(c.getName().equalsIgnoreCase("hub")) {
  62. p.teleport(Bukkit.getWorld(world).getSpawnLocation());
  63. p.sendMessage("§cDu bist nun am Spawn");
  64. }
  65. if(c.getName().equalsIgnoreCase("ffa")) {
  66. p.teleport(Bukkit.getWorld(world2).getSpawnLocation());
  67. p.sendMessage("§cDu bist nun bei FFA");
  68. }
  69.  
  70. return true;
  71. }
  72.  
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement