Skip to content

fix: Auto-register unregistered players instead of producing errors#41

Merged
Zen-d merged 1 commit intomasterfrom
fix/auto-register-players
Feb 21, 2026
Merged

fix: Auto-register unregistered players instead of producing errors#41
Zen-d merged 1 commit intomasterfrom
fix/auto-register-players

Conversation

@Chafficui
Copy link
Member

@Chafficui Chafficui commented Feb 21, 2026

Summary

  • Adds MiningPlayer.getOrCreateMiningPlayer(UUID) that returns an existing player or creates a new one (level 0, 0 XP) on the fly
  • Replaces all getMiningPlayer() + null-check-with-error patterns across 8 files with the new auto-registering method
  • Bumps MiningLevels version to 1.3.1 and CrucialLib dependency to 3.0.1
  • Documents the auto-registration behavior in docs/installation.md

Test plan

  • All 533 existing tests pass
  • Verify on a server: delete a player from players.json, have them mine a block — they should be auto-registered instead of getting an error
  • Verify /ml self, /miningrewards, and PlaceholderAPI placeholders work for a previously unregistered player

🤖 Generated with Claude Code

Players missing from players.json now get automatically created (level 0,
0 XP) on the fly instead of failing with cryptic errors or silently
cancelling events. Adds MiningPlayer.getOrCreateMiningPlayer() and
updates all call sites. Bumps version to 1.3.1 and CrucialLib to 3.0.1.

Co-Authored-By: Claude <noreply@anthropic.com>
@Zen-d Zen-d self-requested a review February 21, 2026 17:05
Copy link
Contributor

@Zen-d Zen-d left a comment

Choose a reason for hiding this comment

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

lgtm

@Zen-d Zen-d merged commit 39f6ac0 into master Feb 21, 2026
1 check passed
@Zen-d Zen-d deleted the fix/auto-register-players branch February 21, 2026 17:06
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