Skip to content

Comments

Fix custom block count/value/limit placeholders for Oraxen, Nexo, ItemsAdder #391#400

Merged
tastybento merged 1 commit intodevelopfrom
391_custom_block_placeholders
Feb 20, 2026
Merged

Fix custom block count/value/limit placeholders for Oraxen, Nexo, ItemsAdder #391#400
tastybento merged 1 commit intodevelopfrom
391_custom_block_placeholders

Conversation

@tastybento
Copy link
Member

@tastybento tastybento commented Feb 20, 2026

Summary

Fixes placeholder support for custom blocks (Oraxen, Nexo, ItemsAdder) in PlaceholderManager.

  • getObjectFromConfigKey: Previously only returned a custom block's string key when ItemsAdder confirmed it was in its registry — Oraxen and Nexo keys always returned null, making _island_count_<block> always "0". Fixed by returning configKey as-is for anything that isn't a vanilla Material or EntityType spawner, since custom block strings are stored directly as String keys in mdCount/uwCount.
  • getItemIdentifier: Added Oraxen (OraxenHook.getNamespacedId) and Nexo (NexoItems.idFromItem) lookups so _island_count_mainhand correctly identifies custom items held in hand.
  • getBlockIdentifier: Added Oraxen (OraxenHook.getOraxenBlockID), Nexo (NexoBlocks.customBlockMechanic), and ItemsAdder (ItemsAdderHook.getInCustomRegion) lookups so _island_count_looking correctly identifies custom blocks being looked at.

Test plan

  • All 22 existing tests pass
  • Place an Oraxen/Nexo/ItemsAdder custom block on an island, run level calc, confirm _island_count_<block> placeholder returns the correct count
  • Hold an Oraxen/Nexo/ItemsAdder custom item, confirm _island_count_mainhand returns the correct count
  • Look at an Oraxen/Nexo/ItemsAdder custom block, confirm _island_count_looking returns the correct count

🤖 Generated with Claude Code

- getObjectFromConfigKey: return configKey as-is for unresolved keys
  instead of only returning when ItemsAdder confirms it; custom block
  strings (oraxen:x, nexo:x, namespace:id) are stored as String keys
  in mdCount/uwCount so they must be returned as strings
- getItemIdentifier: add Oraxen (OraxenHook.getNamespacedId) and
  Nexo (NexoItems.idFromItem) checks for _island_count_mainhand
- getBlockIdentifier: add Oraxen (OraxenHook.getOraxenBlockID),
  Nexo (NexoBlocks.customBlockMechanic), and ItemsAdder
  (ItemsAdderHook.getInCustomRegion) checks for _island_count_looking

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link

@tastybento tastybento merged commit 6b986b8 into develop Feb 20, 2026
3 checks passed
@tastybento tastybento deleted the 391_custom_block_placeholders branch February 20, 2026 22:55
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