| 123456789101112131415161718192021222324252627 |
- package me.lethunderhawk.minion.registry;
- import me.lethunderhawk.minion.api.MinionType;
- import java.util.HashMap;
- import java.util.Map;
- public class MinionRegistry {
- private static final Map<String, MinionType> TYPES = new HashMap<>();
- public static void register(MinionType type) {
- TYPES.putIfAbsent(type.getId(), type);
- }
- public static MinionType get(String id) {
- return TYPES.get(id);
- }
- public static boolean exists(String id) {
- return TYPES.containsKey(id);
- }
- public static Map<String, MinionType> getAllRegisteredTypes() {
- return TYPES;
- }
- }
|