Class ViaFacet<V>
- java.lang.Object
-
- net.kyori.adventure.platform.facet.FacetBase<V>
-
- net.kyori.adventure.platform.viaversion.ViaFacet<V>
-
- All Implemented Interfaces:
Facet<V>,Facet.Message<V,java.lang.String>
- Direct Known Subclasses:
ViaFacet.BossBar.Builder,ViaFacet.BossBar.Builder1_9_To_1_15,ViaFacet.ProtocolBased
public class ViaFacet<V> extends FacetBase<V> implements Facet.Message<V,java.lang.String>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classViaFacet.ActionBar<V>static classViaFacet.ActionBarTitle<V>static classViaFacet.BossBar<V>static classViaFacet.Chat<V>static classViaFacet.ProtocolBased<V>static classViaFacet.Title<V>-
Nested classes/interfaces inherited from interface net.kyori.adventure.platform.facet.Facet
Facet.Book<V,M,B>, Facet.BossBarEntity<V,P>, Facet.BossBarPacket<V>, Facet.ChatPacket<V,M>, Facet.FakeEntity<V,P>, Facet.Message<V,M>, Facet.Position<V,P>, Facet.Sound<V,P>, Facet.TitlePacket<V,M,T>
-
-
Field Summary
-
Fields inherited from class net.kyori.adventure.platform.facet.FacetBase
viewerClass
-
Fields inherited from interface net.kyori.adventure.platform.facet.Facet.Message
PROTOCOL_HEX_COLOR, PROTOCOL_JSON
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NonNull java.lang.StringcreateMessage(@NonNull V viewer, @NonNull net.kyori.adventure.text.Component message)Creates a message.@Nullable us.myles.ViaVersion.api.data.UserConnectionfindConnection(@NonNull V viewer)intfindProtocol(@NonNull V viewer)booleanisApplicable(@NonNull V viewer)Gets whether this handler is applicable to a particular viewer.booleanisSupported()Gets whether this handler is supported by the current runtime.
-
-
-
Method Detail
-
isSupported
public boolean isSupported()
Description copied from interface:FacetGets whether this handler is supported by the current runtime.If not, this can be discarded since it will fail for all viewers.
- Specified by:
isSupportedin interfaceFacet<V>- Overrides:
isSupportedin classFacetBase<V>- Returns:
- if this handler is supported
-
isApplicable
public boolean isApplicable(@NonNull V viewer)
Description copied from interface:FacetGets whether this handler is applicable to a particular viewer.This should only be invoked if
Facet.isSupported()istrue.- Specified by:
isApplicablein interfaceFacet<V>- Overrides:
isApplicablein classFacetBase<V>- Parameters:
viewer- a viewer- Returns:
- if this handler is applicable to a viewer
-
findConnection
public @Nullable us.myles.ViaVersion.api.data.UserConnection findConnection(@NonNull V viewer)
-
findProtocol
public int findProtocol(@NonNull V viewer)
-
createMessage
public @NonNull java.lang.String createMessage(@NonNull V viewer, @NonNull net.kyori.adventure.text.Component message)
Description copied from interface:Facet.MessageCreates a message.Messages should not be translated to a viewer's locale, this is done elsewhere.
- Specified by:
createMessagein interfaceFacet.Message<V,java.lang.String>- Parameters:
viewer- a viewermessage- a message- Returns:
- a message or
null
-
-