Implement API for Sound, and playing the sounds for Worlds and Players. Adds BUKKIT-1430, BUKKIT-1226 and BUKKIT-2019
This commit is contained in:
@@ -41,6 +41,7 @@ import org.bukkit.World;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.generator.BlockPopulator;
|
||||
import org.bukkit.Difficulty;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.craftbukkit.block.CraftBlock;
|
||||
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
import org.bukkit.plugin.messaging.StandardMessenger;
|
||||
@@ -1161,4 +1162,14 @@ public class CraftWorld implements World {
|
||||
public void setWaterAnimalSpawnLimit(int limit) {
|
||||
waterAnimalSpawn = limit;
|
||||
}
|
||||
|
||||
public void playSound(Location loc, Sound sound, float volume, float pitch) {
|
||||
if (loc == null || sound == null) return;
|
||||
|
||||
double x = loc.getX();
|
||||
double y = loc.getY();
|
||||
double z = loc.getZ();
|
||||
|
||||
getHandle().makeSound(x, y, z, sound.getSound(), volume, pitch);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user