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
FieldsModifier and TypeFieldDescriptionprivate com.mojang.datafixers.util.Pair<ResourceLocation,ResourceLocation> final IInventoryintprivate final intfinal intfinal int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckTakeAchievements(ItemStack p_75208_1_) getItem()intintgetMaxStackSize(ItemStack p_178170_1_) com.mojang.datafixers.util.Pair<ResourceLocation,ResourceLocation> intRetrieves the index in the inventory for this slot, this value should typically not be used, but can be useful for some occasions.booleanhasItem()booleanisActive()booleanisSameInventory(Slot other) Checks if the other slot is in the same inventory, by comparing the inventory reference.booleanmayPickup(PlayerEntity p_82869_1_) booleanprotected voidonQuickCraft(ItemStack p_75210_1_, int p_75210_2_) voidonQuickCraft(ItemStack p_75220_1_, ItemStack p_75220_2_) protected voidonSwapCraft(int p_190900_1_) onTake(PlayerEntity p_190901_1_, ItemStack p_190901_2_) remove(int p_75209_1_) voidsetBackground(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.
-