summaryrefslogtreecommitdiff
path: root/src/main/java/net/benjidial/nswp/Plugin.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/benjidial/nswp/Plugin.java')
-rw-r--r--src/main/java/net/benjidial/nswp/Plugin.java20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/main/java/net/benjidial/nswp/Plugin.java b/src/main/java/net/benjidial/nswp/Plugin.java
index 45509a7..94c652e 100644
--- a/src/main/java/net/benjidial/nswp/Plugin.java
+++ b/src/main/java/net/benjidial/nswp/Plugin.java
@@ -5,7 +5,6 @@ import net.benjidial.nswp.commands.*;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.logging.Logger;
-import java.util.logging.Level;
import java.sql.SQLException;
import java.io.File;
@@ -13,23 +12,30 @@ public class Plugin extends JavaPlugin {
public static Logger logger;
public void onEnable() {
+
logger = getLogger();
getDataFolder().mkdirs();
try {
Database.connect(new File(getDataFolder(), "database.db").getPath());
+ Database.createWBacks();
+ Database.createTPATable();
}
catch (SQLException ex) {
- logger.log(Level.SEVERE, "Database error: (not enabling plugin)");
+ logger.severe("Database error (not enabling plugin):");
ex.printStackTrace();
return;
}
- getCommand("wlist" ).setExecutor(new ListWaypoints());
- getCommand("wsave" ).setExecutor(new SaveWaypoint());
- getCommand("wtp" ).setExecutor(new TeleportToWaypoint());
- getCommand("wdel" ).setExecutor(new DeleteWaypoint());
- getCommand("wback" ).setExecutor(new WaypointBack());
+ getCommand("wtpallow").setExecutor(new AllowTPA());
+ getCommand("wdel").setExecutor(new DeleteWaypoint());
+ getCommand("wtpdeny").setExecutor(new DenyTPA());
+ getCommand("wlist").setExecutor(new ListWaypoints());
getCommand("wrename").setExecutor(new RenameWaypoint());
+ getCommand("wsave").setExecutor(new SaveWaypoint());
+ getCommand("wtp").setExecutor(new TeleportToWaypoint());
+ getCommand("wtpa").setExecutor(new TPA());
+ getCommand("wback").setExecutor(new WaypointBack());
+
}
}