make the storage gui an interface

This commit is contained in:
Raoul Van den Berge
2016-01-31 14:01:25 +01:00
parent 0c7a9381ac
commit 7afb7cb1fc
6 changed files with 100 additions and 156 deletions

View File

@@ -9,6 +9,7 @@ import net.minecraftforge.fml.common.network.IGuiHandler;
import storagecraft.StorageCraftGUI;
import storagecraft.container.*;
import storagecraft.tile.*;
import storagecraft.storage.IStorageGui;
public class GuiHandler implements IGuiHandler
{
@@ -39,7 +40,7 @@ public class GuiHandler implements IGuiHandler
case StorageCraftGUI.CONSTRUCTOR:
return new ContainerConstructor(player, (TileConstructor) tile);
case StorageCraftGUI.STORAGE:
return new ContainerStorage(player, (TileStorage) tile);
return new ContainerStorage(player, ((IStorageGui) tile).getInventory());
default:
return null;
}
@@ -81,7 +82,7 @@ public class GuiHandler implements IGuiHandler
case StorageCraftGUI.CONSTRUCTOR:
return new GuiConstructor((ContainerConstructor) getContainer(ID, player, tile), (TileConstructor) tile);
case StorageCraftGUI.STORAGE:
return new GuiStorage((ContainerStorage) getContainer(ID, player, tile), (TileStorage) tile);
return new GuiStorage((ContainerStorage) getContainer(ID, player, tile), (IStorageGui) tile);
default:
return null;
}