ActuallyAdditions/src/main/java/de/ellpeck/actuallyadditions/mod/misc/SoundHandler.java

45 lines
1.3 KiB
Java
Raw Normal View History

2016-05-16 22:52:27 +02:00
/*
* This file ("SoundHandler.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
2017-01-01 16:23:26 +01:00
* © 2015-2017 Ellpeck
2016-05-16 22:52:27 +02:00
*/
2016-12-06 18:10:43 +01:00
package de.ellpeck.actuallyadditions.mod.misc;
2016-05-01 22:26:26 +02:00
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
2016-06-17 23:50:38 +02:00
public final class SoundHandler{
2016-05-01 22:26:26 +02:00
public static SoundEvent duhDuhDuhDuuuh;
public static SoundEvent coffeeMachine;
public static SoundEvent reconstructor;
public static SoundEvent crusher;
private static int size = 0;
public static void init(){
size = SoundEvent.REGISTRY.getKeys().size();
2016-11-19 23:12:22 +01:00
duhDuhDuhDuuuh = registerSound("duh_duh_duh_duuuh");
coffeeMachine = registerSound("coffee_machine");
2016-05-01 22:26:26 +02:00
reconstructor = registerSound("reconstructor");
crusher = registerSound("crusher");
}
private static SoundEvent registerSound(String name){
2016-11-17 20:23:18 +01:00
ResourceLocation resLoc = new ResourceLocation(ModUtil.MOD_ID, name);
2016-05-01 22:26:26 +02:00
SoundEvent event = new SoundEvent(resLoc);
SoundEvent.REGISTRY.register(size, resLoc, event);
size++;
return event;
}
}