Mazetar

Plugin 0.1

Jun 13th, 2011
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.98 KB | None | 0 0
  1. public class StikkCommands extends Plugin{
  2.      public static String name = "StikkCommands";
  3.     public static String version = "1.0";
  4.     private StikkCommandsListener listener = new StikkCommandsListener();
  5.    
  6.    
  7.     public void disable()
  8.     {    
  9.     }
  10.  
  11.     public void enable()
  12.     {
  13.     }
  14.     public void initialize()
  15.     {
  16.         etc.getLoader().addListener(PluginLoader.Hook.COMMAND, listener, this, PluginListener.Priority.MEDIUM);
  17.        
  18.         PropertiesFile props = new PropertiesFile("MyComs.properties");
  19.         props.setString("commands", "/");
  20.     }
  21.  
  22.     private class StikkCommandsListener extends PluginListener
  23.     {
  24.         public boolean onCommand(Player player, String[] split) {
  25.             String com = props.getString("commands");
  26.             if (com.contains(split[0])) {
  27.             String message = props.getString(split[0]+"=");
  28.             player.sendMessage(message);
  29.             return true;
  30.             }
  31.            
  32.             return false;
  33.             }
  34.    
  35.        
  36.     }  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment