Fix turtles incorrectly handling waterlogged blocks

This would return true for any block with a fluid in it, including
waterlogged blocks. This resulted in much broken behaviour

 - Turtles cannot place blocks when waterlogged (fixedd #385)
 - Turtles could move into waterlogged blocks (such as fences),
   replacing them.
This commit is contained in:
SquidDev 2020-04-20 20:25:09 +01:00
parent 524b6f1d8a
commit df557e03fa
1 changed files with 1 additions and 3 deletions

View File

@ -7,7 +7,6 @@
import com.google.common.base.Predicate;
import com.google.common.collect.MapMaker;
import net.minecraft.block.BlockState;
import net.minecraft.entity.*;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.entity.player.PlayerEntity;
@ -54,8 +53,7 @@ public EntitySize getSize( Pose pose )
public static boolean isLiquidBlock( World world, BlockPos pos )
{
if( !World.isValid( pos ) ) return false;
BlockState state = world.getBlockState( pos );
return !state.getFluidState().isEmpty();
return world.getBlockState( pos ).getMaterial().isLiquid();
}
public static boolean isVecInside( VoxelShape shape, Vec3d vec )