Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@
import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.BlockParticleOption;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.util.RandomSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityDimensions;
import net.minecraft.world.entity.MoverType;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.RenderShape;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate;
import net.minecraft.world.phys.Vec3;
Expand All @@ -55,7 +57,7 @@ public abstract class EntityContraptionInteractionMixin {
protected abstract float nextStep();

@Shadow
protected abstract void playStepSound(BlockPos pos, BlockState state);
public abstract void playSound(SoundEvent sound, float volume, float pitch);

@Unique
private Stream<AbstractContraptionEntity> create$getIntersectionContraptionsStream() {
Expand Down Expand Up @@ -101,7 +103,8 @@ public abstract class EntityContraptionInteractionMixin {
MutableBoolean stepped = new MutableBoolean(false);

create$forCollision(worldPos, (contraption, state, pos) -> {
playStepSound(pos, state);
SoundType soundtype = state.getSoundType();
playSound(soundtype.getStepSound(), soundtype.getVolume() * 0.15F, soundtype.getPitch());
stepped.setTrue();
});

Expand Down