Sulphuric caves & fixes

This commit is contained in:
paulevsGitch 2020-12-04 13:50:13 +03:00
parent b442dfff42
commit 9504432cdd
5 changed files with 91 additions and 43 deletions

View file

@ -37,6 +37,7 @@ import net.minecraft.world.WorldView;
import ru.betterend.blocks.basis.BlockAttached;
import ru.betterend.client.render.ERenderLayer;
import ru.betterend.interfaces.IRenderTypeable;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndItems;
import ru.betterend.util.MHelper;
@ -102,6 +103,13 @@ public class BlockSulphurCrystal extends BlockAttached implements IRenderTypeabl
return BOUNDING_SHAPES.get(state.get(FACING));
}
@Override
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
Direction direction = (Direction) state.get(FACING);
BlockPos blockPos = pos.offset(direction.getOpposite());
return world.getBlockState(blockPos).isOf(EndBlocks.BRIMSTONE);
}
static {
BOUNDING_SHAPES.put(Direction.UP, VoxelShapes.cuboid(0.125, 0.0, 0.125, 0.875F, 0.5, 0.875F));
BOUNDING_SHAPES.put(Direction.DOWN, VoxelShapes.cuboid(0.125, 0.5, 0.125, 0.875F, 1.0, 0.875F));