Skip to content

Comments

Add Nexo custom block and furniture support for island levelling#398

Merged
tastybento merged 1 commit intodevelopfrom
389_nexo_support
Feb 20, 2026
Merged

Add Nexo custom block and furniture support for island levelling#398
tastybento merged 1 commit intodevelopfrom
389_nexo_support

Conversation

@tastybento
Copy link
Member

Summary

Closes #389

Nexo is the successor to Oraxen and ships its own API (com.nexomc:nexo). This PR adds full support for all Nexo custom-block mechanics and furniture so they contribute to island level calculations.

Custom blocks (noteblock / stringblock / chorusblock mechanics)

  • NexoBlocks.customBlockMechanic(Location) is called in processBlock() alongside the existing ItemsAdder and Oraxen checks. If a Nexo custom block is found at a location it is counted as "nexo:<itemId>" and the method returns early (no double-counting with the vanilla block beneath).
  • NexoItems.idFromItem(ItemStack) is checked in countItemStack() so Nexo items inside containers are counted when chest-scanning is enabled.

Furniture mechanic

  • Nexo furniture uses ItemDisplay entities rather than blocks, so it is invisible to the chunk block scanner.
  • After the block scan, a new handleNexoFurniture() step iterates entities in every island chunk. NexoFurniture.furnitureMechanic(entity) returning non-null identifies the furniture's base entity; each such entity within the island's protected bounds is counted as "nexo:<itemId>".

Other changes

  • pom.xml – Nexo repository and provided-scoped dependency added (with triumph-gui excluded to avoid a transitive resolution failure).
  • Level.isNexo() – convenience helper that checks the plugin is enabled and not in the disabled-plugin-hooks list.
  • BlockConfig.isOther() – validates nexo: prefixed keys via NexoItems.exists().
  • Utils.prettifyObject() – strips the nexo: prefix before looking up display names, mirroring the existing oraxen: handling.

Configuration

Values are set in blockconfig.yml using the Nexo item ID, exactly like Oraxen:

blocks:
  nexo:my_chair: 5
  nexo:my_table: 3
  nexo:my_noteblock_block: 10

To disable Nexo integration entirely, add Nexo to disabled-plugin-hooks in config.yml.

Test plan

  • Place Nexo custom blocks (noteblock / stringblock / chorusblock mechanics) on an island and run /is level — they should contribute to the level.
  • Place Nexo furniture on an island and run /is level — furniture should contribute to the level.
  • Put Nexo items inside a chest and verify they are counted when include-chests: true.
  • Verify Oraxen and ItemsAdder blocks still work as before (priority order is unchanged).
  • Verify that when Nexo is not installed the calculation completes without errors.
  • Verify blocks / furniture outside the island's protected bounds are not counted.

🤖 Generated with Claude Code

…ion #389

Nexo is the successor to Oraxen and has its own API for custom blocks and
furniture. This adds full support for both:

Custom blocks (noteblock, stringblock, chorusblock mechanics):
- NexoBlocks.customBlockMechanic(Location) detects any Nexo custom block
  at a location during the async chunk scan, counted as "nexo:<id>"
- NexoItems.exists/idFromItem detects Nexo items inside containers

Furniture mechanic:
- After the block scan, NexoFurniture.furnitureMechanic(Entity) scans
  entities in each island chunk; entities with a non-null mechanic are
  the furniture base entities and are counted as "nexo:<id>"

Configuration:
- Values are set in blockconfig.yml using the item ID, e.g.:
    nexo:my_chair: 5
- isNexo() helper in Level respects the disabled-plugin-hooks config list
- BlockConfig.isOther() validates nexo: keys via NexoItems.exists()
- Utils.prettifyObject() strips the nexo: prefix for display names

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tastybento tastybento merged commit 3179732 into develop Feb 20, 2026
1 check passed
@sonarqubecloud
Copy link

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.

Nexo Support for Levels Addon

1 participant