HaniiPuppy

Untitled

Jan 4th, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.22 KB | None | 0 0
  1. import java.util.logging.Logger;
  2. import org.bukkit.Bukkit;
  3. import org.bukkit.event.Listener;
  4. import org.bukkit.plugin.java.JavaPlugin;
  5.  
  6. /**
  7.  * Repository for general static methods.
  8.  * @author Hanii Puppy <[email protected]>
  9.  */
  10. public class SM
  11. {
  12.     /**
  13.      * Initialises the static methods class, assigning values to variables required.
  14.      * @param plugin The instance of the plugin.
  15.      */
  16.     public static void initialise(JavaPlugin plugin)
  17.     {
  18.         SM.plugin = plugin;
  19.         logger = plugin.getLogger();
  20.     }
  21.  
  22.     static JavaPlugin plugin;
  23.     static Logger logger;
  24.  
  25.     /**
  26.      * Gets the instance of the SimpleSplegg plugin.
  27.      * @return The Simple Splegg plugin.
  28.      */
  29.     public static JavaPlugin getPlugin()
  30.     { return plugin; }
  31.  
  32.     /**
  33.      * Registers a listener.
  34.      * @param listenertoregister The listener class to register.
  35.      */
  36.     public static void registerListener(Listener listenertoregister)
  37.     { Bukkit.getPluginManager().registerEvents(listenertoregister, plugin); }
  38.  
  39.     /**
  40.      * Prints a message to the console.
  41.      * @param message The message to print.
  42.      */
  43.     public static void print(String message)
  44.     { logger.info(message); }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment