Skip to content

Refactor mining speed logic into common modules#3

Merged
Meatwo310 merged 5 commits into
mainfrom
refactor/common-logic
May 2, 2026
Merged

Refactor mining speed logic into common modules#3
Meatwo310 merged 5 commits into
mainfrom
refactor/common-logic

Conversation

@Meatwo310

@Meatwo310 Meatwo310 commented Apr 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Move block/tag cache construction and mining-speed decisions into version common SoftDeepslateLogic modules.
  • Introduce a shared server config contract, config entry definitions, and common ID/tag validation helpers for Forge and Neo.
  • Add generic config entry models under net.meatwo310.mdk.config for simple values, ranges, lists, enums, whitelists, and validated values.
  • Keep Forge/Neo modules responsible for config registration, event subscription, and loader-specific registry/tag adapters.

Commit Structure

  • refactor(...): move mining speed logic into common modules
  • refactor(...): introduce shared server config contract
  • refactor(...): add generic config entry models

Validation

  • ./gradlew.bat build

@Meatwo310 Meatwo310 marked this pull request as ready for review April 30, 2026 07:15
@Meatwo310 Meatwo310 force-pushed the refactor/common-logic branch 2 times, most recently from a810d8e to 486f8a3 Compare May 1, 2026 02:18
@Meatwo310 Meatwo310 force-pushed the refactor/common-logic branch from 24a4a9a to 63e1cdf Compare May 1, 2026 14:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors deepslate mining-speed behavior and server config definitions into shared/common modules so loader-specific code (Forge/Neo) focuses on registration/events and registry/tag adaptation.

Changes:

  • Introduces a shared SoftDeepslateLogic (per MC version) that owns block/tag caching and mining-speed decisions.
  • Adds a loader-agnostic server config contract + shared config entry metadata (ModServerConfigEntries) and ID/tag validation helpers.
  • Adds generic ConfigEntry record models (range/list/enum/etc.) under net.meatwo310.mdk.config.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
common/src/main/java/net/meatwo310/softdeepslate/config/ModServerConfigValidator.java Shared ID/tag validation contract for loader configs.
common/src/main/java/net/meatwo310/softdeepslate/config/ModServerConfigEntries.java Centralizes mining speed + block/tag list keys/defaults/comments.
common/src/main/java/net/meatwo310/softdeepslate/config/ModServerConfig.java Common interface for accessing server config values.
common/src/main/java/net/meatwo310/mdk/config/ConfigEntry.java Base model for config entry metadata.
common/src/main/java/net/meatwo310/mdk/config/ConfigSimpleEntry.java Simple value config entry model.
common/src/main/java/net/meatwo310/mdk/config/ConfigRangeEntry.java Range-bounded config entry model.
common/src/main/java/net/meatwo310/mdk/config/ConfigListEntry.java List config entry model (plus new-element value).
common/src/main/java/net/meatwo310/mdk/config/ConfigInListEntry.java “Value must be one of allowed values” entry model.
common/src/main/java/net/meatwo310/mdk/config/ConfigEnumEntry.java Enum config entry model.
common/src/main/java/net/meatwo310/mdk/config/ConfigValidatedEntry.java Predicate-validated config entry model.
26.1-neo/src/main/java/net/meatwo310/softdeepslate/config/ServerConfig.java Neo server config now pulls definitions from shared entries + shared validator.
26.1-neo/src/main/java/net/meatwo310/softdeepslate/ModMain.java Neo event handler now delegates mining-speed decisions/cache to SoftDeepslateLogic.
26.1-common/src/main/java/net/meatwo310/softdeepslate/SoftDeepslateLogic.java Common cache + mining-speed logic for 26.1 line (Identifier-based).
1.20.1-forge/src/main/java/net/meatwo310/softdeepslate/config/ServerConfig.java Forge server config now pulls definitions from shared entries + shared validator (Forge-specific defaults).
1.20.1-forge/src/main/java/net/meatwo310/softdeepslate/ModMain.java Forge event handler now delegates mining-speed decisions/cache to SoftDeepslateLogic.
1.20.1-common/src/main/java/net/meatwo310/softdeepslate/SoftDeepslateLogic.java Common cache + mining-speed logic for 1.20.1 line (ResourceLocation-based).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread 1.20.1-forge/src/main/java/net/meatwo310/softdeepslate/ModMain.java
@Meatwo310 Meatwo310 merged commit 6fdba0a into main May 2, 2026
16 checks passed
@Meatwo310 Meatwo310 deleted the refactor/common-logic branch May 2, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants