类 Slot
java.lang.Object
net.minecraft.world.inventory.Slot
- 直接已知子类:
BeaconMenu.PaymentSlot
,BrewingStandMenu.FuelSlot
,BrewingStandMenu.IngredientsSlot
,BrewingStandMenu.PotionSlot
,CreativeModeInventoryScreen.CustomCreativeSlot
,CreativeModeInventoryScreen.SlotWrapper
,FurnaceFuelSlot
,FurnaceResultSlot
,MerchantResultSlot
,ResultSlot
,ShulkerBoxSlot
,SlotItemHandler
-
字段概要
字段修饰符和类型字段说明private com.mojang.datafixers.util.Pair<ResourceLocation,
ResourceLocation> final Container
int
private final int
final int
final int
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明boolean
allowModification
(Player pPlayer) protected void
checkTakeAchievements
(ItemStack pStack) int
getItem()
int
int
getMaxStackSize
(ItemStack pStack) com.mojang.datafixers.util.Pair<ResourceLocation,
ResourceLocation> int
Retrieves the index in the inventory for this slot, this value should typically not be used, but can be useful for some occasions.boolean
hasItem()
boolean
isActive()
boolean
boolean
isSameInventory
(Slot other) Checks if the other slot is in the same inventory, by comparing the inventory reference.boolean
boolean
protected void
onQuickCraft
(ItemStack pStack, int pAmount) void
onQuickCraft
(ItemStack pOldStack, ItemStack pNewStack) protected void
onSwapCraft
(int pNumItemsCrafted) void
remove
(int pAmount) safeInsert
(ItemStack pStack) safeInsert
(ItemStack pStack, int pIncrement) void
setBackground
(ResourceLocation atlas, ResourceLocation sprite) Sets the background atlas and sprite location.void
setByPlayer
(ItemStack pStack) void
-
字段详细资料
-
slot
private final int slot -
container
-
index
public int index -
x
public final int x -
y
public final int y -
backgroundPair
-
-
构造器详细资料
-
Slot
-
-
方法详细资料
-
onQuickCraft
-
onQuickCraft
-
onSwapCraft
protected void onSwapCraft(int pNumItemsCrafted) -
checkTakeAchievements
-
onTake
-
mayPlace
-
getItem
-
hasItem
public boolean hasItem() -
setByPlayer
-
set
-
setChanged
public void setChanged() -
getMaxStackSize
public int getMaxStackSize() -
getMaxStackSize
-
getNoItemIcon
-
remove
-
mayPickup
-
isActive
public boolean isActive() -
getSlotIndex
public int getSlotIndex()Retrieves the index in the inventory for this slot, this value should typically not be used, but can be useful for some occasions.- 返回:
- Index in associated inventory for this slot.
-
isSameInventory
Checks if the other slot is in the same inventory, by comparing the inventory reference.- 参数:
other
-- 返回:
- true if the other slot is in the same inventory
-
setBackground
Sets the background atlas and sprite location.- 参数:
atlas
- The atlas namesprite
- The sprite located on that atlas.- 返回:
- this, to allow chaining.
-
tryRemove
-
safeTake
-
safeInsert
-
safeInsert
-
allowModification
-
getContainerSlot
public int getContainerSlot() -
isHighlightable
public boolean isHighlightable()
-