package net.glowstone.constants;

import org.apache.commons.lang3.Validate;
import org.bukkit.Sound;

import static org.bukkit.Sound.*;

/**
 * Mappings from the Sound enum to individual sound names.
 */
public final class GlowSound {

    private static final String[] names = new String[values().length];

    static {
        for (Sound sound : values()) {
            set(sound, sound.name().toLowerCase().replaceAll("\\.", ""));
            System.out.println(sound.name().toLowerCase().replaceAll("\\.", ""));
        }
    }

    private GlowSound() {
    }

    /**
     * Get the sound name for a specified Sound.
     *
     * @param sound the Sound.
     * @return the sound name.
     */
    public static String getName(Sound sound) {
        Validate.notNull(sound, "Sound cannot be null");
        return names[sound.ordinal()];
    }

    private static void set(Sound sound, String key) {
        names[sound.ordinal()] = key;
    }

}

@@ -95,16 +95,49 @@
 Sound;%0A%0A
+import java.util.regex.Pattern;%0A%0A
 import s
@@ -337,165 +337,188 @@
 h%5D;%0A
-%0A    static %7B%0A        for (Sound sound : values()) %7B%0A            set(sound, sound.name().toLowerCase().replaceAll(%22%5C%5C.%22, %22%22));%0A            System.out.println
+    private static final Pattern SOUND_ENUM_PATTERN = Pattern.compile(%22%5C%5C.%22);%0A%0A    static %7B%0A        for (Sound sound : values()) %7B%0A            set(sound, SOUND_ENUM_PATTERN.matcher
 (sou
@@ -540,16 +540,17 @@
 erCase()
+)
 .replace
@@ -557,15 +557,8 @@
 All(
-%22%5C%5C.%22, 
 %22%22))

Optimize GlowSound (add pattern and remove debug)