diff --git a/plugins/load_config.py b/plugins/load_config.py index f685054..0c02a62 100644 --- a/plugins/load_config.py +++ b/plugins/load_config.py @@ -1,28 +1,13 @@ import json -from dataclasses import dataclass from typing import Dict, List, cast -from attr import dataclass from pydantic import BaseModel -from beet import Context, Predicate, configurable +from beet import Context, configurable from beet.core.utils import JsonDict from bolt import Runtime DEFAULT_MATCH = [ "config/**/*.json" ] -@dataclass -class Config: - content: JsonDict - - def __getitem__(self, key: str): - return self.content[key] - - def __setitem__(self, key: str, value: any): - self.content[key] = value - - def get_all(self, key: str): - return [ value for cfg in self.content.values() if (value := cfg.get(key)) ] - class ConfigLoaderOptions(BaseModel): match: List[str] = DEFAULT_MATCH @@ -58,12 +43,6 @@ def merge_config(config: JsonDict, contents: Dict, id: str): if ore.get("state"): ore.pop("tag", None) ore.pop("mining_level", None) - drops = ore["drops"] - if ore.get("self_drops", True): - drops.append(ore["block"]) # ores might drop themselves - for i, item in enumerate(drops): - if type(item) is str: - drops[i] = { "id": item } if cond := contents.get("condition"): value["condition"] = cond if type(cond) is list else [ cond ]