mchorse / metamorph

Morphing mod for Minecraft 1.12.2
Other
72 stars 42 forks source link

Implement sparse morph settings, compute health/speed when not provided #287

Closed asanetargoss closed 1 year ago

asanetargoss commented 2 years ago

Hello, there! This is the probably the largest major pull request based on a subset of current Changeling's differences from Metamorph. Its main focus is an overhaul of the settings system to support "sparse" morph settings. This is done in a way that shouldn't break add-ons that depend on Metamorph.

From a user's perspective, the main difference is that health and speed are calculated automatically for entity-based morphs that have not been configured yet. This allows for a better morphing experience by default, and makes it less tedious to customize morphs. Some morph speeds may not be calculated correctly, but it should work for most modded mobs that are based on vanilla mobs.

From a technical perspective, sparse morph settings allows for incremental configuration of morphs over time. This has the following impact on the Metamorph code:

Chryfi commented 2 years ago

Thank you, I will review as soon as I have time again.

asanetargoss commented 2 years ago

One additional detail regarding the current implementation as of this commit: hasAbilities, hasAttack, etc have been made true by default for theoretical backwards compatibility reasons, i.e. an addon initializing a MorphSettings object for some purpose.

If we want to discourage the use of hasAbilities and the others, due to future refactoring, I can mark them as @Deprecated

asanetargoss commented 1 year ago

Per your request, I've adjusted whitespace to have a blank line before and after control blocks.

Chryfi commented 1 year ago

Thank you 👍