Auto crafting table sound
This commit is contained in:
parent
9a7ffce98e
commit
5efd8daab1
4 changed files with 15 additions and 0 deletions
|
@ -36,11 +36,13 @@ public class ModSounds {
|
||||||
public static SoundEvent CABLE_SHOCK;
|
public static SoundEvent CABLE_SHOCK;
|
||||||
public static SoundEvent BLOCK_DISMANTLE;
|
public static SoundEvent BLOCK_DISMANTLE;
|
||||||
public static SoundEvent SAP_EXTRACT;
|
public static SoundEvent SAP_EXTRACT;
|
||||||
|
public static SoundEvent AUTO_CRAFTING;
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
CABLE_SHOCK = getSound("cable_shock");
|
CABLE_SHOCK = getSound("cable_shock");
|
||||||
BLOCK_DISMANTLE = getSound("block_dismantle");
|
BLOCK_DISMANTLE = getSound("block_dismantle");
|
||||||
SAP_EXTRACT = getSound("sap_extract");
|
SAP_EXTRACT = getSound("sap_extract");
|
||||||
|
AUTO_CRAFTING = getSound("auto_crafting");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static SoundEvent getSound(String str) {
|
private static SoundEvent getSound(String str) {
|
||||||
|
|
|
@ -12,6 +12,7 @@ import net.minecraft.item.crafting.Ingredient;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.util.SoundCategory;
|
||||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
import reborncore.api.tile.IInventoryProvider;
|
import reborncore.api.tile.IInventoryProvider;
|
||||||
|
@ -21,6 +22,7 @@ import reborncore.common.util.ItemUtils;
|
||||||
import techreborn.client.container.IContainerProvider;
|
import techreborn.client.container.IContainerProvider;
|
||||||
import techreborn.client.container.builder.BuiltContainer;
|
import techreborn.client.container.builder.BuiltContainer;
|
||||||
import techreborn.client.container.builder.ContainerBuilder;
|
import techreborn.client.container.builder.ContainerBuilder;
|
||||||
|
import techreborn.init.ModSounds;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -115,6 +117,11 @@ public class TileAutoCraftingTable extends TilePowerAcceptor implements IContain
|
||||||
if (canMake(recipe)) {
|
if (canMake(recipe)) {
|
||||||
if (canUseEnergy(euTick)) {
|
if (canUseEnergy(euTick)) {
|
||||||
progress++;
|
progress++;
|
||||||
|
if(progress == 1){
|
||||||
|
world.playSound(null, pos.getX(), pos.getY(),
|
||||||
|
pos.getZ(), ModSounds.AUTO_CRAFTING,
|
||||||
|
SoundCategory.BLOCKS, 0.3F, 0.8F);
|
||||||
|
}
|
||||||
useEnergy(euTick);
|
useEnergy(euTick);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,5 +16,11 @@
|
||||||
"sounds": [
|
"sounds": [
|
||||||
"techreborn:cable_shock"
|
"techreborn:cable_shock"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"auto_crafting": {
|
||||||
|
"category": "block",
|
||||||
|
"sounds": [
|
||||||
|
"techreborn:auto_crafting"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
BIN
src/main/resources/assets/techreborn/sounds/auto_crafting.ogg
Normal file
BIN
src/main/resources/assets/techreborn/sounds/auto_crafting.ogg
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue