Skip to content

Recover null CraftInventory contents on 26.2 - #23

Merged
slyphmp4 merged 3 commits into
ver/26.2from
fix/craftinventory-null-contents-26.2
Aug 25, 2026
Merged

Recover null CraftInventory contents on 26.2#23
slyphmp4 merged 3 commits into
ver/26.2from
fix/craftinventory-null-contents-26.2

Conversation

@slyphmp4

@slyphmp4 slyphmp4 commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Prevents Bukkit inventory consumers such as CoreProtect from crashing when a Cardboard ContainerBridge#getContents() implementation unexpectedly returns null.

  • Injects a null-content recovery path into CraftInventory.asCraftMirror(...).
  • Rebuilds the real inventory contents from the backing NMS Container slots instead of pretending the inventory is empty.
  • Handles a malformed null NMS item defensively as an empty Bukkit slot.
  • Logs the offending concrete container class only once, so the underlying bridge implementation can be identified without log spam.

Runtime-tested successfully together with #22. #22 has now been merged into ver/26.2; this PR contains only the CraftInventory recovery fix.

@slyphmp4
slyphmp4 changed the base branch from fix/hurt-by-target-reason-26.2 to ver/26.2 August 25, 2026 03:00
@slyphmp4
slyphmp4 changed the base branch from ver/26.2 to fix/hurt-by-target-reason-26.2 August 25, 2026 03:03
@slyphmp4
slyphmp4 changed the base branch from fix/hurt-by-target-reason-26.2 to ver/26.2 August 25, 2026 03:58
@slyphmp4 slyphmp4 closed this Aug 25, 2026
@slyphmp4
slyphmp4 force-pushed the fix/craftinventory-null-contents-26.2 branch from be9d10c to 8b62de4 Compare August 25, 2026 03:58
@slyphmp4 slyphmp4 reopened this Aug 25, 2026
@slyphmp4
slyphmp4 merged commit f6d7f7c into ver/26.2 Aug 25, 2026
3 checks passed
@slyphmp4
slyphmp4 deleted the fix/craftinventory-null-contents-26.2 branch August 25, 2026 04:09
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