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
    FixedItemInv inv  
    boolean server  
    int slotIndex  

    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​(java.lang.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, doDrawHoveringEffect, getBackgroundSprite, getMaxItemCount, getStack, hasStack, markDirty, onCrafted, onCrafted, onStackChanged, onTake, onTakeItem, takeStack

    Methods inherited from class java.lang.Object

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

  • 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​(java.lang.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