Permalink
Browse files

Database inside Quest object for addons to store their information.

Signed-off-by: Robert Xu <robxu9@gmail.com>
  • Loading branch information...
1 parent 06c65a1 commit fbc3dd59ddccc46bef0eefb9ac35fc1912e9399e @robxu9 robxu9 committed Apr 14, 2012
@@ -30,6 +30,7 @@
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeMap;
@@ -98,6 +99,11 @@
public String world;
public boolean loadworld;
public boolean nether;
+
+ /**
+ * For addons to store their data
+ */
+ public Map<String,Object> database;
/*
* Constructor will start the quest for the user.
@@ -134,16 +140,15 @@ protected Quest(long questid, String id) {
loadworld = false;
activeTask = null;
+
+ database = Collections.synchronizedMap(new LinkedHashMap<String,Object>());
// DEFAULTS end
try {
MineQuest.questManager.parser.parseDefinition(this);
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
}
-
- System.out.println("THIS TOSTRING");
- System.out.println(events);
// sort the tasks, events, and targets in order of id.
// because we have absolutely 0 idea if someone would skip numbers...
@@ -319,11 +324,6 @@ public TargetDetails getTarget(int id) {
return targets.get(id);
}
- public List<String> getDisallowedAbilities() {
- // TODO not done yet
- return new ArrayList<String>();
- }
-
public Location getSpawnLocation() {
return new Location(Bukkit.getWorld(world), spawnPoint[0],
spawnPoint[1], spawnPoint[2]);
@@ -67,7 +67,7 @@
protected final String locationofQuests;
private LinkedHashMap<Long,Quest> quests;
private long questid;
- protected final QuestParser parser;
+ public final QuestParser parser;
public QuestManager(){
MineQuest.log("[Quest] Starting Manager...");

0 comments on commit fbc3dd5

Please sign in to comment.