类 SimpleInventory
- java.lang.Object
-
- net.minecraft.inventory.SimpleInventory
-
- 所有已实现的接口:
Inventory,RecipeInputProvider,Clearable
- 直接已知子类:
ComposterBlock.ComposterInventory,ComposterBlock.DummyInventory,ComposterBlock.FullComposterInventory,EnderChestInventory
public class SimpleInventory extends Object implements Inventory, RecipeInputProvider
- Mappings:
Namespace Name official arlintermediary net/minecraft/class_1277named net/minecraft/inventory/SimpleInventory
-
-
字段概要
字段 修饰符和类型 字段 说明 private List<InventoryChangedListener>listenersprivate intsizeprivate DefaultedList<ItemStack>stacks-
从接口继承的字段 net.minecraft.inventory.Inventory
MAX_COUNT_PER_STACK
-
-
构造器概要
构造器 构造器 说明 SimpleInventory(int size)SimpleInventory(ItemStack[] items)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddListener(InventoryChangedListener listener)ItemStackaddStack(ItemStack stack)private voidaddToExistingSlot(ItemStack stack)private voidaddToNewSlot(ItemStack stack)booleancanInsert(ItemStack stack)booleancanPlayerUse(PlayerEntity player)voidclear()List<ItemStack>clearToList()Clears this inventory and return all the non-empty stacks in a list.ItemStackgetStack(int slot)Fetches the stack currently stored at the given slot.booleanisEmpty()voidmarkDirty()voidprovideRecipeInputs(RecipeFinder finder)voidreadNbtList(ListTag nbtList)ItemStackremoveItem(Item item, int count)Searches this inventory for the specified item and removes the given amount from this inventory.voidremoveListener(InventoryChangedListener listener)ItemStackremoveStack(int slot)Removes the stack currently stored at the indicated slot.ItemStackremoveStack(int slot, int amount)Removes a specific number of items from the given slot.voidsetStack(int slot, ItemStack stack)intsize()ListTagtoNbtList()StringtoString()private voidtransfer(ItemStack source, ItemStack target)-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
从接口继承的方法 net.minecraft.inventory.Inventory
containsAny, count, getMaxCountPerStack, isValid, onClose, onOpen
-
-
-
-
字段详细资料
-
size
private final int size
- Mappings:
Namespace Name Mixin selector official bLarl;b:Iintermediary field_5831Lnet/minecraft/class_1277;field_5831:Inamed sizeLnet/minecraft/inventory/SimpleInventory;size:I
-
stacks
private final DefaultedList<ItemStack> stacks
- Mappings:
Namespace Name Mixin selector official cLarl;c:Lgn;intermediary field_5828Lnet/minecraft/class_1277;field_5828:Lnet/minecraft/class_2371;named stacksLnet/minecraft/inventory/SimpleInventory;stacks:Lnet/minecraft/util/collection/DefaultedList;
-
listeners
private List<InventoryChangedListener> listeners
- Mappings:
Namespace Name Mixin selector official dLarl;d:Ljava/util/List;intermediary field_5829Lnet/minecraft/class_1277;field_5829:Ljava/util/List;named listenersLnet/minecraft/inventory/SimpleInventory;listeners:Ljava/util/List;
-
-
构造器详细资料
-
SimpleInventory
public SimpleInventory(int size)
- Mappings:
Namespace Name Mixin selector official <init>Larl;<init>(I)Vintermediary <init>Lnet/minecraft/class_1277;<init>(I)Vnamed <init>Lnet/minecraft/inventory/SimpleInventory;<init>(I)V
-
SimpleInventory
public SimpleInventory(ItemStack[] items)
- Mappings:
Namespace Name Mixin selector official <init>Larl;<init>([Lbpr;)Vintermediary <init>Lnet/minecraft/class_1277;<init>([Lnet/minecraft/class_1799;)Vnamed <init>Lnet/minecraft/inventory/SimpleInventory;<init>([Lnet/minecraft/item/ItemStack;)V
-
-
方法详细资料
-
addListener
public void addListener(InventoryChangedListener listener)
- Mappings:
Namespace Name Mixin selector official aLarl;a(Larb;)Vintermediary method_5489Lnet/minecraft/class_1277;method_5489(Lnet/minecraft/class_1265;)Vnamed addListenerLnet/minecraft/inventory/SimpleInventory;addListener(Lnet/minecraft/inventory/InventoryChangedListener;)V
-
removeListener
public void removeListener(InventoryChangedListener listener)
- Mappings:
Namespace Name Mixin selector official bLarl;b(Larb;)Vintermediary method_5488Lnet/minecraft/class_1277;method_5488(Lnet/minecraft/class_1265;)Vnamed removeListenerLnet/minecraft/inventory/SimpleInventory;removeListener(Lnet/minecraft/inventory/InventoryChangedListener;)V
-
getStack
public ItemStack getStack(int slot)
Fetches the stack currently stored at the given slot. If the slot is empty, or is outside the bounds of this inventory, returns seeItemStack.EMPTY.
-
clearToList
public List<ItemStack> clearToList()
Clears this inventory and return all the non-empty stacks in a list.- Mappings:
Namespace Name Mixin selector official fLarl;f()Ljava/util/List;intermediary method_24514Lnet/minecraft/class_1277;method_24514()Ljava/util/List;named clearToListLnet/minecraft/inventory/SimpleInventory;clearToList()Ljava/util/List;
-
removeStack
public ItemStack removeStack(int slot, int amount)
Removes a specific number of items from the given slot.- 指定者:
removeStack在接口中Inventory- 返回:
- the removed items as a stack
- Mappings:
Namespace Name Mixin selector official aLaqz;a(II)Lbpr;intermediary method_5434Lnet/minecraft/class_1263;method_5434(II)Lnet/minecraft/class_1799;named removeStackLnet/minecraft/inventory/Inventory;removeStack(II)Lnet/minecraft/item/ItemStack;
-
removeItem
public ItemStack removeItem(Item item, int count)
Searches this inventory for the specified item and removes the given amount from this inventory.- 返回:
- the stack of removed items
- Mappings:
Namespace Name Mixin selector official aLarl;a(Lbpn;I)Lbpr;intermediary method_20631Lnet/minecraft/class_1277;method_20631(Lnet/minecraft/class_1792;I)Lnet/minecraft/class_1799;named removeItemLnet/minecraft/inventory/SimpleInventory;removeItem(Lnet/minecraft/item/Item;I)Lnet/minecraft/item/ItemStack;
-
addStack
public ItemStack addStack(ItemStack stack)
- Mappings:
Namespace Name Mixin selector official aLarl;a(Lbpr;)Lbpr;intermediary method_5491Lnet/minecraft/class_1277;method_5491(Lnet/minecraft/class_1799;)Lnet/minecraft/class_1799;named addStackLnet/minecraft/inventory/SimpleInventory;addStack(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;
-
canInsert
public boolean canInsert(ItemStack stack)
- Mappings:
Namespace Name Mixin selector official bLarl;b(Lbpr;)Zintermediary method_27070Lnet/minecraft/class_1277;method_27070(Lnet/minecraft/class_1799;)Znamed canInsertLnet/minecraft/inventory/SimpleInventory;canInsert(Lnet/minecraft/item/ItemStack;)Z
-
removeStack
public ItemStack removeStack(int slot)
Removes the stack currently stored at the indicated slot.- 指定者:
removeStack在接口中Inventory- 返回:
- the stack previously stored at the indicated slot.
- Mappings:
Namespace Name Mixin selector official bLaqz;b(I)Lbpr;intermediary method_5441Lnet/minecraft/class_1263;method_5441(I)Lnet/minecraft/class_1799;named removeStackLnet/minecraft/inventory/Inventory;removeStack(I)Lnet/minecraft/item/ItemStack;
-
setStack
public void setStack(int slot, ItemStack stack)
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
markDirty
public void markDirty()
-
canPlayerUse
public boolean canPlayerUse(PlayerEntity player)
- 指定者:
canPlayerUse在接口中Inventory- Mappings:
Namespace Name Mixin selector official aLaqz;a(Lbjf;)Zintermediary method_5443Lnet/minecraft/class_1263;method_5443(Lnet/minecraft/class_1657;)Znamed canPlayerUseLnet/minecraft/inventory/Inventory;canPlayerUse(Lnet/minecraft/entity/player/PlayerEntity;)Z
-
clear
public void clear()
-
provideRecipeInputs
public void provideRecipeInputs(RecipeFinder finder)
- 指定者:
provideRecipeInputs在接口中RecipeInputProvider- Mappings:
Namespace Name Mixin selector official aLbnf;a(Lbjh;)Vintermediary method_7683Lnet/minecraft/class_1737;method_7683(Lnet/minecraft/class_1662;)Vnamed provideRecipeInputsLnet/minecraft/recipe/RecipeInputProvider;provideRecipeInputs(Lnet/minecraft/recipe/RecipeFinder;)V
-
toString
public String toString()
-
addToNewSlot
private void addToNewSlot(ItemStack stack)
- Mappings:
Namespace Name Mixin selector official cLarl;c(Lbpr;)Vintermediary method_20633Lnet/minecraft/class_1277;method_20633(Lnet/minecraft/class_1799;)Vnamed addToNewSlotLnet/minecraft/inventory/SimpleInventory;addToNewSlot(Lnet/minecraft/item/ItemStack;)V
-
addToExistingSlot
private void addToExistingSlot(ItemStack stack)
- Mappings:
Namespace Name Mixin selector official dLarl;d(Lbpr;)Vintermediary method_20634Lnet/minecraft/class_1277;method_20634(Lnet/minecraft/class_1799;)Vnamed addToExistingSlotLnet/minecraft/inventory/SimpleInventory;addToExistingSlot(Lnet/minecraft/item/ItemStack;)V
-
transfer
private void transfer(ItemStack source, ItemStack target)
- Mappings:
Namespace Name Mixin selector official aLarl;a(Lbpr;Lbpr;)Vintermediary method_20632Lnet/minecraft/class_1277;method_20632(Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)Vnamed transferLnet/minecraft/inventory/SimpleInventory;transfer(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)V
-
readNbtList
public void readNbtList(ListTag nbtList)
- Mappings:
Namespace Name Mixin selector official aLarl;a(Lnb;)Vintermediary method_7659Lnet/minecraft/class_1277;method_7659(Lnet/minecraft/class_2499;)Vnamed readNbtListLnet/minecraft/inventory/SimpleInventory;readNbtList(Lnet/minecraft/nbt/ListTag;)V
-
toNbtList
public ListTag toNbtList()
- Mappings:
Namespace Name Mixin selector official gLarl;g()Lnb;intermediary method_7660Lnet/minecraft/class_1277;method_7660()Lnet/minecraft/class_2499;named toNbtListLnet/minecraft/inventory/SimpleInventory;toNbtList()Lnet/minecraft/nbt/ListTag;
-
-