接口 CommandItemSlot
-
public interface CommandItemSlotRepresents an item slot for command access. Usually obtained from entities.Some dispenser behaviors also use this to simulate commands' behavior of equipping items.
- 另请参阅:
Entity.getCommandItemSlot(int)- Mappings:
Namespace Name official atointermediary net/minecraft/class_5630named net/minecraft/inventory/CommandItemSlot
-
-
字段概要
字段 修饰符和类型 字段 说明 static CommandItemSlotEMPTYAn immutable empty slot.
-
方法概要
所有方法 静态方法 实例方法 抽象方法 修饰符和类型 方法 说明 ItemStackget()Gets the current item stack in this slot.static CommandItemSlotof(LivingEntity entity, EquipmentSlot equipmentSlot)Creates a slot backed by an equipment slot of an living entity.static CommandItemSlotof(LivingEntity entity, EquipmentSlot equipmentSlot, Predicate<ItemStack> stackFilter)Creates a slot backed by an equipment slot of an living entity and guarded by a condition for setting stacks into the inventory.static CommandItemSlotof(Inventory inventory, int index)Creates a slot backed by an index within an inventory.static CommandItemSlotof(Inventory inventory, int index, Predicate<ItemStack> stackFilter)Creates a slot backed by an index within an inventory and guarded by a condition for setting stacks into the inventory.booleanset(ItemStack stack)Sets thestackto this slot.
-
-
-
字段详细资料
-
EMPTY
static final CommandItemSlot EMPTY
An immutable empty slot.- Mappings:
Namespace Name Mixin selector official aLato;a:Lato;intermediary field_27860Lnet/minecraft/class_5630;field_27860:Lnet/minecraft/class_5630;named EMPTYLnet/minecraft/inventory/CommandItemSlot;EMPTY:Lnet/minecraft/inventory/CommandItemSlot;
-
-
方法详细资料
-
of
static CommandItemSlot of(Inventory inventory, int index, Predicate<ItemStack> stackFilter)
Creates a slot backed by an index within an inventory and guarded by a condition for setting stacks into the inventory.- 参数:
stackFilter- the condition to guard stack setting- Mappings:
Namespace Name Mixin selector official aLato;a(Laqz;ILjava/util/function/Predicate;)Lato;intermediary method_32329Lnet/minecraft/class_5630;method_32329(Lnet/minecraft/class_1263;ILjava/util/function/Predicate;)Lnet/minecraft/class_5630;named ofLnet/minecraft/inventory/CommandItemSlot;of(Lnet/minecraft/inventory/Inventory;ILjava/util/function/Predicate;)Lnet/minecraft/inventory/CommandItemSlot;
-
of
static CommandItemSlot of(Inventory inventory, int index)
Creates a slot backed by an index within an inventory.- Mappings:
Namespace Name Mixin selector official aLato;a(Laqz;I)Lato;intermediary method_32328Lnet/minecraft/class_5630;method_32328(Lnet/minecraft/class_1263;I)Lnet/minecraft/class_5630;named ofLnet/minecraft/inventory/CommandItemSlot;of(Lnet/minecraft/inventory/Inventory;I)Lnet/minecraft/inventory/CommandItemSlot;
-
of
static CommandItemSlot of(LivingEntity entity, EquipmentSlot equipmentSlot, Predicate<ItemStack> stackFilter)
Creates a slot backed by an equipment slot of an living entity and guarded by a condition for setting stacks into the inventory.- 参数:
stackFilter- the condition to guard stack setting- Mappings:
Namespace Name Mixin selector official aLato;a(Lasy;Lasq;Ljava/util/function/Predicate;)Lato;intermediary method_32331Lnet/minecraft/class_5630;method_32331(Lnet/minecraft/class_1309;Lnet/minecraft/class_1304;Ljava/util/function/Predicate;)Lnet/minecraft/class_5630;named ofLnet/minecraft/inventory/CommandItemSlot;of(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/EquipmentSlot;Ljava/util/function/Predicate;)Lnet/minecraft/inventory/CommandItemSlot;
-
of
static CommandItemSlot of(LivingEntity entity, EquipmentSlot equipmentSlot)
Creates a slot backed by an equipment slot of an living entity.- Mappings:
Namespace Name Mixin selector official aLato;a(Lasy;Lasq;)Lato;intermediary method_32330Lnet/minecraft/class_5630;method_32330(Lnet/minecraft/class_1309;Lnet/minecraft/class_1304;)Lnet/minecraft/class_5630;named ofLnet/minecraft/inventory/CommandItemSlot;of(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/EquipmentSlot;)Lnet/minecraft/inventory/CommandItemSlot;
-
get
ItemStack get()
Gets the current item stack in this slot.- Mappings:
Namespace Name Mixin selector official aLato;a()Lbpr;intermediary method_32327Lnet/minecraft/class_5630;method_32327()Lnet/minecraft/class_1799;named getLnet/minecraft/inventory/CommandItemSlot;get()Lnet/minecraft/item/ItemStack;
-
set
boolean set(ItemStack stack)
Sets thestackto this slot.- 参数:
stack- the item stack to set- 返回:
trueif the setting is successful,falseif rejected- Mappings:
Namespace Name Mixin selector official aLato;a(Lbpr;)Zintermediary method_32332Lnet/minecraft/class_5630;method_32332(Lnet/minecraft/class_1799;)Znamed setLnet/minecraft/inventory/CommandItemSlot;set(Lnet/minecraft/item/ItemStack;)Z
-
-