diff --git a/src/main/java/techreborn/init/ModSounds.java b/src/main/java/techreborn/init/ModSounds.java index 30687046c..8e4c9b5b7 100644 --- a/src/main/java/techreborn/init/ModSounds.java +++ b/src/main/java/techreborn/init/ModSounds.java @@ -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) { diff --git a/src/main/java/techreborn/tiles/TileAutoCraftingTable.java b/src/main/java/techreborn/tiles/TileAutoCraftingTable.java index 2241350df..fbec9323d 100644 --- a/src/main/java/techreborn/tiles/TileAutoCraftingTable.java +++ b/src/main/java/techreborn/tiles/TileAutoCraftingTable.java @@ -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); } } diff --git a/src/main/resources/assets/techreborn/sounds.json b/src/main/resources/assets/techreborn/sounds.json index a9536b5a4..95775b14c 100644 --- a/src/main/resources/assets/techreborn/sounds.json +++ b/src/main/resources/assets/techreborn/sounds.json @@ -16,5 +16,11 @@ "sounds": [ "techreborn:cable_shock" ] + }, + "auto_crafting": { + "category": "block", + "sounds": [ + "techreborn:auto_crafting" + ] } } \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/sounds/auto_crafting.ogg b/src/main/resources/assets/techreborn/sounds/auto_crafting.ogg new file mode 100644 index 000000000..93793b40a Binary files /dev/null and b/src/main/resources/assets/techreborn/sounds/auto_crafting.ogg differ