How timas130/playerlocatorplus works
Project type and purpose
• Player Locator Plus is a Minecraft Fabric mod (full-stack in the sense of client–server plugin).
• Purpose: track other players’ positions on the in-game experience bar, with client and server logic, configurable behavior, and mixin-based injection into Minecraft.
File structure
• Top-level files: build.gradle, settings.gradle, gradlew – standard Gradle build.
• src/client: client-only code (Java/Kotlin) + resource folder for client mixins JSON.
• src/main: shared/server code (Java/Kotlin) + resource folder containing mod metadata (fabric.mod.json), mixins.json, assets, data tags.
• Key packages:
• sh.sit.plp.config – loads/saves TOML config and handles client/server parameters.
• sh.sit.plp.network – defines S2C payload classes (ModConfigS2CPayload, PlayerLocationsS2CPayload).
• sh.sit.plp.mixin – Mixin classes injecting into Minecraft networking, command trees, HUD rendering.
• sh.sit.plp (root) – entrypoint classes (ModInitializers), BarUpdater, HUD logic, command registration.
• Resources: textures, lang files, mixin JSON, tag JSON for hiding equipment.
README
• Confirms Fabric API, Cloth Config, Kotlin usage.
• Describes server-side vs client-side config parameters and how server can push config to clients.
• Mentions networking of direction/distance data.
Main components
a. Minecraft Engine (Client & Server)
• Fabric Loader & Fabric API
• Game loop & rendering pipeline
b. Player Locator Plus Mod
• Server module (ModInitializer, network, config manager)
• Client module (ModMenu entrypoint, HUD rendering, BarUpdater, config manager)
c. Network Channel
• SimpleChannel instance for S2C messages (ModConfig, PlayerLocations)
d. Configuration subsystem
• File I/O (player-locator-plus.toml)
• Cloth Config UI (client)
• Server override logic
e. Mixin subsystem
• injection into CommandTreeS2CPacket, ArgumentTypes, InGameHud, AutoconfigGuiRegistryAccess
f. Resources
• Texture assets, lang assets, data tags (hiding_equipment.json)
Relationships & interactions
• On server tick → Server ModInitializer registers a scheduled task:
• Gathers player positions → constructs PlayerLocationsS2CPayload → sends via SimpleChannel to all clients.
• On client startup:
• Client ModInitializer registers network handlers (ModConfigS2CPayload, PlayerLocationsS2CPayload).
• Loads local TOML config → if acceptServerConfig and server sends config, client config manager merges in.
• BarUpdater listens on client tick/render events to update experience bar.
• Mixin layers:
• AutoconfigGuiRegistryAccessMixin: add mod config screen entry in Mod Menu.
• Config UI (Cloth Config) ↔ ConfigManagerClient.
• Resource assets ←→ HUD renderer (textures & language data).
Architectural patterns & design principles
• Event-driven (server tick, client tick, network message callbacks).
• Mixin injection for cross-cutting concerns (no direct edits to MC).
• Separation of concerns: config, network, rendering, utility modules.
• Data packets (DTOs) for network communication.
• Resource-driven: JSON/TOML/asset pipelines.
Relevant technologies & frameworks
• Gradle build system
• Fabric Loader / Fabric API
• Fabric Language Kotlin
• Cloth Config API
• SpongePowered Mixin
• TOML config via KTomlConfigSerializer
• Minecraft’s rendering & networking internals