[Mod] Hoppers [hopper]

K1ck
Member
Posts: 13
Joined: Wed Feb 17, 2016 17:12
GitHub: k1ckcyph3r

Re: [Mod] Hoppers

by K1ck » Post

Thanks, that worked

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Hoppers

by TenPlus1 » Post

Updated to 1.1:

- Hoppers now work with abm timed Furnaces
- Reduced Abm's needed
- Tidied and tweaked code

https://github.com/tenplus1/hopper

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Hoppers

by azekill_DIABLO » Post

is it possible to make them interact with mesecons mod?

exemple: mese on >> hopper locked
mese off >>hopper ok

or: mese on>>>>super fast hopper
mese off>>>>normal hopper

I ho(p)pe(r) you will add it!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Hoppers

by TenPlus1 » Post

Will have to look at mesecon functions and maybe have it so that mesecon ON disabled hopper.

Rate85
New member
Posts: 6
Joined: Tue Mar 22, 2016 19:31
In-game: Rate85

Re: [Mod] Hoppers

by Rate85 » Post

2 Questions
1: Can You Make It Have a Smaller Inventory Like The Minecraft Ones
2: Do I Need To Update To Make It Look Like Steel Blocks?

Rate85
New member
Posts: 6
Joined: Tue Mar 22, 2016 19:31
In-game: Rate85

Re: [Mod] Hoppers

by Rate85 » Post

I Have Old Version With Coal TYexture, And Same Inventory As A Chest

wilkgr76
Member
Posts: 832
Joined: Wed Feb 18, 2015 02:44
GitHub: wilkgr76

Re: [Mod] Hoppers

by wilkgr76 » Post

Rate85 wrote:2: Do I Need To Update To Make It Look Like Steel Blocks?
On lines 21 & 72 change it from:

Code: Select all

tiles = {"default_coal_block.png"},
to

Code: Select all

tiles = {"default_steel_block.png"},
(Comma is not accidental)
N/A

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: [Mod] Hoppers

by jordan4ibanez » Post

TenPlus1 wrote:Updated to 1.0:

- New node timer furnaces don't work properly so reverted back to abm one's instead

https://github.com/tenplus1/hopper
Merged and updated license to wtfpl
hello, am program. do language in rust. make computer do. okay i go now.

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Hoppers

by TenPlus1 » Post

Update: Hoppers now have 2x lucky blocks added when mod available.

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: [Mod] Hoppers

by jordan4ibanez » Post

TenPlus1 wrote:Update: Hoppers now have 2x lucky blocks added when mod available.
Why don't you create a new forum topic and I'll redirect my topic to yours? Your version is way more advanced!
hello, am program. do language in rust. make computer do. okay i go now.

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Hoppers

by TenPlus1 » Post

You sure ? it was originally your mod, I just helped it along in places :)

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: [Mod] Hoppers

by jordan4ibanez » Post

TenPlus1 wrote:You sure ? it was originally your mod, I just helped it along in places :)
Well I abandoned this mod long ago so yes! It's now your mod :)
hello, am program. do language in rust. make computer do. okay i go now.

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Hoppers

by TenPlus1 » Post

You get full credits dude :)

LordNevar
Member
Posts: 14
Joined: Wed Dec 14, 2016 19:46

Re: [Mod] Hoppers

by LordNevar » Post

Hello, I'm not sure this is a "Bug" ,but when you connect the hopper to the side of a furnace the coal dose go in but it dose not activate it. as in it dose not burn

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Hoppers

by TenPlus1 » Post

Are you using 0.4.14 stable or the latest dev builds ? I do recall that the latest had some furnace changes made, so will have to look into those.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Mod] Hoppers

by sofar » Post

Why isn't this submitted to minetest-mods? then we can all help maintain it.

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Hoppers

by TenPlus1 » Post

sofar: because I enjoy maintaining my own set of mods (hoppers being a joint project with jordan).

Update: Timer issues fixed, hoppers should work a-ok with furnaces again :)

LordNevar
Member
Posts: 14
Joined: Wed Dec 14, 2016 19:46

Re: [Mod] Hoppers

by LordNevar » Post

cool thanks for the reply im new to this but would enjoy being more apart of this wonderful community

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

Re: [Mod] Hoppers

by FaceDeer » Post

A few weeks back I was working on a mod of my own that included chest- and furnace-like inventory-bearing blocks, and one of my testers suggested that I should make my mod compatible with Hoppers. Unfortunately, when I cracked open the code for Hoppers I found that the source and target node types were hard-coded within it.

