[Change] Refactored Plant API

This commit is contained in:
Frank 2022-06-30 17:51:44 +02:00
parent d5cf63427b
commit 1de4db3cde
11 changed files with 116 additions and 127 deletions

View file

@ -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);
}
}