Skip to content

🔌 API およびアドオン統合開発者ガイド

Agrarian ReformDasikLibrary と緊密に連携し、他MODやデータパックからの拡張に対応しています。


📚 DasikLibrary API 依存モジュール

Agrarian Reform は基盤部分に DasikLibrary (>=1.8.3) を活用しています:

DasikLibrary API モジュール当 MOD での利用箇所目的
DynamicGameRuleManagerAgrarianGameRules.java, AgrarianCropRules.javaGSON 同期とワールド保存を兼ね備えた名前空間付き動的ゲームルールの登録。
ConfigHelperAgrarianConfig.javaスキーマ移行に対応したグローバル設定 JSON テンプレートの読み書き。

🌾 AgrarianCropRules パブリックファサード

他 MOD からプログラム経由で作物のキャッシュ情報や成長計算式を参照できます:

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);

🏷️ カスタムデータパックタグ統合

1. 軽歩対応フットウェアタグ (#agrarian_reform:soft_step_boots)

耕地を踏み荒らしから守る追加のブーツや防具を登録:

data/agrarian_reform/tags/item/soft_step_boots.json:

json
{
  "replace": false,
  "values": [
    "mymod:padded_leather_boots",
    "mymod:farmer_shoes"
  ]
}

2. コンティニュアム植物タグ (#agrarian_reform:continuum_plants & #c:crops)

オフライン成長シミュレーター「コンティニュアム」へ独自植物を登録:

data/agrarian_reform/tags/block/continuum_plants.json:

json
{
  "replace": false,
  "values": [
    "mymod:custom_corn_crop",
    "mymod:custom_tomato_bush"
  ]
}

See also: 作物レジストリと汎用作物 and アーキテクチャと Mixin ターゲット.

Official documentation & web portal for Dasik Igaijinn mods.