类 ContainerLock
- java.lang.Object
-
- net.minecraft.inventory.ContainerLock
-
@Unmodifiable public class ContainerLock extends Object
- Mappings:
Namespace Name official ariintermediary net/minecraft/class_1273named net/minecraft/inventory/ContainerLock
-
-
构造器概要
构造器 构造器 说明 ContainerLock(String key)
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 booleancanOpen(ItemStack stack)Returns true if this lock can be opened with the key item stack.static ContainerLockfromNbt(CompoundTag nbt)Creates a newContainerLockfrom theLockkey of the NBT compound.voidwriteNbt(CompoundTag nbt)Inserts the key string of this lock into theLockkey of the NBT compound.
-
-
-
字段详细资料
-
EMPTY
public static final ContainerLock EMPTY
An empty container lock that can always be opened.- Mappings:
Namespace Name Mixin selector official aLari;a:Lari;intermediary field_5817Lnet/minecraft/class_1273;field_5817:Lnet/minecraft/class_1273;named EMPTYLnet/minecraft/inventory/ContainerLock;EMPTY:Lnet/minecraft/inventory/ContainerLock;
-
LOCK_KEY
public static final String LOCK_KEY
- 另请参阅:
- 常量字段值
- Mappings:
Namespace Name Mixin selector official bLari;b:Ljava/lang/String;intermediary field_29956Lnet/minecraft/class_1273;field_29956:Ljava/lang/String;named LOCK_KEYLnet/minecraft/inventory/ContainerLock;LOCK_KEY:Ljava/lang/String;
-
key
private final String key
- Mappings:
Namespace Name Mixin selector official cLari;c:Ljava/lang/String;intermediary field_5818Lnet/minecraft/class_1273;field_5818:Ljava/lang/String;named keyLnet/minecraft/inventory/ContainerLock;key:Ljava/lang/String;
-
-
构造器详细资料
-
ContainerLock
public ContainerLock(String key)
- Mappings:
Namespace Name Mixin selector official <init>Lari;<init>(Ljava/lang/String;)Vintermediary <init>Lnet/minecraft/class_1273;<init>(Ljava/lang/String;)Vnamed <init>Lnet/minecraft/inventory/ContainerLock;<init>(Ljava/lang/String;)V
-
-
方法详细资料
-
canOpen
public boolean canOpen(ItemStack stack)
Returns true if this lock can be opened with the key item stack.An item stack is a valid key if the stack name matches the key string of this lock, or if the key string is empty.
- 参数:
stack- the key item stack- Mappings:
Namespace Name Mixin selector official aLari;a(Lbpr;)Zintermediary method_5472Lnet/minecraft/class_1273;method_5472(Lnet/minecraft/class_1799;)Znamed canOpenLnet/minecraft/inventory/ContainerLock;canOpen(Lnet/minecraft/item/ItemStack;)Z
-
writeNbt
public void writeNbt(CompoundTag nbt)
Inserts the key string of this lock into theLockkey of the NBT compound.- Mappings:
Namespace Name Mixin selector official aLari;a(Lmv;)Vintermediary method_5474Lnet/minecraft/class_1273;method_5474(Lnet/minecraft/class_2487;)Vnamed writeNbtLnet/minecraft/inventory/ContainerLock;writeNbt(Lnet/minecraft/nbt/CompoundTag;)V
-
fromNbt
public static ContainerLock fromNbt(CompoundTag nbt)
Creates a newContainerLockfrom theLockkey of the NBT compound.If the
Lockkey is not present, returns an empty lock.- Mappings:
Namespace Name Mixin selector official bLari;b(Lmv;)Lari;intermediary method_5473Lnet/minecraft/class_1273;method_5473(Lnet/minecraft/class_2487;)Lnet/minecraft/class_1273;named fromNbtLnet/minecraft/inventory/ContainerLock;fromNbt(Lnet/minecraft/nbt/CompoundTag;)Lnet/minecraft/inventory/ContainerLock;
-
-