Package net.mcft.copy.betterstorage.api.lock

Examples of net.mcft.copy.betterstorage.api.lock.IKey


  }
 
  @Override
  public boolean canApplyAtEnchantingTable(ItemStack stack) {
    if (type == BetterStorageEnchantment.getType("key")) {
      IKey key = (stack.getItem() instanceof IKey ? (IKey)stack.getItem() : null);
      return ((key != null) && key.canApplyEnchantment(stack, this));
    } else if (type == BetterStorageEnchantment.getType("lock")) {
      ILock lock = (stack.getItem() instanceof ILock ? (ILock)stack.getItem() : null);
      return ((lock != null) && lock.canApplyEnchantment(stack, this));
    } else return false;
  }
View Full Code Here


    // returns if any of the keys fit in the lock.
   
    ItemStack[] items = StackUtils.getStackContents(keyring, 9);
    for (ItemStack key : items) {
      if (key == null) continue;
      IKey keyType = (IKey)key.getItem();
      if (keyType.unlock(key, lock, false))
        return true;
    }
   
    return false;
   
View Full Code Here

        lockable.setLock(holding);
        player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
        return true;
      }
    } else if (StackUtils.isKey(holding)) {
      IKey keyType = (IKey)holding.getItem();
      ILock lockType = (ILock)lock.getItem();
     
      boolean success = keyType.unlock(holding, lock, true);
      lockType.onUnlock(lock, holding, lockable, player, success);
      if (!success) return true;
     
      if (player.isSneaking()) {
        AxisAlignedBB box = getHighlightBox();
View Full Code Here

TOP

Related Classes of net.mcft.copy.betterstorage.api.lock.IKey

Copyright © 2018 www.massapicom. 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.