Skip to content

Commit

Permalink
refactor: range in findNearbyPlayer
Browse files Browse the repository at this point in the history
feat: sfx on mask toggle
  • Loading branch information
Duzos committed Sep 30, 2024
1 parent 4a17750 commit 0a0bf38
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.nbt.NbtCompound;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.Identifier;

import mc.duzo.timeless.Timeless;
Expand Down Expand Up @@ -41,6 +42,9 @@ private static void setMask(ServerPlayerEntity player, boolean val, boolean sync
Identifier anim = suit.getMaskAnimation(val);
if (anim == null) return;
DuzoAnimationMod.play(player, Register.Trackers.SUIT, anim);

SoundEvent sound = val ? suit.getEquipSound().orElse(null) : suit.getUnequipSound().orElse(null);
if (sound != null) player.playSound(sound, SoundCategory.PLAYERS, 1f, 1f);
}
}
public static boolean hasMask(PlayerEntity player) {
Expand Down

0 comments on commit 0a0bf38

Please sign in to comment.