Class HopperHooks
java.lang.Object
alexiil.mc.lib.attributes.item.mixin.HopperHooks
Helper class for the
HopperBlockEntity
to implement the actual transfer logic.-
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.util.ActionResult
tryDispense(net.minecraft.block.entity.DispenserBlockEntity dropper, int invIndex)
static net.minecraft.util.ActionResult
tryExtract(net.minecraft.world.World world, net.minecraft.block.entity.Hopper hopper)
Tries to extract items from a LBA extractable above the given hopper.static net.minecraft.util.ActionResult
tryInsert(net.minecraft.block.entity.HopperBlockEntity hopper)
Attempts to insert items from a Hopper into an adjacent LBA insertable.
-
Method Details
-
tryInsert
public static net.minecraft.util.ActionResult tryInsert(net.minecraft.block.entity.HopperBlockEntity hopper)Attempts to insert items from a Hopper into an adjacent LBA insertable. If the block entity to be inserted into directly implementsInventory
, we delegate back to Vanilla.- Returns:
ActionResult.PASS
to continue with the original Vanilla logic, otherwise indicates whether insertion failed or succeeded.
-
tryExtract
public static net.minecraft.util.ActionResult tryExtract(net.minecraft.world.World world, net.minecraft.block.entity.Hopper hopper)Tries to extract items from a LBA extractable above the given hopper. Note that the given hopper can also be a hopper minecart.If the block entity to be extracted from directly implements
Inventory
, we delegate back to Vanilla.- Returns:
ActionResult.PASS
to continue with the original Vanilla logic, otherwise indicates whether extraction failed or succeeded.
-
tryDispense
public static net.minecraft.util.ActionResult tryDispense(net.minecraft.block.entity.DispenserBlockEntity dropper, int invIndex)
-