Guest User

Untitled

a guest
Sep 30th, 2014
204
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package r3.electrohd.r3serv;
  2.  
  3. import java.io.File;
  4.  
  5. import org.bukkit.Bukkit;
  6. import org.bukkit.Location;
  7. import org.bukkit.plugin.PluginManager;
  8. import org.bukkit.plugin.java.JavaPlugin;
  9.  
  10. import de.kumpelblase2.remoteentities.CreateEntityContext;
  11. import de.kumpelblase2.remoteentities.EntityManager;
  12. import de.kumpelblase2.remoteentities.RemoteEntities;
  13. import de.kumpelblase2.remoteentities.api.RemoteEntityType;
  14. import r3.electrohd.r3serv.R3Chat;
  15. import r3.electrohd.r3serv.R3Coins;
  16. import r3.electrohd.r3serv.R3Focus;
  17. import r3.electrohd.r3serv.R3Grief;
  18. import r3.electrohd.r3serv.R3Management;
  19. import r3.electrohd.r3serv.R3Stats;
  20.  
  21. public class Main extends JavaPlugin {
  22.  
  23. R3Chat R3Chat = new R3Chat(this);
  24. R3Coins R3Coins = new R3Coins(this);
  25. R3Focus R3Focus = new R3Focus(this);
  26. R3Grief R3Grief = new R3Grief(this);
  27. R3Management R3Management = new R3Management(this);
  28. R3Stats R3Stats = new R3Stats(this);
  29. R3Stats R3Report = new R3Stats(this);
  30. R3Team R3Team = new R3Team(this);
  31. private EntityManager manager;
  32.  
  33. public void onEnable() {
  34. System.out.println("[R3Serv] Enabled");
  35. events();
  36.  
  37. manager = RemoteEntities.createManager(this);
  38.  
  39. File f = new File(this.getDataFolder(), "config.yml");
  40. if (!(f.exists())) {
  41. try {
  42. getConfig().options().copyDefaults(false);
  43. getConfig().set("NomDuServeur", "R3Serv");
  44. getConfig().set("Server", "R3Box");
  45. saveDefaultConfig();
  46. } catch (Exception e) {
  47. e.printStackTrace();
  48. }
  49.  
  50. getCommand("chat").setExecutor(new R3Chat(this));
  51. getCommand("gg").setExecutor(new R3Chat(this));
  52. getCommand("gf").setExecutor(new R3Chat(this));
  53. getCommand("gl").setExecutor(new R3Chat(this));
  54. getCommand("cc").setExecutor(new R3Chat(this));
  55. getCommand("lock").setExecutor(new R3Chat(this));
  56. getCommand("unlock").setExecutor(new R3Chat(this));
  57. getCommand("suicide").setExecutor(new R3Chat(this));
  58. getCommand("msg").setExecutor(new R3Chat(this));
  59. getCommand("focus").setExecutor(new R3Focus(this));
  60. getCommand("help2").setExecutor(new R3Management(this));
  61. getCommand("ip").setExecutor(new R3Management(this));
  62. getCommand("help2").setExecutor(new R3Management(this));
  63. getCommand("ban").setExecutor(new R3Management(this));
  64. getCommand("unban").setExecutor(new R3Management(this));
  65. getCommand("kick").setExecutor(new R3Management(this));
  66. getCommand("mute").setExecutor(new R3Management(this));
  67. getCommand("unmute").setExecutor(new R3Management(this));
  68. getCommand("reason").setExecutor(new R3Management(this));
  69. getCommand("pinfo").setExecutor(new R3Management(this));
  70. getCommand("stats").setExecutor(new R3Stats(this));
  71. getCommand("resetstats").setExecutor(new R3Stats(this));
  72. getCommand("r3stats").setExecutor(new R3Stats(this));
  73. getCommand("report").setExecutor(new R3Report(this));
  74. getCommand("check").setExecutor(new R3Report(this));
  75. getCommand("team").setExecutor(new R3Team(this));
  76. getCommand("r3report").setExecutor(new R3Report(this));
  77.  
  78.  
  79. }
  80.  
  81. }
  82.  
  83. public void spawnNPC(String name, Location loc) {
  84. CreateEntityContext c = manager
  85. .prepareEntity(RemoteEntityType.Villager)
  86. .asPushable(true)
  87. .asStationary(true)
  88. .atLocation(loc)
  89. .withName(name);
  90.  
  91. c.create();
  92.  
  93. }
  94.  
  95.  
  96. public void events() {
  97. PluginManager pm = Bukkit.getServer().getPluginManager();
  98. pm.registerEvents(R3Chat, this);
  99. pm.registerEvents(R3Coins, this);
  100. pm.registerEvents(R3Focus, this);
  101. pm.registerEvents(R3Grief, this);
  102. pm.registerEvents(R3Management, this);
  103. pm.registerEvents(R3Stats, this);
  104. pm.registerEvents(R3Report, this);
  105. pm.registerEvents(R3Team, this);
  106. }
  107.  
  108. public void onDisable() {
  109. System.out.println("[R3Serv] Disabled");
  110. }
  111.  
  112.  
  113. }
RAW Paste Data