More pottable plants & config save/load

This commit is contained in:
paulevsGitch 2021-07-11 23:05:07 +03:00
parent e41fd592c7
commit 797db9d2d4
17 changed files with 310 additions and 28 deletions

View file

@ -1,12 +1,28 @@
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 net.minecraft.world.level.levelgen.feature.Feature;
import ru.bclib.blocks.FeatureSaplingBlock;
import ru.betterend.blocks.basis.PottableFeatureSapling;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures;
public class HelixTreeSaplingBlock extends FeatureSaplingBlock {
public class HelixTreeSaplingBlock extends PottableFeatureSapling {
@Override
protected Feature<?> getFeature() {
return EndFeatures.HELIX_TREE.getFeature();
}
@Override
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
return world.getBlockState(pos.below()).is(EndBlocks.AMBER_MOSS);
}
@Override
public boolean canPlantOn(Block block) {
return block == EndBlocks.AMBER_MOSS;
}
}