Add support for Shelf item logging#833
Conversation
Remove project branch definition from properties.
There was a problem hiding this comment.
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){ |
There was a problem hiding this comment.
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.
|
@guss-alberto Please review the above, and test/confirm desired behavior once resolved. |
Note
Adds 1.21 shelf detection and chain-aware item transaction logging, exposing new shelf utilities in the Bukkit interface and adapter.
BukkitInterface): AddisShelf(Material)andshelfMaterials().BukkitAdapter): Provide stub implementations forisShelfandshelfMaterials.Bukkit_v1_21):SHELVESset fromTag.WOODEN_SHELVES, implementisShelfandshelfMaterials.shelfMaterials()toBlockGroup.CONTAINERSduring initialization.implements BukkitInterfaceexplicitly.PlayerInteractListener):InventoryChangeListener.inventoryTransactionfor the correct block(s).Written by Cursor Bugbot for commit c07221d. This will update automatically on new commits. Configure here.