Auto crafting table sound

This commit is contained in:
modmuss50 2017-07-01 12:09:35 +01:00
parent 9a7ffce98e
commit 5efd8daab1
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82
4 changed files with 15 additions and 0 deletions

View file

@ -36,11 +36,13 @@ public class ModSounds {
public static SoundEvent CABLE_SHOCK;
public static SoundEvent BLOCK_DISMANTLE;
public static SoundEvent SAP_EXTRACT;
public static SoundEvent AUTO_CRAFTING;
public static void init() {
CABLE_SHOCK = getSound("cable_shock");
BLOCK_DISMANTLE = getSound("block_dismantle");
SAP_EXTRACT = getSound("sap_extract");
AUTO_CRAFTING = getSound("auto_crafting");
}
private static SoundEvent getSound(String str) {

View file

@ -12,6 +12,7 @@ import net.minecraft.item.crafting.Ingredient;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundCategory;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import org.apache.commons.lang3.tuple.Pair;
import reborncore.api.tile.IInventoryProvider;
@ -21,6 +22,7 @@ import reborncore.common.util.ItemUtils;
import techreborn.client.container.IContainerProvider;
import techreborn.client.container.builder.BuiltContainer;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.init.ModSounds;
import javax.annotation.Nullable;
import java.util.ArrayList;
@ -115,6 +117,11 @@ public class TileAutoCraftingTable extends TilePowerAcceptor implements IContain
if (canMake(recipe)) {
if (canUseEnergy(euTick)) {
progress++;
if(progress == 1){
world.playSound(null, pos.getX(), pos.getY(),
pos.getZ(), ModSounds.AUTO_CRAFTING,
SoundCategory.BLOCKS, 0.3F, 0.8F);
}
useEnergy(euTick);
}
}

View file

@ -16,5 +16,11 @@
"sounds": [
"techreborn:cable_shock"
]
},
"auto_crafting": {
"category": "block",
"sounds": [
"techreborn:auto_crafting"
]
}
}