Hey guys, i try to make recipes based of config options, but i can`t find the problem here, all recipes linked to an config options are always disabled and theres no error in the console, maybe a problem in the factories?
ConditionsFactory
public class ConditionFactory implements IConditionBuilder {
//@Override
public BooleanSupplier parse(JsonSerializationContext context, JsonObject json) {
boolean value = JSONUtils.getBoolean(json , "value", true);
String key = JSONUtils.getString(json, "type");
if (key.equals(Uncrafted.MODID + ":spawneggs_enabled")) {
return () -> Config.ACTIVATE_SPAWNEGG_RECIPES.get().booleanValue() == value;
}
else if (key.equals(Uncrafted.MODID + ":spawner_enabled")) {
return () -> Config.ACTIVATE_SPAWNER_RECIPES.get().booleanValue() == value;
}
else if (key.equals(Uncrafted.MODID + ":skulls_enabled")) {
return () -> Config.ACTIVATE_SKULL_RECIPES.get().booleanValue() == value;
}
return null;
}
}
_factories.json
{
"conditions": {
"spawneggs_enabled": "xxrexraptorxx.util.ConditionFactory",
"spawner_enabled": "xxrexraptorxx.util.ConditionFactory",
"skulls_enabled": "xxrexraptorxx.util.ConditionFactory"
}
}
example recipe: spawner.json
{
"conditions" : [
{
"type" : "uncrafted:spawner_enabled",
"value" : true
} ],
"type": "minecraft:crafting_shaped",
"pattern": [
"XXX",
"X#X",
"XXX"
],
"key": {
"X": {
"item": "minecraft:iron_bars"
},
"#": {
"item": "minecraft:nether_star"
}
},
"result": {
"item": "minecraft:spawner"
}
}
i hope anyone can help me