file dir edit

This commit is contained in:
RyanTLG
2022-03-17 18:59:32 +02:00
parent 8a0f393cc0
commit 3b84706602
59 changed files with 152 additions and 143 deletions

View 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 Damon extends Block{
public Damon(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.MATT_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;
}
}

View File

@@ -0,0 +1,60 @@
package net.arcmods.ryantlg.blockClasses;
import net.arcmods.ryantlg.sounds;
import net.arcmods.ryantlg.items.itemsByCrop.weemItems;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.CropBlock;
import net.minecraft.block.ShapeContext;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemConvertible;
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.util.shape.VoxelShape;
import net.minecraft.world.World;
public class WeemCropBlock extends CropBlock {
private static final VoxelShape[] AGE_TO_SHAPE = new VoxelShape[]{Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 2.0D, 16.0D),
Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 3.0D, 16.0D),
Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 4.0D, 16.0D),
Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 5.0D, 16.0D),
Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 6.0D, 16.0D),
Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 7.0D, 16.0D),
Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 8.0D, 16.0D),
Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 9.0D, 16.0D)
};
public WeemCropBlock(AbstractBlock.Settings settings) {
super(settings);
}
public ItemConvertible getSeedsItem() {
return weemItems.WEEM_SEEDS;
}
public VoxelShape getOutlineShape(BlockState state, Block world, BlockPos pos, ShapeContext context) {
return AGE_TO_SHAPE[(Integer)state.get(this.getAgeProperty())];
}
@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.SNIFF_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;
}
}

View 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;
}
}

View File

@@ -0,0 +1,22 @@
package net.arcmods.ryantlg.blockClasses;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.item.ItemStack;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Formatting;
import net.minecraft.world.BlockView;
public class oriumBlock extends Block{
public oriumBlock(Settings settings) {
super(settings);
}
@Override
public void appendTooltip(ItemStack itemStack, BlockView world, List<Text> tooltip, TooltipContext tooltipContext) {
tooltip.add( new TranslatableText("block.gamermod.orium.tooltip").formatted(Formatting.LIGHT_PURPLE, Formatting.ITALIC) );
}
}