2025-11-24 22:52:51 +03:00

41 lines
1.3 KiB
Java

/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.mojang.serialization.MapCodec
*/
package net.minecraft.world.level.block;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.entity.projectile.Projectile;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
public class AmethystBlock
extends Block {
public static final MapCodec<AmethystBlock> CODEC = AmethystBlock.simpleCodec(AmethystBlock::new);
public MapCodec<? extends AmethystBlock> codec() {
return CODEC;
}
public AmethystBlock(BlockBehaviour.Properties props) {
super(props);
}
@Override
protected void onProjectileHit(Level level, BlockState state, BlockHitResult hitResult, Projectile projectile) {
if (!level.isClientSide()) {
BlockPos hitPos = hitResult.getBlockPos();
level.playSound(null, hitPos, SoundEvents.AMETHYST_BLOCK_CHIME, SoundSource.BLOCKS, 1.0f, 0.5f + level.random.nextFloat() * 1.2f);
}
}
}