mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-15 02:13:43 +01:00
Merge pull request #4017 from starlottemusic/patch-1
Sails use vanilla dye/shear sounds
This commit is contained in:
commit
94cb3a43f7
1 changed files with 4 additions and 0 deletions
|
@ -21,6 +21,8 @@ import net.minecraft.MethodsReturnNonnullByDefault;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.core.NonNullList;
|
import net.minecraft.core.NonNullList;
|
||||||
|
import net.minecraft.sounds.SoundEvents;
|
||||||
|
import net.minecraft.sounds.SoundSource;
|
||||||
import net.minecraft.world.InteractionHand;
|
import net.minecraft.world.InteractionHand;
|
||||||
import net.minecraft.world.InteractionResult;
|
import net.minecraft.world.InteractionResult;
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
|
@ -90,6 +92,7 @@ public class SailBlock extends WrenchableDirectionalBlock {
|
||||||
|
|
||||||
if (heldItem.getItem() instanceof ShearsItem) {
|
if (heldItem.getItem() instanceof ShearsItem) {
|
||||||
if (!world.isClientSide)
|
if (!world.isClientSide)
|
||||||
|
world.playSound(null, pos, SoundEvents.SHEEP_SHEAR, SoundSource.BLOCKS, 1.0f, 1.0f);
|
||||||
applyDye(state, world, pos, ray.getLocation(), null);
|
applyDye(state, world, pos, ray.getLocation(), null);
|
||||||
return InteractionResult.SUCCESS;
|
return InteractionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -100,6 +103,7 @@ public class SailBlock extends WrenchableDirectionalBlock {
|
||||||
DyeColor color = DyeColor.getColor(heldItem);
|
DyeColor color = DyeColor.getColor(heldItem);
|
||||||
if (color != null) {
|
if (color != null) {
|
||||||
if (!world.isClientSide)
|
if (!world.isClientSide)
|
||||||
|
world.playSound(null, pos, SoundEvents.DYE_USE, SoundSource.BLOCKS, 1.0f, 1.1f - world.random.nextFloat() * .2f);
|
||||||
applyDye(state, world, pos, ray.getLocation(), color);
|
applyDye(state, world, pos, ray.getLocation(), color);
|
||||||
return InteractionResult.SUCCESS;
|
return InteractionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue