Added config for machines crafting sound (#1969)

This commit is contained in:
vhd 2020-01-10 23:03:58 +02:00 committed by modmuss50
parent bc47a03451
commit 9e1b1a76e1
3 changed files with 9 additions and 2 deletions

View file

@ -70,7 +70,10 @@ public class TechReborn implements ModInitializer {
ServerboundPackets.init();
ModRegistry.setupShit();
RecipeCrafter.soundHanlder = new ModSounds.SoundHandler();
if (TechRebornConfig.machineSoundVolume > 0) {
if (TechRebornConfig.machineSoundVolume > 1) TechRebornConfig.machineSoundVolume = 1F;
RecipeCrafter.soundHanlder = new ModSounds.SoundHandler();
}
ModLoot.init();
WorldGenerator.initBiomeFeatures();
GuiHandler.register();

View file

@ -495,6 +495,9 @@ public class TechRebornConfig {
@Config(config = "misc", category = "general", key = "IC2TransformersStyle", comment = "Input from dots side, output from other sides, like in IC2.")
public static boolean IC2TransformersStyle = true;
@Config(config = "misc", category = "general", key = "MachineSoundVolume", comment = "Machines crafting sound volume (0 - disabled, 1 - max)")
public static float machineSoundVolume = 1.0F;
@Config(config = "misc", category = "general", key = "manualRefund", comment = "Allow refunding items used to craft the manual")
public static boolean allowManualRefund = true;

View file

@ -29,6 +29,7 @@ import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvent;
import net.minecraft.world.World;
import reborncore.common.recipes.ICrafterSoundHanlder;
import techreborn.config.TechRebornConfig;
/**
* Created by Mark on 20/03/2016.
@ -54,7 +55,7 @@ public class ModSounds {
return;
}
world.playSound(null, blockEntity.getPos().getX(), blockEntity.getPos().getY(),
blockEntity.getPos().getZ(), ModSounds.MACHINE_RUN, SoundCategory.BLOCKS, 1F, 1F);
blockEntity.getPos().getZ(), ModSounds.MACHINE_RUN, SoundCategory.BLOCKS, TechRebornConfig.machineSoundVolume, 1F);
}
}
}