Record Class DummyContainer

java.lang.Object
java.lang.Record
com.petrolpark.core.inventory.DummyContainer
All Implemented Interfaces:
net.minecraft.world.Clearable, net.minecraft.world.Container

public record DummyContainer(int size) extends Record implements net.minecraft.world.Container
  • Field Summary

    Fields inherited from interface net.minecraft.world.Container

    DEFAULT_DISTANCE_BUFFER
  • Constructor Summary

    Constructors
    Constructor
    Description
    DummyContainer(int size)
    Creates an instance of a DummyContainer record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    static final void
    addFakePlayerSlots(Consumer<net.minecraft.world.inventory.Slot> slotAdder)
     
    boolean
    canPlaceItem(int slot, net.minecraft.world.item.ItemStack stack)
     
    boolean
    canTakeItem(net.minecraft.world.Container target, int slot, net.minecraft.world.item.ItemStack stack)
     
    void
     
    int
    countItem(net.minecraft.world.item.Item item)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
     
    net.minecraft.world.item.ItemStack
    getItem(int slot)
     
    int
     
    boolean
    hasAnyMatching(Predicate<net.minecraft.world.item.ItemStack> predicate)
     
    boolean
    hasAnyOf(Set<net.minecraft.world.item.Item> set)
     
    final int
    Returns a hash code value for this object.
    boolean
     
    net.minecraft.world.item.ItemStack
    removeItem(int slot, int amount)
     
    net.minecraft.world.item.ItemStack
     
    void
     
    void
    setItem(int slot, net.minecraft.world.item.ItemStack stack)
     
    int
    Returns the value of the size record component.
    boolean
    stillValid(net.minecraft.world.entity.player.Player player)
     
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.minecraft.world.Container

    getMaxStackSize, startOpen, stopOpen
  • Constructor Details

    • DummyContainer

      public DummyContainer(int size)
      Creates an instance of a DummyContainer record class.
      Parameters:
      size - the value for the size record component
  • Method Details

    • addFakePlayerSlots

      public static final void addFakePlayerSlots(Consumer<net.minecraft.world.inventory.Slot> slotAdder)
    • clearContent

      public void clearContent()
      Specified by:
      clearContent in interface net.minecraft.world.Clearable
    • getContainerSize

      public int getContainerSize()
      Specified by:
      getContainerSize in interface net.minecraft.world.Container
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface net.minecraft.world.Container
    • getItem

      public net.minecraft.world.item.ItemStack getItem(int slot)
      Specified by:
      getItem in interface net.minecraft.world.Container
    • removeItem

      public net.minecraft.world.item.ItemStack removeItem(int slot, int amount)
      Specified by:
      removeItem in interface net.minecraft.world.Container
    • removeItemNoUpdate

      public net.minecraft.world.item.ItemStack removeItemNoUpdate(int slot)
      Specified by:
      removeItemNoUpdate in interface net.minecraft.world.Container
    • setItem

      public void setItem(int slot, @Nonnull net.minecraft.world.item.ItemStack stack)
      Specified by:
      setItem in interface net.minecraft.world.Container
    • setChanged

      public void setChanged()
      Specified by:
      setChanged in interface net.minecraft.world.Container
    • getMaxStackSize

      public int getMaxStackSize()
      Specified by:
      getMaxStackSize in interface net.minecraft.world.Container
    • stillValid

      public boolean stillValid(@Nonnull net.minecraft.world.entity.player.Player player)
      Specified by:
      stillValid in interface net.minecraft.world.Container
    • canPlaceItem

      public boolean canPlaceItem(int slot, @Nonnull net.minecraft.world.item.ItemStack stack)
      Specified by:
      canPlaceItem in interface net.minecraft.world.Container
    • canTakeItem

      public boolean canTakeItem(@Nonnull net.minecraft.world.Container target, int slot, @Nonnull net.minecraft.world.item.ItemStack stack)
      Specified by:
      canTakeItem in interface net.minecraft.world.Container
    • countItem

      public int countItem(@Nonnull net.minecraft.world.item.Item item)
      Specified by:
      countItem in interface net.minecraft.world.Container
    • hasAnyOf

      public boolean hasAnyOf(@Nonnull Set<net.minecraft.world.item.Item> set)
      Specified by:
      hasAnyOf in interface net.minecraft.world.Container
    • hasAnyMatching

      public boolean hasAnyMatching(@Nonnull Predicate<net.minecraft.world.item.ItemStack> predicate)
      Specified by:
      hasAnyMatching in interface net.minecraft.world.Container
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • size

      public int size()
      Returns the value of the size record component.
      Returns:
      the value of the size record component