Class ItemNbtProvider
show_item hover is built from.
Covers 1.8 through 1.18.1 and throws above it. From 1.18.2 a server has its own Adventure and
hands the hover over through ItemStack.asHoverEvent(), so nothing on those versions asks
for this.
Below 1.17 the implementation is the one
AbstractItemTextPre_1_17 already
carries, so those branches resolve the same adapter the item text provider does. 1.17 and 1.18.1
are separate modules because their mappings differ.
This lives in :api rather than :core for the same reason
ItemTextProviderPre_1_17 does: it is resolved from inside the nested Adventure jar, whose
classloader can see :api by parent-first delegation and cannot see :core.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected @NotNull AbstractItemNbtprovide(int ver) Creates the appropriate implementation for the specified NMS version.
-
Constructor Details
-
ItemNbtProvider
public ItemNbtProvider()
-
-
Method Details
-
provide
Creates the appropriate implementation for the specified NMS version.This method must be implemented by subclasses to provide version-specific logic for creating the appropriate implementation. The method receives a formatted NMS integer that can be compared against known version thresholds to determine which implementation to create.
Use the
Provider.f(String)helper method to convert Minecraft version strings to formatted integers for comparison.- Specified by:
providein classProvider<AbstractItemNbt>- Parameters:
ver- the formatted NMS version integer- Returns:
- the version-appropriate
AbstractItemNbtimplementation - Throws:
IllegalArgumentException- if the version is below 1.8 or 1.18.2 and above
-