Fix controller GUI crashes
This commit is contained in:
@@ -10,6 +10,9 @@ import refinedstorage.gui.sidebutton.SideButtonRedstoneMode;
|
|||||||
import refinedstorage.tile.TileController;
|
import refinedstorage.tile.TileController;
|
||||||
import refinedstorage.tile.TileMachine;
|
import refinedstorage.tile.TileMachine;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class GuiController extends GuiBase {
|
public class GuiController extends GuiBase {
|
||||||
private TileController controller;
|
private TileController controller;
|
||||||
|
|
||||||
@@ -68,9 +71,11 @@ public class GuiController extends GuiBase {
|
|||||||
|
|
||||||
RenderHelper.enableGUIStandardItemLighting();
|
RenderHelper.enableGUIStandardItemLighting();
|
||||||
|
|
||||||
|
List<TileMachine> machines = new ArrayList<TileMachine>(controller.getMachines());
|
||||||
|
|
||||||
for (int i = 0; i < 4; ++i) {
|
for (int i = 0; i < 4; ++i) {
|
||||||
if (slot < controller.getMachines().size()) {
|
if (slot < machines.size()) {
|
||||||
TileMachine machine = controller.getMachines().get(slot);
|
TileMachine machine = machines.get(slot);
|
||||||
IBlockState machineState = machine.getWorld().getBlockState(machine.getPos());
|
IBlockState machineState = machine.getWorld().getBlockState(machine.getPos());
|
||||||
Block machineBlock = machineState.getBlock();
|
Block machineBlock = machineState.getBlock();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user