Package org.moddingx.libx.inventory
Class VanillaWrapper
java.lang.Object
org.moddingx.libx.inventory.VanillaWrapper
- All Implemented Interfaces:
net.minecraft.world.Clearable
,net.minecraft.world.Container
Wraps an
IItemHandlerModifiable
to a vanilla Container
.-
Field Summary
Modifier and TypeFieldDescriptionfinal Runnable
final net.minecraftforge.items.IItemHandlerModifiable
Fields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_LIMIT, LARGE_MAX_STACK_SIZE
-
Constructor Summary
ConstructorDescriptionVanillaWrapper
(net.minecraftforge.items.IItemHandlerModifiable handler, Runnable changed) Wraps the givenIItemHandlerModifiable
to a vanillaContainer
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canPlaceItem
(int index, net.minecraft.world.item.ItemStack stack) void
int
net.minecraft.world.item.ItemStack
getItem
(int index) boolean
isEmpty()
net.minecraft.world.item.ItemStack
removeItem
(int index, int count) net.minecraft.world.item.ItemStack
removeItemNoUpdate
(int index) void
void
setItem
(int index, 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
canTakeItem, countItem, getMaxStackSize, hasAnyMatching, hasAnyOf, startOpen, stopOpen
-
Field Details
-
handler
public final net.minecraftforge.items.IItemHandlerModifiable handler -
changed
-
-
Constructor Details
-
VanillaWrapper
public VanillaWrapper(net.minecraftforge.items.IItemHandlerModifiable handler, @Nullable Runnable changed) Wraps the givenIItemHandlerModifiable
to a vanillaContainer
.- Parameters:
changed
- A runnable which is always called whenContainer.setChanged()
is called on the vanilla container.
-
-
Method Details
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSize
in interfacenet.minecraft.world.Container
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfacenet.minecraft.world.Container
-
getItem
- Specified by:
getItem
in interfacenet.minecraft.world.Container
-
removeItem
- Specified by:
removeItem
in interfacenet.minecraft.world.Container
-
removeItemNoUpdate
- Specified by:
removeItemNoUpdate
in interfacenet.minecraft.world.Container
-
setItem
- Specified by:
setItem
in interfacenet.minecraft.world.Container
-
setChanged
public void setChanged()- Specified by:
setChanged
in interfacenet.minecraft.world.Container
-
stillValid
- Specified by:
stillValid
in interfacenet.minecraft.world.Container
-
canPlaceItem
- Specified by:
canPlaceItem
in interfacenet.minecraft.world.Container
-
clearContent
public void clearContent()- Specified by:
clearContent
in interfacenet.minecraft.world.Clearable
-