Package net.minecraft.inventory
Class Slot
- java.lang.Object
-
- net.minecraft.inventory.Slot
-
- Direct Known Subclasses:
SlotCrafting
,SlotFurnaceFuel
,SlotFurnaceOutput
,SlotMerchantResult
public class Slot extends java.lang.Object
+ This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. NOT FOR COMMERCIAL OR MALICIOUS USE (please read the 'LICENSE' file this repo's root directory for more info)
-
-
Field Summary
Fields Modifier and Type Field Description IInventory
inventory
int
slotNumber
int
xDisplayPosition
int
yDisplayPosition
-
Constructor Summary
Constructors Constructor Description Slot(IInventory inventoryIn, int index, int xPosition, int yPosition)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canBeHovered()
+ Actualy only call when we want to render the white square effect over the slots.boolean
canTakeStack(EntityPlayer var1)
+ Return whether this slot's stack can be taken from this slot.ItemStack
decrStackSize(int i)
+ Decrease the size of the stack in slot (first int arg) by the amount of the second int arg.boolean
getHasStack()
+ Returns if this slot contains a stack.int
getItemStackLimit(ItemStack var1)
int
getSlotStackLimit()
+ Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case of armor slots)java.lang.String
getSlotTexture()
ItemStack
getStack()
+ Helper fnct to get the stack in the slot.boolean
isHere(IInventory iinventory, int i)
+ returns true if the slot exists in the given inventory and locationboolean
isItemValid(ItemStack var1)
+ Check if the stack is a valid item for this slot.protected void
onCrafting(ItemStack var1)
+ the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood.protected void
onCrafting(ItemStack var1, int var2)
+ the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood.void
onPickupFromSlot(EntityPlayer var1, ItemStack var2)
void
onSlotChange(ItemStack parItemStack, ItemStack parItemStack2)
+ if par2 has more items than par1, onCrafting(item,countIncrease) is calledvoid
onSlotChanged()
+ Called when the stack in a Slot changesvoid
putStack(ItemStack itemstack)
+ Helper method to put a stack in the slot.
-
-
-
Field Detail
-
inventory
public final IInventory inventory
-
slotNumber
public int slotNumber
-
xDisplayPosition
public int xDisplayPosition
-
yDisplayPosition
public int yDisplayPosition
-
-
Constructor Detail
-
Slot
public Slot(IInventory inventoryIn, int index, int xPosition, int yPosition)
-
-
Method Detail
-
onSlotChange
public void onSlotChange(ItemStack parItemStack, ItemStack parItemStack2)
+ if par2 has more items than par1, onCrafting(item,countIncrease) is called
-
onCrafting
protected void onCrafting(ItemStack var1, int var2)
+ the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an internal count then calls onCrafting(item).
-
onCrafting
protected void onCrafting(ItemStack var1)
+ the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an internal count then calls onCrafting(item).
-
onPickupFromSlot
public void onPickupFromSlot(EntityPlayer var1, ItemStack var2)
-
isItemValid
public boolean isItemValid(ItemStack var1)
+ Check if the stack is a valid item for this slot. Always true beside for the armor slots.
-
getStack
public ItemStack getStack()
+ Helper fnct to get the stack in the slot.
-
getHasStack
public boolean getHasStack()
+ Returns if this slot contains a stack.
-
putStack
public void putStack(ItemStack itemstack)
+ Helper method to put a stack in the slot.
-
onSlotChanged
public void onSlotChanged()
+ Called when the stack in a Slot changes
-
getSlotStackLimit
public int getSlotStackLimit()
+ Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case of armor slots)
-
getItemStackLimit
public int getItemStackLimit(ItemStack var1)
-
getSlotTexture
public java.lang.String getSlotTexture()
-
decrStackSize
public ItemStack decrStackSize(int i)
+ Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new stack.
-
isHere
public boolean isHere(IInventory iinventory, int i)
+ returns true if the slot exists in the given inventory and location
-
canTakeStack
public boolean canTakeStack(EntityPlayer var1)
+ Return whether this slot's stack can be taken from this slot.
-
canBeHovered
public boolean canBeHovered()
+ Actualy only call when we want to render the white square effect over the slots. Return always True, except for the armor slot of the Donkey/Mule (we can't interact with the Undead and Skeleton horses)
-
-