Java 类net.minecraft.world.LockCode 实例源码

项目:DecompiledMinecraft    文件:EntityPlayer.java   
/**
 * Check whether this player can open an inventory locked with the given LockCode.
 */
public boolean canOpen(LockCode code)
{
    if (code.isEmpty())
    {
        return true;
    }
    else
    {
        ItemStack itemstack = this.getCurrentEquippedItem();
        return itemstack != null && itemstack.hasDisplayName() ? itemstack.getDisplayName().equals(code.getLock()) : false;
    }
}
项目:DecompiledMinecraft    文件:EntityPlayer.java   
/**
 * Check whether this player can open an inventory locked with the given LockCode.
 */
public boolean canOpen(LockCode code)
{
    if (code.isEmpty())
    {
        return true;
    }
    else
    {
        ItemStack itemstack = this.getCurrentEquippedItem();
        return itemstack != null && itemstack.hasDisplayName() ? itemstack.getDisplayName().equals(code.getLock()) : false;
    }
}
项目:BaseClient    文件:EntityPlayer.java   
/**
 * Check whether this player can open an inventory locked with the given LockCode.
 */
public boolean canOpen(LockCode code)
{
    if (code.isEmpty())
    {
        return true;
    }
    else
    {
        ItemStack itemstack = this.getCurrentEquippedItem();
        return itemstack != null && itemstack.hasDisplayName() ? itemstack.getDisplayName().equals(code.getLock()) : false;
    }
}
项目:BaseClient    文件:EntityPlayer.java   
/**
 * Check whether this player can open an inventory locked with the given LockCode.
 */
public boolean canOpen(LockCode code)
{
    if (code.isEmpty())
    {
        return true;
    }
    else
    {
        ItemStack itemstack = this.getCurrentEquippedItem();
        return itemstack != null && itemstack.hasDisplayName() ? itemstack.getDisplayName().equals(code.getLock()) : false;
    }
}
项目:UniversalRemote    文件:EntityPlayerMPProxy.java   
@Override
public boolean canOpen(LockCode code) {
    if (m_realPlayer == null) {
        return super.canOpen(code);
    } else {
        syncToRealPlayer();
        return syncPublicFieldsFromRealAndReturn(m_realPlayer.canOpen(code));
    }
}
项目:UniversalRemote    文件:EntityPlayerProxy.java   
@Override
public boolean canOpen(LockCode code) {
    if (m_realPlayer == null) {
        return super.canOpen(code);
    } else {
        return m_realPlayer.canOpen(code);
    }
}
项目:Zombe-Modpack    文件:EntityPlayer.java   
/**
 * Check whether this player can open an inventory locked with the given LockCode.
 */
public boolean canOpen(LockCode code)
{
    if (code.isEmpty())
    {
        return true;
    }
    else
    {
        ItemStack itemstack = this.getHeldItemMainhand();
        return !itemstack.func_190926_b() && itemstack.hasDisplayName() ? itemstack.getDisplayName().equals(code.getLock()) : false;
    }
}
项目:Backmemed    文件:EntityPlayer.java   
/**
 * Check whether this player can open an inventory locked with the given LockCode.
 */
public boolean canOpen(LockCode code)
{
    if (code.isEmpty())
    {
        return true;
    }
    else
    {
        ItemStack itemstack = this.getHeldItemMainhand();
        return !itemstack.func_190926_b() && itemstack.hasDisplayName() ? itemstack.getDisplayName().equals(code.getLock()) : false;
    }
}
项目:CustomWorldGen    文件:EntityPlayer.java   
/**
 * Check whether this player can open an inventory locked with the given LockCode.
 */
public boolean canOpen(LockCode code)
{
    if (code.isEmpty())
    {
        return true;
    }
    else
    {
        ItemStack itemstack = this.getHeldItemMainhand();
        return itemstack != null && itemstack.hasDisplayName() ? itemstack.getDisplayName().equals(code.getLock()) : false;
    }
}
项目:Skree    文件:GoldRushListener.java   
@Listener
public void onChestOpen(InteractInventoryEvent.Open event, @Root Player player) {
  Optional<GoldRushInstance> optInst = manager.getApplicableZone(player);
  if (!optInst.isPresent()) {
    return;
  }

  GoldRushInstance inst = optInst.get();

  Inventory inventory = event.getTargetInventory();
  if (!inst.isLocked() && inventory instanceof ContainerChest) {
    IInventory chestInv = ((ContainerChest) inventory).getLowerChestInventory();
    if (chestInv instanceof ILockableContainer) {
      LockCode newLockCode = new LockCode(UUID.randomUUID().toString());
      tileEntityClaimMap.put(newLockCode.getLock(), player);
      ((ILockableContainer) chestInv).setLockCode(newLockCode);

      BigDecimal risk = Optional.ofNullable(
          inst.cofferRisk.get(player.getUniqueId())
      ).orElse(BigDecimal.ZERO);

      Collection<org.spongepowered.api.item.inventory.ItemStack> queue = CofferValueMap.inst().satisfy(risk.toBigInteger());
      Iterator<org.spongepowered.api.item.inventory.ItemStack> it = queue.iterator();
      for (int i = 0; i < chestInv.getSizeInventory(); ++i) {
        if (it.hasNext()) {
          chestInv.setInventorySlotContents(i, tf(it.next()));
          continue;
        }
        chestInv.setInventorySlotContents(i, ItemStack.EMPTY);
      }
    }
  }
}
项目:ExpandedRailsMod    文件:EntityPlayer.java   
/**
 * Check whether this player can open an inventory locked with the given LockCode.
 */
