AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Minetest mods animals9/19/2023 ![]() What I’ve explained so far indicates that a high-level mod like mobs redo assumes many things by the time it is loaded. Reduce the number of assumptions regarding names of accessors. Even then, they may not want all of the behaviors in your mod, so if you put your registrations in a separate mod, users can choose whether to use the behaviors your programmed or just your nodes/craftitems. You can give them free choice by depending on a mod that offers definitions (registrations) rather than behaviors. You don’t have to make them use behaviors from some other mod. If this article applies to you, someone is already going to use your mod. Let people choose how their project behaves. The headings below show why this is better. Then mods don’t have to depend on your specific mobs mod and assume which materials are present. You can change your mobs mod to depend on the animalmaterials mod or a mod like it (mods like default and basic_materials use the same idea, being low-level mods which primarily define materials for use by other mods). I can’t guarantee anyone else will care about this modpack in particular due to being tied to mobf, but I also plan to make mobf optional in other mods in this modpack (even making it optional forces it to be a high-level mod, but that is probably ok for mods in the animalmaterials modpack other than the animalmaterials mod). My fork based on this antum branch will be useful to what I’m doing. Core devs are even encouraging mods not to depend on default. With minetest_game planned to not ship with minetest anymore and people to fork it, mods such as basic_materials and possibly even animalmaterials will become more important for the reasons above. minetest.override_item is useful in those cases from their end since those high-level mods personalize behavior as players and server owners wish. Therefore, the better way to integrate the mods listed in this commit are to make them utilize a common low-level mod (animalmaterials). Every time you add a dependency, that mod and mods that mod requires can no longer utilize animalmaterials, because they must load before it. I don’t know if you care about this mod anymore, but this commit and 00fd6a5 defeat the single advantage of animalmaterials: to be a low-level dependency that other mobs mods and various mods can utilize to help them integrate with each other and not register duplicate craftitems. I commented on the related commits (f6fc55b and 00fd6a5) as follows, which is also the TLDR version of this article: AntumMT’s antum branch had added the “mobs” dependency. My fork is a fork of AntumMT’s fork of sapier’s animalmaterials modpack. For example, the Minetest cooking mod depends on animalmaterials and doesn’t have to depend on any specific mobs mod. ![]() The purpose of a low-level module (such as a low-level minetest mod that primarily provides registrations) is to define things that multiple other modules can use (In game modding, mod is short for modification rather than module, but the principle applies to both). The animalmaterials modpack is an excellent case study on the general Computer Science topic of why definitions should be in a module that is separate from the behaviors. I started to write a long “ readme” for why I forked animalmaterials in 2021 (about 4 years after it was abandoned) and it became this article. This is not as important in true object-oriented programming (OOP) languages like C#, but in Lua or even C++ there is still an issue of order-of-definition. Have you ever wondered why there are so many circular dependencies in your project? Maybe you’ve made reusable code in your project and made everything into components (or at least a good number of them, like Drupal 9 tried to do better than previous versions), but the order in which dependencies should be determined is unclear.
0 Comments
Read More
Leave a Reply. |