Map org.bukkit.Sound to String values for sending to client.

This change was done to remove the internal sound names from the API.
Along with moving the internal names into CraftBukkit, a unit test was
added for any new sounds added in the API to assure they have a non-null
mapping.

By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
CraftBukkit/Spigot
2012-09-26 16:34:06 -05:00
parent 4277872612
commit f57bc0f77f
4 changed files with 160 additions and 2 deletions

View File

@@ -33,6 +33,7 @@ import org.bukkit.craftbukkit.conversations.ConversationTracker;
import org.bukkit.craftbukkit.CraftEffect;
import org.bukkit.craftbukkit.CraftOfflinePlayer;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.CraftSound;
import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.map.CraftMapView;
import org.bukkit.craftbukkit.map.RenderData;
@@ -257,7 +258,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
double y = loc.getBlockY() + 0.5;
double z = loc.getBlockZ() + 0.5;
Packet62NamedSoundEffect packet = new Packet62NamedSoundEffect(sound.getSound(), x, y, z, volume, pitch);
Packet62NamedSoundEffect packet = new Packet62NamedSoundEffect(CraftSound.getSound(sound), x, y, z, volume, pitch);
getHandle().netServerHandler.sendPacket(packet);
}