Class FabricServerAudiencesImpl
java.lang.Object
net.kyori.adventure.platform.fabric.impl.server.FabricServerAudiencesImpl
- All Implemented Interfaces:
AutoCloseable,net.kyori.adventure.platform.AudienceProvider,FabricAudiences,FabricServerAudiences,FabricAudiencesInternal
public final class FabricServerAudiencesImpl
extends Object
implements FabricServerAudiences, FabricAudiencesInternal
The entry point for accessing Adventure.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionFabricServerAudiencesImpl(net.minecraft.server.MinecraftServer server, Function<net.kyori.adventure.pointer.Pointered, ?> partition, net.kyori.adventure.text.renderer.ComponentRenderer<net.kyori.adventure.pointer.Pointered> renderer) -
Method Summary
Modifier and TypeMethodDescription@NotNull net.kyori.adventure.audience.Audienceall()@NotNull net.kyori.adventure.audience.AudienceCreate an audience that will send to every listed player.@NotNull net.kyori.adventure.audience.Audienceaudience(@NotNull net.minecraft.commands.CommandSource source) Get an audience that will send to the providedCommandSource.@NotNull AdventureCommandSourceStackaudience(@NotNull net.minecraft.commands.CommandSourceStack source) Get an audience to send to aCommandSourceStack.bossBars()voidclose()@NotNull net.kyori.adventure.audience.Audienceconsole()@NotNull net.kyori.adventure.text.flattener.ComponentFlattenerReturn a component flattener that can use game data to resolve extra information about components.static voidPerform an action on every audience provider instance.@NotNull net.kyori.adventure.audience.Audiencepermission(@NotNull String permission) @NotNull net.kyori.adventure.audience.Audience@NotNull net.kyori.adventure.audience.Audienceplayers()@NotNull net.minecraft.core.RegistryAccess@NotNull net.kyori.adventure.text.renderer.ComponentRenderer<net.kyori.adventure.pointer.Pointered>renderer()Active renderer to render components.@NotNull net.kyori.adventure.audience.Audience@NotNull net.minecraft.network.chat.ComponenttoNative(@NotNull net.kyori.adventure.text.Component adventure) Get a nativeComponentfrom an adventureComponent.@NotNull net.kyori.adventure.audience.Audienceworld(@NotNull net.kyori.adventure.key.Key worldId) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.kyori.adventure.platform.AudienceProvider
permissionMethods inherited from interface net.kyori.adventure.platform.fabric.FabricAudiences
toAdventure
-
Constructor Details
-
FabricServerAudiencesImpl
public FabricServerAudiencesImpl(net.minecraft.server.MinecraftServer server, Function<net.kyori.adventure.pointer.Pointered, ?> partition, net.kyori.adventure.text.renderer.ComponentRenderer<net.kyori.adventure.pointer.Pointered> renderer)
-
-
Method Details
-
forEachInstance
Perform an action on every audience provider instance.- Parameters:
actor- a consumer that will be called for every provider
-
all
@NotNull public @NotNull net.kyori.adventure.audience.Audience all()- Specified by:
allin interfacenet.kyori.adventure.platform.AudienceProvider
-
console
@NotNull public @NotNull net.kyori.adventure.audience.Audience console()- Specified by:
consolein interfacenet.kyori.adventure.platform.AudienceProvider
-
players
@NotNull public @NotNull net.kyori.adventure.audience.Audience players()- Specified by:
playersin interfacenet.kyori.adventure.platform.AudienceProvider
-
player
@NotNull public @NotNull net.kyori.adventure.audience.Audience player(@NotNull @NotNull UUID playerId) - Specified by:
playerin interfacenet.kyori.adventure.platform.AudienceProvider
-
permission
@NotNull public @NotNull net.kyori.adventure.audience.Audience permission(@NotNull @NotNull String permission) - Specified by:
permissionin interfacenet.kyori.adventure.platform.AudienceProvider
-
audience
@NotNull public @NotNull AdventureCommandSourceStack audience(@NotNull @NotNull net.minecraft.commands.CommandSourceStack source) Description copied from interface:FabricServerAudiencesGet an audience to send to aCommandSourceStack.This will delegate to the native implementation by the command source, or otherwise use a wrapping implementation.
- Specified by:
audiencein interfaceFabricServerAudiences- Parameters:
source- source to send to.- Returns:
- the audience
-
audience
@NotNull public @NotNull net.kyori.adventure.audience.Audience audience(@NotNull @NotNull net.minecraft.commands.CommandSource source) Description copied from interface:FabricServerAudiencesGet an audience that will send to the providedCommandSource.Depending on the specific source, the returned audience may only support a subset of abilities.
- Specified by:
audiencein interfaceFabricServerAudiences- Parameters:
source- source to send to- Returns:
- an audience for the source
-
audience
@NotNull public @NotNull net.kyori.adventure.audience.Audience audience(@NotNull @NotNull Iterable<net.minecraft.server.level.ServerPlayer> players) Description copied from interface:FabricServerAudiencesCreate an audience that will send to every listed player.- Specified by:
audiencein interfaceFabricServerAudiences- Parameters:
players- Players to send to.- Returns:
- a new audience
-
world
@NotNull public @NotNull net.kyori.adventure.audience.Audience world(@NotNull @NotNull net.kyori.adventure.key.Key worldId) - Specified by:
worldin interfacenet.kyori.adventure.platform.AudienceProvider
-
server
@NotNull public @NotNull net.kyori.adventure.audience.Audience server(@NotNull @NotNull String serverName) - Specified by:
serverin interfacenet.kyori.adventure.platform.AudienceProvider
-
flattener
@NotNull public @NotNull net.kyori.adventure.text.flattener.ComponentFlattener flattener()Description copied from interface:FabricAudiencesReturn a component flattener that can use game data to resolve extra information about components.- Specified by:
flattenerin interfacenet.kyori.adventure.platform.AudienceProvider- Specified by:
flattenerin interfaceFabricAudiences- Returns:
- the flattener
-
renderer
@NotNull public @NotNull net.kyori.adventure.text.renderer.ComponentRenderer<net.kyori.adventure.pointer.Pointered> renderer()Description copied from interface:FabricAudiencesActive renderer to render components.- Specified by:
rendererin interfaceFabricAudiences- Returns:
- Shared renderer
-
toNative
public @NotNull net.minecraft.network.chat.Component toNative(@NotNull @NotNull net.kyori.adventure.text.Component adventure) Description copied from interface:FabricAudiencesGet a nativeComponentfrom an adventureComponent.The specific type of the returned component is undefined. For example, it may be a wrapper object.
- Specified by:
toNativein interfaceFabricAudiences- Parameters:
adventure- adventure input- Returns:
- native representation
-
bossBars
-
close
public void close()- Specified by:
closein interfacenet.kyori.adventure.platform.AudienceProvider- Specified by:
closein interfaceAutoCloseable
-
registryAccess
@NotNull public @NotNull net.minecraft.core.RegistryAccess registryAccess()- Specified by:
registryAccessin interfaceFabricAudiencesInternal
-