Implemented the Ritual Diviner and added its recipe. Added unlocalized name to rituals. Removed a few unnecessary imports.

This commit is contained in:
WayofTime 2015-12-30 11:34:04 -05:00
parent c815960f5e
commit 98ca2fbd16
12 changed files with 553 additions and 88 deletions

View file

@ -1,18 +1,21 @@
package WayofTime.bloodmagic.api.registry;
import WayofTime.bloodmagic.api.BloodMagicAPI;
import WayofTime.bloodmagic.api.ritual.Ritual;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import WayofTime.bloodmagic.api.BloodMagicAPI;
import WayofTime.bloodmagic.api.ritual.Ritual;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
public class RitualRegistry {
public static final Map<Ritual, Boolean> enabledRituals = new HashMap<Ritual, Boolean>();
private static final BiMap<String, Ritual> registry = HashBiMap.create();
// Ordered list for actions that depend on the order that the rituals were registered in
private static final ArrayList<String> orderedIdList = new ArrayList<String>();
/**
* The safe way to register a new Ritual.
@ -24,8 +27,10 @@ public class RitualRegistry {
if (ritual != null) {
if (registry.containsKey(id))
BloodMagicAPI.getLogger().error("Duplicate ritual id: %s", id);
else
else {
registry.put(id, ritual);
orderedIdList.add(id);
}
}
}
@ -65,6 +70,10 @@ public class RitualRegistry {
public static ArrayList<String> getIds() {
return new ArrayList<String>(registry.keySet());
}
public static ArrayList<String> getOrderedIds() {
return orderedIdList;
}
public static ArrayList<Ritual> getRituals() {
return new ArrayList<Ritual>(registry.values());