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

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


  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


  public boolean isNormalKey() { return true; }
 
  @Override
  public boolean unlock(ItemStack key, ItemStack lock, boolean useAbility) {
   
    ILock lockType = (ILock)lock.getItem();
    // If the lock type isn't normal, the key can't unlock it.
    if (lockType.getLockType() != "normal")
      return false;
   
    int lockId = getID(lock);
    int keyId = getID(key);
   
View Full Code Here

        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();
        double x = (box.minX + box.maxX) / 2;
View Full Code Here

TOP

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

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.