public boolean canOpen(LockCode code)
{
    if (code.isEmpty())
    {
        return true;
    }
    else
    {
        ItemStack itemstack = this.getHeldItemMainhand();
        return itemstack != null && itemstack.hasDisplayName() ? itemstack.getDisplayName().equals(code.getLock()) : false;
    }
}
项目:DecompiledMinecraft    文件:EntityMinecartContainer.java   
public void setLockCode(LockCode code)
{
}
项目:DecompiledMinecraft    文件:EntityMinecartContainer.java   
public LockCode getLockCode()
{
    return LockCode.EMPTY_CODE;
}
项目:DecompiledMinecraft    文件:InventoryLargeChest.java   
public void setLockCode(LockCode code)
{
    this.upperChest.setLockCode(code);
    this.lowerChest.setLockCode(code);
}
项目:DecompiledMinecraft    文件:InventoryLargeChest.java   
public LockCode getLockCode()
{
    return this.upperChest.getLockCode();
}
项目:DecompiledMinecraft    文件:TileEntityLockable.java   
public void readFromNBT(NBTTagCompound compound)
{
    super.readFromNBT(compound);
    this.code = LockCode.fromNBT(compound);
}
项目:DecompiledMinecraft    文件:TileEntityLockable.java   
public LockCode getLockCode()
{
    return this.code;
}
项目:DecompiledMinecraft    文件:TileEntityLockable.java   
public void setLockCode(LockCode code)
{
    this.code = code;
}
项目:DecompiledMinecraft    文件:EntityMinecartContainer.java   
public void setLockCode(LockCode code)
{
}
项目:DecompiledMinecraft    文件:EntityMinecartContainer.java   
public LockCode getLockCode()
{
    return LockCode.EMPTY_CODE;
}
项目:DecompiledMinecraft    文件:InventoryLargeChest.java   
public void setLockCode(LockCode code)
{
    this.upperChest.setLockCode(code);
    this.lowerChest.setLockCode(code);
}
项目:DecompiledMinecraft    文件:InventoryLargeChest.java   
public LockCode getLockCode()
{
    return this.upperChest.getLockCode();
}
项目:DecompiledMinecraft    文件:ContainerLocalMenu.java   
public void setLockCode(LockCode code)
{
}
项目:DecompiledMinecraft    文件:ContainerLocalMenu.java   
public LockCode getLockCode()
{
    return LockCode.EMPTY_CODE;
}
项目:DecompiledMinecraft    文件:TileEntityLockable.java   
public void readFromNBT(NBTTagCompound compound)
{
    super.readFromNBT(compound);
    this.code = LockCode.fromNBT(compound);
}
项目:DecompiledMinecraft    文件:TileEntityLockable.java   
public LockCode getLockCode()
{
    return this.code;
}
项目:DecompiledMinecraft    文件:TileEntityLockable.java   
public void setLockCode(LockCode code)
{
    this.code = code;
}
项目:BaseClient    文件:EntityMinecartContainer.java   
public void setLockCode(LockCode code)
{
}
项目:BaseClient    文件:EntityMinecartContainer.java   
public LockCode getLockCode()
{
    return LockCode.EMPTY_CODE;
}
项目:BaseClient    文件:InventoryLargeChest.java   
public void setLockCode(LockCode code)
{
    this.upperChest.setLockCode(code);
    this.lowerChest.setLockCode(code);
}
项目:BaseClient    文件:InventoryLargeChest.java   
public LockCode getLockCode()
{
    return this.upperChest.getLockCode();
}
项目:BaseClient    文件:ContainerLocalMenu.java   
public void setLockCode(LockCode code)
{
}
项目:BaseClient    文件:ContainerLocalMenu.java   
public LockCode getLockCode()
{
    return LockCode.EMPTY_CODE;
}
项目:BaseClient    文件:TileEntityLockable.java   
public void readFromNBT(NBTTagCompound compound)
{
    super.readFromNBT(compound);
    this.code = LockCode.fromNBT(compound);
}
项目:BaseClient    文件:TileEntityLockable.java   
public LockCode getLockCode()
{
    return this.code;
}
项目:BaseClient    文件:TileEntityLockable.java   
public void setLockCode(LockCode code)
{
    this.code = code;
}
项目:BaseClient    文件:EntityMinecartContainer.java   
public void setLockCode(LockCode code)
{
}
项目:BaseClient    文件:EntityMinecartContainer.java   
public LockCode getLockCode()
{
    return LockCode.EMPTY_CODE;
}
项目:BaseClient    文件:InventoryLargeChest.java   
public void setLockCode(LockCode code)
{
    this.upperChest.setLockCode(code);
    this.lowerChest.setLockCode(code);
}
项目:BaseClient    文件:InventoryLargeChest.java   
public LockCode getLockCode()
{
    return this.upperChest.getLockCode();
}