How saberslay/slayercore works
1. What this repo is
- SlayerCore is a Java/Maven library with a small Spigot/Paper plugin layer on top.
- The code is organized as a reusable “core” utility toolkit plus a Minecraft-specific integration package.
2. Top-level split: core vs Spigot
- com.saberslay.slayercore.core contains framework-agnostic utilities.
- com.saberslay.slayercore.spigot contains platform-specific plugin code that depends on the Spigot runtime and likely acts as the entrypoint for Minecraft server usage.
- This is the main architectural boundary in the repo.
3. Plugin/runtime entrypoint
- SlayerCore.java is the main plugin class, backed by src/main/resources/plugin.yml.
- That means the Spigot side is deployed as a plugin jar, not a standalone app.
- The plugin layer likely wires registration and listeners during server startup.
4. Logging subsystem
- core.logging provides a colored terminal logger with Logger, Level, and ANSI color support via ConsoleColors.
- The README shows this as a general-purpose console output API with timestamped, level-based messages.
- This subsystem is purely output-facing; it does not depend on Spigot.
5. Audio / composition subsystem
- core.composers.NokiaComposer generates simple Nokia-style monophonic tones.
- The README shows synchronous/asynchronous playback and configurable note length, play style, looping, and volume.
- Architecturally, this is an independent utility module that spawns background playback work rather than blocking the caller.
6. Asset I/O subsystem
- core.io.ImageLoader and SpriteSheet indicate image loading and sprite slicing utilities.
- This layer is where external files become in-memory assets, likely for game/tooling use.
- It is separate from plugin logic, so the repo can support visual resources without hardwiring them to Minecraft APIs.
7. Serialization subsystem
- core.serialization contains a small type system: SCBase, SCObject, SCArray, SCString, SCField, SCDatabase, plus Type, ContainerType, and SerializationUtils.
- The shape suggests a custom structured-data model with nested objects/arrays and typed fields.
- This is likely the repo’s main data interchange layer for converting domain objects into a serialized form and back.
8. System and metadata utilities
- core.system.AppInfo reads application metadata, and the README ties it to Maven jar manifest entries.
- This creates a build-time/runtime bridge: the jar must be packaged with implementation entries so version info is available at runtime.
9. Formatting and time helpers
- core.formatting.NumberFormatter handles numeric presentation.
- core.time.Time likely provides time abstractions or conversions used by logging and other utilities.
- These are small supporting utilities rather than major subsystems.
10. Spigot custom-item flow
- spigot.CustomItem, ItemRegistry, and listeners.CustomItemListener form a small item-management pipeline.
- The registry likely stores custom item definitions; the listener reacts to game events and routes them through those definitions.
- This is the main game-facing behavior in the plugin layer.
11. Dependencies and boundaries
- The repo appears self-contained: no database, message broker, or external service integration is visible.
- The only obvious runtime dependency is the Spigot API for the plugin side; everything else is internal utility code.
- Most subsystems are reusable independently, which is why they live under core rather than inside the plugin package.
12. How to think about the architecture diagram
- Draw a central core library box with branches for logging, serialization, IO/assets, audio composition, formatting/time, and system metadata.
- Draw a separate spigot box that consumes core utilities and exposes plugin lifecycle, item registry, and event listeners.
- Show resource/package inputs flowing into the core utilities: console output, image files, serialized data, and plugin metadata/version info.
Main entry points: core Core · spigot Spigot · logging Logging · SlayerCore.java SlayerCore
Components 18
Core library
Framework-agnostic utilities shared by the repo.
- Core · Reusable utility toolkit and shared foundation.
src/main/java/com/saberslay/slayercore/core - Logging · Colored, level-based console logging.
src/main/java/com/saberslay/slayercore/core/logging - Serialization · Structured custom serialization types and helpers.
src/main/java/com/saberslay/slayercore/core/serialization - Image I/O · Image loading and sprite-sheet slicing utilities.
src/main/java/com/saberslay/slayercore/core/io - Composer · Monophonic tone composition and playback support.
src/main/java/com/saberslay/slayercore/core/composers/NokiaComposer.java - Formatting · Numeric formatting utilities.
src/main/java/com/saberslay/slayercore/core/formatting/NumberFormatter.java - Time · Time abstractions and conversions.
src/main/java/com/saberslay/slayercore/core/time/Time.java - App Info · Reads application and manifest metadata.
src/main/java/com/saberslay/slayercore/core/system/AppInfo.java - Logger · Primary logging API.
src/main/java/com/saberslay/slayercore/core/logging/Logger.java - Level · Logging severity definitions.
src/main/java/com/saberslay/slayercore/core/logging/Level.java - Colors · ANSI terminal color support.
src/main/java/com/saberslay/slayercore/core/logging/ConsoleColors.java - SC Types · Base, object, array, string, field, database, and type metadata.
src/main/java/com/saberslay/slayercore/core/serialization
Spigot plugin
Minecraft server integration built on the core library.
- Spigot · Minecraft plugin integration on top of the core library.
src/main/java/com/saberslay/slayercore/spigot - SlayerCore · Spigot plugin bootstrap and lifecycle entrypoint.
src/main/java/com/saberslay/slayercore/spigot/SlayerCore.java - Custom Item · Plugin-side custom item definition.
src/main/java/com/saberslay/slayercore/spigot/CustomItem.java - Registry · Stores and resolves custom item definitions.
src/main/java/com/saberslay/slayercore/spigot/ItemRegistry.java - Item Listener · Responds to server events and applies custom-item behavior.
src/main/java/com/saberslay/slayercore/spigot/listeners/CustomItemListener.java
Resources
Runtime metadata and plugin descriptor files.
- plugin.yml · Spigot plugin metadata and entrypoint declaration.
src/main/resources/plugin.yml
Connections 23
- Core → Logging: contains · Core library is decomposed into logging.
- Core → Serialization: contains · Core library is decomposed into serialization.
- Core → Image I/O: contains · Core library is decomposed into asset I/O.
- Core → Composer: contains · Core library includes audio composition utilities.
- Core → Formatting: contains · Core library includes formatting helpers.
- Core → Time: contains · Core library includes time helpers.
- Core → App Info: contains · Core library includes runtime metadata helpers.
- Logging → Logger: implemented by · Logger is the main logging API.
- Logging → Level: uses · Logging relies on severity levels.
- Logging → Colors: uses · Logging uses ANSI color codes.
- Serialization → SC Types: contains · Serialization package groups the structured data types.
- Serialization → SC Types: uses · Serialization utilities operate on the type model.
- Spigot → SlayerCore: contains · Spigot layer is anchored by the plugin entrypoint.
- Spigot → Custom Item: contains · Spigot layer defines custom item behavior.
- Spigot → Registry: contains · Spigot layer manages custom items through a registry.
- Spigot → Item Listener: contains · Spigot layer reacts to server events with listeners.
- SlayerCore → plugin.yml: declared in · Plugin entrypoint is wired by the plugin descriptor.
- SlayerCore → Registry: initializes · Plugin bootstrap likely registers custom items.
- SlayerCore → Item Listener: registers · Plugin bootstrap registers event listeners.
- Item Listener → Custom Item: dispatches · Listener routes game events through custom item logic.
- Registry → Custom Item: stores · Registry holds custom item definitions.
- Spigot → Core: depends on · Plugin layer consumes reusable core utilities.
- App Info → plugin.yml: reads metadata from · Runtime metadata is aligned with packaged plugin/build info.