Skip to content

feat: fishing gameplay - #32

Merged
MrInspection merged 25 commits into
masterfrom
feat/fishing-gameplay
Aug 23, 2026
Merged

feat: fishing gameplay#32
MrInspection merged 25 commits into
masterfrom
feat/fishing-gameplay

Conversation

@MrInspection

@MrInspection MrInspection commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added administrative commands for game modes, flight, invulnerability, night vision, entity cleanup, speed, inventory viewing, and Ender Chest viewing.
    • Added fishing-themed items, expanded overworld fishing rewards, new food effects, and custom Iron Golem behavior.
    • Added improved command help, usage guidance, and tab-completion suggestions.
  • Updates

    • Updated supported Spigot BuildTools version to 26.2.
    • Refreshed item names, lore, codex presentation, and join/quit messages.
    • Reorganized command handling and restored player utilities.

@MrInspection MrInspection added enhancement New feature or request area: engine The core system of BlightedMC plugin fix A code style fix area: content Affects the implementation of the core features area: commands Command logic of the Blugin area: server labels Aug 2, 2026
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6f705a41-c643-46d0-8238-fa775d9f1773

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9f17da10-a671-4095-81b1-54de357096eb

📥 Commits

Reviewing files that changed from the base of the PR and between e182bf2 and e2dd147.

📒 Files selected for processing (6)
  • src/main/java/fr/moussax/blightedMC/engine/items/abilities/AbilityExecutor.java
  • src/main/java/fr/moussax/blightedMC/engine/items/abilities/AbilityListener.java
  • src/main/java/fr/moussax/blightedMC/engine/items/abilities/AbilityManager.java
  • src/main/java/fr/moussax/blightedMC/engine/items/abilities/AbilityType.java
  • src/main/java/fr/moussax/blightedMC/engine/items/abilities/CooldownEntry.java
  • src/main/java/fr/moussax/blightedMC/engine/items/rules/ItemRuleListener.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/java/fr/moussax/blightedMC/engine/items/rules/ItemRuleListener.java

📝 Walkthrough

Walkthrough

The plugin replaces command registration with a shared framework, adds and migrates commands, expands fishing content and item behavior, configures Iron Golem AI, adds block-break ability handling, and updates build metadata and player-facing formatting.

Changes

Command system

