Cave bushes

This commit is contained in:
paulevsGitch 2020-10-21 17:02:22 +03:00
parent 8a89794f08
commit 28d501f351
19 changed files with 264 additions and 11 deletions

View file

@ -24,7 +24,14 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTyp
private static final Vec3i[] COLORS;
public AuroraCrystalBlock() {
super(FabricBlockSettings.of(Material.GLASS).breakByTool(FabricToolTags.PICKAXES).sounds(BlockSoundGroup.GLASS).lightLevel(15).nonOpaque());
super(FabricBlockSettings.of(Material.GLASS)
.breakByTool(FabricToolTags.PICKAXES)
.suffocates((state, world, pos) -> { return false; })
.hardness(1F)
.resistance(1F)
.sounds(BlockSoundGroup.GLASS)
.lightLevel(15)
.nonOpaque());
}
@Override

View file

@ -17,9 +17,11 @@ import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.BlockView;
import ru.betterend.blocks.BlockProperties.TripleShape;
import ru.betterend.blocks.basis.BlockBaseNotFull;
import ru.betterend.client.ERenderLayer;
import ru.betterend.client.IRenderTypeable;
import ru.betterend.util.BlocksHelper;
public class BlockEndLotusLeaf extends BlockBaseNotFull {
public class BlockEndLotusLeaf extends BlockBaseNotFull implements IRenderTypeable {
public static final EnumProperty<Direction> HORIZONTAL_FACING = Properties.HORIZONTAL_FACING;
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
private static final VoxelShape VSHAPE = Block.createCuboidShape(0, 0, 0, 16, 1, 16);
@ -47,4 +49,9 @@ public class BlockEndLotusLeaf extends BlockBaseNotFull {
public BlockState mirror(BlockState state, BlockMirror mirror) {
return BlocksHelper.mirrorHorizontal(state, mirror, HORIZONTAL_FACING);
}
@Override
public ERenderLayer getRenderLayer() {
return ERenderLayer.CUTOUT;
}
}

View file

@ -0,0 +1,60 @@
package ru.betterend.blocks.basis;
import java.io.Reader;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Material;
import net.minecraft.block.MaterialColor;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import ru.betterend.client.ERenderLayer;
import ru.betterend.client.IRenderTypeable;
import ru.betterend.interfaces.Patterned;
public class BlockSimpleLeaves extends BlockBaseNotFull implements IRenderTypeable {
public BlockSimpleLeaves(MaterialColor color) {
super(FabricBlockSettings.of(Material.LEAVES)
.strength(0.2F)
.sounds(BlockSoundGroup.GRASS)
.nonOpaque()
.allowsSpawning((state, world, pos, type) -> { return false; })
.suffocates((state, world, pos) -> { return false; })
.blockVision((state, world, pos) -> { return false; })
.materialColor(color));
}
public BlockSimpleLeaves(MaterialColor color, int light) {
super(FabricBlockSettings.of(Material.LEAVES)
.strength(0.2F)
.sounds(BlockSoundGroup.GRASS)
.nonOpaque()
.lightLevel(light)
.allowsSpawning((state, world, pos, type) -> { return false; })
.suffocates((state, world, pos) -> { return false; })
.blockVision((state, world, pos) -> { return false; })
.materialColor(color));
}
@Override
public String getStatesPattern(Reader data) {
Identifier blockId = Registry.BLOCK.getId(this);
return Patterned.createJson(data, blockId, blockId.getPath());
}
@Override
public String getModelPattern(String block) {
Identifier blockId = Registry.BLOCK.getId(this);
return Patterned.createJson(Patterned.BASE_BLOCK_MODEL, blockId, blockId.getPath());
}
@Override
public Identifier statePatternId() {
return Patterned.BLOCK_STATES_PATTERN;
}
@Override
public ERenderLayer getRenderLayer() {
return ERenderLayer.CUTOUT;
}
}