mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-21 15:41:38 +01:00
Move convenience method to PackeetGroupingAudience
This commit is contained in:
parent
5aa8b97c60
commit
af9dcf258a
@ -11,6 +11,7 @@ import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.title.TitlePart;
|
||||
import net.minestom.server.MinecraftServer;
|
||||
import net.minestom.server.adventure.AdventurePacketConvertor;
|
||||
import net.minestom.server.coordinate.Point;
|
||||
import net.minestom.server.entity.Player;
|
||||
import net.minestom.server.message.ChatPosition;
|
||||
import net.minestom.server.message.Messenger;
|
||||
@ -96,6 +97,15 @@ public interface PacketGroupingAudience extends ForwardingAudience {
|
||||
MinecraftServer.getBossBarManager().removeBossBar(this.getPlayers(), bar);
|
||||
}
|
||||
|
||||
/**
|
||||
* Plays a {@link Sound} at a given point
|
||||
* @param sound The sound to play
|
||||
* @param point The point in this instance at which to play the sound
|
||||
*/
|
||||
default void playSound(@NotNull Sound sound, @NotNull Point point) {
|
||||
playSound(sound, point.x(), point.y(), point.z());
|
||||
}
|
||||
|
||||
@Override
|
||||
default void playSound(@NotNull Sound sound, double x, double y, double z) {
|
||||
sendGroupedPacket(AdventurePacketConvertor.createSoundPacket(sound, x, y, z));
|
||||
|
@ -3,7 +3,6 @@ package net.minestom.server.instance;
|
||||
import it.unimi.dsi.fastutil.objects.ObjectArraySet;
|
||||
import net.kyori.adventure.identity.Identity;
|
||||
import net.kyori.adventure.pointer.Pointers;
|
||||
import net.kyori.adventure.sound.Sound;
|
||||
import net.minestom.server.MinecraftServer;
|
||||
import net.minestom.server.ServerProcess;
|
||||
import net.minestom.server.Tickable;
|
||||
@ -694,15 +693,6 @@ public abstract class Instance implements Block.Getter, Block.Setter,
|
||||
this.explosionSupplier = supplier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Plays a {@link Sound} at a given point
|
||||
* @param sound The sound to play
|
||||
* @param point The point in this instance at which to play the sound
|
||||
*/
|
||||
public void playSound(@NotNull Sound sound, @NotNull Point point) {
|
||||
playSound(sound, point.x(), point.y(), point.z());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the instance space.
|
||||
* <p>
|
||||
|
Loading…
Reference in New Issue
Block a user