If lazy initialization isn't needed, you could actually replace your class for an enum. Heard it from Effective Java second edition:
public enum MusicPlayer {
PLAYER; //could use a better name
private static MusicPlayer instance = new MusicPlayer();
private HashMap<String, Clip> clips = new HashMap<String, Clip>();
private int frameGap;
private boolean mute;
//...
}Due to the nature of how enums are created, you don't need to worry about double-checked locking if you switch to a multithreaded environment. Also, serialization doesn't break the singleton design (when deserializing a class object, a new instance is constructed in memory. Enums prevent this, allowing you to simply discard the new object by overriding readResolve and returning the pre-existing instance.Enums are basically the future of the singleton design. I'm not a huge fan of the singleton pattern, other than maybe for logging, but hopefully this will come in handy for those who use it quite often.
Thanks! I plan on staying, although I'm not much of a RuneScaper myself anymore (quit a few years ago). I've been helping friends with this scripts every now-and-then, so within time I'll hopefully be familiar enough with the API and botting aspects (like antiban) to release my own innovative scripts. Thanks for the warm welcome, much appreciated