Layer / File(s) Summary
Command framework contracts and utilities
src/main/java/fr/moussax/blightedMC/commands/..., src/main/java/fr/moussax/blightedMC/commands/utils/...
Adds player/admin command bases, command registration, argument annotations, help formatting, and registry-backed tab completion.
Plugin command registration
src/main/java/fr/moussax/blightedMC/BlightedMC.java, src/main/java/fr/moussax/blightedMC/registry/CommandsRegistry.java, src/main/resources/plugin.yml
Wires command registration through CommandsRegistry, registers aliases and suggestion providers, and declares the expanded command set.
Command implementations
src/main/java/fr/moussax/blightedMC/commands/impl/*
Adds menu, administration, game-mode, gem, item, mob, movement, teleportation, looping, and test commands. Migrated commands use the shared framework.

Content expansion

Layer / File(s) Summary
Fishing materials and loot
src/main/java/fr/moussax/blightedMC/content/fishing/*, src/main/java/fr/moussax/blightedMC/content/items/materials/FishingMaterials.java, src/main/java/fr/moussax/blightedMC/engine/items/..., src/main/java/fr/moussax/blightedMC/engine/items/rules/ItemRuleListener.java
Adds eleven fishing items, registers them, expands biome-specific loot, updates lava loot naming, and applies consumable effects.
Item and entity behavior
src/main/java/fr/moussax/blightedMC/content/items/BlightedItems.java, src/main/java/fr/moussax/blightedMC/content/items/materials/NetherMaterials.java, src/main/java/fr/moussax/blightedMC/content/utils/ai/GolemAI.java
Updates item metadata and lore, and configures Iron Golem goals and targeting.

Ability event handling

Layer / File(s) Summary
Block-break ability flow
src/main/java/fr/moussax/blightedMC/engine/items/abilities/*
Adds passive block-break matching, resolves the player’s main-hand item, and delegates event cancellation to the ability manager.

Project maintenance

Layer / File(s) Summary
Build and presentation updates
.github/workflows/maven.yml, README.md, src/main/java/fr/moussax/blightedMC/engine/player/PlayerListener.java, src/main/java/fr/moussax/blightedMC/server/PluginSettings.java, src/main/java/fr/moussax/blightedMC/utils/Formatter.java
Updates the Spigot version, removes the development notice and banner setting, and simplifies player and formatter messages.

Estimated code review effort: 5 (Critical) | ~120 minutes

Mergeability Score: 🔵 Low · up to e2dd1

The fishing gameplay changes can cause an ability exception to cancel an interaction even when normal block-breaking behavior would otherwise be preserved. This is a bounded behavior risk that is mergeable with explicit owner awareness or a documented cancellation policy.

Sequence Diagram(s)

sequenceDiagram
  participant Player
  participant BlightedMC
  participant CommandsRegistry
  participant CommandRegistrar
  participant AdminCommand
  Player->>BlightedMC: plugin startup
  BlightedMC->>CommandsRegistry: register(plugin)
  CommandsRegistry->>CommandRegistrar: register(command, executor)
  CommandRegistrar->>AdminCommand: assign executor
  Player->>AdminCommand: execute command
  AdminCommand->>AdminCommand: validate player and permission
  AdminCommand-->>Player: execute command behavior
Loading

Possibly related PRs

Suggested labels: area: features

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.08% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the fishing gameplay changes, although the pull request also includes substantial command and ability-system changes.
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.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/fishing-gameplay

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
src/main/java/fr/moussax/blightedMC/utils/Formatter.java (1)

155-161: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Update the inform(List<String>) Javadoc.

The implementation now sends messages without a prefix, but the Javadoc still promises a gray prefix.

Proposed fix
-     * Sends informational messages to a command sender with a gray prefix.
+     * Sends informational messages to a command sender without a prefix.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/fr/moussax/blightedMC/utils/Formatter.java` around lines 155 -
161, Update the Javadoc for Formatter.inform(CommandSender, List<String>) to
remove the inaccurate claim that messages include a gray prefix, and describe
that it sends the provided messages directly to the command sender.
src/main/java/fr/moussax/blightedMC/commands/impl/TeleportPositionCommand.java (1)

66-78: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Handle a failed teleport.

Entity#teleport(Location) returns false when cancellation or server conditions prevent the teleport. Check this return value and show failure feedback instead of posting success messages and playing the success sound.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/fr/moussax/blightedMC/commands/impl/TeleportPositionCommand.java`
around lines 66 - 78, Check the boolean result of target.teleport(location) in
the TeleportPositionCommand flow before sending success messages or playing the
teleport sound. If it returns false, provide failure feedback and exit without
executing the existing success branch; retain the current messaging and sound
behavior only for successful teleports.
src/main/java/fr/moussax/blightedMC/commands/impl/GiveItemCommand.java (1)

45-58: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Handle unknown item IDs before formatting the success message.

ItemRegistry.getItem(itemId) throws IllegalArgumentException for unknown ids, so a simple typo in gaveitem <player> <id> is not converted into the warning shown at line 41. Catch the lookup failure, send a warning to player, and return false before target.getInventory().addItem(stack) at line 60.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/fr/moussax/blightedMC/commands/impl/GiveItemCommand.java`
around lines 45 - 58, Update GiveItemCommand around ItemRegistry.getItem(itemId)
to catch IllegalArgumentException for unknown item IDs, warn player with an
appropriate invalid-item message, and return false before creating or adding the
ItemStack; preserve the existing amount validation and successful give flow.
🧹 Nitpick comments (4)
src/main/java/fr/moussax/blightedMC/commands/impl/GiveItemCommand.java (1)

17-20: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Tab completion never suggests items at position 0 for self-give.

The command treats args[0] as an item id whenever it does not resolve to an online player (Lines 34-38), yet @CommandArgument(position = 0, ...) only lists suggestions = {"$players"}. Self-give usage (/give <item>) has no item tab-completion at position 0.

Also applies to: 31-38

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/fr/moussax/blightedMC/commands/impl/GiveItemCommand.java`
around lines 17 - 20, Update the `@CommandArguments` declaration for
GiveItemCommand so position 0 includes both player and item suggestions,
matching the command logic that treats an unresolved first argument as an item
id for self-give; leave position 1’s item suggestions unchanged.
src/main/java/fr/moussax/blightedMC/commands/impl/FlyCommand.java (1)

16-26: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Toggle-off branches bypass the shared Formatter helpers.

FlyCommand and GodCommand both use Formatter.text(...).send(player) for the ON branch but call player.sendMessage(...) directly for the OFF branch. The shared root cause is the same duplicated toggle pattern in both files.

  • src/main/java/fr/moussax/blightedMC/commands/impl/FlyCommand.java#L16-L26: route the OFF branch of toggleFlightMode through Formatter.inform or Formatter.text(...).send(player) instead of player.sendMessage(...).
  • src/main/java/fr/moussax/blightedMC/commands/impl/GodCommand.java#L16-L26: route the OFF branch of toggleGodMode through Formatter.inform or Formatter.text(...).send(player) instead of player.sendMessage(...).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/fr/moussax/blightedMC/commands/impl/FlyCommand.java` around
lines 16 - 26, Route the toggle-off notification through the shared Formatter
helpers instead of calling player.sendMessage directly. Update toggleFlightMode
in src/main/java/fr/moussax/blightedMC/commands/impl/FlyCommand.java lines 16-26
and toggleGodMode in
src/main/java/fr/moussax/blightedMC/commands/impl/GodCommand.java lines 16-26,
using Formatter.inform or Formatter.text(...).send(player), while preserving the
existing OFF message.
src/main/java/fr/moussax/blightedMC/content/fishing/OverworldFishing.java (1)

51-51: 📐 Maintainability & Code Quality | 🔵 Trivial

Resolve the TODO before merging fishing gameplay.

The comment // TODO : Finish the fishing mods signals unfinished work in a file this PR adds as part of the fishing feature. State what remains, or remove the comment if the table is complete.

Do you want me to open an issue to track the remaining fishing-mob work?

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/fr/moussax/blightedMC/content/fishing/OverworldFishing.java` at
line 51, Resolve the unfinished-work marker in OverworldFishing by completing
the remaining fishing-mob implementation and documenting what is still missing,
or remove the “Finish the fishing mods” TODO when the fishing table is complete.
Ensure the final state accurately reflects the implementation status before
merging.
src/main/java/fr/moussax/blightedMC/engine/items/rules/ItemRuleListener.java (1)

98-105: 📐 Maintainability & Code Quality | 🔵 Trivial

Move item-specific consume effects out of the generic rule listener.

onItemConsume now hardcodes "FISHERMANS_STEW" and "BLIGHTED_SUSHI" string literals to decide which potion effects to apply. This duplicates the item IDs already declared in FishingMaterials.java with no compiler link between the two. If an ID changes there, this listener silently stops applying the effect.

Consider modeling consume effects as data on BlightedItem (for example a list of PotionEffect suppliers applied on successful consume) so ItemRuleListener stays generic and item behavior lives with the item definition.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/fr/moussax/blightedMC/engine/items/rules/ItemRuleListener.java`
around lines 98 - 105, Move the FISHERMANS_STEW and BLIGHTED_SUSHI
consume-effect definitions from ItemRuleListener.onItemConsume into BlightedItem
data, using the existing item definitions in FishingMaterials.java and
PotionEffect suppliers or equivalent. Update onItemConsume to apply configured
effects generically after a successful consume, removing the hardcoded item ID
checks while preserving each item’s durations, amplifiers, and random sushi
hunger effect.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Line 32: Update the Spigot BuildTools link in the README download instruction
to replace the vague “here” link text with descriptive text identifying the
BuildTools documentation, while preserving the existing URL and sentence
meaning.

In `@src/main/java/fr/moussax/blightedMC/commands/impl/ButcherCommand.java`:
- Around line 27-39: Validate the parsed radius in ButcherCommand before the
existing positive-value check by requiring Double.isFinite(radius). Reject NaN
and positive or negative infinity through the same invalid-radius warning and
return path, while preserving the current handling for finite non-positive
values.

In `@src/main/java/fr/moussax/blightedMC/commands/impl/GemsCommand.java`:
- Around line 21-30: Update the usage strings in GemsCommand’s
CommandFormatter.sendCommands call so amount is shown as required with angle
brackets for gems add, remove, set, and giveall. Keep the existing player and
command descriptions unchanged, matching the validation behavior in
handleModify, handleSet, and handleGiveAll.

In `@src/main/java/fr/moussax/blightedMC/commands/impl/LoopCommand.java`:
- Around line 54-59: Update the nested-loop check in LoopCommand by normalizing
commandToExecute’s case before testing its “loop ” prefix, so commands such as
“LOOP” are rejected while preserving the existing warning and return behavior.

In `@src/main/java/fr/moussax/blightedMC/commands/impl/SpeedCommand.java`:
- Around line 40-53: Update applySpeed so intensity 1 uses the normal fly-speed
baseline of 0.1f when flying, while retaining the existing 0.2f walking baseline
and all other intensity mappings. Keep the reset notification behavior
unchanged.

In `@src/main/java/fr/moussax/blightedMC/content/utils/ai/GolemAI.java`:
- Line 20: Wire GolemAI.init into the Iron Golem lifecycle by invoking it when
an Iron Golem is spawned, attached, or configured, using the existing lifecycle
hook such as onConfigureAI or attachToExisting. Ensure every relevant Iron Golem
instance receives the custom goals; otherwise remove the unused GolemAI
implementation.

In `@src/main/resources/plugin.yml`:
- Around line 46-49: Add short descriptions to the god, butcher, speed, and fly
command entries in plugin.yml, matching the concise style of the other command
definitions so Bukkit help output includes each command’s purpose.

---

Outside diff comments:
In `@src/main/java/fr/moussax/blightedMC/commands/impl/GiveItemCommand.java`:
- Around line 45-58: Update GiveItemCommand around ItemRegistry.getItem(itemId)
to catch IllegalArgumentException for unknown item IDs, warn player with an
appropriate invalid-item message, and return false before creating or adding the
ItemStack; preserve the existing amount validation and successful give flow.

In
`@src/main/java/fr/moussax/blightedMC/commands/impl/TeleportPositionCommand.java`:
- Around line 66-78: Check the boolean result of target.teleport(location) in
the TeleportPositionCommand flow before sending success messages or playing the
teleport sound. If it returns false, provide failure feedback and exit without
executing the existing success branch; retain the current messaging and sound
behavior only for successful teleports.

In `@src/main/java/fr/moussax/blightedMC/utils/Formatter.java`:
- Around line 155-161: Update the Javadoc for Formatter.inform(CommandSender,
List<String>) to remove the inaccurate claim that messages include a gray
prefix, and describe that it sends the provided messages directly to the command
sender.

---

Nitpick comments:
In `@src/main/java/fr/moussax/blightedMC/commands/impl/FlyCommand.java`:
- Around line 16-26: Route the toggle-off notification through the shared
Formatter helpers instead of calling player.sendMessage directly. Update
toggleFlightMode in
src/main/java/fr/moussax/blightedMC/commands/impl/FlyCommand.java lines 16-26
and toggleGodMode in
src/main/java/fr/moussax/blightedMC/commands/impl/GodCommand.java lines 16-26,
using Formatter.inform or Formatter.text(...).send(player), while preserving the
existing OFF message.

In `@src/main/java/fr/moussax/blightedMC/commands/impl/GiveItemCommand.java`:
- Around line 17-20: Update the `@CommandArguments` declaration for
GiveItemCommand so position 0 includes both player and item suggestions,
matching the command logic that treats an unresolved first argument as an item
id for self-give; leave position 1’s item suggestions unchanged.

In `@src/main/java/fr/moussax/blightedMC/content/fishing/OverworldFishing.java`:
- Line 51: Resolve the unfinished-work marker in OverworldFishing by completing
the remaining fishing-mob implementation and documenting what is still missing,
or remove the “Finish the fishing mods” TODO when the fishing table is complete.
Ensure the final state accurately reflects the implementation status before
merging.

In
`@src/main/java/fr/moussax/blightedMC/engine/items/rules/ItemRuleListener.java`:
- Around line 98-105: Move the FISHERMANS_STEW and BLIGHTED_SUSHI consume-effect
definitions from ItemRuleListener.onItemConsume into BlightedItem data, using
the existing item definitions in FishingMaterials.java and PotionEffect
suppliers or equivalent. Update onItemConsume to apply configured effects
generically after a successful consume, removing the hardcoded item ID checks
while preserving each item’s durations, amplifiers, and random sushi hunger
effect.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 99eb1b58-3ad8-4c96-9c34-83d81c9cf8a8

📥 Commits

Reviewing files that changed from the base of the PR and between 91f0814 and e182bf2.

📒 Files selected for processing (55)
  • .github/workflows/maven.yml
  • README.md
  • src/main/java/fr/moussax/blightedMC/BlightedMC.java
  • src/main/java/fr/moussax/blightedMC/commands/AdminCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/AltarCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/CommandRegistrar.java
  • src/main/java/fr/moussax/blightedMC/commands/CraftCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/FlyCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/ForgeCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/GemsCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/PlayerCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/SpawnCustomMobCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/TestCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/impl/AltarCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/impl/ButcherCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/impl/CraftCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/impl/EnderseeCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/impl/FlyCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/impl/ForgeCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/impl/GamemodeCommands.java
  • src/main/java/fr/moussax/blightedMC/commands/impl/GemsCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/impl/GiveItemCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/impl/GodCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/impl/InvseeCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/impl/LoopCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/impl/NightVisionCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/impl/SpawnCustomMobCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/impl/SpeedCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/impl/TeleportPositionCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/impl/TestCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/see/EnderSeeCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/see/InvSeeCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/utils/CommandArgument.java
  • src/main/java/fr/moussax/blightedMC/commands/utils/CommandArguments.java
  • src/main/java/fr/moussax/blightedMC/commands/utils/CommandFormatter.java
  • src/main/java/fr/moussax/blightedMC/commands/utils/TabSuggestionBuilder.java
  • src/main/java/fr/moussax/blightedMC/commands/utils/TabSuggestionRegistry.java
  • src/main/java/fr/moussax/blightedMC/content/fishing/OverworldFishing.java
  • src/main/java/fr/moussax/blightedMC/content/fishing/OverworldLavaFishing.java
  • src/main/java/fr/moussax/blightedMC/content/items/BlightedItems.java
  • src/main/java/fr/moussax/blightedMC/content/items/materials/FishingMaterials.java
  • src/main/java/fr/moussax/blightedMC/content/items/materials/NetherMaterials.java
  • src/main/java/fr/moussax/blightedMC/content/utils/ai/GolemAI.java
  • src/main/java/fr/moussax/blightedMC/engine/items/registry/ItemRegistry.java
  • src/main/java/fr/moussax/blightedMC/engine/items/rules/ItemRuleListener.java
  • src/main/java/fr/moussax/blightedMC/engine/player/PlayerListener.java
  • src/main/java/fr/moussax/blightedMC/registry/CommandsRegistry.java
  • src/main/java/fr/moussax/blightedMC/server/PluginSettings.java
  • src/main/java/fr/moussax/blightedMC/utils/Formatter.java
  • src/main/java/fr/moussax/blightedMC/utils/commands/CommandArgument.java
  • src/main/java/fr/moussax/blightedMC/utils/commands/CommandBuilder.java
  • src/main/java/fr/moussax/blightedMC/utils/commands/CommandInfo.java
  • src/main/java/fr/moussax/blightedMC/utils/commands/TabSuggestionBuilder.java
  • src/main/java/fr/moussax/blightedMC/utils/commands/TabSuggestionRegistry.java
  • src/main/resources/plugin.yml
💤 Files with no reviewable changes (14)
  • src/main/java/fr/moussax/blightedMC/commands/ForgeCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/FlyCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/AltarCommand.java
  • src/main/java/fr/moussax/blightedMC/utils/commands/CommandArgument.java
  • src/main/java/fr/moussax/blightedMC/commands/CraftCommand.java
  • src/main/java/fr/moussax/blightedMC/utils/commands/TabSuggestionRegistry.java
  • src/main/java/fr/moussax/blightedMC/commands/SpawnCustomMobCommand.java
  • src/main/java/fr/moussax/blightedMC/utils/commands/CommandBuilder.java
  • src/main/java/fr/moussax/blightedMC/utils/commands/CommandInfo.java
  • src/main/java/fr/moussax/blightedMC/commands/see/EnderSeeCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/GemsCommand.java
  • src/main/java/fr/moussax/blightedMC/utils/commands/TabSuggestionBuilder.java
  • src/main/java/fr/moussax/blightedMC/commands/see/InvSeeCommand.java
  • src/main/java/fr/moussax/blightedMC/commands/TestCommand.java

Comment thread README.md

### Server Setup
* Download and install Spigot's build tools for version `26.1.2` from [here](https://www.spigotmc.org/wiki/buildtools/)
* Download and install Spigot's build tools for version `26.2` from [here](https://www.spigotmc.org/wiki/buildtools/)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use descriptive link text.

Replace here with text that identifies the BuildTools documentation.

Proposed fix
-* Download and install Spigot's build tools for version `26.2` from [here](https://www.spigotmc.org/wiki/buildtools/)
+* Download and install Spigot's build tools for version `26.2` from [Spigot's BuildTools documentation](https://www.spigotmc.org/wiki/buildtools/)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* Download and install Spigot's build tools for version `26.2` from [here](https://www.spigotmc.org/wiki/buildtools/)
* Download and install Spigot's build tools for version `26.2` from [Spigot's BuildTools documentation](https://www.spigotmc.org/wiki/buildtools/)
🧰 Tools
🪛 markdownlint-cli2 (0.23.1)

[warning] 32-32: Link text should be descriptive

(MD059, descriptive-link-text)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 32, Update the Spigot BuildTools link in the README
download instruction to replace the vague “here” link text with descriptive text
identifying the BuildTools documentation, while preserving the existing URL and
sentence meaning.

Source: Linters/SAST tools

Comment on lines +27 to +39
try {
radius = Double.parseDouble(args[0]);
} catch (NumberFormatException exception) {
warn(player, "Radius must be a valid number.");
return true;
}

if (radius <= 0) {
warn(player, "Radius must be greater than 0.");
return true;
}

player.sendMessage(" §eRemoved §d" + butcher(player, radius) + " §eentities in a §b" + Math.round(radius) + " §eblocks radius.");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

file='src/main/java/fr/moussax/blightedMC/commands/impl/ButcherCommand.java'
rg -n -C 3 'Double\.parseDouble|Double\.isFinite|radius <= 0' "$file"

Repository: MrInspection/BlightedMC

Length of output: 564


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file='src/main/java/fr/moussax/blightedMC/commands/impl/ButcherCommand.java'
echo "FILE LINE COUNT:"
wc -l "$file"
echo
echo "FILE CONTENT:"
cat -n "$file"
echo
echo "RELATED butcher method references:"
rg -n -C 4 '\bbutcher\s*\(|butcher\(player, radius\)|distanceSquared|radiusSquared' src/main/java || true

Repository: MrInspection/BlightedMC

Length of output: 12207


🏁 Script executed:

#!/bin/bash
set -euo pipefail

java -version >/dev/null || true

python3 - <<'PY'
import math
radius = float("nan")
radius_squared = radius * radius
distance_squared_cases = [0.0, 10.0, 1e100]
print("radius_nan:", radius)
print("radius_squared_nan:", radius_squared)
print("radius_nan_le_0:", radius_nan() is False)
print("radius_nan_gt_0:", radius_nan() is False)
for d2 in distance_squared_cases:
    print(f"{d2} > radius_squared_nan = {d2 > radius_squared}")
PY

Repository: MrInspection/BlightedMC

Length of output: 523


🏁 Script executed:

#!/bin/bash
set -euo pipefail

cat > /tmp/ButcherNaNProbe.java <<'JAVA'
public class ButcherNaNProbe {
    public static void main(String[] args) {
        double[] inputs = {"NaN", "-NaN", "Infinity", "-Infinity", "0", "5"};
        for (String s : inputs) {
            try {
                double r = Double.parseDouble(s);
                boolean passesPositive = 0 < r;
                System.out.println(s + " -> parseDouble ok: true, finite: " + Double.isFinite(r) + ", is NaN: " + Double.isNaN(r) + ", positive: " + passesPositive + ", r*r " + (r*r));
            } catch (NumberFormatException x) {
                System.out.println(s + " -> parseDouble ok: false");
            }
        }

        double radius = Double.parseDouble("NaN");
        double radiusSquared = radius * radius;
        double[] distancesSquared = {0.0, 10.0, 1e20};
        for (double d : distancesSquared) {
            System.out.println("distanceSquared=" + d + " > radiusSquared(" + radiusSquared + ") = " + (d > radiusSquared));
        }
    }
}
JAVA

javac /tmp/ButcherNaNProbe.java
java -cp /tmp ButcherNaNProbe

Repository: MrInspection/BlightedMC

Length of output: 205


🌐 Web query:

Java Double.parseDouble NaN Double.parseDouble Infinity documentation

💡 Result:

In Java, the method Double.parseDouble(String s) is designed to parse strings representing floating-point numbers [1][2]. It supports specific string representations for NaN (Not-a-Number) and infinity, meaning these are considered valid inputs rather than errors [3]. When the input string is "NaN", "Infinity", or "-Infinity", Double.parseDouble successfully parses these into their corresponding double values [3]. Specifically: 1. "NaN": Parses to Double.NaN [3]. 2. "Infinity": Parses to Double.POSITIVE_INFINITY [3]. 3. "-Infinity": Parses to Double.NEGATIVE_INFINITY [3]. Because these are considered valid floating-point values according to the IEEE 754 standard, Double.parseDouble does not throw a NumberFormatException for these inputs [1][2][3]. If your application requires that these specific values be treated as invalid, you must explicitly check the result of the parsing operation using methods such as Double.isNaN or Double.isInfinite [1][3].

Citations:


Reject non-finite radii.

Double.parseDouble("NaN"), "Infinity", and "-Infinity" do not throw. NaN also fails the radius <= 0 check and makes the distance comparison false, so /butcher NaN removes every non-player living entity. Add Double.isFinite(radius) before accepting the radius.

Proposed fix
-        if (radius <= 0) {
-            warn(player, "Radius must be greater than 0.");
+        if (!Double.isFinite(radius) || radius <= 0) {
+            warn(player, "Radius must be a finite number greater than 0.");
             return true;
         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
try {
radius = Double.parseDouble(args[0]);
} catch (NumberFormatException exception) {
warn(player, "Radius must be a valid number.");
return true;
}
if (radius <= 0) {
warn(player, "Radius must be greater than 0.");
return true;
}
player.sendMessage(" §eRemoved §d" + butcher(player, radius) + " §eentities in a §b" + Math.round(radius) + " §eblocks radius.");
try {
radius = Double.parseDouble(args[0]);
} catch (NumberFormatException exception) {
warn(player, "Radius must be a valid number.");
return true;
}
if (!Double.isFinite(radius) || radius <= 0) {
warn(player, "Radius must be a finite number greater than 0.");
return true;
}
player.sendMessage(" §eRemoved §d" + butcher(player, radius) + " §eentities in a §b" + Math.round(radius) + " §eblocks radius.");
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/fr/moussax/blightedMC/commands/impl/ButcherCommand.java` around
lines 27 - 39, Validate the parsed radius in ButcherCommand before the existing
positive-value check by requiring Double.isFinite(radius). Reject NaN and
positive or negative infinity through the same invalid-radius warning and return
path, while preserving the current handling for finite non-positive values.

Comment on lines +21 to +30
CommandFormatter.sendCommands(
player, "COMMANDS", "Gems Currency",
CommandFormatter.CommandInfo.of("gems add <player> [amount]", "Give gems to a player."),
CommandFormatter.CommandInfo.of("gems remove <player> [amount]", "Take gems from a player."),
CommandFormatter.CommandInfo.of("gems set <player> [amount]", "Set gems for a player."),
CommandFormatter.CommandInfo.of("gems reset <player>", "Reset gems for a player."),
CommandFormatter.CommandInfo.of("gems giveall [amount]", "Give gems to everyone."),
CommandFormatter.CommandInfo.of("gems resetall", "Reset everyone's balance."),
CommandFormatter.CommandInfo.of("gems help", "Prints this help message.")
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Usage text marks required amount as optional.

gems add <player> [amount], gems remove <player> [amount], gems set <player> [amount], and gems giveall [amount] all use square brackets for amount. handleModify (Line 50), handleSet (Line 83), and handleGiveAll (Line 139) each reject a call when amount is missing, so amount is required, not optional. Use angle brackets for amount in these usage strings to match the actual requirement.

Also applies to: 138-148

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/fr/moussax/blightedMC/commands/impl/GemsCommand.java` around
lines 21 - 30, Update the usage strings in GemsCommand’s
CommandFormatter.sendCommands call so amount is shown as required with angle
brackets for gems add, remove, set, and giveall. Keep the existing player and
command descriptions unchanged, matching the validation behavior in
handleModify, handleSet, and handleGiveAll.

Comment on lines 54 to 59
String commandToExecute = String.join(" ", Arrays.copyOfRange(args, 2, args.length));

if (commandToExecute.startsWith("loop ")) {
warn(sender, "You cannot loop the §4loop §ccommand.");
warn(player, "You cannot loop the §4loop §ccommand.");
return false;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Nested-loop guard is bypassed by a different letter case.

commandToExecute.startsWith("loop ") is case-sensitive. A command like LOOP 5 5 give ... bypasses the guard and can still schedule a nested loop. Normalize the case before the comparison.

🛡️ Proposed fix for case-insensitive comparison
-        if (commandToExecute.startsWith("loop ")) {
+        if (commandToExecute.toLowerCase().startsWith("loop ")) {
             warn(player, "You cannot loop the §4loop §ccommand.");
             return false;
         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
String commandToExecute = String.join(" ", Arrays.copyOfRange(args, 2, args.length));
if (commandToExecute.startsWith("loop ")) {
warn(sender, "You cannot loop the §4loop §ccommand.");
warn(player, "You cannot loop the §4loop §ccommand.");
return false;
}
String commandToExecute = String.join(" ", Arrays.copyOfRange(args, 2, args.length));
if (commandToExecute.toLowerCase().startsWith("loop ")) {
warn(player, "You cannot loop the §4loop §ccommand.");
return false;
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/fr/moussax/blightedMC/commands/impl/LoopCommand.java` around
lines 54 - 59, Update the nested-loop check in LoopCommand by normalizing
commandToExecute’s case before testing its “loop ” prefix, so commands such as
“LOOP” are rejected while preserving the existing warning and return behavior.

Comment on lines +40 to +53
private void applySpeed(Player player, int intensity) {
float speed = Math.min(1.0f, (intensity + 1) / 10.0f);

boolean flying = player.getAllowFlight() && player.isFlying();
String type = flying ? "Flying" : "Walking";

if (flying) {
player.setFlySpeed(speed);
} else {
player.setWalkSpeed(speed);
}

if (intensity == 1) {
inform(player, " §f" + type + " Speed §ehas been reset.");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Files matching SpeedCommand:\n'
fd -i 'SpeedCommand\.java$' . || true

printf '\nRelevant file excerpt if found:\n'
file="$(fd -i 'SpeedCommand\.java$' . | head -n 1 || true)"
if [ -n "${file:-}" ]; then
  wc -l "$file"
  sed -n '1,120p' "$file" | cat -n
fi

printf '\nSearch for setFlySpeed/getAllowFlight/isFlying usage (limited):\n'
rg -n "setFlySpeed|getAllowFlight|isFlying|setWalkSpeed|speed" -S --glob '*.java' . | head -n 120

Repository: MrInspection/BlightedMC

Length of output: 6504


🌐 Web query:

Spigot API Player default fly speed setFlySpeed default 0.1 walk speed setWalkSpeed default 0.2

💡 Result:

In the Spigot API, the default values for player movement speeds are as follows: Walk Speed: 0.2 [1] Fly Speed: 0.1 [2] The Player interface provides the methods setWalkSpeed(float value) and setFlySpeed(float value) to modify these speeds [3][4]. According to the API documentation, the value parameter for both methods accepts a float between -1 and 1 [3][5]. Setting a value outside of this range will throw an IllegalArgumentException [3][6]. Note that these methods modify the player's movement speed settings directly [3]. Because these changes may persist until explicitly reset or until the player disconnects (depending on the server implementation), it is common practice to manually reset these values to their defaults (0.2 for walking and 0.1 for flying) when necessary [2][1].

Citations:


Use the normal fly-speed baseline for /speed 1.

Spigot sets the default walk speed to 0.2f and the default fly speed to 0.1f. When the player is flying, intensity == 1 currently calls player.setFlySpeed(0.2f) but reports a speed reset; keep the walking mapping and map flying intensity 1 to 0.1f.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/fr/moussax/blightedMC/commands/impl/SpeedCommand.java` around
lines 40 - 53, Update applySpeed so intensity 1 uses the normal fly-speed
baseline of 0.1f when flying, while retaining the existing 0.2f walking baseline
and all other intensity mappings. Keep the reset notification behavior
unchanged.

private GolemAI() {
}

public static void init(LivingEntity spawned) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 8 '\bGolemAI\.init\s*\(|\bonConfigureAI\s*\(|\battachToExisting\s*\(' src/main/java

Repository: MrInspection/BlightedMC

Length of output: 13331


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '--- GolemAI file ---\n'
cat -n src/main/java/fr/moussax/blightedMC/content/utils/ai/GolemAI.java

printf '\n--- GolemAI usages ---\n'
rg -n 'GolemAI|IRONGOLEM|IronGolem|Iron Golem|onConfigureAI|onRehydrate' src/main/java || true

printf '\n--- candidate entity files ---\n'
fd -e java . src/main/java | sed -n '1,160p' | rg -n 'Golem|Iron|EntitiesRegistry|BlightedEntity' || true

printf '\n--- precise GolemAI text search (entire tracked files) ---\n'
git ls-files | xargs rg -n 'GolemAI|onConfigureAI\s*\(|attachToExisting\s*\(' || true

Repository: MrInspection/BlightedMC

Length of output: 252


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- GolemAI file ---'
cat -n src/main/java/fr/moussax/blightedMC/content/utils/ai/GolemAI.java

printf '%s\n' ''
printf '%s\n' '--- GolemAI usages ---'
rg -n 'GolemAI|IRONGOLEM|IronGolem|Iron Golem|onConfigureAI|onRehydrate' src/main/java || true

printf '%s\n' ''
printf '%s\n' '--- candidate entity files ---'
fd -e java . src/main/java | sed -n '1,160p' | rg -n 'Golem|Iron|EntitiesRegistry|BlightedEntity' || true

printf '%s\n' ''
printf '%s\n' '--- precise GolemAI text search (entire tracked files) ---'
git ls-files | xargs rg -n 'GolemAI|onConfigureAI\s*\(|attachToExisting\s*\(' || true

Repository: MrInspection/BlightedMC

Length of output: 5790


Wire GolemAI.init into the Iron Golem lifecycle.

GolemAI.init only clears goals/targets and adds Iron Golem-specific goals, but the repository has no caller for GolemAI.init. If no Iron Golem subtype overrides onConfigureAI or calls this method from attachToExisting/spawn, this code has no runtime effect. Add the lifecycle call for Iron Golems or remove the file.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/fr/moussax/blightedMC/content/utils/ai/GolemAI.java` at line
20, Wire GolemAI.init into the Iron Golem lifecycle by invoking it when an Iron
Golem is spawned, attached, or configured, using the existing lifecycle hook
such as onConfigureAI or attachToExisting. Ensure every relevant Iron Golem
instance receives the custom goals; otherwise remove the unused GolemAI
implementation.

Comment on lines +46 to +49
god:
butcher:
speed:
fly: No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add descriptions for god, butcher, speed, fly.

Every other command in this file declares a description. These four commands have none, so Bukkit's /help output shows no description for them.

Add a short description for each command, consistent with the rest of the file.

📝 Proposed fix
   god:
+    description: Toggle invulnerability for yourself
   butcher:
+    description: Remove nearby hostile mobs
   speed:
+    description: Adjust your movement speed
   fly:
+    description: Toggle flight for yourself
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
god:
butcher:
speed:
fly:
god:
description: Toggle invulnerability for yourself
butcher:
description: Remove nearby hostile mobs
speed:
description: Adjust your movement speed
fly:
description: Toggle flight for yourself
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/resources/plugin.yml` around lines 46 - 49, Add short descriptions
to the god, butcher, speed, and fly command entries in plugin.yml, matching the
concise style of the other command definitions so Bukkit help output includes
each command’s purpose.

…rticle rendering, enhance inventory handling, and fix sound/message formatting
@MrInspection
MrInspection force-pushed the feat/fishing-gameplay branch from 3350937 to 2aa0b0f Compare August 23, 2026 19:30
@MrInspection
MrInspection merged commit 7bc602c into master Aug 23, 2026
3 checks passed
@MrInspection
MrInspection deleted the feat/fishing-gameplay branch August 23, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: commands Command logic of the Blugin area: content Affects the implementation of the core features area: engine The core system of BlightedMC plugin area: server enhancement New feature or request fix A code style fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant