Sapling fix (#155)

This commit is contained in:
paulevsGitch 2021-05-05 03:07:50 +03:00
parent 9678969d4a
commit 05d6eaf8c8
3 changed files with 28 additions and 3 deletions

View file

@ -0,0 +1,25 @@
package ru.betterend.blocks;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.Feature;
import ru.betterend.blocks.basis.FeatureSaplingBlock;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures;
public class LucerniaSaplingBlock extends FeatureSaplingBlock {
public LucerniaSaplingBlock() {
super();
}
@Override
protected Feature<?> getFeature() {
return EndFeatures.LUCERNIA.getFeature();
}
@Override
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
return world.getBlockState(pos.below()).is(EndBlocks.RUTISCUS);
}
}

View file

@ -15,11 +15,11 @@ public class TenaneaSaplingBlock extends FeatureSaplingBlock {
@Override
protected Feature<?> getFeature() {
return EndFeatures.LUCERNIA.getFeature();
return EndFeatures.TENANEA.getFeature();
}
@Override
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
return world.getBlockState(pos.below()).is(EndBlocks.RUTISCUS);
return world.getBlockState(pos.below()).is(EndBlocks.PINK_MOSS);
}
}