From 9732ecb06e4eb24828ea047386cf0bbc274949b7 Mon Sep 17 00:00:00 2001 From: Andrew-71 Date: Mon, 17 Apr 2023 22:27:44 +0300 Subject: [PATCH] Tag, you're it --- .../DigitalInterfacePeripheral.java | 26 ++++++++++++++++++ .../DigitalInterfacePeripheral.java | 27 +++++++++++++++++++ Forge/src/main/resources/META-INF/mods.toml | 2 +- gradle.properties | 2 +- 4 files changed, 55 insertions(+), 2 deletions(-) diff --git a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfacePeripheral.java b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfacePeripheral.java index 812e787..f72e511 100644 --- a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfacePeripheral.java +++ b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfacePeripheral.java @@ -33,6 +33,7 @@ import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.levelgen.Heightmap; import net.minecraft.world.phys.Vec3; +import su.a71.tardim_ic.tardim_ic.Registration; import su.a71.tardim_ic.tardim_ic.utils.FakePlayer; import javax.annotation.Nonnull; @@ -826,4 +827,29 @@ public class DigitalInterfacePeripheral implements IPeripheral { return new ObjectLuaTable(skins); } + + /** + * Play cloister bell sound. + */ + @LuaFunction(mainThread = true) + public final void cloisterBell() throws LuaException { + if (this.tileEntity.getLevel().isClientSide()) { + return; + } + try { + Level lvl = this.tileEntity.getLevel(); + if (!lvl.isClientSide) { + lvl.playSound( + null, + this.tileEntity.getPos(), + Registration.CLOISTER_SOUND_EVENT, + SoundSource.BLOCKS, + 1.5f, + 1f + ); + } + } catch (Exception var9) { + throw new LuaException("There was an error trying to play the sound"); + } + } } diff --git a/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfacePeripheral.java b/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfacePeripheral.java index c00164f..60ea768 100644 --- a/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfacePeripheral.java +++ b/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfacePeripheral.java @@ -1,6 +1,7 @@ package su.a71.tardim_ic.tardim_ic.digital_interface; import com.mojang.datafixers.util.Pair; +import com.swdteam.common.command.tardim.CommandTardimBase; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Holder; @@ -34,6 +35,7 @@ import com.swdteam.common.init.TRDSounds; import com.swdteam.common.item.ItemTardim; import com.swdteam.main.Tardim; +import su.a71.tardim_ic.tardim_ic.Registration; import su.a71.tardim_ic.tardim_ic.utils.FakePlayer; import javax.annotation.Nonnull; @@ -813,4 +815,29 @@ public class DigitalInterfacePeripheral implements IPeripheral { return new ObjectLuaTable(skins); } + + /** + * Play cloister bell sound. + */ + @LuaFunction(mainThread = true) + public final void cloisterBell() throws LuaException { + if (this.tileEntity.getLevel().isClientSide()) { + return; + } + try { + Level lvl = this.tileEntity.getLevel(); + if (!lvl.isClientSide) { + lvl.playSound( + null, + this.tileEntity.getPos(), + Registration.CLOISTER_SOUND.get(), + SoundSource.BLOCKS, + 1.5f, + 1f + ); + } + } catch (Exception var9) { + throw new LuaException("There was an error trying to play the sound"); + } + } } diff --git a/Forge/src/main/resources/META-INF/mods.toml b/Forge/src/main/resources/META-INF/mods.toml index eadc068..ddaa3b9 100644 --- a/Forge/src/main/resources/META-INF/mods.toml +++ b/Forge/src/main/resources/META-INF/mods.toml @@ -5,7 +5,7 @@ license = "MIT" [[mods]] #mandatory # The modid of the mod modId = "tardim_ic" #mandatory -version = "0.9" #mandatory +version = "1.0" #mandatory # A display name for the mod displayName = "TARDIM: In Control" #mandatory # The description text for the mod (multi line!) (#mandatory) diff --git a/gradle.properties b/gradle.properties index ffd83e6..fc9bf37 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Project -version=0.9 +version=1.0 group=su.a71.tardim_ic # Common