Paper/Spigot-Server-Patches/0077-Re-add-playSound-in-CraftWorld.patch
2016-03-06 14:37:28 -06:00

33 lines
1.4 KiB
Diff

From 32d4f7dafab4e62891e0c353c83fe8a65e4272ed Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sun, 6 Mar 2016 14:31:04 -0600
Subject: [PATCH] Re-add playSound in CraftWorld
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 9e75cb6..c0246a0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1357,6 +1357,18 @@ public class CraftWorld implements World {
getHandle().a(null, x, y, z, CraftSound.getSoundEffect(CraftSound.getSound(sound)), SoundCategory.MASTER, volume, pitch); // PAIL: rename
}
+ // Paper - This is getting removed somewhere/somehow and preventing a build from compiling
+ public void playSound(Location loc, String sound, float volume, float pitch) {
+ if (loc == null || sound == null) return;
+
+ double x = loc.getX();
+ double y = loc.getY();
+ double z = loc.getZ();
+
+ PacketPlayOutCustomSoundEffect packet = new PacketPlayOutCustomSoundEffect(sound, SoundCategory.MASTER, x, y, z, volume, pitch);
+ world.getMinecraftServer().getPlayerList().sendPacketNearby(null, x, y, z, volume > 1.0F ? 16.0F * volume : 16.0D, this.world.dimension, packet);
+ }
+
public String getGameRuleValue(String rule) {
return getHandle().getGameRules().get(rule);
}
--
2.7.2