2016-01-01 12:08:17 -05:00
|
|
|
package WayofTime.bloodmagic.client.gui;
|
|
|
|
|
|
|
|
import net.minecraft.client.multiplayer.WorldClient;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.util.BlockPos;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
import net.minecraftforge.fml.common.network.IGuiHandler;
|
2016-01-07 18:05:23 -05:00
|
|
|
import WayofTime.bloodmagic.api.Constants;
|
|
|
|
import WayofTime.bloodmagic.tile.TileSoulForge;
|
|
|
|
import WayofTime.bloodmagic.tile.TileTeleposer;
|
2016-01-14 08:27:09 -05:00
|
|
|
import WayofTime.bloodmagic.tile.container.ContainerItemRoutingNode;
|
2016-01-07 18:05:23 -05:00
|
|
|
import WayofTime.bloodmagic.tile.container.ContainerSoulForge;
|
|
|
|
import WayofTime.bloodmagic.tile.container.ContainerTeleposer;
|
2016-01-14 11:06:50 -05:00
|
|
|
import WayofTime.bloodmagic.tile.routing.TileFilteredRoutingNode;
|
2016-01-01 12:08:17 -05:00
|
|
|
|
|
|
|
public class GuiHandler implements IGuiHandler
|
|
|
|
{
|
|
|
|
@Override
|
|
|
|
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
|
|
|
|
{
|
|
|
|
BlockPos pos = new BlockPos(x, y, z);
|
|
|
|
|
|
|
|
switch (id)
|
|
|
|
{
|
2016-01-02 17:56:37 -05:00
|
|
|
case Constants.Gui.TELEPOSER_GUI:
|
|
|
|
return new ContainerTeleposer(player.inventory, (TileTeleposer) world.getTileEntity(pos));
|
2016-01-07 18:05:23 -05:00
|
|
|
case Constants.Gui.SOUL_FORGE_GUI:
|
|
|
|
return new ContainerSoulForge(player.inventory, (TileSoulForge) world.getTileEntity(pos));
|
2016-01-14 08:27:09 -05:00
|
|
|
case Constants.Gui.ROUTING_NODE_GUI:
|
2016-01-14 11:06:50 -05:00
|
|
|
return new ContainerItemRoutingNode(player.inventory, (TileFilteredRoutingNode) world.getTileEntity(pos));
|
2016-01-01 12:08:17 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
|
|
|
|
{
|
|
|
|
if (world instanceof WorldClient)
|
|
|
|
{
|
|
|
|
BlockPos pos = new BlockPos(x, y, z);
|
|
|
|
|
|
|
|
switch (id)
|
|
|
|
{
|
2016-01-02 17:56:37 -05:00
|
|
|
case Constants.Gui.TELEPOSER_GUI:
|
|
|
|
return new GuiTeleposer(player.inventory, (TileTeleposer) world.getTileEntity(pos));
|
2016-01-07 18:05:23 -05:00
|
|
|
case Constants.Gui.SOUL_FORGE_GUI:
|
|
|
|
return new GuiSoulForge(player.inventory, (TileSoulForge) world.getTileEntity(pos));
|
2016-01-14 08:27:09 -05:00
|
|
|
case Constants.Gui.ROUTING_NODE_GUI:
|
2016-01-14 11:06:50 -05:00
|
|
|
return new GuiItemRoutingNode(player.inventory, (TileFilteredRoutingNode) world.getTileEntity(pos));
|
2016-01-01 12:08:17 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|