Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,9 @@ public TurtleCommandResult execute( @Nonnull ITurtleAccess turtle )

private TurtleCommandResult canEnter( TurtlePlayer turtlePlayer, World world, BlockPos position )
{
if( position.getY() < 0 )
if( world.isOutsideBuildHeight( position ) )
{
return TurtleCommandResult.failure( "Too low to move" );
}
else if( position.getY() > world.getHeight() - 1 )
{
return TurtleCommandResult.failure( "Too high to move" );
return TurtleCommandResult.failure( "Move would be outside world height." );
}
if( ComputerCraft.turtlesObeyBlockProtection )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ public static ItemStack copyItem( @Nonnull ItemStack a )
public static IItemHandler getInventory( World world, BlockPos pos, EnumFacing side )
{
// Look for tile with inventory
int y = pos.getY();
if( y >= 0 && y < world.getHeight() )
if( !world.isOutsideBuildHeight( pos ) )
{
TileEntity tileEntity = world.getTileEntity( pos );
if( tileEntity != null )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class WorldUtil
{
public static boolean isBlockInWorld( World world, BlockPos pos )
{
return pos.getY() >= 0 && pos.getY() < world.getHeight();
return !world.isOutsideBuildHeight( pos );
}

public static boolean isLiquidBlock( World world, BlockPos pos )
Expand Down