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
    Modifier and Type
    Class
    Description
    static final class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    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 Summary

    Modifier and Type
    Method
    Description
    @NotNull net.kyori.adventure.audience.Audience
    all()
     
    @NotNull net.kyori.adventure.audience.Audience
    audience(@NotNull Iterable<net.minecraft.server.level.ServerPlayer> players)
    Create an audience that will send to every listed player.
    @NotNull net.kyori.adventure.audience.Audience
    audience(@NotNull net.minecraft.commands.CommandSource source)
    Get an audience that will send to the provided CommandSource.
    audience(@NotNull net.minecraft.commands.CommandSourceStack source)
    Get an audience to send to a CommandSourceStack.
     
    void
     
    @NotNull net.kyori.adventure.audience.Audience
     
    @NotNull net.kyori.adventure.text.flattener.ComponentFlattener
    Return a component flattener that can use game data to resolve extra information about components.
    static void
    Perform an action on every audience provider instance.
    @NotNull net.kyori.adventure.audience.Audience
    permission(@NotNull String permission)
     
    @NotNull net.kyori.adventure.audience.Audience
    player(@NotNull UUID playerId)
     
    @NotNull net.kyori.adventure.audience.Audience
     
    @NotNull net.minecraft.core.RegistryAccess
     
    @NotNull net.kyori.adventure.text.renderer.ComponentRenderer<net.kyori.adventure.pointer.Pointered>
    Active renderer to render components.
    @NotNull net.kyori.adventure.audience.Audience
    server(@NotNull String serverName)
     
    @NotNull net.minecraft.network.chat.Component
    toNative(@NotNull net.kyori.adventure.text.Component adventure)
    Get a native Component from an adventure Component.
    @NotNull net.kyori.adventure.audience.Audience
    world(@NotNull net.kyori.adventure.key.Key worldId)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.kyori.adventure.platform.AudienceProvider

    permission

    Methods 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

      public static void forEachInstance(Consumer<FabricServerAudiencesImpl> actor)
      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:
      all in interface net.kyori.adventure.platform.AudienceProvider
    • console

      @NotNull public @NotNull net.kyori.adventure.audience.Audience console()
      Specified by:
      console in interface net.kyori.adventure.platform.AudienceProvider
    • players

      @NotNull public @NotNull net.kyori.adventure.audience.Audience players()
      Specified by:
      players in interface net.kyori.adventure.platform.AudienceProvider
    • player

      @NotNull public @NotNull net.kyori.adventure.audience.Audience player(@NotNull @NotNull UUID playerId)
      Specified by:
      player in interface net.kyori.adventure.platform.AudienceProvider
    • permission

      @NotNull public @NotNull net.kyori.adventure.audience.Audience permission(@NotNull @NotNull String permission)
      Specified by:
      permission in interface net.kyori.adventure.platform.AudienceProvider
    • audience

      @NotNull public @NotNull AdventureCommandSourceStack audience(@NotNull @NotNull net.minecraft.commands.CommandSourceStack source)
      Description copied from interface: FabricServerAudiences
      Get an audience to send to a CommandSourceStack.

      This will delegate to the native implementation by the command source, or otherwise use a wrapping implementation.

      Specified by:
      audience in interface FabricServerAudiences
      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: FabricServerAudiences
      Get an audience that will send to the provided CommandSource.

      Depending on the specific source, the returned audience may only support a subset of abilities.

      Specified by:
      audience in interface FabricServerAudiences
      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: FabricServerAudiences
      Create an audience that will send to every listed player.
      Specified by:
      audience in interface FabricServerAudiences
      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:
      world in interface net.kyori.adventure.platform.AudienceProvider
    • server

      @NotNull public @NotNull net.kyori.adventure.audience.Audience server(@NotNull @NotNull String serverName)
      Specified by:
      server in interface net.kyori.adventure.platform.AudienceProvider
    • flattener

      @NotNull public @NotNull net.kyori.adventure.text.flattener.ComponentFlattener flattener()
      Description copied from interface: FabricAudiences
      Return a component flattener that can use game data to resolve extra information about components.
      Specified by:
      flattener in interface net.kyori.adventure.platform.AudienceProvider
      Specified by:
      flattener in interface FabricAudiences
      Returns:
      the flattener
    • renderer

      @NotNull public @NotNull net.kyori.adventure.text.renderer.ComponentRenderer<net.kyori.adventure.pointer.Pointered> renderer()
      Description copied from interface: FabricAudiences
      Active renderer to render components.
      Specified by:
      renderer in interface FabricAudiences
      Returns:
      Shared renderer
    • toNative

      public @NotNull net.minecraft.network.chat.Component toNative(@NotNull @NotNull net.kyori.adventure.text.Component adventure)
      Description copied from interface: FabricAudiences
      Get a native Component from an adventure Component.

      The specific type of the returned component is undefined. For example, it may be a wrapper object.

      Specified by:
      toNative in interface FabricAudiences
      Parameters:
      adventure - adventure input
      Returns:
      native representation
    • bossBars

      public ServerBossBarListener bossBars()
    • close

      public void close()
      Specified by:
      close in interface net.kyori.adventure.platform.AudienceProvider
      Specified by:
      close in interface AutoCloseable
    • registryAccess

      @NotNull public @NotNull net.minecraft.core.RegistryAccess registryAccess()
      Specified by:
      registryAccess in interface FabricAudiencesInternal