[Change] Refactored Plant API
This commit is contained in:
parent
d5cf63427b
commit
1de4db3cde
11 changed files with 116 additions and 127 deletions
|
@ -0,0 +1,8 @@
|
|||
package org.betterx.bclib.interfaces;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface SettingsExtender {
|
||||
BlockBehaviour.Properties amend(BlockBehaviour.Properties props);
|
||||
}
|
|
@ -53,11 +53,14 @@ public interface SurvivesOnSpecialGround {
|
|||
|
||||
boolean isSurvivable(BlockState state);
|
||||
|
||||
default boolean canSurviveOnTop(BlockState state, LevelReader world, BlockPos pos) {
|
||||
default boolean canSurviveOnTop(LevelReader world, BlockPos pos) {
|
||||
return isSurvivable(world.getBlockState(pos.below()));
|
||||
}
|
||||
|
||||
default boolean canSurviveOnBottom(BlockState state, LevelReader world, BlockPos pos) {
|
||||
default boolean canSurviveOnBottom(LevelReader world, BlockPos pos) {
|
||||
return isSurvivable(world.getBlockState(pos.above()));
|
||||
}
|
||||
default boolean isTerrain(BlockState state) {
|
||||
return isSurvivable(state);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue