Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package lilian.xteam;
- import lilian.xteam.commands.FreezeCommand;
- import lilian.xteam.commands.IpCommand;
- import lilian.xteam.commands.KillStreakCommand;
- import lilian.xteam.commands.PingCommand;
- import lilian.xteam.listener.EnderPearlListener;
- import lilian.xteam.listener.FreezeListener;
- import lilian.xteam.listener.GoldenAppleListener;
- import lilian.xteam.listener.HeadListener;
- import lilian.xteam.listener.KillStreakListener;
- import lilian.xteam.listener.PickaxeListener;
- import lilian.xteam.listener.PlayerKillDeathListener;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.event.Listener;
- import org.bukkit.plugin.Plugin;
- import org.bukkit.plugin.java.JavaPlugin;
- import org.bukkit.scoreboard.DisplaySlot;
- import org.bukkit.scoreboard.Objective;
- import org.bukkit.scoreboard.Scoreboard;
- public class Main extends JavaPlugin{
- public static Main plugin;
- public Objective o; //Creates a objective called o
- public Scoreboard timerBoard = null; //Creates a scoreboard called timerBoard(You will see what thats used for later)
- public Objective timerObj = null; // Same as above but it creates a objective called timerObj
- public Main() {
- }
- public void onEnable() {
- plugin = this;
- registerEvents(this, new HeadListener(), new FreezeListener(), new GoldenAppleListener(), new PickaxeListener(), new KillStreakListener(), new PlayerKillDeathListener(), new EnderPearlListener(null));
- getCommand("freeze").setExecutor(new FreezeCommand());
- getCommand("ks").setExecutor(new KillStreakCommand());
- getCommand("ping").setExecutor(new PingCommand());
- getCommand("ip").setExecutor(new IpCommand());
- getConfig().options().copyDefaults(true);
- saveConfig();
- Scoreboard board = Bukkit.getServer().getScoreboardManager().getNewScoreboard();
- o = board.registerNewObjective("timer", "dummy"); //Registering the objective needed for the timer
- o.setDisplayName(ChatColor.BOLD + "" + ChatColor.GOLD + "xTeam Faction Soupe"); // Setting the title for the scoreboard. This would look like: TCGN | Walls
- o.setDisplaySlot(DisplaySlot.SIDEBAR); //Telling the scoreboard where to display when we tell it to display
- this.timerBoard = board; //Setting timerBoard equal to board.
- this.timerObj = o; //Setting timerObj equal to o. This makes it so we can access it by typing plugin.timerObj
- }
- public void onDisable() {
- plugin = null;
- }
- public static void registerEvents(org.bukkit.plugin.Plugin plugin, Listener... listeners) {
- for (Listener listener : listeners) {
- Bukkit.getServer().getPluginManager().registerEvents(listener, plugin);
- }
- }
- public static Plugin getPlugin() {
- return plugin;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement