Class TinkerItemResolver

java.lang.Object
io.github.sefiraat.slimetinker.i18n.TinkerItemResolver
All Implemented Interfaces:
io.github.thebusybiscuit.slimefun5.core.services.localization.ItemTextResolver

public final class TinkerItemResolver extends Object implements io.github.thebusybiscuit.slimefun5.core.services.localization.ItemTextResolver
Resolves SlimeTinker's assembled tools/armour/parts for Slimefun's per-viewer packet translation. Their name is composed at runtime from the material + type ids stored in the stack's PDC (and tools /armour rebuild their whole lore per language), so they can't live in a static items.yml; this is the item-aware resolver that replaces the old TinkerTranslationListener. Because a tinker item's id (e.g. TOOL_PICKAXE) also backs a static guide entry, the resolver only claims the ASSEMBLED instances (identified by their tinker PDC) and returns null otherwise, leaving the guide item to its static entry.

For an English viewer (or a missing translation) the rebuilt name is byte-identical to the original composition. Player renames are preserved by the core packet layer (it skips the display name of a RenamedItems-marked stack); only the lore is refreshed.

  • Constructor Details

    • TinkerItemResolver

      public TinkerItemResolver()
  • Method Details

    • resolve

      @Nullable public io.github.thebusybiscuit.slimefun5.core.services.localization.ItemTranslationService.RenderedDisplay resolve(@Nullable org.bukkit.inventory.ItemStack item, String itemId, @Nullable String languageId)
      Specified by:
      resolve in interface io.github.thebusybiscuit.slimefun5.core.services.localization.ItemTextResolver