TerraformersMC / Biolith

A biome placement mod focusing on configurability and consistent distribution of modded biomes
Other
9 stars 2 forks source link

Sub-Biome Criteria Overhaul #14

Closed Apollounknowndev closed 3 months ago

Apollounknowndev commented 3 months ago

Especially after the addition of the any_of and all_of criterion, the sub-biome criteria system has been a bit of a mess. This PR aims to resolve this by moving criteria types into a registry-like system and simplifying the process of using sub-biomes in both code and json.

Internal Changes

The SubBiomeMatcher, SubBiomeMatcherImpl, and SubBiomeMatcherMarshaller classes were removed. The primary classes in their place are:

External Changes

Mods

Any references to the SubBiomeMatcher class itself should be changed to CriterionBuilder. Any references to the class in method references should be changed to Criterion. Examples of changes:

Datapacks

Todo

gniftygnome commented 3 months ago

This is timely, since I was going to stabilize the API as soon as I figure out the End issue I'm working on. Also, it's pretty much all stuff that's been on my to-do list for some time. From a very quick review, I think it can be merged as-is followed by a few minor code style changes. I need to:

gniftygnome commented 3 months ago

I don't think Criteria was necessarily wrong. The problem is a Criterion can be a container of multiple criteria. When you talk about the object it probably makes more sense for it to be called Criterion, but when you are passing them around as arguments it usually makes more sense to call them criteria... I think this is actually why I created the Matcher as a container of criteria in the first place. Then somebody had to ask for sub-containers........ :laughing:

gniftygnome commented 3 months ago

I want to get this released soon and I have time today, so I'll just merge and adjust. But please feel free to ping me with any comments.