So I got started on adding a modding API, and I kiiiind of went a little bit crazy and did a bunch of other tweaks and fixes and stuff in the process. :) Here's a summary of the changes I made:
  • Hoppers now call on_metadata_inventory_put and on_metadata_inventory_take, triggering furnace timers via their standard callbacks. This approach also prevents hoppers from inserting "illegal" items into the furnace's fuel inventory slot.
  • Hoppers record the identity of the player that placed them in their metadata, which should in theory allow them to work correctly with locked chests (they'll only be able to take/place items in locked chests if the player that placed the hopper has the permissions needed to do so). I haven't tried that yet though.
  • Added an API to allow other mods to add new "source" and "target" blocks to hoppers without having to edit this mod's code.
  • Updated side hopper rotation handling to allow it to function in any orientation.
  • Added settings options to use 16-pixel or 32-pixel textures so that the mod can fit in better with whatever other textures the world is using.
  • 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. The original version of the mod had the single-crafting-item approach and I liked it, but this way both approaches are supported.
  • Added in-game documentation via optional "doc" mod dependency
  • Updated the screenshot
My fork is here: https://github.com/minetest-mods/hopper (Download).

If you're curious to see how the API works for allowing other mods to add hopper support, here's where I make use of it in my own mod.

tenplus1, want me to send you a pull request? I think I'm about done with this particular coding spree for now.
Last edited by FaceDeer on Tue Feb 07, 2017 00:17, edited 1 time in total.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Mod] Hoppers

by sofar » Post

FaceDeer wrote:A few weeks back I was working on a mod of my own that included chest- and furnace-like inventory-bearing blocks, and one of my testers suggested that I should make my mod compatible with Hoppers. Unfortunately, when I cracked open the code for Hoppers I found that the source and target node types were hard-coded within it.

So I got started on adding a modding API, and I kiiiind of went a little bit crazy and did a bunch of other tweaks and fixes and stuff in the process. :) Here's a summary of the changes I made:
  • Hoppers now call on_metadata_inventory_put and on_metadata_inventory_take, triggering furnace timers via their standard callbacks. This approach also prevents hoppers from inserting "illegal" items into the furnace's fuel inventory slot.
  • Hoppers record the identity of the player that placed them in their metadata, which should in theory allow them to work correctly with locked chests (they'll only be able to take/place items in locked chests if the player that placed the hopper has the permissions needed to do so). I haven't tried that yet though.
  • Added an API to allow other mods to add new "source" and "target" blocks to hoppers without having to edit this mod's code.
  • Updated side hopper rotation handling to allow it to function in any orientation.
  • Added settings options to use 16-pixel or 32-pixel textures so that the mod can fit in better with whatever other textures the world is using.
  • 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. The original version of the mod had the single-crafting-item approach and I liked it, but this way both approaches are supported.
  • Added in-game documentation via optional "doc" mod dependency
  • Updated the screenshot
My fork is here: https://github.com/FaceDeer/hopper/ (Download).

If you're curious to see how the API works for allowing other mods to add hopper support, here's where I make use of it in my own mod.

tenplus1, want me to send you a pull request? I think I'm about done with this particular coding spree for now.

This is some pretty cool and well-thought out work.

I'd really think this mod is better off maintained on minetest-mods as a *team* and not just in a personal repo. Commits like these are hard to review, and in minetest-mods we have a few core devs and senior minetest folks helping out reviewing changes like these.

So @tenplus1, please consider maintaining this in minetest-mods.

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Hoppers

by TenPlus1 » Post

It seems that FaceDeer and myself have both been working on our own API's for the Hopper mod :)

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

Re: [Mod] Hoppers

by FaceDeer » Post

TenPlus1 wrote:It seems that FaceDeer and myself have both been working on our own API's for the Hopper mod :)
How far along are you with yours? I'd like to release Digtron fairly soon now, I could substitute your API into my fork to keep it forward-compatible if you've got the interface defined.

How about the other changes I made? I think many of them will be necessary for robustness when other mods are calling on Hoppers to move stuff in and out of their blocks' inventories, they should probably be merged in either way the API goes.

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Hoppers

by TenPlus1 » Post

Initially there was three different api examples and I've settled for the simplest to implement and fastest to use. It's finished and on my git page listed in this thread.

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

Re: [Mod] Hoppers

by FaceDeer » Post

TenPlus1 wrote:Initially there was three different api examples and I've settled for the simplest to implement and fastest to use. It's finished and on my git page listed in this thread.
Nice API, simple is good in these situations and I like how it's all packaged up in one table of values. I've merged it into my fork and updated Digtron to make use of it.

I'll send you a pull request now for the rest of the stuff I did. I note you put in the ability for hoppers to add to locked chests, my code handles player permissions via the standard callbacks so I was able to put in the ability for them to take from locked chests as well - a hopper will only be able to take items from a locked chest if the owner of the chest placed the hopper there, other players' hoppers won't be able to.

I'd like to second sofar's request to put this on minetest-mods, by the way. I'm going to be moving my own mods there shortly (if they'll take them) and it looks like a great way to help keep collaborations like this compatible.

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

Re: [Mod] Hoppers

by FaceDeer » Post

I've synched up my fork to your latest changes. Are you going to take my pull request? Please let me know what you think of it.

Post Reply

Who is online

Users browsing this forum: No registered users and 24 guests