Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ca.thecow;
- import org.bukkit.entity.Player;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.player.PlayerJoinEvent;
- import org.bukkit.plugin.PluginManager;
- import org.bukkit.plugin.java.JavaPlugin;
- import org.bukkit.scoreboard.Scoreboard;
- import ca.thecow.commands.BedCommand;
- import ca.thecow.commands.DayCommand;
- import ca.thecow.commands.NightCommand;
- import ca.thecow.commands.SellCommand;
- import ca.thecow.commands.SwordCommand;
- import ca.thecow.ecownomie.MoneyCommand;
- import ca.thecow.ecownomie.SqlConnection;
- public class TestPlugins extends JavaPlugin implements Listener{
- public static Scoreboard board;
- public SqlConnection sql;
- @Override
- public void onEnable(){
- getLogger().info("ENABLED PLUGIN");
- saveDefaultConfig();
- Listener l = new PluginsListener();
- PluginManager pm = getServer().getPluginManager();
- pm.registerEvents(l, this);
- getCommand("day").setExecutor(new DayCommand());
- getCommand("night").setExecutor(new NightCommand());
- getCommand("bed").setExecutor(new BedCommand());
- getCommand("chest").setExecutor(new SwordCommand());
- getCommand("sell").setExecutor(new SellCommand(sql));
- sql = new SqlConnection("jdbc:mysql://", "localhost", "servermc", "root", "");
- sql.connection();
- getServer().getPluginManager().registerEvents(this, this);
- getCommand("money").setExecutor(new MoneyCommand(sql));
- }
- @Override
- public void onDisable(){
- getLogger().info("DISABLED PLUGIN");
- sql.disconnect();
- }
- @EventHandler
- public void join(PlayerJoinEvent e){
- Player p = e.getPlayer();
- sql.createAccount(p);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement