本文整理汇总了Java中net.minecraft.world.LockCode类的典型用法代码示例。如果您正苦于以下问题:Java LockCode类的具体用法?Java LockCode怎么用?Java LockCode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LockCode类属于net.minecraft.world包,在下文中一共展示了LockCode类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: canOpen
import net.minecraft.world.LockCode; //导入依赖的package包/类
/**
* 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;
}
}
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:16,代码来源:EntityPlayer.java
示例2: canOpen
import net.minecraft.world.LockCode; //导入依赖的package包/类
@Override
public boolean canOpen(LockCode code) {
if (m_realPlayer == null) {
return super.canOpen(code);
} else {
syncToRealPlayer();
return syncPublicFieldsFromRealAndReturn(m_realPlayer.canOpen(code));
}
}
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:10,代码来源:EntityPlayerMPProxy.java
示例3: canOpen
import net.minecraft.world.LockCode; //导入依赖的package包/类
@Override
public boolean canOpen(LockCode code) {
if (m_realPlayer == null) {
return super.canOpen(code);
} else {
return m_realPlayer.canOpen(code);
}
}
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:9,代码来源:EntityPlayerProxy.java
示例4: canOpen
import net.minecraft.world.LockCode; //导入依赖的package包/类
/**
* 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;
}
}
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:16,代码来源:EntityPlayer.java
示例5: canOpen
import net.minecraft.world.LockCode; //导入依赖的package包/类
/**
* 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;
}
}
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:16,代码来源:EntityPlayer.java
示例6: onChestOpen
import net.minecraft.world.LockCode; //导入依赖的package包/类
@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);
}
}
}
}
开发者ID:Skelril,项目名称:Skree,代码行数:34,代码来源:GoldRushListener.java
示例7: setLockCode
import net.minecraft.world.LockCode; //导入依赖的package包/类
public void setLockCode(LockCode code)
{
}
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:4,代码来源:EntityMinecartContainer.java
示例8: getLockCode
import net.minecraft.world.LockCode; //导入依赖的package包/类
public LockCode getLockCode()
{
return LockCode.EMPTY_CODE;
}
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:EntityMinecartContainer.java
示例9: setLockCode
import net.minecraft.world.LockCode; //导入依赖的package包/类
public void setLockCode(LockCode code)
{
this.upperChest.setLockCode(code);
this.lowerChest.setLockCode(code);
}
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:6,代码来源:InventoryLargeChest.java
示例10: getLockCode
import net.minecraft.world.LockCode; //导入依赖的package包/类
public LockCode getLockCode()
{
return this.upperChest.getLockCode();
}
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:InventoryLargeChest.java
示例11: readFromNBT
import net.minecraft.world.LockCode; //导入依赖的package包/类
public void readFromNBT(NBTTagCompound compound)
{
super.readFromNBT(compound);
this.code = LockCode.fromNBT(compound);
}
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:6,代码来源:TileEntityLockable.java
示例12: getLockCode
import net.minecraft.world.LockCode; //导入依赖的package包/类
public LockCode getLockCode()
{
return this.code;
}
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:TileEntityLockable.java
示例13: setLockCode
import net.minecraft.world.LockCode; //导入依赖的package包/类
public void setLockCode(LockCode code)
{
this.code = code;
}
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:TileEntityLockable.java
注:本文中的net.minecraft.world.LockCode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论