Skip to content

Commit

Permalink
feat: mk5 suit up/down sfx
Browse files Browse the repository at this point in the history
  • Loading branch information
Duzos committed Aug 28, 2024
1 parent b110d3a commit 3932202
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ private void genSounds(FabricDataGenerator.Pack pack) {
BasicSoundProvider provider = new BasicSoundProvider(output);

provider.addSound("thruster", Register.Sounds.THRUSTER);
provider.addSound("mark5_noises", Register.Sounds.MARK5_NOISES);

return provider;
})));
Expand Down
1 change: 1 addition & 0 deletions src/main/java/mc/duzo/timeless/registry/Register.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public static void init() {

public static class Sounds {
public static final SoundEvent THRUSTER = register("thruster");
public static final SoundEvent MARK5_NOISES = register("mark5_noises");

private static SoundEvent register(String name) {
return register(new Identifier(Timeless.MOD_ID, name));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.sound.SoundCategory;
import net.minecraft.util.Hand;
import net.minecraft.util.TypedActionResult;
import net.minecraft.world.World;
Expand Down Expand Up @@ -40,6 +41,7 @@ public static boolean toCase(ServerPlayerEntity player, boolean force) {
if (!player.isOnGround()) return false;
if (!(getSet().isWearing(player))) return false;

player.getWorld().playSound(null, player.getBlockPos(), Register.Sounds.MARK5_NOISES, SoundCategory.PLAYERS, 0.25f, 1f);
Network.toTracking(new MarkFiveAnimationS2CPacket(player.getUuid(), false), player);
}

Expand All @@ -61,6 +63,7 @@ public static boolean fromCase(ServerPlayerEntity player, boolean force) {
if (!player.getMainHandStack().isOf(Register.Items.MARK_FIVE_CASE)) return false; // not holding
if (getSet().isWearing(player)) return false; // already wearing

player.getWorld().playSound(null, player.getBlockPos(), Register.Sounds.MARK5_NOISES, SoundCategory.PLAYERS, 0.25f, 1f);
Network.toTracking(new MarkFiveAnimationS2CPacket(player.getUuid(), true), player);

player.getMainHandStack().setCount(0);
Expand Down
Binary file not shown.

0 comments on commit 3932202

Please sign in to comment.