Skip to content

Release 1.0.0 - #1

Merged
tastybento merged 3 commits into
masterfrom
develop
Oct 4, 2026
Merged

tastybento merged 3 commits into
masterfrom
develop

Conversation

@tastybento

Copy link
Copy Markdown
Member

First release of IslandStats: statistics kept per island rather than per player, starting with mob deaths.

What's in it

  • Counting — EntityDeathEvent at MONITOR, with early exits for players, ignored types and non-game-mode worlds, then one island grid lookup and an in-memory increment. Two stats per entity type: KILL_ENTITY (killed by a player on the island) and ENTITY_DEATH (died on the island from any cause, including mob farms).
  • Storage — BentoBox database API, one IslandStatsData record per island keyed by island id. Lazy-loaded and cached, dirty records saved every save-interval minutes and on shutdown. Deleted with the island (resets included, since BentoBox deletes the old island).
  • Dialogs — /<gamemode> stats opens a summary dialog and per-stat pages (paged, highest first, mob names client-translated). Must be run in that game mode's world.
  • Admin — /<gamemode>admin stats <player> [reset]; console gets chat output, reset asks for confirmation.
  • Placeholders — <gamemode>_island_<stat>_total, <gamemode>_island_<stat>_<entity>, <gamemode>_visited_island_<stat>_total.

Testing

  • 52 unit tests (JUnit 5 + MockBukkit). MockBukkit can't build Paper dialogs, so page layout is tested on the builder, not the rendered dialog.
  • Tested in game on Paper 26.3 / BentoBox 3.23.3-SNAPSHOT with AOneBlock: kills counted, saved to the JSON database, shown in the dialog.

Note on history

master starts from an empty root commit that was merged into develop, so this PR shows the whole addon for review.

🤖 Generated with Claude Code

tastybento and others added 3 commits October 4, 2026 07:57
Keeps statistics per island rather than per player, starting with mob
deaths: KILL_ENTITY (killed by a player on the island) and ENTITY_DEATH
(died on the island from any cause, including mob farms), per entity type.

- Counts from EntityDeathEvent with a cheap early-exit handler and an
  in-memory cache; one database record per island via the BentoBox
  database API, saved on a timer and at shutdown, deleted with the island
- /<gamemode> stats shows paged dialog pages (BentoBox Dialogs API)
- /<gamemode>admin stats <player> [reset] for admins and the console
- Placeholders for island totals, per-mob counts and the visited island
- Targets BentoBox 3.23.3, Paper 26.2, Java 25

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- getIslandName: read the island name once, so a null is never returned
  where @nonnull is promised (reliability), and drop a null check on
  PlayersManager.getName, which never returns null
- Drop always-false user null checks in the placeholders
- Admin execute returns false if called without a successful canExecute
- Unnamed catch variables, a stream for the dialog lines, and test tidy-ups

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Oct 4, 2026

Copy link
Copy Markdown

@tastybento
tastybento merged commit f590513 into master Oct 4, 2026
4 checks passed
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