How alrex-u/parcool works
Project type and purpose
• ParCool is a Minecraft “mod” (plugin) built on the Forge API.
• Its goal is to extend player movement and animations—parkour-style actions—while exposing an API for other modders and packaging a guide via Patchouli.
High-level architecture & main components
• Common Core
• Client Module
• Server Module
• API & External Integration
Additionally, include a “Resources & Data Packs” component to capture JSON assets, models, sounds, and the Patchouli guide.
Break down each subsystem
A. Common Core (shared code)
– Action processor: classes under common/action → defines Action, BehaviorEnforcer, StaminaConsumeTiming
– Capability providers & storage: common/capability → Animation, Stamina, Parkourability, plus storage backends
– Block & item registry: common/block, common/item → Registers zipline hooks, ropes
– Network messaging: common/network → SimpleChannel messages (SyncStamina, SyncActionState, etc.)
– Utilities: common/utilities → math, easing, model helpers
B. Client Module
– Proxy entry: ClientProxy
– GUI / HUD: api/client/gui + client/gui + client/hud → ParCoolSettingScreen, HUDRegistry, StaminaHUD
– Animation engine: client/animation → Animator, AnimatorList, per-action Animator implementations
– Input & keybinding: client/input → KeyBindings, KeyRecorder → drives ParCoolActionEvent
– Rendering: client/renderer → custom RenderTypes, entity renderer for ziplines
– Event enforcer: RenderBehaviorEnforcer
C. Server Module
– Proxy entry: ServerProxy
– Command registration: server/command → CommandRegistry, ControlLimitationCommand
– Limitation logic: server/limitation → ActionLimitation, Limitations
– Login/logout & clone handlers: handlers for sync and state initialization
D. API & External Integration
– Stable API: api package → Attributes, Effects, SoundEvents, Stamina interfaces
– Unstable hooks: api/unstable → ParCoolActionEvent, ParCoolAnimationInfoEvent, Limitation extensions
– Extern adapters: extern → ModManager, AdditionalMods, integration with BetterThirdPerson, ShoulderSurfing
E. Resources & Data Packs
– Assets: models, textures, sounds under resources/assets/parcool
– Data: loot_tables, recipes, advancements, Patchouli books in resources/data/parcool
– Metadata: META-INF/mods.toml, mixin configs
Relationships & data flow
• User Input → Client Input Handler → Action Processor (common)
• Action Processor → Capability updates → Network SyncMessage → Server & back to Client
• EventBus: Forge’s event bus triggers ParCoolActionEvent and ParCoolAnimationInfoEvent subscribers
• Server Commands/API → Limitation providers → sync back to clients
• Client draws based on capability state → Renderer / Animator → HUD
Architectural patterns & principles
• Proxy Pattern: CommonProxy / ClientProxy / ServerProxy to separate environment-specific code
• Event-Driven: Forge EventBus, custom events for actions & animations
• Capability System: Forge capabilities for attaching per-entity data (stamina, animation)
• Modular Animation: strategy pattern via Animator implementations per action
• Resource-Driven: JSON-driven assets and data packs (recipes, Patchouli guide)
Diagramming recommendations
– Grey for Common Core
– Blue for Client Module
– Green for Server Module
– Yellow for API/External
– Orange for Resources & Data
– From “Minecraft + Forge” into each Proxy entry point
– Between modules for data flow (Input → Processor → Network → Renderer, etc.)
• Interactions: “EventBus subscription,” “SimpleChannel message,” “Capability attach,” “JSON data load”