Example #1
0
  public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
    TileEntity tile_entity = world.getTileEntity(BlockUtils.toPos(x, y, z));

    switch (ID) {
      case SETUP_KEYCARD_READER_ID:
        return new ContainerGeneric(player.inventory, tile_entity);

      case MRAT_MENU_ID:
        return new ContainerGeneric(player.inventory, tile_entity);

      case MRAT_ACTIVATE_ID:
        return new ContainerGeneric(player.inventory, tile_entity);

      case MRAT_DEACTIVATE_ID:
        return new ContainerGeneric(player.inventory, tile_entity);

      case MRAT_DETONATE_ID:
        return new ContainerGeneric(player.inventory, tile_entity);

      case INVENTORY_SCANNER_GUI_ID:
        return new ContainerInventoryScanner(
            player.inventory, (TileEntityInventoryScanner) tile_entity);

      case USERNAME_LOGGER_GUI_ID:
        return new ContainerGeneric(player.inventory, tile_entity);

      case KEYPAD_FURNACE_GUI_ID:
        return new ContainerKeypadFurnace(player.inventory, (TileEntityKeypadFurnace) tile_entity);

      case SETUP_PASSWORD_ID:
        return new ContainerGeneric(player.inventory, tile_entity);

      case INSERT_PASSWORD_ID:
        return new ContainerGeneric(player.inventory, tile_entity);

      case IMS_GUI_ID:
        return new ContainerGeneric(player.inventory, tile_entity);

      case CAMERA_MONITOR_GUI_ID:
        if (!PlayerUtils.isHoldingItem(player, mod_SecurityCraft.cameraMonitor)) return null;

        return new ContainerGeneric(player.inventory, tile_entity);

      case BRIEFCASE_CODE_SETUP_GUI_ID:
        if (!PlayerUtils.isHoldingItem(player, mod_SecurityCraft.briefcase)) return null;

        return null;

      case BRIEFCASE_INSERT_CODE_GUI_ID:
        if (!PlayerUtils.isHoldingItem(player, mod_SecurityCraft.briefcase)) return null;

        return null;

      case BRIEFCASE_GUI_ID:
        if (!PlayerUtils.isHoldingItem(player, mod_SecurityCraft.briefcase)) return null;

        return new ContainerBriefcase(
            player, player.inventory, new BriefcaseInventory(player.getCurrentEquippedItem()));

      case CUSTOMIZE_BLOCK:
        return new ContainerCustomizeBlock(player.inventory, (CustomizableSCTE) tile_entity);

      default:
        return null;
    }
  }
Example #2
0
  public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
    TileEntity tile_entity = world.getTileEntity(BlockUtils.toPos(x, y, z));

    switch (ID) {
      case SETUP_KEYCARD_READER_ID:
        return new GuiKeycardSetup(player.inventory, (TileEntityKeycardReader) tile_entity);

      case MRAT_MENU_ID:
        return new GuiMRAT(player.inventory);

      case MRAT_ACTIVATE_ID:
        return new GuiMRATActivate(player.inventory, player.getCurrentEquippedItem());

      case MRAT_DEACTIVATE_ID:
        return new GuiMRATDeactivate(player.inventory, player.getCurrentEquippedItem());

      case MRAT_DETONATE_ID:
        return new GuiMRATDetonate(player.inventory, player.getCurrentEquippedItem());

      case INVENTORY_SCANNER_GUI_ID:
        return new GuiInventoryScanner(
            player.inventory, (TileEntityInventoryScanner) tile_entity, player);

      case USERNAME_LOGGER_GUI_ID:
        return new GuiLogger(player.inventory, (TileEntityLogger) tile_entity);

      case KEYPAD_FURNACE_GUI_ID:
        return new GuiKeypadFurnaceInventory(
            player.inventory, (TileEntityKeypadFurnace) tile_entity);

      case SETUP_PASSWORD_ID:
        return new GuiSetPassword(
            player.inventory, tile_entity, BlockUtils.getBlock(world, x, y, z));

      case INSERT_PASSWORD_ID:
        return new GuiCheckPassword(
            player.inventory, tile_entity, BlockUtils.getBlock(world, x, y, z));

      case IMS_GUI_ID:
        return new GuiIMS(player.inventory, (TileEntityIMS) tile_entity);

      case CAMERA_MONITOR_GUI_ID:
        if (!PlayerUtils.isHoldingItem(player, mod_SecurityCraft.cameraMonitor)) return null;

        return new GuiCameraMonitor(
            player.inventory,
            (ItemCameraMonitor) player.getCurrentEquippedItem().getItem(),
            player.getCurrentEquippedItem().getTagCompound());

      case BRIEFCASE_CODE_SETUP_GUI_ID:
        if (!PlayerUtils.isHoldingItem(player, mod_SecurityCraft.briefcase)) return null;

        return new GuiBriefcaseSetup(player.inventory, null);

      case BRIEFCASE_INSERT_CODE_GUI_ID:
        if (!PlayerUtils.isHoldingItem(player, mod_SecurityCraft.briefcase)) return null;

        return new GuiBriefcase(player.inventory, null);

      case BRIEFCASE_GUI_ID:
        if (!PlayerUtils.isHoldingItem(player, mod_SecurityCraft.briefcase)) return null;

        return new GuiBriefcaseInventory(player, player.inventory);

      case CUSTOMIZE_BLOCK:
        return new GuiCustomizeBlock(player.inventory, (CustomizableSCTE) tile_entity);

      default:
        return null;
    }
  }