Class AdventurePacketConvertor
java.lang.Object
net.minestom.server.adventure.AdventurePacketConvertor
Utility methods to convert adventure enums to their packet values.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ServerPacketcreateEntitySoundPacket(Sound sound, Entity entity) Deprecated, for removal: This API element is subject to removal in a future version.static ServerPacketcreateSoundPacket(Sound sound, double x, double y, double z) Creates a sound packet from a sound and a location.
Random variation by default unless a seed is provided in theSound.static ServerPacketcreateSoundPacket(Sound sound, Sound.Emitter emitter) Creates a sound effect packet from a sound and an emitter.
Random variation by default unless a seed is provided in theSound.static ServerPacketCreates a sound stop packet from a sound stop.static <T> ServerPacketcreateTitlePartPacket(TitlePart<T> part, T value) Creates one of the three title packets from a title part and a value.static intGets the int value of a boss bar color.static byteGets the byte value of a collection of boss bar flags.static intgetBossBarOverlayValue(BossBar.Overlay overlay) Gets the int value of a boss bar overlay.static intGets the int value from a named text color.static intgetSoundSourceValue(Sound.Source source) Gets the int value of a sound source.
-
Constructor Details
-
AdventurePacketConvertor
public AdventurePacketConvertor()
-
-
Method Details
-
getBossBarOverlayValue
Gets the int value of a boss bar overlay.- Parameters:
overlay- the overlay- Returns:
- the value
-
getBossBarFlagValue
Gets the byte value of a collection of boss bar flags.- Parameters:
flags- the flags- Returns:
- the value
-
getBossBarColorValue
Gets the int value of a boss bar color.- Parameters:
color- the color- Returns:
- the value
-
getSoundSourceValue
Gets the int value of a sound source.- Parameters:
source- the source- Returns:
- the value
-
getNamedTextColorValue
Gets the int value from a named text color.- Parameters:
color- the color- Returns:
- the int value
-
createSoundPacket
Creates a sound packet from a sound and a location.
Random variation by default unless a seed is provided in theSound.- Parameters:
sound- the soundx- the x coordinatey- the y coordinatez- the z coordinate- Returns:
- the sound packet
-
createSoundPacket
-
createEntitySoundPacket
@Deprecated(forRemoval=true) public static ServerPacket createEntitySoundPacket(Sound sound, Entity entity) Deprecated, for removal: This API element is subject to removal in a future version.Creates an entity sound packet from an Adventure sound.- Parameters:
sound- the soundentity- the entity the sound is coming from- Returns:
- the packet
-
createSoundStopPacket
Creates a sound stop packet from a sound stop.- Parameters:
stop- the sound stop- Returns:
- the sound stop packet
-
createTitlePartPacket
Creates one of the three title packets from a title part and a value.- Type Parameters:
T- the type of the part- Parameters:
part- the partvalue- the value- Returns:
- the title packet
-
createSoundPacket(Sound, Sound.Emitter)