file dir edit
This commit is contained in:
34
src/main/java/net/arcmods/ryantlg/blockClasses/elon.java
Executable file
34
src/main/java/net/arcmods/ryantlg/blockClasses/elon.java
Executable file
@@ -0,0 +1,34 @@
|
||||
package net.arcmods.ryantlg.blockClasses;
|
||||
|
||||
import net.arcmods.ryantlg.sounds;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class elon extends Block{
|
||||
|
||||
public elon(Settings settings) {
|
||||
super(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult onUse(BlockState blockState, World world, BlockPos blockPos, PlayerEntity placedBy, Hand hand, BlockHitResult blockHitResult) {
|
||||
if (!world.isClient) {
|
||||
world.playSound(
|
||||
null, // Player - if non-null, will play sound for every nearby player *except* the specified player
|
||||
blockPos, // The position of where the sound will come from
|
||||
sounds.ELON_SOUND_EVENT, // The sound that will play
|
||||
SoundCategory.BLOCKS, // This determines which of the volume sliders affect this sound
|
||||
1f, //Volume multiplier, 1 is normal, 0.5 is half volume, etc
|
||||
1f // Pitch multiplier, 1 is normal, 0.5 is half pitch, etc
|
||||
);
|
||||
}
|
||||
return ActionResult.FAIL;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user