[Fix] Saplings can not be placed (#228)
This commit is contained in:
parent
7fc1c96a2b
commit
300a262ac4
1 changed files with 9 additions and 0 deletions
|
@ -5,7 +5,10 @@ import org.betterx.bclib.blocks.FeatureSaplingBlock;
|
||||||
import org.betterx.bclib.interfaces.SurvivesOn;
|
import org.betterx.bclib.interfaces.SurvivesOn;
|
||||||
import org.betterx.betterend.interfaces.PottablePlant;
|
import org.betterx.betterend.interfaces.PottablePlant;
|
||||||
|
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.world.level.BlockGetter;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration;
|
||||||
|
|
||||||
|
@ -19,8 +22,14 @@ public abstract class PottableFeatureSapling<F extends Feature<FC>, FC extends F
|
||||||
super(light, featureSupplier);
|
super(light, featureSupplier);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlantOn(Block block) {
|
public boolean canPlantOn(Block block) {
|
||||||
return isSurvivable(block.defaultBlockState());
|
return isSurvivable(block.defaultBlockState());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean mayPlaceOn(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos) {
|
||||||
|
return isSurvivable(blockState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue