Interface FabricAudiences
- All Known Subinterfaces:
FabricAudiencesInternal,FabricServerAudiences
- All Known Implementing Classes:
FabricServerAudiencesImpl
public interface FabricAudiences
Common operations in both the client and server environments.
See FabricServerAudiences for logical server-specific operations,
and FabricClientAudiences for logical client-specific operations
- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull net.kyori.adventure.util.ComponentMessageThrowableasComponentThrowable(@NotNull com.mojang.brigadier.exceptions.CommandSyntaxException ex) Expose a Brigadier CommandSyntaxException's message using the adventure-provided interface for rich-message exceptions.static @NotNull net.kyori.adventure.sound.Sound.EmitterasEmitter(@NotNull net.minecraft.world.entity.Entity entity) Deprecated, for removal: This API element is subject to removal in a future version.for removal, we can use loom interface injection instead@NotNull net.kyori.adventure.text.flattener.ComponentFlattenerReturn a component flattener that can use game data to resolve extra information about components.static @NotNull net.kyori.adventure.identity.Identifiedidentified(@NotNull net.minecraft.world.entity.player.Player player) Deprecated, for removal: This API element is subject to removal in a future version.for removal, use interface injection insteadstatic @NotNull net.kyori.adventure.identity.Identityidentity(@NotNull com.mojang.authlib.GameProfile profile) Get anIdentityrepresentation of aGameProfile.static @NotNull net.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,net.kyori.adventure.text.Component, net.minecraft.network.chat.Component> Return a TextSerializer instance that will do deep conversions between AdventureComponentsand MinecraftComponents.@NotNull net.kyori.adventure.text.renderer.ComponentRenderer<net.kyori.adventure.pointer.Pointered>renderer()Active renderer to render components.default @NotNull net.kyori.adventure.text.ComponenttoAdventure(@NotNull net.minecraft.network.chat.Component vanilla) Deprecated, for removal: This API element is subject to removal in a future version.UseComponentLike.asComponent()instead, implemented onComponentstatic net.kyori.adventure.key.KeytoAdventure(net.minecraft.resources.ResourceLocation loc) Deprecated, for removal: This API element is subject to removal in a future version.ResourceLocation directly implements key, and all Keys are ResourceLocations since Loader 0.14.0@NotNull net.minecraft.network.chat.ComponenttoNative(@NotNull net.kyori.adventure.text.Component adventure) Get a nativeComponentfrom an adventureComponent.static net.minecraft.resources.ResourceLocationtoNative(net.kyori.adventure.key.Key key) Convert a KyoriKeyinstance to a MC ResourceLocation.static @NotNull net.minecraft.network.chat.Componentupdate(@NotNull net.minecraft.network.chat.Component input, UnaryOperator<net.kyori.adventure.text.Component> modifier) Given an existing native component, convert it into an Adventure component for working with.
-
Method Details
-
update
static @NotNull net.minecraft.network.chat.Component update(@NotNull net.minecraft.network.chat.Component input, UnaryOperator<net.kyori.adventure.text.Component> modifier) Given an existing native component, convert it into an Adventure component for working with.- Parameters:
input- source componentmodifier- operator to transform the component- Returns:
- new component
- Since:
- 4.0.0
-
toAdventure
@Deprecated(forRemoval=true, since="5.3.0") @Contract("null -> null; !null -> !null") static net.kyori.adventure.key.Key toAdventure(net.minecraft.resources.ResourceLocation loc) Deprecated, for removal: This API element is subject to removal in a future version.ResourceLocation directly implements key, and all Keys are ResourceLocations since Loader 0.14.0Convert a MCResourceLocationinstance to a text Key.- Parameters:
loc- The Identifier to convert- Returns:
- The equivalent data as a Key
- Since:
- 4.0.0
-
toNative
@Contract("null -> null; !null -> !null") static net.minecraft.resources.ResourceLocation toNative(net.kyori.adventure.key.Key key) Convert a KyoriKeyinstance to a MC ResourceLocation.All
Keyinstances created in a Fabric environment with this mod are implemented byResourceLocation, as long as loader 0.14 is present, so this is effectively a cast.- Parameters:
key- The Key to convert- Returns:
- The equivalent data as an Identifier
- Since:
- 4.0.0
-
asEmitter
@Deprecated(forRemoval=true, since="5.3.0") static @NotNull net.kyori.adventure.sound.Sound.Emitter asEmitter(@NotNull @NotNull net.minecraft.world.entity.Entity entity) Deprecated, for removal: This API element is subject to removal in a future version.for removal, we can use loom interface injection insteadGet anEntity's representation as anSound.Emitterof sounds.- Parameters:
entity- the entity to convert- Returns:
- the entity as a sound emitter
- Since:
- 4.0.0
-
asComponentThrowable
@NotNull static @NotNull net.kyori.adventure.util.ComponentMessageThrowable asComponentThrowable(@NotNull @NotNull com.mojang.brigadier.exceptions.CommandSyntaxException ex) Expose a Brigadier CommandSyntaxException's message using the adventure-provided interface for rich-message exceptions.- Parameters:
ex- the exception to cast- Returns:
- a converted command exception
- Since:
- 5.3.0
-
nonWrappingSerializer
@NotNull static @NotNull net.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,net.kyori.adventure.text.Component, nonWrappingSerializer()net.minecraft.network.chat.Component> Return a TextSerializer instance that will do deep conversions between AdventureComponentsand MinecraftComponents.This serializer will never wrap text, and can provide
MutableComponentinstances suitable for passing around the game.- Returns:
- a serializer instance
- Since:
- 4.0.0
-
identified
@Deprecated(forRemoval=true, since="5.3.0") @NotNull static @NotNull net.kyori.adventure.identity.Identified identified(@NotNull @NotNull net.minecraft.world.entity.player.Player player) Deprecated, for removal: This API element is subject to removal in a future version.for removal, use interface injection insteadGet aPlayeridentified by their profile'sUUID.- Parameters:
player- the player to identify- Returns:
- an identified representation of the player
- Since:
- 4.0.0
-
identity
@NotNull static @NotNull net.kyori.adventure.identity.Identity identity(@NotNull @NotNull com.mojang.authlib.GameProfile profile) Get anIdentityrepresentation of aGameProfile.- Parameters:
profile- the profile to represent- Returns:
- an identity of the game profile
- Since:
- 4.0.0
-
flattener
@NotNull @NotNull net.kyori.adventure.text.flattener.ComponentFlattener flattener()Return a component flattener that can use game data to resolve extra information about components.- Returns:
- the flattener
- Since:
- 4.0.0
-
renderer
@NotNull @NotNull net.kyori.adventure.text.renderer.ComponentRenderer<net.kyori.adventure.pointer.Pointered> renderer()Active renderer to render components.- Returns:
- Shared renderer
- Since:
- 4.0.0
-
toNative
@NotNull net.minecraft.network.chat.Component toNative(@NotNull @NotNull net.kyori.adventure.text.Component adventure) Get a nativeComponentfrom an adventureComponent.The specific type of the returned component is undefined. For example, it may be a wrapper object.
- Parameters:
adventure- adventure input- Returns:
- native representation
- Since:
- 4.0.0
-
toAdventure
@Deprecated(forRemoval=true) @NotNull default @NotNull net.kyori.adventure.text.Component toAdventure(@NotNull net.minecraft.network.chat.Component vanilla) Deprecated, for removal: This API element is subject to removal in a future version.UseComponentLike.asComponent()instead, implemented onComponentGet an adventureComponentfrom a nativeComponent.- Parameters:
vanilla- the native component- Returns:
- adventure component
- Since:
- 4.0.0
-