Imperfect rituals work mostly now
Just need to figure out an issue with the config
This commit is contained in:
parent
3a0dcae59a
commit
92bf7cc35b
15 changed files with 226 additions and 64 deletions
|
@ -2,13 +2,14 @@ package WayofTime.bloodmagic.api.registry;
|
|||
|
||||
import WayofTime.bloodmagic.api.BloodMagicAPI;
|
||||
import WayofTime.bloodmagic.api.ritual.Ritual;
|
||||
import WayofTime.bloodmagic.api.ritual.imperfect.ImperfectRitual;
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class RitualRegistry {
|
||||
|
||||
public static final BiMap<Ritual, Boolean> enabledRituals = HashBiMap.create();
|
||||
private static final BiMap<Ritual, Boolean> enabledRituals = HashBiMap.create();
|
||||
private static final BiMap<String, Ritual> registry = HashBiMap.create();
|
||||
|
||||
/**
|
||||
|
@ -43,13 +44,22 @@ public class RitualRegistry {
|
|||
}
|
||||
|
||||
public static boolean ritualEnabled(Ritual ritual) {
|
||||
return enabledRituals.get(ritual);
|
||||
try {
|
||||
return enabledRituals.get(ritual);
|
||||
} catch (NullPointerException e) {
|
||||
BloodMagicAPI.getLogger().error("Invalid Ritual was called");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static BiMap<String, Ritual> getRegistry() {
|
||||
return HashBiMap.create(registry);
|
||||
}
|
||||
|
||||
public static BiMap<Ritual, Boolean> getEnabledMap() {
|
||||
return HashBiMap.create(enabledRituals);
|
||||
}
|
||||
|
||||
public static ArrayList<String> getIds() {
|
||||
return new ArrayList<String>(registry.keySet());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue