Class VanillaInventoryCodeHooks
java.lang.Object
net.neoforged.neoforge.transfer.item.VanillaInventoryCodeHooks
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanextractHook(Hopper dest, ResourceHandler<ItemResource> handler) Tries to extract items from an item handler and insert them in the hopper.static ContainerOrHandlergetEntityContainerOrHandler(Level level, double x, double y, double z, @Nullable Direction side) static booleaninsertHook(HopperBlockEntity hopper, ResourceHandler<ItemResource> itemHandler) Tries to insert a hopper's items into an item handler.
-
Constructor Details
-
VanillaInventoryCodeHooks
public VanillaInventoryCodeHooks()
-
-
Method Details
-
extractHook
Tries to extract items from an item handler and insert them in the hopper.- Parameters:
handler- target item handler- Returns:
trueif we moved an item,falseif we moved no items
-
insertHook
public static boolean insertHook(HopperBlockEntity hopper, ResourceHandler<ItemResource> itemHandler) Tries to insert a hopper's items into an item handler.- Parameters:
itemHandler- target item handler- Returns:
trueif we moved an item,falseif we moved no items
-
getEntityContainerOrHandler
public static ContainerOrHandler getEntityContainerOrHandler(Level level, double x, double y, double z, @Nullable @Nullable Direction side)
-