Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class GuiHandler implements IGuiHandler
- {
- public static final int CARD_VIEWER_GUI = 0;
- public static final int DUEL_FIELD_GUI = 1;
- public static final int DECK_GUI = 2;
- public static final int DUEL_GUI = 3;
- @Override
- public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
- {
- if (ID == GuiHandler.CARD_VIEWER_GUI)
- {
- TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
- if(tile instanceof TileEntityCardViewer)
- {
- return new ContainerCardViewer(world, player.inventory, (TileEntityCardViewer) tile);
- }
- }
- else if(ID == GuiHandler.DUEL_FIELD_GUI)
- {
- TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
- if(tile instanceof TileEntityDuelField)
- {
- return new ContainerDuelField(player.inventory, (TileEntityDuelField) tile);
- }
- }
- else if(ID == GuiHandler.DECK_GUI)
- {
- return new ContainerDeck(player.inventory, player);
- }
- else if(ID == GuiHandler.DUEL_GUI)
- {
- TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
- return new ContainerDuel(player, (TileEntityDuelField) tile);
- }
- return null;
- }
- @Override
- public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
- {
- if (ID == GuiHandler.CARD_VIEWER_GUI)
- {
- TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
- if(tile instanceof TileEntityCardViewer)
- {
- return new GuiCardViewer(world, player.inventory, (TileEntityCardViewer) tile);
- }
- }
- else if(ID == GuiHandler.DUEL_FIELD_GUI)
- {
- TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
- if(tile instanceof TileEntityDuelField)
- {
- return new GuiDuelField(player.inventory, (TileEntityDuelField) tile);
- }
- }
- else if(ID == GuiHandler.DECK_GUI)
- {
- return new GuiDeck(player.inventory, player);
- }
- else if(ID == GuiHandler.DUEL_GUI)
- {
- TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
- return new GuiDuel(player, (TileEntityDuelField) tile);
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement