Class SlotFixedItemInv

java.lang.Object
net.minecraft.screen.slot.Slot
alexiil.mc.lib.attributes.item.compat.SlotFixedItemInv
All Implemented Interfaces:
Convertible

public class SlotFixedItemInv extends net.minecraft.screen.slot.Slot implements Convertible
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
    final boolean
     
    final int
     

    Fields inherited from class net.minecraft.screen.slot.Slot

    id, inventory, x, y
  • Constructor Summary

    Constructors
    Constructor
    Description
    SlotFixedItemInv(net.minecraft.screen.ScreenHandler container, FixedItemInv inv, boolean server, int slotIndex, int x, int y)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canInsert(net.minecraft.item.ItemStack stack)
     
    <T> T
    convertTo(Class<T> otherType)
    Attempts to provide a variant of this in the given class form.
    int
    getMaxItemCount(net.minecraft.item.ItemStack stack)
     
    void
    setStack(net.minecraft.item.ItemStack stack)
     

    Methods inherited from class net.minecraft.screen.slot.Slot

    canTakeItems, canTakePartial, getBackgroundSprite, getIndex, getMaxItemCount, getStack, hasStack, insertStack, insertStack, isEnabled, markDirty, onCrafted, onCrafted, onQuickTransfer, onTake, onTakeItem, setStackNoCallbacks, takeStack, takeStackRange, tryTakeStackRange

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • inv

      public final FixedItemInv inv
    • slotIndex

      public final int slotIndex
    • server

      public final boolean server
  • Constructor Details

    • SlotFixedItemInv

      public SlotFixedItemInv(net.minecraft.screen.ScreenHandler container, FixedItemInv inv, boolean server, int slotIndex, int x, int y)
  • Method Details

    • canInsert

      public boolean canInsert(net.minecraft.item.ItemStack stack)
      Overrides:
      canInsert in class net.minecraft.screen.slot.Slot
    • getMaxItemCount

      public int getMaxItemCount(net.minecraft.item.ItemStack stack)
      Overrides:
      getMaxItemCount in class net.minecraft.screen.slot.Slot
    • setStack

      public void setStack(net.minecraft.item.ItemStack stack)
      Overrides:
      setStack in class net.minecraft.screen.slot.Slot
    • convertTo

      public <T> T convertTo(Class<T> otherType)
      Description copied from interface: Convertible
      Attempts to provide a variant of this in the given class form. This does not have to return "this" object if this is already an instance of the given class.

      Note: In order to be typesafe (and prevent crashes) it is recommended that you return Class.cast(Object) with the object you wish to return rather than just blindly cast to "T".

      Specified by:
      convertTo in interface Convertible