Package net.darkhax.bookshelf.impl.util
Class InventoryHelperForge
java.lang.Object
net.darkhax.bookshelf.impl.util.InventoryHelperForge
- All Implemented Interfaces:
IInventoryHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanItemsStack(net.minecraft.world.item.ItemStack original, net.minecraft.world.item.ItemStack toStack) Checks if two ItemStack may be stacked together.net.minecraft.world.entity.player.PlayergetCraftingPlayer(net.minecraft.world.Container container) net.minecraft.world.item.ItemStackgetCraftingRemainder(net.minecraft.world.item.ItemStack stack) @Nullable IInventoryAccessgetInventory(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, @Nullable net.minecraft.core.Direction direction) Attempts to provide access to an inventory stored at the given position.booleanhasCraftingRemainder(net.minecraft.world.item.ItemStack stack) booleanisFakePlayer(net.minecraft.world.entity.player.Player player) voidopenMenu(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.MenuProvider provider, Consumer<net.minecraft.network.FriendlyByteBuf> buf, boolean allowFakes) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.darkhax.bookshelf.api.util.IInventoryHelper
applyForEach, applyForEach, damageStack, fill, getCraftingContainer, isUnbreakableItem, keepDamageableItems, openMenu, openMenu, toList
-
Constructor Details
-
InventoryHelperForge
public InventoryHelperForge()
-
-
Method Details
-
getCraftingPlayer
public net.minecraft.world.entity.player.Player getCraftingPlayer(net.minecraft.world.Container container) - Specified by:
getCraftingPlayerin interfaceIInventoryHelper
-
canItemsStack
public boolean canItemsStack(net.minecraft.world.item.ItemStack original, net.minecraft.world.item.ItemStack toStack) Description copied from interface:IInventoryHelperChecks if two ItemStack may be stacked together.- Specified by:
canItemsStackin interfaceIInventoryHelper- Parameters:
original- The original stack.toStack- The stack attempting to be stacked into the original.- Returns:
- Can the two stacks be stacked together.
-
getInventory
@Nullable public @Nullable IInventoryAccess getInventory(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, @Nullable @Nullable net.minecraft.core.Direction direction) Description copied from interface:IInventoryHelperAttempts to provide access to an inventory stored at the given position.- Specified by:
getInventoryin interfaceIInventoryHelper- Parameters:
level- The world to query.pos- The position to look at.direction- The side of the inventory being accessed.- Returns:
- Access to the inventory at the given position.
-
openMenu
public void openMenu(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.MenuProvider provider, Consumer<net.minecraft.network.FriendlyByteBuf> buf, boolean allowFakes) - Specified by:
openMenuin interfaceIInventoryHelper
-
getCraftingRemainder
public net.minecraft.world.item.ItemStack getCraftingRemainder(net.minecraft.world.item.ItemStack stack) - Specified by:
getCraftingRemainderin interfaceIInventoryHelper
-
hasCraftingRemainder
public boolean hasCraftingRemainder(net.minecraft.world.item.ItemStack stack) - Specified by:
hasCraftingRemainderin interfaceIInventoryHelper
-
isFakePlayer
public boolean isFakePlayer(net.minecraft.world.entity.player.Player player) - Specified by:
isFakePlayerin interfaceIInventoryHelper
-