This commit is contained in:
Aleksey 2020-10-22 18:01:20 +03:00
commit 1a2ec137f1
2 changed files with 10 additions and 3 deletions

View file

@ -8,7 +8,7 @@
loader_version = 0.10.1+build.209
# Mod Properties
mod_version = 0.3.0-alpha
mod_version = 0.3.1-alpha
maven_group = ru.betterend
archives_base_name = better-end

View file

@ -27,9 +27,11 @@ import net.minecraft.world.BlockView;
import net.minecraft.world.WorldAccess;
import ru.betterend.blocks.BlockProperties.TripleShape;
import ru.betterend.blocks.basis.BlockBase;
import ru.betterend.client.ERenderLayer;
import ru.betterend.client.IRenderTypeable;
import ru.betterend.util.BlocksHelper;
public class BlockEndLotusStem extends BlockBase implements Waterloggable {
public class BlockEndLotusStem extends BlockBase implements Waterloggable, IRenderTypeable {
public static final EnumProperty<Direction> FACING = Properties.FACING;
public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED;
public static final BooleanProperty LEAF = BooleanProperty.of("leaf");
@ -43,7 +45,7 @@ public class BlockEndLotusStem extends BlockBase implements Waterloggable {
@Override
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ePos) {
return SHAPES.get(state.get(FACING).getAxis());
return state.get(LEAF) ? SHAPES.get(Axis.Y) : SHAPES.get(state.get(FACING).getAxis());
}
@Override
@ -81,6 +83,11 @@ public class BlockEndLotusStem extends BlockBase implements Waterloggable {
return state;
}
@Override
public ERenderLayer getRenderLayer() {
return ERenderLayer.CUTOUT;
}
static {
SHAPES.put(Axis.X, Block.createCuboidShape(0, 6, 6, 16, 10, 10));
SHAPES.put(Axis.Y, Block.createCuboidShape(6, 0, 6, 10, 16, 10));