Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class PixelEngineRegistry {
- //this was static first time
- private final Map<String,SoundManager>sndmngs=new HashMap<String,SoundManager>();
- public void registerSoundManager(String id, SoundManager sndmng){
- if(!id.equals("")&&!id.equals(" ")){
- sndmngs.put(id, sndmng);
- PixelEngine.LOGGER.info("Successfulley registered SoundManager '"+id+"' into PixelEngine Registry.");
- }else if(sndmngs.containsKey(id))
- PixelEngine.LOGGER.info("There already is a SoundManager registered with the id '"+id+"'. Using the registered one instead.");
- else
- PixelEngine.LOGGER.info("There was a problem registering the SoundManager '"+id+"', either it's null or it has an invalid id.");
- }
- public void registerResourcePack(IResourcePack pack){
- List<IResourcePack> defaultPack=ObfuscationReflectionHelper.getPrivateValue(Minecraft.class, Minecraft.getMinecraft(), "defaultResourcePacks");
- defaultPack.add(pack);
- }
- public SoundManager getSoundManager(String id) {
- return this.sndmngs.get(id);
- }
- public SoundManager getWorldSoundManager(World world) {
- return this.sndmngs.get(WorldData.forWorld(world).getWorldID());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment