@Override
  public void onGuiClosed() {
    super.onGuiClosed();

    if (hasInteractedWith) {
      PacketDispatcher.sendPacketToServer(
          PacketEnhancedPortals.makePacket(new PacketPortalModifierUpdate(portalModifier)));
      PacketDispatcher.sendPacketToServer(
          PacketEnhancedPortals.makePacket(new PacketPortalModifierUpgrade(portalModifier)));

      portalModifier.worldObj.markBlockForRenderUpdate(
          portalModifier.xCoord, portalModifier.yCoord, portalModifier.zCoord);
    }
  }
  @Override
  protected void mouseClicked(int x, int y, int buttonClicked) {
    super.mouseClicked(x, y, buttonClicked);

    if (isPointInRegion(7, 46, 162, 18, x, y)) {
      PacketDispatcher.sendPacketToServer(
          PacketEnhancedPortals.makePacket(
              new PacketGui(portalModifier, GuiIds.PortalModifierNetwork)));
    } else if (isShiftKeyDown() && getSlotAtPosition(x, y) != null) {
      ItemStack itemStack = getSlotAtPosition(x, y).getStack();
      PortalTexture Text = Textures.getTextureFromItemStack(itemStack);

      if (Text != null) {
        extendedSlots.get(0).setSlot(itemStack);
      }
    }
  }