Buggy code:
public class GuiController extends GuiBase { public static final int VISIBLE_ROWS = 2 ; private TileController controller ; private int barX = 8 ; private int barY = 20 ; private int barWidth = 16 ; private int barHeight = 59 ; private Scrollbar scrollbar = new Scrollbar ( 157 , 20 , 12 , 59 ) ; public GuiController ( ContainerController container , TileController controller ) { } @ Override public void init ( int x , int y ) { } @ Override public void update ( int x , int y ) { } @ Override public void drawBackground ( int x , int y , int mouseX , int mouseY ) { } private int calculateOffsetOnScale ( int pos , float scale ) { } @ Override public void drawForeground ( int mouseX , int mouseY ) { scrollbar . update ( this , mouseX , mouseY ) ; drawString ( 7 , 7 , t ( ( "gui.refinedstorage:controller." + ( controller . getType ( ) . getId ( ) ) ) ) ) ; drawString ( 7 , 87 , t ( "container.inventory" ) ) ; int x = 33 ; int y = 26 ; int slot = ( getOffset ( ) ) * 2 ; RenderHelper . enableGUIStandardItemLighting ( ) ; List < TileMachine > machines = new ArrayList < TileMachine > ( controller . getMachines ( ) ) ; TileMachine machineHovering = null ; for ( int i = 0 ; i < 4 ; ++ i ) { <START_BUG> if ( slot < ( machines . size ( ) ) ) { <END_BUG> TileMachine machine = machines . get ( slot ) ; IBlockState machineState = machine . getWorld ( ) . getBlockState ( machine . getPos ( ) ) ; Block machineBlock = machineState . getBlock ( ) ; ItemStack machineStack = new ItemStack ( machineBlock , 1 , machineBlock . getMetaFromState ( machineState ) ) ; drawItem ( x , ( y + 5 ) , machineStack ) ; GlStateManager . pushMatrix ( ) ; float scale = 0.5F ; GlStateManager . scale ( scale , scale , 1 ) ; drawString ( calculateOffsetOnScale ( ( x + 1 ) , scale ) , calculateOffsetOnScale ( ( y - 3 ) , scale ) , machineStack . getDisplayName ( ) ) ; drawString ( calculateOffsetOnScale ( ( x + 21 ) , scale ) , calculateOffsetOnScale ( ( y + 10 ) , scale ) , t ( "misc.refinedstorage:energy_usage_minimal" , machine . getEnergyUsage ( ) ) ) ; GlStateManager . popMatrix ( ) ; if ( inBounds ( x , y , 16 , 16 , mouseX , mouseY ) ) { machineHovering = machine ; } } if ( i == 1 ) { x = 33 ; y += 30 ; } else { x += 60 ; } slot ++ ; } if ( machineHovering != null ) { String message = I18n . translateToLocalFormatted ( "gui.refinedstorage:controller.machine_position.x" , machineHovering . getPos ( ) . getX ( ) ) ; message += "\n" + ( I18n . translateToLocalFormatted ( "gui.refinedstorage:controller.machine_position.y" , machineHovering . getPos ( ) . getY ( ) ) ) ; message += "\n" + ( I18n . translateToLocalFormatted ( "gui.refinedstorage:controller.machine_position.z" , machineHovering . getPos ( ) . getZ ( ) ) ) ; drawTooltip ( mouseX , mouseY , message ) ; } if ( inBounds ( barX , barY , barWidth , barHeight , mouseX , mouseY ) ) { String message = t ( "misc.refinedstorage:energy_usage" , ( controller . isActiveClientSide ( ) ? controller . getEnergyUsage ( ) : 0 ) ) ; message += "\n" + ( t ( "misc.refinedstorage:energy_stored" , controller . getEnergyStored ( null ) , controller . getMaxEnergyStored ( null ) ) ) ; drawTooltip ( mouseX , mouseY , message ) ; } } public int getOffset ( ) { } private int getRows ( ) { } }

Fix:
if ( ( ( slot < ( machines . size ( ) ) ) && ( ( machines . get ( slot ) ) != null ) ) && ( ( machines . get ( slot ) . getWorld ( ) ) != null ) ) {