Skip to content

Commit

Permalink
- Mallet Sound
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeryn99 committed Nov 26, 2024
1 parent ee81ad9 commit 5f116ff
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@
import whocraft.tardis_refined.constants.ModMessages;
import whocraft.tardis_refined.constants.NbtConstants;
import whocraft.tardis_refined.patterns.sound.ConfiguredSound;
import whocraft.tardis_refined.registry.TRControlRegistry;
import whocraft.tardis_refined.registry.TRDimensionTypes;
import whocraft.tardis_refined.registry.TREntityRegistry;
import whocraft.tardis_refined.registry.TRItemRegistry;
import whocraft.tardis_refined.registry.*;

public class ControlEntity extends Entity {

Expand Down Expand Up @@ -257,6 +254,7 @@ public boolean hurt(DamageSource damageSource, float f) {

if(itemStack.is(TRItemRegistry.MALLET.get()) && !player.getCooldowns().isOnCooldown(TRItemRegistry.MALLET.get())){
player.getCooldowns().addCooldown(TRItemRegistry.MALLET.get(), 600);
playSound(TRSoundRegistry.MALLET.get());
itemStack.hurtAndBreak(15, player, (livingEntityx) -> {
livingEntityx.broadcastBreakEvent(EquipmentSlot.MAINHAND);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class TRSoundRegistry {
public static final RegistrySupplier<SoundEvent> CORRIDOR_TELEPORTER = setUpSound("corridor_teleporter");
public static final RegistrySupplier<SoundEvent> CORRIDOR_TELEPORTER_SUCCESS = setUpSound("corridor_teleporter_success");
public static final RegistrySupplier<SoundEvent> CLOISTER_BELL = setUpSound("cloister_bell");
public static final RegistrySupplier<SoundEvent> MALLET = setUpSound("mallet");

// Hums

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected void useWorkstation(ServerLevel serverLevel, Villager villager) {
return;
}

double observePointOffset = 4;
/* double observePointOffset = 4;
// Calculate villager position relative to the FACING direction
Vec3 offset = switch (facing) {
Expand All @@ -76,7 +76,7 @@ protected void useWorkstation(ServerLevel serverLevel, Villager villager) {
Vec3 targetPosition = new Vec3(consolePos.getX(), villager.position().y, consolePos.getZ()).add(offset);
villager.getNavigation().moveTo(targetPosition.x, targetPosition.y, targetPosition.z, 1);

*/
// Find the nearest control and perform actions
for (ControlEntity controlEntity : console.getControlEntityList()) {
if (controlEntity.isTickingDown() && villager.getRandom().nextBoolean()) {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ protected void addTranslations() {
addSound(TRSoundRegistry.GRAVITY_TUNNEL.get(), "Gravity tunnel winds");
addSound(TRSoundRegistry.LOW_FUEL.get(), "Low fuel warning");
addSound(TRSoundRegistry.CLOISTER_BELL.get(), "Cloister Bell");
addSound(TRSoundRegistry.MALLET.get(), "Mallet Hit");

//Hum Sounds
TardisHums.registerDefaultHums();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public void registerSounds() {
add(TRSoundRegistry.ARTRON_PILLAR_ACTIVE.get(), basicSound("artron_pillar", new ResourceLocation(TardisRefined.MODID, "blocks/artron_pillar_active")));
add(TRSoundRegistry.CORRIDOR_TELEPORTER.get(), basicSound("corridor_teleporter", new ResourceLocation(TardisRefined.MODID, "blocks/corridor_teleporter")));
add(TRSoundRegistry.CORRIDOR_TELEPORTER_SUCCESS.get(), basicSound("corridor_teleporter_success", new ResourceLocation(TardisRefined.MODID, "blocks/corridor_teleporter_success")));
add(TRSoundRegistry.MALLET.get(), basicSound("mallet", new ResourceLocation(TardisRefined.MODID, "tools/mallet")));


add(TRSoundRegistry.CLOISTER_BELL.get(),
basicSound("cloister_bell", SoundDefinition.Sound.sound(new ResourceLocation("block/bell/resonate"), SoundDefinition.SoundType.SOUND).pitch(0.85),
SoundDefinition.Sound.sound(new ResourceLocation("block/bell/resonate"), SoundDefinition.SoundType.SOUND).pitch(0.9)
Expand Down

0 comments on commit 5f116ff

Please sign in to comment.