SHARE
TWEET

Main

a guest Aug 12th, 2016 100 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package ca.thecow;
  2.  
  3.  
  4. import org.bukkit.entity.Player;
  5. import org.bukkit.event.EventHandler;
  6. import org.bukkit.event.Listener;
  7. import org.bukkit.event.player.PlayerJoinEvent;
  8. import org.bukkit.plugin.PluginManager;
  9. import org.bukkit.plugin.java.JavaPlugin;
  10. import org.bukkit.scoreboard.Scoreboard;
  11.  
  12. import ca.thecow.commands.BedCommand;
  13. import ca.thecow.commands.DayCommand;
  14.  
  15. import ca.thecow.commands.NightCommand;
  16. import ca.thecow.commands.SellCommand;
  17. import ca.thecow.commands.SwordCommand;
  18. import ca.thecow.ecownomie.MoneyCommand;
  19. import ca.thecow.ecownomie.SqlConnection;
  20.  
  21. public class TestPlugins extends JavaPlugin implements Listener{
  22.    
  23.     public static Scoreboard board;
  24.     public SqlConnection sql;
  25.    
  26.     @Override
  27.     public void onEnable(){
  28.         getLogger().info("ENABLED PLUGIN");
  29.         saveDefaultConfig();
  30.         Listener l =  new PluginsListener();
  31.         PluginManager pm = getServer().getPluginManager();
  32.         pm.registerEvents(l, this);
  33.         getCommand("day").setExecutor(new DayCommand());
  34.         getCommand("night").setExecutor(new NightCommand());
  35.         getCommand("bed").setExecutor(new BedCommand());
  36.         getCommand("chest").setExecutor(new SwordCommand());
  37.         getCommand("sell").setExecutor(new SellCommand(sql));
  38.         sql = new SqlConnection("jdbc:mysql://", "localhost", "servermc", "root", "");
  39.         sql.connection();
  40.         getServer().getPluginManager().registerEvents(this, this);
  41.         getCommand("money").setExecutor(new MoneyCommand(sql));
  42.     }
  43.    
  44.     @Override
  45.     public void onDisable(){
  46.         getLogger().info("DISABLED PLUGIN");
  47.         sql.disconnect();
  48.     }  
  49.     @EventHandler
  50.     public void join(PlayerJoinEvent e){
  51.         Player p = e.getPlayer();
  52.         sql.createAccount(p);
  53.        
  54.     }
  55. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top