Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package r3.electrohd.r3serv;
- import java.io.File;
- import org.bukkit.Bukkit;
- import org.bukkit.Location;
- import org.bukkit.plugin.PluginManager;
- import org.bukkit.plugin.java.JavaPlugin;
- import de.kumpelblase2.remoteentities.CreateEntityContext;
- import de.kumpelblase2.remoteentities.EntityManager;
- import de.kumpelblase2.remoteentities.RemoteEntities;
- import de.kumpelblase2.remoteentities.api.RemoteEntityType;
- import r3.electrohd.r3serv.R3Chat;
- import r3.electrohd.r3serv.R3Coins;
- import r3.electrohd.r3serv.R3Focus;
- import r3.electrohd.r3serv.R3Grief;
- import r3.electrohd.r3serv.R3Management;
- import r3.electrohd.r3serv.R3Stats;
- public class Main extends JavaPlugin {
- R3Chat R3Chat = new R3Chat(this);
- R3Coins R3Coins = new R3Coins(this);
- R3Focus R3Focus = new R3Focus(this);
- R3Grief R3Grief = new R3Grief(this);
- R3Management R3Management = new R3Management(this);
- R3Stats R3Stats = new R3Stats(this);
- R3Stats R3Report = new R3Stats(this);
- R3Team R3Team = new R3Team(this);
- private EntityManager manager;
- public void onEnable() {
- System.out.println("[R3Serv] Enabled");
- events();
- manager = RemoteEntities.createManager(this);
- File f = new File(this.getDataFolder(), "config.yml");
- if (!(f.exists())) {
- try {
- getConfig().options().copyDefaults(false);
- getConfig().set("NomDuServeur", "R3Serv");
- getConfig().set("Server", "R3Box");
- saveDefaultConfig();
- } catch (Exception e) {
- e.printStackTrace();
- }
- getCommand("chat").setExecutor(new R3Chat(this));
- getCommand("gg").setExecutor(new R3Chat(this));
- getCommand("gf").setExecutor(new R3Chat(this));
- getCommand("gl").setExecutor(new R3Chat(this));
- getCommand("cc").setExecutor(new R3Chat(this));
- getCommand("lock").setExecutor(new R3Chat(this));
- getCommand("unlock").setExecutor(new R3Chat(this));
- getCommand("suicide").setExecutor(new R3Chat(this));
- getCommand("msg").setExecutor(new R3Chat(this));
- getCommand("focus").setExecutor(new R3Focus(this));
- getCommand("help2").setExecutor(new R3Management(this));
- getCommand("ip").setExecutor(new R3Management(this));
- getCommand("help2").setExecutor(new R3Management(this));
- getCommand("ban").setExecutor(new R3Management(this));
- getCommand("unban").setExecutor(new R3Management(this));
- getCommand("kick").setExecutor(new R3Management(this));
- getCommand("mute").setExecutor(new R3Management(this));
- getCommand("unmute").setExecutor(new R3Management(this));
- getCommand("reason").setExecutor(new R3Management(this));
- getCommand("pinfo").setExecutor(new R3Management(this));
- getCommand("stats").setExecutor(new R3Stats(this));
- getCommand("resetstats").setExecutor(new R3Stats(this));
- getCommand("r3stats").setExecutor(new R3Stats(this));
- getCommand("report").setExecutor(new R3Report(this));
- getCommand("check").setExecutor(new R3Report(this));
- getCommand("team").setExecutor(new R3Team(this));
- getCommand("r3report").setExecutor(new R3Report(this));
- }
- }
- public void spawnNPC(String name, Location loc) {
- CreateEntityContext c = manager
- .prepareEntity(RemoteEntityType.Villager)
- .asPushable(true)
- .asStationary(true)
- .atLocation(loc)
- .withName(name);
- c.create();
- }
- public void events() {
- PluginManager pm = Bukkit.getServer().getPluginManager();
- pm.registerEvents(R3Chat, this);
- pm.registerEvents(R3Coins, this);
- pm.registerEvents(R3Focus, this);
- pm.registerEvents(R3Grief, this);
- pm.registerEvents(R3Management, this);
- pm.registerEvents(R3Stats, this);
- pm.registerEvents(R3Report, this);
- pm.registerEvents(R3Team, this);
- }
- public void onDisable() {
- System.out.println("[R3Serv] Disabled");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement