Base blocks (WIP)
This commit is contained in:
parent
feb6c5172c
commit
c4a510bd2e
56 changed files with 4418 additions and 1 deletions
39
src/main/java/ru/bclib/blocks/WallMushroomBlock.java
Normal file
39
src/main/java/ru/bclib/blocks/WallMushroomBlock.java
Normal file
|
@ -0,0 +1,39 @@
|
|||
package ru.bclib.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
|
||||
public class WallMushroomBlock extends BaseWallPlantBlock {
|
||||
public WallMushroomBlock(int light) {
|
||||
super(FabricBlockSettings.of(Material.PLANT)
|
||||
.breakByTool(FabricToolTags.AXES)
|
||||
.breakByHand(true)
|
||||
.luminance(light)
|
||||
.hardness(0.2F)
|
||||
.sound(SoundType.GRASS)
|
||||
.sound(SoundType.WOOD)
|
||||
.noCollission());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
return Lists.newArrayList(new ItemStack(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSupport(LevelReader world, BlockPos pos, BlockState blockState, Direction direction) {
|
||||
return blockState.getMaterial().isSolid() && blockState.isFaceSturdy(world, pos, direction);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue