Fix pom.xml

This commit is contained in:
fullwall 2012-02-17 15:48:20 +08:00
parent c47e7c0b50
commit 64559a9579
3 changed files with 19 additions and 12 deletions

16
pom.xml
View File

@ -11,25 +11,21 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<bukkit.version>1.1-R4</bukkit.version> <bukkit.version>1.1-R4-SNAPSHOT</bukkit.version>
<craftbukkit.version>1.1-R4</craftbukkit.version> <craftbukkit.version>1.1-R4-SNAPSHOT</craftbukkit.version>
<build.number>Unknown</build.number> <build.number>Unknown</build.number>
</properties> </properties>
<repositories> <repositories>
<repository>
<id>craftbukkit-repo</id>
<url>http://repo.bukkit.org/org/bukkit/craftbukkit/${craftbukkit.version}/craftbukkit-${craftbukkit.version}.jar</url>
</repository>
<repository> <repository>
<id>bukkit-repo</id> <id>bukkit-repo</id>
<url>http://repo.bukkit.org/org/bukkit/bukkit/${bukkit.version}/bukkit-${bukkit.version}.jar</url> <url>http://repo.bukkit.org/content/groups/public/</url>
</repository> </repository>
<repository>
<!-- This does not work yet. Need repo to be set up. <repository>
<id>citizensapi-repo</id> <id>citizensapi-repo</id>
<!-- This does not work yet. Need repo to be set up. -->
<url>http://repo.citizensnpcs.net</url> <url>http://repo.citizensnpcs.net</url>
</repository> </repository>-->
</repositories> </repositories>
<dependencies> <dependencies>

View File

@ -2,6 +2,7 @@ package net.citizensnpcs;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.sql.SQLException;
import java.util.List; import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
@ -164,7 +165,13 @@ public class Citizens extends JavaPlugin {
// NPC storage // NPC storage
if (Setting.USE_DATABASE.asBoolean()) { if (Setting.USE_DATABASE.asBoolean()) {
saves = new DatabaseStorage(); try {
saves = new DatabaseStorage(Setting.DATABASE_DRIVER.asString(), Setting.DATABASE_URL.asString(),
Setting.DATABASE_USERNAME.asString(), Setting.DATABASE_PASSWORD.asString());
} catch (SQLException e) {
Messaging.log("Unable to connect to database, falling back to YAML");
saves = new YamlStorage(getDataFolder() + File.separator + "saves.yml", "Citizens NPC Storage");
}
} else { } else {
saves = new YamlStorage(getDataFolder() + File.separator + "saves.yml", "Citizens NPC Storage"); saves = new YamlStorage(getDataFolder() + File.separator + "saves.yml", "Citizens NPC Storage");
} }

View File

@ -35,7 +35,11 @@ public class Settings {
QUICK_SELECT("npc.selection.quick-select", false), QUICK_SELECT("npc.selection.quick-select", false),
SELECTION_ITEM("npc.selection.item", 280), SELECTION_ITEM("npc.selection.item", 280),
SELECTION_MESSAGE("npc.selection.message", "<b>You selected <a><npc><b>!"), SELECTION_MESSAGE("npc.selection.message", "<b>You selected <a><npc><b>!"),
USE_DATABASE("use-database", false); USE_DATABASE("use-database", false),
DATABASE_PASSWORD("database.password", ""),
DATABASE_USERNAME("database.username", ""),
DATABASE_URL("database.url", ""),
DATABASE_DRIVER("database.driver", "");
private String path; private String path;
private Object value; private Object value;