Skip to content

Add standalone Fabric 1.21.1 bootstrap - #1771

Draft
BenCodez wants to merge 4 commits into
masterfrom
fabric/phase-a-bootstrap-1.21.1
Draft

BenCodez wants to merge 4 commits into
masterfrom
fabric/phase-a-bootstrap-1.21.1

Conversation

@BenCodez

@BenCodez BenCodez commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Scope

  • Add a standalone Fabric dedicated-server module for Minecraft 1.21.1 and Java 21. It initializes local configuration and uses the shared immutable player identity for server-thread lookups.
  • Load optional read-only VoteSites.yml rules with deterministic case-insensitive matching by priority and file order. Evaluate interval and daily delay boundaries with an explicit clock and zone.
  • Leave bootstrap active when the rule file is absent, empty, or invalid. Invalid documents disable the entire snapshot and produce a bounded diagnostic.
  • Vote receipt, persistence, commands, proxy delivery, and rewards remain future work. This bootstrap registers no VotifierPlus callback.

Validation

  • Gradle 8.8 and Loom 1.7.4 built the remapped JAR and passed 11 tests for lifecycle, lookup, strict configuration parsing, and interval/daily delay boundaries.
  • Native Minecraft 1.21.1 with Fabric Loader 0.16.14 and Fabric API 0.116.5+1.21.1 started and stopped cleanly in all three scenarios: absent, valid, and malformed optional configuration. The malformed Unicode fixture loaded no rules. The smoke runs did not connect a player or deliver votes.
  • Java 21 Maven focused checks passed 22 tests. The full clean package discovered 3,369 suite tests with one skip and passed 8 packaged-artifact checks. The existing universal JAR emitted its advisory size warning.
  • Tested head 47b7fca3113f7da097bdc3980ffe6f57f479adbb, remapped Fabric JAR SHA-256 b056e3a63fa8e552a5337e6707f962d59fba0dd0ca87c57027d25746d515c07e. The JAR includes one pinned SnakeYAML 2.7 nested dependency.

Summary by CodeRabbit

  • New Features
    • Added a standalone Fabric server bootstrap for Minecraft 1.21.1, with configurable startup and shutdown logging.
    • Added online-player lookups processed on the server thread; lookups are unavailable when the bootstrap is inactive.
    • Added optional, read-only vote-site rules with alias matching, priority handling, and voting-delay checks. The bootstrap does not receive or count votes or register voting commands.
  • Documentation
    • Added setup, installation, configuration, compatibility, and feature-scope information for the Fabric bootstrap.

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Adds a Fabric dedicated-server bootstrap, validated configuration loading, read-only vote-site rules, and queued online-player lookups. The runtime processes lookups on the server thread and returns identities for online players.

Changes: Fabric Server Bootstrap

Layer / File(s) Summary
Fabric project setup
VotingPlugin-Fabric/settings.gradle, VotingPlugin-Fabric/build.gradle, VotingPlugin-Fabric/src/main/resources/fabric.mod.json, VotingPlugin-Fabric/.gitignore
Configures the Fabric Loom project for Java 21, declares Fabric and Minecraft versions, adds mod metadata, includes shared source files and the license in the build, configures JUnit Platform, and ignores root-level Gradle, build, and run directories.
Configuration loading
VotingPlugin-Fabric/src/main/java/com/bencodez/votingplugin/fabric/FabricConfiguration.java, VotingPlugin-Fabric/src/main/resources/votingplugin-fabric.properties, VotingPlugin-Fabric/src/test/java/com/bencodez/votingplugin/tests/fabric/FabricBootstrapTest.java
Loads or installs configuration defaults, validates paths and properties, and tests default creation, preservation of existing settings, and rejection of invalid configuration files.
Vote-site rules and delay gates
VotingPlugin-Fabric/src/main/java/com/bencodez/votingplugin/fabric/FabricVoteSite.java, VotingPlugin-Fabric/src/main/java/com/bencodez/votingplugin/fabric/FabricVoteSites.java, VotingPlugin-Fabric/src/test/java/com/bencodez/votingplugin/tests/fabric/FabricVoteSitesTest.java, VotingPlugin-Fabric/README.md
Loads and validates bounded YAML vote-site rules, resolves identifiers and aliases, parses delays, and applies interval and daily eligibility rules. Tests cover validation, matching, and time boundaries. The README describes the read-only rules and their behavior.
Server lifecycle and player lookup
VotingPlugin-Fabric/src/main/java/com/bencodez/votingplugin/fabric/FabricServerRuntime.java, VotingPlugin-Fabric/src/main/java/com/bencodez/votingplugin/fabric/FabricVotingPlugin.java, VotingPlugin-Fabric/src/test/java/com/bencodez/votingplugin/tests/fabric/FabricBootstrapTest.java, VotingPlugin-Fabric/README.md
Wires runtime creation, ticking, and shutdown to server lifecycle events. Queued player lookups run on the server thread, with limits and exceptional completion on lookup failures, rejection, or shutdown. Tests cover dispatch and lifecycle behavior. The README documents setup and lookup behavior.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant FabricVotingPlugin
  participant FabricServerRuntime
  participant MinecraftServer
  Caller->>FabricVotingPlugin: onlinePlayer(UUID)
  FabricVotingPlugin->>FabricServerRuntime: enqueue lookup
  FabricVotingPlugin->>FabricServerRuntime: tick at end of server tick
  FabricServerRuntime->>MinecraftServer: resolve online player
  MinecraftServer-->>FabricServerRuntime: player or no match
  FabricServerRuntime-->>Caller: complete future with optional identity
