Giter Site home page Giter Site logo

hopper's Introduction

Hoppers, chutes and sorters

Hoppers, chutes and sorters

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.

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.

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

Lucky Blocks: 2

hopper's People

Contributors

bewlay avatar facedeer avatar louisroyer avatar paly2 avatar smalljoker avatar tenplus1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

hopper's Issues

[Feature Request] Expand the API to add specific nodes instead of all nodes with that name

I think it would be a good idea to expand the API so that you can add hopper support for a specific node like at a given position instead of all nodes with a specific node name. For example, say I want to add one default:chest node instead of all default:chest nodes so that a hopper works with that one chest node and not all of them. This would be useful if you wanted to add support for a specific node under certain conditions.

Sorter item duplication bug

If one moves an item from the player inventory to the sorter filter row, then to the sorter inventory and then back to the start, the item duplicates.
tblvtdydnr

This bug also disappears items when doing the same procedure "counter-clockwise".
i9rtf2cmxj

Inconsistent placing of nodes against chute/filter output end

When you place a node against the output end of a chute or filter, the node might end up in an unexpected location depending on where exactly you were aiming.

case A

I'm aiming at the “ring” around the output end.
chute-green-aiming
The node ends up in the expected position.
chute-green-placed

case B

I'm aiming directly at the output end
chute-red-aiming
The node ends up one grid cell farther than expected.
chute-red-placed

Since i don’t know the details about node selection boxes yet, i have no idea if this issue is easy or hard to fix. Anyway, this is my report :)

[Feature request] Add support for MineClone's `container` groups.

This mod should support MineClone's container groups. This would make it compatible with any containers that support MineClone's hoppers (and therefore most mods that support MineClone).

From MineClone's GROUPS.md:

  • container: Node is a container which physically stores items within and has at least 1 inventory
    • container=2: Has one inventory with list name "main". Items can be placed and taken freely
    • container=3: Same as container=2, but shulker boxes can not be inserted
    • container=4: Furnace-like, has lists "src", "fuel" and "dst".
      It is expected that this also reacts on on_timer;
      the node timer must be started from other mods when they add into "src" or "fuel"
    • container=5: Left part of a 2-part horizontal connected container. Both parts have a "main" inventory
      list. Both inventories are considered to belong together. This is used for large chests.
    • container=6: Same as above, but for the right part.
    • container=7: Has inventory list "main", no movement allowed
    • container=1: Other/unspecified container type

You could do this fairly easily, something like this:

-- This pretty much makes it so that anything that works with MineClone hoppers will
-- automatically work with other hoppers.

hopper:add_container({
	{"top", "group:container=2", "main"},
	{"bottom", "group:container=2", "main"},
	{"side", "group:container=2", "main"},
})

-- The mod already checks the `allow_metadata_inventory_<whatever>` functions, so this works.
hopper:add_container({
	{"top", "group:container=3", "main"},
	{"bottom", "group:container=3", "main"},
	{"side", "group:container=3", "main"},
})

hopper:add_container({
	{"top", "group:container=4", "dst"},
	{"side", "group:container=4", "fuel"},
	{"bottom", "group:container=4", "src"},
})

-- Hoppers will only be able to insert into one side of a double chest (I think); maybe do something about this.
hopper:add_container({
	{"top", "group:container=5", "main"},
	{"bottom", "group:container=5", "main"},
	{"side", "group:container=5", "main"},
})
hopper:add_container({
	{"top", "group:container=6", "main"},
	{"bottom", "group:container=6", "main"},
	{"side", "group:container=6", "main"},
})

Ejecting

I can never get ejecting to work, no matter how I toggle the eject button. Is there a special procedure other than opening the hopper by clicking the button?

I also can't hide the button in minetest.conf, though I set hopper_eject_button to true.

[Feature Request] API: Alternatively use callbacks as pipeworks

The hoppers API is nice, but in my case I don't have an inventory with lists, I use meta fields to store this data, because I only have one item. (FYI I'm talking abot the drawers mod; https://github.com/minetest-mods/drawers)

It would be nice if the API could alternatively try to call a callback of the nodedef if the node is in a "hopper_receiver" group. It could be even the same callback as in pipeworks ("on_insert_object(pos, node, stack, direction)").

Feature request: lower log verbosity from ACTION to DEBUG

The current verbosity of logs generated by item movmenet in hopper, chute and sorter is ACTION. Since this mod can be used to automate events, it will generate a potentially large ammount of logs.

In my server, a Techpack farm managed to generate 2.8 milion log lines with almost the exact same string. This accounted for a huge ammount of logs, contributing significantly to 50G log storage ingested in my log repository.

There could be a setting to either change the log level or to disable the logs for item movement in hopper/chute/sorter. Specially because the logs don't tell what items are being moved, and the generated output has no much relevance for, say, audit details.

Sorter hopper not in crafting recipes

While hoppers and chutes are visible, the sorter hopper does not appear in craft guide nor does it appear in Qwertymines/FaceDeer's crafting table.

French translation has missing placeholders

The translation checker tool reports the following errors:

