🏗️ Architektur und Mixin-Injektionsreferenz
Dieses Dokument beschreibt die Paketarchitektur, Test-Suites und liefert eine Übersicht aller Java-Mixin-Injektionen in Agrarian Reform.
📦 Paket- und Verzeichnishierarchie
net.instantgratification.agrarianreform
├── AgrarianGameRules.java # 15 static GameRules & transient debug mode
├── AgrarianReformFabric.java # ModInitializer entrypoint, lifecycle hooks, 6D use-block
├── client
│ └── AgrarianReformClient.java # ClientModInitializer & morning moisture tint
├── config
│ ├── AgrarianConfig.java # Global JSON config template (Schema v2) & dirty-tracking
│ ├── ModMenuIntegration.java # ModMenu API integration
│ └── YaclScreenHelper.java # Isolated 3-tab YACL v3 client GUI builder
├── continuum
│ ├── ContinuumData.java # SavedDataType dimension persistence & 30-day pruning
│ ├── ContinuumManager.java # ServerChunkEvents listeners & 5-crops/tick queue
│ └── CropScanner.java # Sub-chunk palette pre-filtering & speed estimator
├── crop
│ └── AgrarianCropRules.java # O(1) universal crop auto-population & dynamic GameRules
├── mixin
│ ├── BlockColorsMixin.java # Client block color provider intercept
│ ├── BlockStateBaseMixin.java # Random tick speedup/slowdown & max-age early-break
│ ├── CropBlockMixin.java # Growth speed, rain spurt, rustle sound mixin
│ └── FarmlandBlockMixin.java # Soft Step trample & Chebyshev concentric hydration
├── util
│ ├── AgrarianTags.java # Datapack tag keys (#c:crops, #soft_step_boots)
│ ├── GrowthHelper.java # Concentric Chebyshev math, bare-foot trample logic
│ ├── ModVersionGuard.java # Startup API class check guard (Knot resolution)
│ └── SoundHelper.java # Audio debouncing & primitive Int2Long collectionsHeadless-Testarchitektur (src/test/java)
net.instantgratification.agrarianreform
├── config
│ └── AgrarianConfigTest.java # Schema stability, multiplier hierarchy, dirty tracking
└── continuum
└── ContinuumMathTest.java # Delta math, frozen scaling, 30-day pruning, Chebyshev geometry🎯 Vollständige Mixin-Injektionstabelle
| Mixin-Klasse | Minecraft-Zielklasse | Annotation & Injektionspunkt | Zweck |
|---|---|---|---|
FarmlandBlockMixin | net.minecraft.world.level.block.FarmlandBlock | @Inject(method = "fallOn", at = @At("HEAD"), cancellable = true) | Fängt Trampeln mit Barfuß-Prüfung, Leisem Tritt und Immunitätsregeln ab. |
FarmlandBlockMixin | net.minecraft.world.level.block.FarmlandBlock | @Inject(method = "isNearWater", at = @At("HEAD"), cancellable = true) | Ersetzt 4-Block-Reichweite durch konzentrische Tschebyschow-Ringe ($r=1 \to \text{maxRange}$). |
CropBlockMixin | net.minecraft.world.level.block.CropBlock | @ModifyReturnValue(method = "getGrowthSpeed", at = @At("RETURN")) | Verleiht +10% Wachstumsbonus für benachbarte unterschiedliche Feldfrüchte (Mischkultur). |
CropBlockMixin | net.minecraft.world.level.block.CropBlock | @Inject(method = "randomTick", at = @At("HEAD"), cancellable = true) | Regen-Wachstumsschub (beschleunigt Reifung bei Niederschlag). |
CropBlockMixin | net.minecraft.world.level.block.CropBlock | @Inject(method = "randomTick", at = @At("RETURN")) | Erzeugt grüne Dorfbewohner-Glückspartikel beim Erreichen einer neuen Stufe. |
CropBlockMixin | net.minecraft.world.level.block.CropBlock | @Inject(method = "entityInside", at = @At("HEAD")) | Löst Raschelgeräusche mit Drosselungs-Cooldowns pro Entität aus. |
BlockStateBaseMixin | net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase | @Inject(method = "randomTick", at = @At("HEAD"), cancellable = true) | Skaliert Wachstumsgeschwindigkeit bei Zufallsticks und bricht bei Reife vorzeitig ab. |
BlockColorsMixin | net.minecraft.client.color.block.BlockColors | @Inject(method = "createDefault", at = @At("RETURN")) | Registriert morgendliche Taufärbung für feuchten Ackerboden (Ticks 23000 bis 2000). |
💾 Weltspeicherung vs. Chunk-NBT-Architektur
Agrarian Reform entkoppelt Zeitstempeldaten strikt von den individuellen Chunk-Dateien:
┌─────────────────────────────────────────────────────────────┐
│ STORAGE SEPARATION │
├─────────────────────────────────────────────────────────────┤
│ 1. DIMENSION STORAGE (data/agrarian_reform_continuum.dat) │
│ ├── ContinuumData (SavedDataType) │
│ └── Stores Map<ChunkPos (Long), UnloadTimestamp (Long)> │
│ └── Auto-prunes entries older than 30 days on save │
│ └── Zero impact on chunk NBT or chunk dirty flags │
│ │
│ 2. CHUNK STORAGE (region/r.X.Z.mca) │
│ ├── LevelChunk NBT (Block States, Tile Entities) │
│ └── ChunkAccess.unsaved flag │
│ └── Only marked TRUE when setBlock() changes a state │
└─────────────────────────────────────────────────────────────┘See also: Das Kontinuum (Offline-Wachstum), Leistung und Warteschlangen-Drosselung, and Entwickler-Setup und Kompilierung.
