mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-01-26 00:46:54 +00:00
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:
parent
524b6f1d8a
commit
df557e03fa
@ -7,7 +7,6 @@ package dan200.computercraft.shared.util;
|
||||
|
||||
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 final class WorldUtil
|
||||
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 )
|
||||
|
Loading…
Reference in New Issue
Block a user