Loading
Merge Risk: Minimal · up to 47b7f

This adds a standalone Fabric server bootstrap with configuration loading, read-only vote-site rules, and bounded online-player lookups. It leaves vote handling, persistence and rewards for future work, so existing behavior is unaffected. No actionable merge-blocking issue was identified in the supplied changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "Add standalone Fabric 1.21.1 bootstrap" matches the main change in the changeset. The PR adds a new VotingPlugin-Fabric module with a dedicated-server Fabric entry point, configuration load…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "Add standalone Fabric 1.21.1 bootstrap" matches the main change in the changeset. The PR adds a new VotingPlugin-Fabric module with a dedicated-server Fabric entry point, configuration loading, server lifecycle handling, and bounded online-player lookups for Minecraft 1.21.1. The title is short, specific, and free of file lists or vague terms. It omits the vote-site rules, but those are secondary to the bootstrap.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 18d3a3db-6486-4df1-a17b-107d73207bf2
Commits

Reviewing files that changed from the base of the PR and between aa0eaef and 47b7fca.

Files selected for processing: 8

  • VotingPlugin-Fabric/README.md
  • VotingPlugin-Fabric/build.gradle
  • VotingPlugin-Fabric/src/main/java/com/bencodez/votingplugin/fabric/FabricServerRuntime.java
  • VotingPlugin-Fabric/src/main/java/com/bencodez/votingplugin/fabric/FabricVoteSite.java
  • VotingPlugin-Fabric/src/main/java/com/bencodez/votingplugin/fabric/FabricVoteSites.java
  • VotingPlugin-Fabric/src/main/java/com/bencodez/votingplugin/fabric/FabricVotingPlugin.java
  • VotingPlugin-Fabric/src/test/java/com/bencodez/votingplugin/tests/fabric/FabricBootstrapTest.java
  • VotingPlugin-Fabric/src/test/java/com/bencodez/votingplugin/tests/fabric/FabricVoteSitesTest.java

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

Recent review details

Context from checks skipped due to timeout: 3

  • GitHub Check: build
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (java-kotlin)
Additional context used

ast-grep (0.51.1)

VotingPlugin-Fabric/src/main/java/com/bencodez/votingplugin/fabric/FabricVoteSites.java

[warning] 110-110: Regular expression is compiled from a non-literal, possibly user-controlled value. A crafted regex (or input matched against one) can trigger catastrophic backtracking and hang the thread (ReDoS). Use a hardcoded literal pattern, wrap untrusted text with Pattern.quote(...), or validate/length-limit the input and enforce a matching timeout before passing it to Pattern.compile / String.matches / String.replaceAll / String.replaceFirst.
Context: site.matches(identifier)
Note: [CWE-1333] Inefficient Regular Expression Complexity.

(redos-non-literal-regex-java)

VotingPlugin-Fabric/src/test/java/com/bencodez/votingplugin/tests/fabric/FabricBootstrapTest.java

[warning] 59-59: Avoid user-generated class names for reflection
Context: Class.forName(PACKAGE + "FabricVoteSites")
Note: [CWE-470] Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection').

(unsafe-reflection-java)

[warning] 62-62: Avoid user-generated class names for reflection
Context: Class.forName(PACKAGE + "FabricServerRuntime")
Note: [CWE-470] Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection').

(unsafe-reflection-java)

VotingPlugin-Fabric/src/test/java/com/bencodez/votingplugin/tests/fabric/FabricVoteSitesTest.java

[warning] 175-175: Avoid user-generated class names for reflection
Context: Class.forName(TYPE)
Note: [CWE-470] Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection').

(unsafe-reflection-java)

Additional comments: 2

VotingPlugin-Fabric/build.gradle: 2

18-19: LGTM!

33-36: LGTM!

This branch has not been deployed

No deployments
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.

1 participant