Error (./locale/hopper.fr.tr:6): Missing placeholder(s) in translation: '@1' '@2' 
Error (./locale/hopper.fr.tr:31): Missing placeholder(s) in translation: '@1' '@2' 
Error (./locale/hopper.fr.tr:32): Missing placeholder(s) in translation: '@1' '@2' 
Error (./locale/hopper.fr.tr:33): Missing placeholder(s) in translation: '@1' '@2' 
Error (./locale/hopper.fr.tr:39): Missing placeholder(s) in translation: '@1' '@2' 
------------
TEST RESULT:
------------
19 file(s) checked. Test FAILED!
1 file(s) with error(s).
4 file(s) with empty translations.

New German Translation

As reported in minetest-whynot/whynot-game#37 by @ChrisLeick

# textdomain: hopper


### chute.lua ###

# translation by Chris Leick <[email protected]>
@1 moves stuff to chute at @2=@1 verlagert Dinge in einen Trichter bei @2
Hopper Chute=Trichterschütte

### doc.lua ###

A chute to transfer items over longer distances.=Eine Rutsche, um Gegenstände über große Entfernungen zu übertragen.

A sorter to redirect certain items to an alternate target.=Ein Sortierer kann bestimmte Gegenstände zu einem alternativen Ziel umleiten.

Chutes operate much like hoppers but do not have their own intake capability. Items can only be inserted into a chute manually or by a hopper connected to a chute. They transfer items in the direction indicated by the arrow on their narrow segment at a rate of one item per second. They have a small buffer capacity, and any items that can't be placed into the target block's inventory will remain lodged in the chute's buffer until manually removed or their destination becomes available.=Rutschen arbeiten wie Trichter, haben aber ihren eigenen Einlass. Gegenstände können nur manuell oder von einem verbundenen Trichter in eine Schütte eingelegt werden. Sie übertragen Gegenstände in die vom Pfeil angegebene Richtung in einem schmalen Abschnitt mit einer Rate von einem Gegenstand pro Sekunde. Sie haben eine kleine Pufferkapazität und alle Gegenstände, die nicht in das Inventar des Zielblocks patziert werden können, verbleiben im Puffer der Rutsche, bis sie manuell entfernt werden oder ihr Ziel verfügbar wird.

Hopper blocks come in both 'vertical' and 'side' forms, but when in a player's inventory both are represented by a single generic item. The type of hopper block that will be placed when the player uses this item depends on what is pointed at - when the hopper item is pointed at the top or bottom face of a block a vertical hopper is placed, when aimed at the side of a block a side hopper is produced that connects to the clicked-on side.@n@n=Trichterblöcke kommen in den Formen 'vertikal' und 'seitlich' daher, werden jedoch im Inventar des Spielers beide durch ein einzelnes allgemeines Element dargestellt. Der Typ des Filterblocks, der beim Benutzen gesetzt wird, hängt davon ab, worauf der Spieler zeigt - wenn der Filtergegenstand auf eine obere oder untere Fläche eines Blocks zeigt, wird ein vertikaler Filter platziert, wenn er auf eine seitliche Fläche zeigt, wird ein seitlicher Filter erzeugt, der sich mit der angeklickten Seite verbindet.@n@n

Hopper blocks come in both 'vertical' and 'side' forms. They can be interconverted between the two forms via the crafting grid.@n@n=Trichterblöcke kommen in den Formen 'vertikal' und 'seitlich' daher. Im Fertigungsgitter kann zwischen den beiden Formen gewechselt werden.@n@n

Hopper to transfer items between neighboring blocks' inventories.=Trichter, um Gegenstände zwischen dem Inventar benachbarter Blöcke zu übertragen.

Items are transfered from the block at the wide end of the hopper to the block at the narrow end of the hopper at a rate of one per second. Items can also be placed directly into the hopper's inventory, or they can be dropped into the space above a hopper and will be sucked into the hopper's inventory automatically.@n@n=Gegenstände werden vom Block am weiten Ende des Trichters zu einem Block am schmalen Ende des Trichters mit einer Rare von einem pro Sekunde übertragen. Sie können auch direkt in das Inventar des Trichters platziert oder in den Raum über dem Trichter fallengelassen werden. Dann werden sie automatisch in das Inventar des Trichters gezogen.@n@n

