Skip to content

Architecture and Package Layout

Rifaditya edited this page Aug 9, 2026 · 1 revision

๐Ÿ›๏ธ Architecture & Package Layout

Design Principle Architectural Policy
Core Philosophy Vanilla Outsider (VO) โ€” Diegetic, non-destructive, input-consistent
Design Rule 1 File, 1 Function Law (Single-responsibility Cohesion)
Main Package Namespace net.vanillaoutsider.betterbats
Thread Safety Model Server-Thread Main Looper Sync (No async world mutation)

๐ŸŒณ ASCII Package Hierarchy Tree

net.vanillaoutsider.betterbats
โ”œโ”€โ”€ BetterBatsFabric.java             [ModInitializer: GameRules, Genetics setup]
โ”œโ”€โ”€ BetterBatsFabricClient.java       [ClientModInitializer]
โ”œโ”€โ”€ BatStateAccessor.java             [State Accessor Interface: Panic & Goals]
โ”‚
โ”œโ”€โ”€ ai
โ”‚   โ”œโ”€โ”€ BatDiveBombGoal.java          [Predatory Attack Goal on Silverfish & Endermites]
โ”‚   โ”œโ”€โ”€ BatFlightHelper.java          [3D BOIDs Flocking & Environmental Flight Steering]
โ”‚   โ”œโ”€โ”€ BatHuntLightGoal.java         [Phototaxis Light Orbiting & Banking AI Goal]
โ”‚   โ”œโ”€โ”€ BatPanicGoal.java             [Vibration Scattering Panic Flight AI Goal]
โ”‚   โ”œโ”€โ”€ BatRoostHelper.java           [Roost Surface Surface Validator Helper]
โ”‚   โ””โ”€โ”€ BatSleepGoal.java             [Photophobia Daytime Cave Roosting AI Goal]
โ”‚
โ”œโ”€โ”€ config
โ”‚   โ”œโ”€โ”€ BetterBatsConfig.java         [Config Data Record & JSON Helper]
โ”‚   โ”œโ”€โ”€ ClothConfigScreenHelper.java  [Cloth Config GUI Integration Helper]
โ”‚   โ””โ”€โ”€ ModMenuIntegration.java       [ModMenu API Screen Provider]
โ”‚
โ”œโ”€โ”€ mixin
โ”‚   โ”œโ”€โ”€ BatMixin.java                 [Core Bat Overhaul: Tick, AI, Guano, Echolocation]
โ”‚   โ”œโ”€โ”€ GameEventDispatcherMixin.java [Vibration Listener: Explosion, Step, Destroy]
โ”‚   โ”œโ”€โ”€ MobAccessor.java              [Exposes Mob.getGoalSelector()]
โ”‚   โ””โ”€โ”€ NaturalSpawnerMixin.java      [Dynamic Ambient Spawn Weight Interceptor]
โ”‚
โ””โ”€โ”€ util
    โ””โ”€โ”€ ModVersionGuard.java          [Zero-Dependency Version Safety Checker]

๐Ÿ”’ 1 File, 1 Function Architectural Law

Every class in Better Bats follows strict single-function responsibility:

  • BatFlightHelper: Purely handles vector math calculations for BOIDs flocking, ground/ceiling avoidance, and day/night flight steering.
  • BatRoostHelper: Purely evaluates block state suitability for bat hanging/roosting.
  • GameEventDispatcherMixin: Purely listens for world vibration events and triggers panic accessors.

๐Ÿ”— Related Pages

Clone this wiki locally