Move convenience method to PackeetGroupingAudience

This commit is contained in:
GreatWyrm 2022-08-01 18:58:30 -07:00 committed by Matt Worzala
parent 5aa8b97c60
commit af9dcf258a
2 changed files with 10 additions and 10 deletions

View File

@ -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));

View File

@ -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>