This is similar to a chute but has a secondary output that is used to shunt specific items to an alternate destination. There is a set of inventory slots labeled "Filter" at the top of this block's inventory display, if you place an item into one of these slots the sorter will record the item's type (without actually taking it from you). Then when items come through the sorter's inventory that match one of the items in the filter list it will first attempt to send it in the direction marked with an arrow on the sorter's sides.@n@nIf the item doesn't match the filter list, or the secondary output is unable to take the item for whatever reason, the sorter will try to send the item out the other output instead.@n@nIn addition, there is a button labeled "Filter All" that will tell the sorter to not use the filter list and instead first attempt to shunt all items out of the filter, only sending items along the non-filter path if the target cannot accept it for whatever reason. This feature is useful for handling "overflow" (when the target's inventory fills up) or for dealing with targets that are selective about what they accept (for example, a furnace's fuel slot).=Dies ist einer Rutsche ähnlich, hat aber eine zweite Ausgabe, die benutzt wird, um spezielle Gegenstände zu einem alternativen Ziel abzuzweigen. Es gibt einen Satz von Fächern mit der Aufschrift "Filter" oben in der Inventaranzeige des Blocks. Falls Sie einen Gegenstand in eins dieser Fächer ablegen, wird der Sortierer den Typ des Elements aufzeichnen (ohne es Ihnen tatsächlich abzunehmen). Dann, wenn Gegenstände durch das Inventar des Sortierers wandern, die zu einem der Gegenstände in der Filterliste passen, wird er versuchen, sie in die mit einem Pfeil an der Seite des Sortierers markierte Richtung zu senden.@n@nFalls der Gegenstand aus irgendeinem Grund nicht zur Filterliste passt, wird der Sortierer versuchen, den Gegenstand stattdessen aus der anderen Ausgabe heraus zu senden.@n@nZusätzlich gib es noch einen Schalter, der mit "Alle filtern" beschriftet ist. Dieser gibt an, dass alle Gegenstände aus dem Filter gesendet werden sollen, außer den Gegenständen, bei denen das aus irgendeinem Grund nicht geht. Diese Funktionalität ist nützlich zur Handhabung eines "Überlaufs" (wenn das Zielinventar voll ist) oder für den Umgang mit Zielen, die wählerisch sind, was sie annehmen (zum Beispiel das Brennfach eines Ofens).

When used with furnaces, hoppers inject items into the furnace's "raw material" inventory slot when the narrow end is attached to the top or bottom and inject items into the furnace's "fuel" inventory slot when attached to the furnace's side.@n@nItems that cannot be placed in a target block's inventory will remain in the hopper.@n@nHoppers 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.=Wenn sie mit Öfen benutzt werden, legen Trichter Gegenstände im Rohstofffach des Ofens ab, wenn das schmale Ende mit der Ober- oder Unterseite des Ofens verbunden ist und in die Brennkammer, wenn sie seitlich verbunden ist.@n@nGegenstände, die nicht im Inventar des Zielblocks abgelegt werden können, verbleiben im Trichter.@n@nTrichter haben dieselben Rechte, wie der Spieler, der sie platziert. Von Ihnen platzierte Filter dürfen Gegenstände aus Ihren Truhen entnehmen oder dort ablegen, Filter anderer Spieler dürfen das nicht. Das filtereigene Inventar ist für niemanden gesperrt, daher können Sie es benutzen, um anderen Spielern eine Möglichkeit einzuräumen, Gegenstände in Ihren verschlossenen Truhen abzulegen.


### hoppers.lua ###

@1 moves stuff from hopper at @2=@1 nimmt Dinge aus einem Trichter bei @2
@1 moves stuff in hopper at @2=@1 bewegt Dinge in einem Trichter bei @2
@1 moves stuff to hopper at @2=@1 verlagert Dinge in einen Trichter bei @2
Hopper=Trichter
Side Hopper=Seitentrichter

### sorter.lua ###

@1 moves stuff to sorter at @2=@1 verlagert Dinge in einen Trichter bei @2
Filter=Filter
Filter@nAll=Filter@nAlle
Selective@nFilter=Auswahl@nFilter
Sorter=Sortierer

This sorter is currently set to only send items listed@nin the filter list in the direction of the arrow.@nClick this button to set it to try sending all@nitems that way first.=Dieser Sortierer ist derzeit so gesetzt, dass er nur@nGegenstände in die Pfeilrichtung sendet, die in der@nFilterliste stehen. Klicken Sie diese@nSchaltfläche an, um zuerst zu versuchen@n alle Gegenstände auf diesem Weg zu versenden.

This sorter is currently set to try sending all items@nin the direction of the arrow. Click this button@nto enable an item-type-specific filter.=Dieser Sortierer ist derzeit so gesetzt, dass er alle@nGegenstände in Pfeilrichtung sendet. Klicken Sie diese@nSchaltfläche an, um einen vom Gegenstandstyp abhängigen Filter zu aktivieren.

### utility.lua ###

Don't@nEject=Nicht@nauswerfen
Eject@nItems=Gegenstände@nauswerfen

This hopper is currently set to eject items from its output@neven if there isn't a compatible block positioned to receive it.@nClick this button to disable this feature.=Dieser Trichter ist derzeit so gesetzt, dass er Gegenstände@nsogar dann aus seiner eigenen Ausgabe auswirft, wenn dort kein passender Empfangsblock positioniert wurde,.@nKlicken Sie diese Schaltfäche an, um dies zu deaktivieren.

This hopper is currently set to hold on to item if there@nisn't a compatible block positioned to receive it.@nClick this button to have it eject items instead.=Dieser Trichter ist derzeit so gesetzt, dass er den Gegenstand@nbehält, wenn kein geeigneter Empfangblock positioniert wurde.@nKlicken Sie diese Schaltfäche an, um Gegenstände stattdessen auszuwerfen.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.