Mushrooms generation
This commit is contained in:
parent
989dbdb583
commit
ae3756d9ee
7 changed files with 80 additions and 6 deletions
|
@ -23,6 +23,7 @@ import net.minecraft.util.math.Direction;
|
|||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.WorldView;
|
||||
import ru.betterend.blocks.basis.BlockAttached;
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
|
@ -54,6 +55,13 @@ public class BlockSmallJellyshroom extends BlockAttached implements IRenderTypea
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
|
||||
Direction direction = (Direction) state.get(FACING);
|
||||
BlockPos blockPos = pos.offset(direction.getOpposite());
|
||||
return sideCoversSmallSquare(world, blockPos, direction) && world.getBlockState(blockPos).isOpaque();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERenderLayer getRenderLayer() {
|
||||
return ERenderLayer.CUTOUT;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue