How reider745/zotecoreloader works
Major architectural domains
• Server Core / Kernel: The main entry point (e.g. the “Main.java” and other key classes in com/reider745) that boots the server, handles bootstrapping and configuration (including reading server.properties and zotecore.yml).
• Mod Loader & Hooks: There is extensive code for hooking into game behavior, instrumenting classes, and processing mods (see com/reider745/api/hooks, modloader directories under com/zhekasmirnov/apparatus and innercore/mod). This component handles loading modpacks, scanning mod directories, and processing custom behavior.
• Network & Protocol Handling: Components in com/reider745/network, as well as Inner Core network adapters and socket handling (reference to socket-server settings and classes like ClientOnly) manage client connections, protocol version checks, and packet processing.
• Game Logic & World Management: Directories such as com/reider745/behavior, block, world, and entity show that in-game object management and environment processing (including dimensions and spawn rules) are key subsystems.
• Scripting and Data-driven Layers: The presence of coreengine scripts, JSON recipe files and config directories in src/main/resources (e.g. innercore/coreengine, innercore/assets) indicates an interpreted/scripting component that allows dynamic modification of gameplay (such as custom recipes and translations).
• Build & Dependency Infrastructure: The Gradle build files, Gradle wrapper and the “iclibs” directory for external libraries (including Nukkit-MOT jar) represent the underlying dependency and build mechanism.
How the components interact
• The Server Core initializes the system by loading configuration settings from files (zotecore.yml, server.properties). It then instantiates key subsystems (network, mod loader, game world) in an ordered bootstrapping process.
• The Mod Loader uses hook APIs (in com/reider745/api/hooks) to inject behavior into game engine classes. It works closely with the core engine (Inner Core and apparatus modules) to register mods, custom items, and block behaviors.
• The Network Layer accepts client connections, processes packets, and interacts with modules that send diagnostic or administrative commands (commands like ‘custom_items’, ‘tps’, etc.).
• The Game Logic layer continuously processes world ticks, dimension changes, and entity interactions. It also oversees mod behavior by coordinating with the hook systems.
• Scripting and data-driven assets (recipes, translations, textures) are loaded at startup and are referenced by the game logic and UI modules, ensuring that modpacks and themes can be updated independently.
Architectural patterns and design principles used
• Modularity: Code is separated into numerous packages (e.g. behavior, network, hooks, modloader) that isolate concerns.
• Hook/Instrumentation Pattern: The extensive “hooks” and “instrument” packages indicate runtime code modification, supporting dynamic extension or override of native methods.
• Data-Driven Design: Usage of JSON recipe files, configuration YAML files, and external asset packs shows a strong reliance on data driven configuration.
• Dependency Injection/Loose Coupling: The core uses APIs and reflective method calls (see various “Helper,” “Manager,” and “Controller” classes) so that mods can interact safely with the engine.
Final checklist
– Include labels for each package and component (e.g., com/reider745 for core, com/zhekasmirnov for engine libraries).
– Add annotations to highlight important design decisions, like the hook/instrumentation pattern and the use of a data-driven mod loading approach.