Examples of ICardIdentification


Examples of calclavia.api.mffs.card.ICardIdentification

    if (packetID == TilePacketType.TOGGLE_MODE.ordinal())
    {
      if (this.getManipulatingCard() != null)
      {
        ICardIdentification idCard = (ICardIdentification) this.getManipulatingCard().getItem();

        int id = dataStream.readInt();
        Permission permission = Permission.getPermission(id);

        if (permission != null)
        {
          if (!idCard.hasPermission(this.getManipulatingCard(), permission))
          {
            idCard.addPermission(this.getManipulatingCard(), permission);
          }
          else
          {
            idCard.removePermission(this.getManipulatingCard(), permission);
          }
        }
        else
        {
          ModularForceFieldSystem.LOGGER.severe("Error handling security station permission packet: " + id + " - " + permission);
        }
      }
    }
    else if (packetID == TilePacketType.STRING.ordinal())
    {
      if (this.getManipulatingCard() != null)
      {
        ICardIdentification idCard = (ICardIdentification) this.getManipulatingCard().getItem();
        idCard.setUsername(this.getManipulatingCard(), dataStream.readUTF());
      }
    }
  }
View Full Code Here

Examples of calclavia.api.mffs.card.ICardIdentification

    super.onInventoryChanged();

    // Try to copy ID card data.
    if (this.getManipulatingCard() != null && this.getStackInSlot(SLOT_COPY) != null && this.getStackInSlot(SLOT_COPY).getItem() instanceof ICardIdentification)
    {
      ICardIdentification masterCard = ((ICardIdentification) this.getManipulatingCard().getItem());
      ICardIdentification copyCard = ((ICardIdentification) this.getStackInSlot(SLOT_COPY).getItem());

      for (Permission permission : Permission.getPermissions())
      {
        if (masterCard.hasPermission(this.getManipulatingCard(), permission))
        {
          copyCard.addPermission(this.getStackInSlot(SLOT_COPY), permission);
        }
        else
        {
          copyCard.removePermission(this.getStackInSlot(SLOT_COPY), permission);
        }
      }
    }
  }
View Full Code Here

Examples of calclavia.api.mffs.card.ICardIdentification

    try
    {
      if (this.tileEntity.getManipulatingCard() != null)
      {
        ICardIdentification idCard = (ICardIdentification) this.tileEntity.getManipulatingCard().getItem();

        this.textFieldUsername.drawTextBox();

        if (idCard.getUsername(this.tileEntity.getManipulatingCard()) != null)
        {

          for (int i = 0; i < this.buttonList.size(); i++)
          {
            if (this.buttonList.get(i) instanceof GuiButtonPress)
            {
              GuiButtonPress button = (GuiButtonPress) this.buttonList.get(i);
              button.drawButton = true;

              int permissionID = i - 1;

              if (Permission.getPermission(permissionID) != null)
              {
                if (idCard.hasPermission(this.tileEntity.getManipulatingCard(), Permission.getPermission(permissionID)))
                {
                  button.stuck = true;
                }
                else
                {
View Full Code Here

Examples of calclavia.api.mffs.card.ICardIdentification

    if (!this.textFieldUsername.isFocused())
    {
      if (this.tileEntity.getManipulatingCard() != null)
      {
        ICardIdentification idCard = (ICardIdentification) this.tileEntity.getManipulatingCard().getItem();

        if (idCard.getUsername(this.tileEntity.getManipulatingCard()) != null)
        {
          this.textFieldUsername.setText(idCard.getUsername(this.tileEntity.getManipulatingCard()));
        }
      }
    }
  }
View Full Code Here

Examples of calclavia.api.mffs.card.ICardIdentification

  @Override
  public void renderItem(ItemRenderType type, ItemStack itemStack, Object... data)
  {
    if (itemStack.getItem() instanceof ICardIdentification)
    {
      ICardIdentification card = (ICardIdentification) itemStack.getItem();

      glPushMatrix();
      glDisable(GL_CULL_FACE);

      this.transform(type);
      this.renderItemIcon(ModularForceFieldSystem.itemCardID.getIcon(itemStack, 0));

      if (type != ItemRenderType.INVENTORY)
      {
        // Prevent Z fighting.
        glTranslatef(0f, 0f, -0.0005f);
      }

      renderPlayerFace(getSkinFace(card.getUsername(itemStack)));

      glEnable(GL_CULL_FACE);
      glPopMatrix();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.