[Mod] Hoppers, chutes and sorters [hopper]

Post Reply
FaceDeer
Member
Posts: 506
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

[Mod] Hoppers, chutes and sorters [hopper]

by FaceDeer » Post

Image

Based on jordan4ibanez's original hoppers mod, optimized by TenPlus1 and FaceDeer, with chutes and sorters by FaceDeer

Hoppers are nodes that can transfer items to and from the inventories of adjacent nodes. The wide end of a hopper is its "input" end, if there's a chest or other compatible container it will take one item per second into its own internal inventory. It will also draw in items that have been dropped here. The narrow end of the hopper is its "output" end. It will attempt to inject items into a compatible container located at its output end. If there's no compatible container and the hopper's "eject" mode has been enabled it will instead dump the items out into the world.

The location of a hopper relative to a furnace determines which inventory slots the hopper will affect. A hopper directly above a furnace will inject items into the furnace's input slot. A hopper to the furnace's side will inject items into the furnace's fuel slot. A hopper below the furnace will pull items out of the furnace's output slot. Hoppers cannot inject items into inappropriate slots; non-fuel items will not be placed into the furnace's fuel slot and non-cookable items will not be placed into the input slot.

Also included in this mod are a "chute" node and a "sorter" node. These allow for items to be routed over short distances and distributed in sophisticated ways.

A chute simply moves items into adjacent nodes. You'll need to use a hopper or sorter to inject items into it to move along. A screwdriver is a useful tool for getting chutes aimed correctly.

A sorter has two different outputs. Its inventory has a "filter" grid; place items in this grid to set the sorter's filter. Items that match the filter will be sent out the output with the large arrow and other items will be sent out the output with the smaller arrow. A "filter all" option will cause the sorter to attempt to send all items in the direction of the large arrow and then if that fails send them in the direction of the smaller arrow. This allows you to have an "overflow" storage should the sorter's primary target fill up, or when used in combination with a selective container (like the furnace's fuel slot, for example) it allows the target inventory to do the filtering for you.

Hoppers have the same permissions as the player that placed them. Hoppers placed by you are allowed to take items from or put items into locked chests that you own, but hoppers placed by other players will be unable to do so. A hopper's own inventory is not not owner-locked, though, so you can use this as a way to allow other players to deposit items into your locked chests.

Advanced settings

This mod has several configurable settings found in the advanced settings menu.
  • Hopper texture size: can be set to 16 pixels (matching most standard Minetest node textures) or 32 pixels
  • Single craftable item: When enabled (the default) hoppers are crafted as a single item and then select whether the output has a 90-degree turn to the side based on how you place it. When disabled you can craft straight and bent hoppers as separate items.
  • Eject items button: this can be used to remove the "eject items" button from hoppers, if it is not desired.
If other mods wish to make containers compatible with hoppers, there is a public API documented here.

Change log

- 0.1 - Initial release from jordan4ibanez
- 0.2 - Fixed tool glitch (wear restored by accident)
- 0.3 - transfer function added
- 0.4 - Supports locked chest and protected chest
- 0.5 - Works with 0.4.13's new shift+click for newly placed Hoppers
- 0.6 - Remove formspec from hopper nodes to improve speed for servers
- 0.7 - Halved hopper capacity, can be dug by wooden pick
- 0.8 - Added Napiophelios' new textures and tweaked code
- 0.9 - Added support for Wine mod's wine barrels
- 1.0 - New furances do not work properly with hoppers so old reverted to abm furnaces
- 1.1 - Hoppers now work with new node timer Furnaces. Reduced Abm's and tidied code.
- 1.2 - Added simple API so that hoppers can work with other containers.
- 1.3 - Hoppers now call on_metadata_inventory_put and on_metadata_inventory_take, triggering furnace timers via their standard callbacks. Updated side hopper rotation handling to allow it to function in any orientation. Added settings options to use 16-pixel or 32-pixel textures. Added settings option to allow explicit crafting of standard/side hoppers or to allow crafting of a single item that selects which type to use on place. Added in-game documentation via optional "doc" mod dependency
- 1.4 - Added intllib support
- 1.5 - Added chutes
- 1.6 - Added "eject items" button to formspecs, "group" support to the API
- 1.7 - Added sorter block to allow for more sophisticated item transfer arrangements

Links
Hopper has in-game documentation available via the doc mod.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Hoppers, chutes and sorters [hopper]

by texmex » Post

Excellent mod with great API features.

User avatar
v-rob
Developer
Posts: 971
Joined: Thu Mar 24, 2016 03:19
GitHub: v-rob
IRC: v-rob
Location: Right behind you.

Re: [Mod] Hoppers, chutes and sorters [hopper]

by v-rob » Post

So you finally posted it on the forums. Great!
Core Developer | My Best Mods: Bridger - Slats - Stained Glass

User avatar
TechNolaByte
Member
Posts: 465
Joined: Wed May 10, 2017 21:00
GitHub: TechNolaByte

Re: [Mod] Hoppers, chutes and sorters [hopper]

by TechNolaByte » Post

the api is probably the easiest way to add item transport to a custom block
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.

Germain
Member
Posts: 42
Joined: Thu Aug 13, 2015 10:16

Re: [Mod] Hoppers, chutes and sorters [hopper]

by Germain » Post

I tested this hopper, in replacement with the older.
Works fine with Minetest V5 (I not yet tested the sorter and chute)

User avatar
acidzebra
Member
Posts: 75
Joined: Sun Sep 10, 2017 09:11

Re: [Mod] Hoppers, chutes and sorters [hopper]

by acidzebra » Post

Still having a lot of fun with this, rotating the hoppers was not always intuitive (but that's a screwdriver thing I guess) but managed to make a fully automated "dump stuff from your inventory and have it smelted" refinery. Great stuff (I'm sure it could be built more efficiently).

I don't think the technic chests are supported, very minor gripe. Great mod.

Thanks!

Image

User avatar
j0j0n4th4n
Member
Posts: 250
Joined: Tue Jan 26, 2021 06:45

Re: [Mod] Hoppers, chutes and sorters [hopper]

by j0j0n4th4n » Post

Do you think it would be possible to make the hoppers work as a pipe if you also have waterworks installed?
cdb_894a100ddd76

chojin
New member
Posts: 8
Joined: Tue May 26, 2020 20:08

Re: [Mod] Hoppers, chutes and sorters [hopper]

by chojin » Post

Is there a limit to how many hops items can travel through chutes and sorters?

I'm trying to build a massive inventory sorting mechanism and it seems to work well up until one specific sorter where items get stuck and don't want to travel any further.
If I however manually remove the items from that sorter and place them back in manually, they continue their travel.. but only for a few sorters where they start to accumulate again.

I have tried shortening the path by placing intermediate chests, with again a hopper connected to them, hoping the items could travel further. But that does not make any difference.

chojin
New member
Posts: 8
Joined: Tue May 26, 2020 20:08

Re: [Mod] Hoppers, chutes and sorters [hopper]

by chojin » Post

Found my problem. I had replicated chutes and sorters using the Node Replacement Tool, and that seemed to sometimes have placed 'defective' ones that accumulated items instead of passing them through to the next block.
After replacing those ones the 'normal' way, everything works correctly.

Alatarius
Member
Posts: 28
Joined: Mon Apr 24, 2023 03:38
GitHub: Alatarius

Re: [Mod] Hoppers, chutes and sorters [hopper]

by Alatarius » Post

I was wondering if anyone has found a way to make the same type of "mega-smelter" like the old minecraft one you made with rails using the hopper and sorter system here in minetest? I want to make it so that all the furnaces are next to each other with no gaps but I am having difficulty in figuring out the sorters work since there is a box with an x on it when you "open" the hopper or sorter. I wish there was an eli5 instructions for it. I have a learning disability and this makes it really difficult to grasp.

User avatar
LRV
Helper
Posts: 378
Joined: Mon Dec 19, 2016 17:29
GitHub: Mooncarguy
In-game: Mooncarman Mooncarguy

Re: [Mod] Hoppers, chutes and sorters [hopper]

by LRV » Post

The mod's license file seems incomplete regarding the textures? Could this be fixed?
This is a cool signature. :)

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests