Interface TextBundle
Implementations live in the nested internal-libs/adventure.jar and are loaded through a
child classloader, because they are the classes that touch the relocated Adventure. This interface
is the boundary: it lives on the plugin classloader, names only VersionedComponent, Bukkit
types and String, and is therefore safe for a module's NmsBundleImpl to reference.
Split out of NmsBundleImpl because an adapter is loaded whenever any capability
from its module is used. On 26.2 commandMapModifier dispatches to v1_17_R1, so an
adapter that referenced the text implementations directly dragged the relocated Adventure onto a
server that has Adventure natively and never touches the shaded copy.
fromJson and toJson are how the native tier crosses the boundary. A JSON string
carries a component between the server's own Adventure and the relocated one without either side
naming the other's types.
-
Method Summary
Modifier and TypeMethodDescription@NotNull ItemMetaaddLoreLine(@NotNull ItemMeta meta, @NotNull VersionedComponent component) default @NotNull ComponentLoggerAdapterDefault-throwing: onlyv1_16_R3serves a logger adapter built on the relocated Adventure.@NotNull VersionedComponentJSON in, component out.@NotNull VersionedComponentfromLegacyAmpersand(@NotNull String legacy) @NotNull VersionedComponentfromLegacySection(@NotNull String legacy) @NotNull VersionedComponentfromMiniMessage(@NotNull String miniMessage) @NotNull VersionedComponentfromMiniMessage(@NotNull String miniMessage, @NotNull TextPlaceholder... placeholders) @NotNull VersionedComponentfromPlainText(@NotNull String text) @Nullable VersionedComponentgetDisplayName(@NotNull ItemMeta meta) @Nullable List<VersionedComponent> @NotNull ItemMetasetDisplayName(@NotNull ItemMeta meta, @Nullable VersionedComponent component) @NotNull ItemMetasetLore(@NotNull ItemMeta meta, @Nullable List<VersionedComponent> lore)
-
Method Details
-
fromPlainText
-
fromMiniMessage
-
fromMiniMessage
@NotNull @NotNull VersionedComponent fromMiniMessage(@NotNull @NotNull String miniMessage, @NotNull @NotNull TextPlaceholder... placeholders) -
fromLegacyAmpersand
-
fromLegacySection
-
fromJson
JSON in, component out. The native tier's route across the boundary. -
setDisplayName
@NotNull @NotNull ItemMeta setDisplayName(@NotNull @NotNull ItemMeta meta, @Nullable @Nullable VersionedComponent component) -
getDisplayName
-
setLore
@NotNull @NotNull ItemMeta setLore(@NotNull @NotNull ItemMeta meta, @Nullable @Nullable List<VersionedComponent> lore) -
getLore
-
addLoreLine
@NotNull @NotNull ItemMeta addLoreLine(@NotNull @NotNull ItemMeta meta, @NotNull @NotNull VersionedComponent component) -
componentLoggerAdapter
Default-throwing: onlyv1_16_R3serves a logger adapter built on the relocated Adventure. From 1.18.2 upward the adapter uses the server's own Adventure and lives in its version module, outside the nested jar entirely.
-