Project MMO

Project MMO

10M Downloads

API: Supplying Configurations

Caltinor opened this issue ยท 0 comments

commented

Describe the solution you'd like
A way to provide, in code, what datapack values provide. for example

APIUtils.addRequirement(Items.DIAMOND_PICKAXE, ReqType.TOOL, Map.of("mining", 40));
APIUtils.addRequirement(ModBlocks.RITUAL_ALTAR, ReqType.PLACE, Map.of("magic", 20));

APIUtils.addXpAward(ModEntities.CREEPY_SPIDER, EventType.KILL, Map.of("slayer": 50, "combat": 10));
APIUtils.addXpAward(ModItems.SPIDER_BONKER, EventType.CRAFT, Map.of("crafting": 500));

Why is this feature needed
The API Currently lets users override behavior but does not give them a way to supply configurations that conform to the standard behavior. The underlying system this would require would also facilitate CT support.

Describe alternatives you've considered
touching internals and modifying the maps dynamically. big ole nope from me fam.

Additional context
Because data reloads and wipes the maps of data, configurations supplied via code need to be cached in a way that they can be reapplied after data has been loaded. This cached invocation will then be used to apply the changes after data reload, preserving the sequence of application (ie code after data).