mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-06-26 07:02:55 +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.base.Predicate;
|
||||||
import com.google.common.collect.MapMaker;
|
import com.google.common.collect.MapMaker;
|
||||||
import net.minecraft.block.BlockState;
|
|
||||||
import net.minecraft.entity.*;
|
import net.minecraft.entity.*;
|
||||||
import net.minecraft.entity.item.ItemEntity;
|
import net.minecraft.entity.item.ItemEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
@ -54,8 +53,7 @@ public final class WorldUtil
|
|||||||
public static boolean isLiquidBlock( World world, BlockPos pos )
|
public static boolean isLiquidBlock( World world, BlockPos pos )
|
||||||
{
|
{
|
||||||
if( !World.isValid( pos ) ) return false;
|
if( !World.isValid( pos ) ) return false;
|
||||||
BlockState state = world.getBlockState( pos );
|
return world.getBlockState( pos ).getMaterial().isLiquid();
|
||||||
return !state.getFluidState().isEmpty();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isVecInside( VoxelShape shape, Vec3d vec )
|
public static boolean isVecInside( VoxelShape shape, Vec3d vec )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user