Mushroom improvements
This commit is contained in:
parent
9a1dc34927
commit
6c4a1d2eb0
28 changed files with 501 additions and 44 deletions
|
@ -0,0 +1,29 @@
|
|||
package ru.betterend.blocks;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
import ru.betterend.registry.BlockRegistry;
|
||||
|
||||
public class BlockMossyGlowshroomCap extends Block {
|
||||
public static final BooleanProperty TRANSITION = BooleanProperty.of("transition");
|
||||
|
||||
public BlockMossyGlowshroomCap() {
|
||||
super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).sounds(BlockSoundGroup.WOOD));
|
||||
this.setDefaultState(this.stateManager.getDefaultState().with(TRANSITION, false));
|
||||
}
|
||||
|
||||
public BlockState getPlacementState(ItemPlacementContext ctx) {
|
||||
return this.getDefaultState().with(TRANSITION, BlockRegistry.MOSSY_GLOWSHROOM.isTreeLog(ctx.getWorld().getBlockState(ctx.getBlockPos().down())));
|
||||
}
|
||||
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||
builder.add(TRANSITION);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue