mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 06:30:46 +01:00
update to Adventure 4.8.1
This commit is contained in:
parent
4d67d89033
commit
7de25fd330
2 changed files with 19 additions and 1 deletions
|
@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
api("org.yaml:snakeyaml:1.29")
|
||||
api("com.googlecode.json-simple:json-simple:1.1.1") // Paper
|
||||
api("it.unimi.dsi:fastutil:8.2.2")
|
||||
+ api(platform("net.kyori:adventure-bom:4.7.0"))
|
||||
+ api(platform("net.kyori:adventure-bom:4.8.1"))
|
||||
+ api("net.kyori:adventure-api")
|
||||
+ api("net.kyori:adventure-text-serializer-gson")
|
||||
+ api("net.kyori:adventure-text-serializer-legacy")
|
||||
|
|
|
@ -2335,6 +2335,24 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void playSound(final net.kyori.adventure.sound.Sound sound, final net.kyori.adventure.sound.Sound.Emitter emitter) {
|
||||
+ final Entity entity;
|
||||
+ if (emitter == net.kyori.adventure.sound.Sound.Emitter.self()) {
|
||||
+ entity = this.getHandle();
|
||||
+ } else if (emitter instanceof org.bukkit.entity.Entity) {
|
||||
+ entity = ((CraftEntity) emitter).getHandle();
|
||||
+ } else {
|
||||
+ throw new IllegalArgumentException("Sound emitter must be an Entity or self(), but was: " + emitter);
|
||||
+ }
|
||||
+
|
||||
+ final ResourceLocation name = io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.name());
|
||||
+ final java.util.Optional<net.minecraft.sounds.SoundEvent> event = net.minecraft.core.Registry.SOUND_EVENT.getOptional(name);
|
||||
+ if (event.isPresent()) {
|
||||
+ this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSoundEntityPacket(event.get(), io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.source()), entity, sound.volume(), sound.pitch()));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void stopSound(final net.kyori.adventure.sound.SoundStop stop) {
|
||||
+ this.getHandle().connection.send(new ClientboundStopSoundPacket(
|
||||
+ io.papermc.paper.adventure.PaperAdventure.asVanillaNullable(stop.sound()),
|
||||
|
|
Loading…
Reference in a new issue