Class SidedContainerView
java.lang.Object
net.ixdarklord.coolcatcore.api.container.SidedContainerView
- All Implemented Interfaces:
Iterable<net.minecraft.world.item.ItemStack>, net.minecraft.world.Clearable, net.minecraft.world.Container, net.minecraft.world.entity.SlotProvider
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.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.Container
net.minecraft.world.Container.ContainerIterator -
Field Summary
Fields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFER -
Constructor Summary
ConstructorsConstructorDescriptionSidedContainerView(net.minecraft.world.WorldlyContainer container, net.minecraft.core.Direction side) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanPlaceItem(int slot, net.minecraft.world.item.ItemStack stack) booleancanTakeItem(net.minecraft.world.Container into, int slot, net.minecraft.world.item.ItemStack stack) voidnet.minecraft.world.WorldlyContainerintintgetContainerSlot(int slot) The underlying container's slot for one of this view's slots.net.minecraft.world.item.ItemStackgetItem(int slot) intintgetMaxStackSize(net.minecraft.world.item.ItemStack stack) net.minecraft.core.DirectiongetSide()booleanisEmpty()net.minecraft.world.item.ItemStackremoveItem(int slot, int count) net.minecraft.world.item.ItemStackremoveItemNoUpdate(int slot) voidvoidsetItem(int slot, net.minecraft.world.item.ItemStack stack) booleanstillValid(net.minecraft.world.entity.player.Player player) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.Container
countItem, getEntitiesWithContainerOpen, getSlot, hasAnyMatching, hasAnyOf, iterator, startOpen, stopOpenMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface net.minecraft.world.entity.SlotProvider
getSlotsFromRange
-
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:
getContainerSizein interfacenet.minecraft.world.Container
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfacenet.minecraft.world.Container
-
getItem
public net.minecraft.world.item.ItemStack getItem(int slot) - Specified by:
getItemin interfacenet.minecraft.world.Container
-
removeItem
public net.minecraft.world.item.ItemStack removeItem(int slot, int count) - Specified by:
removeItemin interfacenet.minecraft.world.Container
-
removeItemNoUpdate
public net.minecraft.world.item.ItemStack removeItemNoUpdate(int slot) - Specified by:
removeItemNoUpdatein interfacenet.minecraft.world.Container
-
setItem
public void setItem(int slot, net.minecraft.world.item.ItemStack stack) - Specified by:
setItemin interfacenet.minecraft.world.Container
-
getMaxStackSize
public int getMaxStackSize()- Specified by:
getMaxStackSizein interfacenet.minecraft.world.Container
-
getMaxStackSize
public int getMaxStackSize(net.minecraft.world.item.ItemStack stack) - Specified by:
getMaxStackSizein interfacenet.minecraft.world.Container
-
setChanged
public void setChanged()- Specified by:
setChangedin interfacenet.minecraft.world.Container
-
stillValid
public boolean stillValid(net.minecraft.world.entity.player.Player player) - Specified by:
stillValidin interfacenet.minecraft.world.Container
-
canPlaceItem
public boolean canPlaceItem(int slot, net.minecraft.world.item.ItemStack stack) - Specified by:
canPlaceItemin interfacenet.minecraft.world.Container
-
canTakeItem
public boolean canTakeItem(net.minecraft.world.Container into, int slot, net.minecraft.world.item.ItemStack stack) - Specified by:
canTakeItemin interfacenet.minecraft.world.Container
-
clearContent
public void clearContent()- Specified by:
clearContentin interfacenet.minecraft.world.Clearable
-