Class Slot
java.lang.Object
net.minecraft.inventory.container.Slot
- Direct Known Subclasses:
BeaconContainer.BeaconSlot
,BrewingStandContainer.FuelSlot
,BrewingStandContainer.IngredientSlot
,BrewingStandContainer.PotionSlot
,CraftingResultSlot
,CreativeScreen.CreativeSlot
,CreativeScreen.LockedSlot
,FurnaceFuelSlot
,FurnaceResultSlot
,MerchantResultSlot
,ShulkerBoxSlot
,SlotItemHandler
-
Field Summary
Modifier and TypeFieldDescriptionprivate com.mojang.datafixers.util.Pair<ResourceLocation,
ResourceLocation> final IInventory
int
private final int
final int
final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkTakeAchievements
(ItemStack p_75208_1_) getItem()
int
int
getMaxStackSize
(ItemStack p_178170_1_) 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
isSameInventory
(Slot other) Checks if the other slot is in the same inventory, by comparing the inventory reference.boolean
mayPickup
(PlayerEntity p_82869_1_) boolean
protected void
onQuickCraft
(ItemStack p_75210_1_, int p_75210_2_) void
onQuickCraft
(ItemStack p_75220_1_, ItemStack p_75220_2_) protected void
onSwapCraft
(int p_190900_1_) onTake
(PlayerEntity p_190901_1_, ItemStack p_190901_2_) remove
(int p_75209_1_) void
setBackground
(ResourceLocation atlas, ResourceLocation sprite) Sets the background atlas and sprite location.void
-
Field Details
-
slot
private final int slot -
container
-
index
public int index -
x
public final int x -
y
public final int y -
backgroundPair
-
-
Constructor Details
-
Slot
-
-
Method Details
-
onQuickCraft
-
onQuickCraft
-
onSwapCraft
protected void onSwapCraft(int p_190900_1_) -
checkTakeAchievements
-
onTake
-
mayPlace
-
getItem
-
hasItem
public boolean hasItem() -
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.- Returns:
- Index in associated inventory for this slot.
-
isSameInventory
Checks if the other slot is in the same inventory, by comparing the inventory reference.- Parameters:
other
-- Returns:
- true if the other slot is in the same inventory
-
setBackground
Sets the background atlas and sprite location.- Parameters:
atlas
- The atlas namesprite
- The sprite located on that atlas.- Returns:
- this, to allow chaining.
-