[Change] Refactored Plant API
This commit is contained in:
parent
d5cf63427b
commit
1de4db3cde
11 changed files with 116 additions and 127 deletions
|
@ -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