Skip to content

Conversation

@guss-alberto
Copy link

@guss-alberto guss-alberto commented Dec 15, 2025

Note

Adds 1.21 shelf detection and chain-aware item transaction logging, exposing new shelf utilities in the Bukkit interface and adapter.

  • Adapters:
    • Interface (BukkitInterface): Add isShelf(Material) and shelfMaterials().
    • Base (BukkitAdapter): Provide stub implementations for isShelf and shelfMaterials.
    • 1.21 Adapter (Bukkit_v1_21):
      • Implement shelf support: maintain SHELVES set from Tag.WOODEN_SHELVES, implement isShelf and shelfMaterials.
      • Add shelfMaterials() to BlockGroup.CONTAINERS during initialization.
      • Minor: class no longer declares implements BukkitInterface explicitly.
  • Player interactions (PlayerInteractListener):
    • Handle shelf right-clicks: ignore back-face clicks, determine center for chained shelves (LEFT/CENTER/RIGHT), and queue InventoryChangeListener.inventoryTransaction for the correct block(s).

Written by Cursor Bugbot for commit c07221d. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

// log center
InventoryChangeListener.inventoryTransaction(player.getName(), center.getLocation(), null);

if (center instanceof Shelf && ((Shelf)center.getBlockData()).getSideChain() != ChainPart.CENTER){
Copy link

Choose a reason for hiding this comment

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

Bug: Type mismatch causes instanceof check to always fail

The check center instanceof Shelf will always evaluate to false because center is a Block while Shelf is a BlockData interface. These are incompatible types in Bukkit's API. The condition likely intended to check center.getBlockData() instanceof Shelf instead. This causes the code to always take the else branch, incorrectly logging left and right shelf blocks even when only a chain of 2 shelves exists.

Fix in Cursor Fix in Web

@Intelli
Copy link
Contributor

Intelli commented Dec 15, 2025

@guss-alberto Please review the above, and test/confirm desired behavior once resolved.

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