Skip to content

Replace hardcoded creative invalidItems with Material-derived filter - #191

Open
xii69 wants to merge 1 commit into
Wind-Development:masterfrom
xii69:fix/creative-item-filter
Open

xii69 wants to merge 1 commit into
Wind-Development:masterfrom
xii69:fix/creative-item-filter

Conversation

@xii69

@xii69 xii69 commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

What was wrong

Creative mode blocked “invalid” item IDs with a hardcoded HashSet and a TODO saying “check after every update.” That list went stale whenever 1.8 materials drifted (doors, banners, comparators, etc.), so some technical/non-placeable IDs could still get through creative inventory.

What this changes

Replaces the manual ID list with CreativeItemFilter, built from Bukkit Material (block vs item forms, wall/standing pairs, on/off states, double slabs, plus explicit technical IDs). Still gated by filter-creative-items.

Why this is needed

A hand-maintained ID list is guaranteed to rot. Deriving the forbidden set from Material keeps the creative filter correct without needing someone to remember to update numbers every protocol tweak.

Testing

CreativeItemFilterTest 5/5; server tests green; package OK.

Replace CraftBukkit's hardcoded invalidItems HashSet with Material-
derived IDs inlined on PlayerConnection (NAME_ITEM, wall/standing,
diode/comparator, double slabs, technical blocks).

Co-authored-by: xii69 <xii69@yahoo.com>
@cursor
cursor Bot force-pushed the fix/creative-item-filter branch from 2de053b to bf8f04c Compare October 14, 2026 21:31
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