类 Slot
java.lang.Object
net.minecraft.world.inventory.Slot
- 直接已知子类:
ArmorSlot
,BeaconMenu.PaymentSlot
,BrewingStandMenu.FuelSlot
,BrewingStandMenu.IngredientsSlot
,BrewingStandMenu.PotionSlot
,CrafterSlot
,CreativeModeInventoryScreen.CustomCreativeSlot
,CreativeModeInventoryScreen.SlotWrapper
,FurnaceFuelSlot
,FurnaceResultSlot
,MerchantResultSlot
,NonInteractiveResultSlot
,ResultSlot
,ShulkerBoxSlot
,SlotItemHandler
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明boolean
allowModification
(Player p_150652_) protected void
checkTakeAchievements
(ItemStack p_40239_) int
getItem()
int
int
getMaxStackSize
(ItemStack p_40238_) 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
isFake()
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 p_40232_, int p_40233_) void
onQuickCraft
(ItemStack p_40235_, ItemStack p_40236_) protected void
onSwapCraft
(int p_40237_) void
remove
(int p_40227_) safeInsert
(ItemStack p_150660_) safeInsert
(ItemStack p_150657_, int p_150658_) void
setBackground
(ResourceLocation sprite) Sets the background atlas and sprite location.void
setByPlayer
(ItemStack p_270152_) void
setByPlayer
(ItemStack p_299954_, ItemStack p_301385_) void
-
字段详细资料
-
slot
private final int slot -
container
-
index
public int index -
x
public final int x -
y
public final int y -
background
-
-
构造器详细资料
-
Slot
-
-
方法详细资料
-
onQuickCraft
-
onQuickCraft
-
onSwapCraft
protected void onSwapCraft(int p_40237_) -
checkTakeAchievements
-
onTake
-
mayPlace
-
getItem
-
hasItem
public boolean hasItem() -
setByPlayer
-
setByPlayer
-
set
-
setChanged
public void setChanged() -
getMaxStackSize
public int getMaxStackSize() -
getMaxStackSize
-
getNoItemIcon
-
remove
-
mayPickup
-
isActive
public boolean isActive() -
tryRemove
-
safeTake
-
safeInsert
-
safeInsert
-
allowModification
-
getContainerSlot
public int getContainerSlot() -
isHighlightable
public boolean isHighlightable() -
isFake
public boolean isFake() -
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.- 参数:
sprite
- The sprite located on that atlas.- 返回:
- this, to allow chaining.
-