Amaranita mushroom blocks (WIP), Sagnum

This commit is contained in:
paulevsGitch 2021-02-28 23:19:08 +03:00
parent 81fe38ad8d
commit 5e3a3ef6cd
40 changed files with 478 additions and 4 deletions

View file

@ -0,0 +1,13 @@
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.Material;
import net.minecraft.sound.BlockSoundGroup;
import ru.betterend.blocks.basis.BlockBase;
public class AmaranitaCapBlock extends BlockBase {
public AmaranitaCapBlock() {
super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).sounds(BlockSoundGroup.WOOD));
}
}

View file

@ -0,0 +1,20 @@
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.Material;
import net.minecraft.sound.BlockSoundGroup;
import ru.betterend.blocks.basis.BlockBase;
import ru.betterend.client.render.ERenderLayer;
import ru.betterend.interfaces.IRenderTypeable;
public class AmaranitaHymenophoreBlock extends BlockBase implements IRenderTypeable {
public AmaranitaHymenophoreBlock() {
super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).sounds(BlockSoundGroup.WOOD));
}
@Override
public ERenderLayer getRenderLayer() {
return ERenderLayer.CUTOUT;
}
}

View file

@ -12,8 +12,10 @@ public class BlockProperties {
public static final EnumProperty<TripleShape> TRIPLE_SHAPE = EnumProperty.of("shape", TripleShape.class);
public static final EnumProperty<PentaShape> PENTA_SHAPE = EnumProperty.of("shape", PentaShape.class);
public static final BooleanProperty TRANSITION = BooleanProperty.of("transition");
public static final BooleanProperty HAS_LIGHT = BooleanProperty.of("has_light");
public static final BooleanProperty HAS_ITEM = BooleanProperty.of("has_item");
public static final BooleanProperty IS_FLOOR = BooleanProperty.of("is_floor");
public static final BooleanProperty NATURAL = BooleanProperty.of("natural");
public static final BooleanProperty ACTIVE = BooleanProperty.of("active");

View file

@ -0,0 +1,44 @@
package ru.betterend.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.state.StateManager;
import net.minecraft.state.property.EnumProperty;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.WorldView;
import ru.betterend.blocks.BlockProperties.TripleShape;
import ru.betterend.blocks.basis.EndPlantBlock;
import ru.betterend.registry.EndBlocks;
public class LargeAmaranitaBlock extends EndPlantBlock {
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
@Override
protected boolean isTerrain(BlockState state) {
return state.getBlock() == EndBlocks.SANGNUM;
}
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> stateManager) {
stateManager.add(SHAPE);
}
@Override
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
TripleShape shape = state.get(SHAPE);
if (shape == TripleShape.BOTTOM) {
return isTerrain(world.getBlockState(pos.down())) && world.getBlockState(pos.up()).isOf(this);
}
else if (shape == TripleShape.TOP) {
return world.getBlockState(pos.down()).isOf(this);
}
else {
return world.getBlockState(pos.down()).isOf(this) && world.getBlockState(pos.up()).isOf(this);
}
}
@Override
public OffsetType getOffsetType() {
return OffsetType.NONE;
}
}

View file

@ -13,7 +13,7 @@ import ru.betterend.blocks.basis.BlockBase;
import ru.betterend.registry.EndBlocks;
public class MossyGlowshroomCapBlock extends BlockBase {
public static final BooleanProperty TRANSITION = BooleanProperty.of("transition");
public static final BooleanProperty TRANSITION = BlockProperties.TRANSITION;
public MossyGlowshroomCapBlock() {
super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).sounds(BlockSoundGroup.WOOD));

View file

@ -0,0 +1,12 @@
package ru.betterend.blocks;
import net.minecraft.block.BlockState;
import ru.betterend.blocks.basis.EndPlantBlock;
import ru.betterend.registry.EndBlocks;
public class SmallAmaranitaBlock extends EndPlantBlock {
@Override
protected boolean isTerrain(BlockState state) {
return state.getBlock() == EndBlocks.SANGNUM;
}
}

View file

@ -18,9 +18,10 @@ import net.minecraft.util.math.Direction;
import net.minecraft.world.BlockView;
import net.minecraft.world.WorldAccess;
import net.minecraft.world.WorldView;
import ru.betterend.blocks.BlockProperties;
public class EndLanternBlock extends BlockBaseNotFull implements Waterloggable, FluidFillable {
public static final BooleanProperty IS_FLOOR = BooleanProperty.of("is_floor");
public static final BooleanProperty IS_FLOOR = BlockProperties.IS_FLOOR;
public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED;
public EndLanternBlock(Block source) {