switch (ChestAction.valueOf(action.asString().toUpperCase())) {
case OPEN:
for (dPlayer player: players) {
if (sound.asBoolean()) player.getPlayerEntity().playSound(location, Sound.CHEST_OPEN, 1, 1);
((CraftPlayer)player.getPlayerEntity()).getHandle().playerConnection.sendPacket(
new PacketPlayOutBlockAction(location.getBlockX(), location.getBlockY(), location.getBlockZ(),
((CraftWorld) location.getWorld()).getHandle().getType(location.getBlockX(), location.getBlockY(), location.getBlockZ()), 1, 1));
}
break;
case CLOSE:
for (dPlayer player: players) {
if (sound.asBoolean()) player.getPlayerEntity().getWorld().playSound(location, Sound.CHEST_CLOSE, 1, 1);
((CraftPlayer)player.getPlayerEntity()).getHandle().playerConnection.sendPacket(
new PacketPlayOutBlockAction(location.getBlockX(), location.getBlockY(), location.getBlockZ(),
((CraftWorld)location.getWorld()).getHandle().getType(location.getBlockX(), location.getBlockY(), location.getBlockZ()), 1, 0));
}
break;
}
}