🔌 API- & Addon-Integrationsleitfaden
Agrarian Reform ist tief in DasikLibrary integriert und bietet offene Schnittstellen für Drittanbieter-Mods und Datapacks.
📚 DasikLibrary API-Abhängigkeiten
Agrarian Reform setzt auf DasikLibrary (>=1.8.3) als Kerninfrastruktur:
| DasikLibrary API-Modul | Verwendung in Agrarian Reform | Zweck |
|---|---|---|
DynamicGameRuleManager | AgrarianGameRules.java, AgrarianCropRules.java | Saubere Registrierung dynamischer GameRules mit GSON-Sync und Weltspeicherung. |
ConfigHelper | AgrarianConfig.java | Lädt und speichert versionierte globale JSON-Konfigurationsvorlagen. |
🌾 AgrarianCropRules Öffentliche Fassade
Drittanbieter-Mods können den Pflanzen-Cache und die Wachstumsformeln programmgesteuert abfragen:
java
// Check if a block is recognized as an agricultural crop
boolean isCrop = AgrarianCropRules.isCropBlock(myBlock);
// Query effective growth speed multiplier (respects frozen -1, positive override, global fallback)
int effectiveMultiplier = AgrarianCropRules.getEffectiveGrowthMultiplier(level, myBlock);
// Check if a block state is at its maximum harvestable age
boolean maxAge = AgrarianCropRules.isMaxAge(blockState);🏷️ Eigene Datapack-Tag-Integrationen
1. Rüstungs-Tag für Leisen Tritt (#agrarian_reform:soft_step_boots)
Füge eigene Stiefel oder Rüstungen hinzu, um Ackerböden vor Zertrampeln zu schützen:
data/agrarian_reform/tags/item/soft_step_boots.json:
json
{
"replace": false,
"values": [
"mymod:padded_leather_boots",
"mymod:farmer_shoes"
]
}2. Pflanzen-Tag für das Kontinuum (#agrarian_reform:continuum_plants & #c:crops)
Eigene Pflanzen explizit im Offline-Wachstumssimulator registrieren:
data/agrarian_reform/tags/block/continuum_plants.json:
json
{
"replace": false,
"values": [
"mymod:custom_corn_crop",
"mymod:custom_tomato_bush"
]
}See also: Pflanzenregister und universelle Feldfrüchte and Architektur und Mixin-Ziele.
