Silk moth nest
This commit is contained in:
parent
1ff3d93404
commit
4910c0568e
20 changed files with 122 additions and 11 deletions
|
@ -18,7 +18,7 @@ import ru.betterend.registry.EndBlocks;
|
|||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class BlockBrimstone extends BlockBase {
|
||||
public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVATED;
|
||||
public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVE;
|
||||
|
||||
public BlockBrimstone() {
|
||||
super(FabricBlockSettings.copyOf(Blocks.END_STONE).materialColor(MaterialColor.BROWN).ticksRandomly());
|
||||
|
|
|
@ -44,7 +44,7 @@ import ru.betterend.util.BlocksHelper;
|
|||
|
||||
public class BlockHydrothermalVent extends BlockBaseNotFull implements BlockEntityProvider, FluidFillable, Waterloggable {
|
||||
public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED;
|
||||
public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVATED;
|
||||
public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVE;
|
||||
private static final VoxelShape SHAPE = Block.createCuboidShape(1, 1, 1, 15, 16, 15);
|
||||
|
||||
public BlockHydrothermalVent() {
|
||||
|
|
|
@ -12,7 +12,7 @@ public class BlockProperties {
|
|||
public static final EnumProperty<PentaShape> PENTA_SHAPE = EnumProperty.of("shape", PentaShape.class);
|
||||
public static final BooleanProperty HAS_ITEM = BooleanProperty.of("has_item");
|
||||
public static final BooleanProperty HAS_LIGHT = BooleanProperty.of("has_light");
|
||||
public static final BooleanProperty ACTIVATED = BooleanProperty.of("active");
|
||||
public static final BooleanProperty ACTIVE = BooleanProperty.of("active");
|
||||
public static final IntProperty ROTATION = IntProperty.of("rotation", 0, 3);
|
||||
|
||||
public static enum TripleShape implements StringIdentifiable {
|
||||
|
|
52
src/main/java/ru/betterend/blocks/BlockSilkMothNest.java
Normal file
52
src/main/java/ru/betterend/blocks/BlockSilkMothNest.java
Normal file
|
@ -0,0 +1,52 @@
|
|||
package ru.betterend.blocks;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
import net.minecraft.state.property.DirectionProperty;
|
||||
import net.minecraft.state.property.Properties;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.world.BlockView;
|
||||
import ru.betterend.blocks.basis.BlockBase;
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
|
||||
public class BlockSilkMothNest extends BlockBase implements IRenderTypeable {
|
||||
public static final BooleanProperty ACTIVE = BlockProperties.ACTIVE;
|
||||
public static final DirectionProperty FACING = Properties.HORIZONTAL_FACING;
|
||||
private static final VoxelShape TOP = createCuboidShape(6, 0, 6, 10, 16, 10);
|
||||
private static final VoxelShape BOTTOM = createCuboidShape(0, 0, 0, 16, 16, 16);
|
||||
|
||||
public BlockSilkMothNest() {
|
||||
super(FabricBlockSettings.of(Material.WOOL).hardness(0.5F).resistance(0.1F).nonOpaque());
|
||||
this.setDefaultState(getDefaultState().with(ACTIVE, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> stateManager) {
|
||||
stateManager.add(ACTIVE, FACING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ePos) {
|
||||
return state.get(ACTIVE) ? BOTTOM : TOP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERenderLayer getRenderLayer() {
|
||||
return ERenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getPlacementState(ItemPlacementContext ctx) {
|
||||
Direction dir = ctx.getPlayerFacing().getOpposite();
|
||||
return this.getDefaultState().with(FACING, dir);
|
||||
}
|
||||
}
|
|
@ -30,7 +30,7 @@ import ru.betterend.registry.EndItems;
|
|||
import ru.betterend.rituals.EternalRitual;
|
||||
|
||||
public class EternalPedestal extends BlockPedestal {
|
||||
public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVATED;
|
||||
public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVE;
|
||||
|
||||
public EternalPedestal() {
|
||||
super(EndBlocks.FLAVOLITE_RUNED_ETERNAL);
|
||||
|
|
|
@ -10,7 +10,7 @@ import ru.betterend.blocks.basis.BlockBase;
|
|||
import ru.betterend.registry.EndBlocks;
|
||||
|
||||
public class RunedFlavolite extends BlockBase {
|
||||
public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVATED;
|
||||
public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVE;
|
||||
|
||||
public RunedFlavolite() {
|
||||
super(FabricBlockSettings.copyOf(EndBlocks.FLAVOLITE.polished).resistance(Blocks.OBSIDIAN.getBlastResistance()).luminance(state -> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue