CustomItemsHook
Clone of the stored ItemStack and optional Nexo/Oraxen rebuild only when the item is AIR.
Based on GrzybcioRynek 1.0.3 and web 0.1.0 source.
CustomItemsHook wraps NexoHook and OraxenHook. Both hooks are optional (softdepend). The plugin works without resource packs.
Public methods
| Method | Source |
|---|---|
getNexoId(ItemStack) | NexoHook.getNexoId |
getOraxenId(ItemStack) | OraxenHook.getOraxenId |
recreateItem(MarketListing) | recreateItem(listing.getItem(), nexoId, oraxenId) |
recreateItem(ItemStack, nexoId, oraxenId) | clone + optional rebuild |
recreateItem — AIR rule
originalItem == null→null.stored = originalItem.clone()— keeps enchantments, PDC, display name.- Rebuild from pack ID only when
stored.getType().isAir():- first Nexo (
nexoId+nexoHook.isEnabled()→getNexoItem); - then Oraxen (
oraxenHook.recreateItem).
- first Nexo (
- Otherwise returns the clone.
Changing an ID in the pack does not rebuild a healthy stack. The problem appears only when the stored item is AIR and the ID no longer exists in the pack API.
NexoHook — reflection
Class: com.nexomc.nexo.api.NexoItems.
| Nexo method | Use |
|---|---|
idFromItem(ItemStack) | read ID when listing |
itemFromId(String) + build() | recreate when AIR |
Nexo plugin not loaded → hook disabled (silent). Plugin present, API fails to start:
Nexo znaleziono, ale nie udało się załadować API: <msg>Success: Wykryto Nexo! Włączono wsparcie dla niestandardowych przedmiotów.
getNexoId / getNexoItem catch exceptions and return null. recreateItem in NexoHook itself sets amount from the original — CustomItemsHook only takes this path on AIR via getNexoItem (without copying amount in that branch).
OraxenHook — reflection
Class: io.th0rgal.oraxen.api.OraxenItems.
| Oraxen method | Use |
|---|---|
getIdByItem(ItemStack) | ID when listing |
exists(String) | whether the ID is alive |
getItemById(String) + build() | recreate |
Oraxen znaleziono, ale nie udało się załadować API: <msg>
Wykryto Oraxen! Włączono wsparcie dla niestandardowych przedmiotów.recreateItem in Oraxen: no hook/ID → clone of original; failed build → clone; success → new stack with original amount.
Where it is called
- listing: save
nexoId/oraxenIdonMarketListing; - buy, remove, expiry, refund reclaim:
recreateItem; - search:
ItemSearchUtilalso compares these IDs.
IDs live in listings.yml and in transaction serialization (nexoId, oraxenId).