Class SidedContainerView

java.lang.Object
net.ixdarklord.coolcatcore.api.container.SidedContainerView
All Implemented Interfaces:
net.minecraft.world.Clearable, net.minecraft.world.Container

public final class SidedContainerView extends Object implements net.minecraft.world.Container
What a WorldlyContainer shows through one face: only the slots that face reaches (numbered from 0), and only what the face allows in and out. Taking from a slot the face can't take from gives nothing.
  • Field Summary

    Fields inherited from interface net.minecraft.world.Container

    DEFAULT_DISTANCE_LIMIT, LARGE_MAX_STACK_SIZE
  • Constructor Summary

    Constructors
    Constructor
    Description
    SidedContainerView(net.minecraft.world.WorldlyContainer container, net.minecraft.core.Direction side)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canPlaceItem(int slot, net.minecraft.world.item.ItemStack stack)
     
    boolean
    canTakeItem(net.minecraft.world.Container into, int slot, net.minecraft.world.item.ItemStack stack)
     
    void
     
    net.minecraft.world.WorldlyContainer
     
    int
     
    int
    getContainerSlot(int slot)
    The underlying container's slot for one of this view's slots.
    net.minecraft.world.item.ItemStack
    getItem(int slot)
     
    int
     
    int
    getMaxStackSize(net.minecraft.world.item.ItemStack stack)
    The most of the item a slot holds, before per-slot limits.
    net.minecraft.core.Direction
     
    boolean
     
    net.minecraft.world.item.ItemStack
    removeItem(int slot, int count)
     
    net.minecraft.world.item.ItemStack
     
    void
     
    void
    setItem(int slot, net.minecraft.world.item.ItemStack stack)
     
    boolean
    stillValid(net.minecraft.world.entity.player.Player player)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.world.Container

    countItem, hasAnyMatching, hasAnyOf, startOpen, stopOpen
  • Constructor Details

    • SidedContainerView

      public SidedContainerView(net.minecraft.world.WorldlyContainer container, net.minecraft.core.Direction side)
  • Method Details

    • getContainer

      public net.minecraft.world.WorldlyContainer getContainer()
    • getSide

      public net.minecraft.core.Direction getSide()
    • getContainerSlot

      public int getContainerSlot(int slot)
      The underlying container's slot for one of this view's slots.
    • 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 count)
      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, net.minecraft.world.item.ItemStack stack)
      Specified by:
      setItem in interface net.minecraft.world.Container
    • getMaxStackSize

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

      public int getMaxStackSize(net.minecraft.world.item.ItemStack stack)
      The most of the item a slot holds, before per-slot limits.
    • setChanged

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

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

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

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

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