本文整理汇总了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;
}
}
示例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));
}
}
示例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);
}
}
示例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;
}
}
示例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;
}
}
示例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);
}
}
}
}
示例7: setLockCode
import net.minecraft.world.LockCode; //导入依赖的package包/类
public void setLockCode(LockCode code)
{
}
示例8: getLockCode
import net.minecraft.world.LockCode; //导入依赖的package包/类
public LockCode getLockCode()
{
return LockCode.EMPTY_CODE;
}
示例9: setLockCode
import net.minecraft.world.LockCode; //导入依赖的package包/类
public void setLockCode(LockCode code)
{
this.upperChest.setLockCode(code);
this.lowerChest.setLockCode(code);
}
示例10: getLockCode
import net.minecraft.world.LockCode; //导入依赖的package包/类
public LockCode getLockCode()
{
return this.upperChest.getLockCode();
}
示例11: readFromNBT
import net.minecraft.world.LockCode; //导入依赖的package包/类
public void readFromNBT(NBTTagCompound compound)
{
super.readFromNBT(compound);
this.code = LockCode.fromNBT(compound);
}
示例12: getLockCode
import net.minecraft.world.LockCode; //导入依赖的package包/类
public LockCode getLockCode()
{
return this.code;
}
示例13: setLockCode
import net.minecraft.world.LockCode; //导入依赖的package包/类
public void setLockCode(LockCode code)
{
this.code = code;
}