BetterEnd/src/main/java/ru/betterend/blocks/TenaneaSaplingBlock.java
2021-12-07 14:53:33 +01:00

25 lines
795 B
Java

package ru.betterend.blocks;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import ru.betterend.blocks.basis.PottableFeatureSapling;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures;
public class TenaneaSaplingBlock extends PottableFeatureSapling {
public TenaneaSaplingBlock() {
super((state)->EndFeatures.TENANEA.getFeature());
}
@Override
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
return world.getBlockState(pos.below()).is(EndBlocks.PINK_MOSS);
}
@Override
public boolean canPlantOn(Block block) {
return block == EndBlocks.PINK_MOSS;
}
}