Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add drops for active tubelib machines and fix end wrench crash bug #64

Closed
wants to merge 3 commits into from
Closed

Conversation

afkplayer5000
Copy link

@afkplayer5000 afkplayer5000 commented Jan 11, 2021

  • Add drops for active tubelib machines to ensure that players can't obtain them with, i. e., a node replacer
  • Punching a mesecons converter with an end wrench causes a crash because its on_receive_message function returns the wrong thing; fixed that

Messy pull request b/c I'm a github noob

Closes #65
Closes BlockySurvival/issue-tracker#270

fluxionary and others added 3 commits December 15, 2020 18:51
Merge with the original, bringing in updates & security fixes
…tain them (#1)

* Update pusher.lua

* Update distributor.lua

* Update pusher.lua

* Update distributor.lua

* Update box_copper.lua

* Update box_gold.lua

* Update box_steel.lua

* Update autocrafter.lua

* Update grinder.lua

* Update liquidsampler.lua

* Update quarry.lua

* Update pusher_fast.lua
@joe7575
Copy link
Owner

joe7575 commented Jan 12, 2021

Add drops for active tubelib machines to ensure that players can't obtain them with, i. e., a node replacer

  • What do they get instead of?
  • What is the sense and purpose of a node replacer?
  • Did you consider NodeStates:on_dig_node?

@afkplayer5000
Copy link
Author

  • An ordinary, non-active tubelib
  • It's a mod that aids players in replacing nodes with different nodes; it uses the ordinary on_dig callback but isn't 100% well-behaved
  • I did not. That seems to be a better way to accomplish this, will look at.

@afkplayer5000
Copy link
Author

I tested a fix in NodeStates:on_dig_node:

	if meta:get_int("tubelib_state") == RUNNING then
		self:stop(pos, meta)
		node = minetest.get_node(pos)
	end

However, as far as I can tell, the can_dig and on_dig callbacks that call the aforementioned function are only defined for the passive node and not the active one on each tubelib. This makes sense, as the active tubelib was never meant to be diggable. I see two options here:

  • Add can_dig and on_dig callbacks to the active form of each tubelib machine, and add the above code into NodeStates:on_dig_node
  • Add a dummy can_dig callback to each active node that always returns false (this solution seems better to me)

@joe7575
Copy link
Owner

joe7575 commented Jan 17, 2021

Alternatively the replacer tool supports a blacklist. But this is no general solution, only a mod related. Better would be to add the unofficial but common used group unbreakable to all active nodes. But unfortunately, this is so far not supported by the replacer.
If I have to decide between your two proposals, I recoment the second one, but I prefer the unbreakable approach.

@afkplayer5000
Copy link
Author

This forum post highlights a number of different ways blocks can get broken when they shouldn't; I'll put together a pull request for the can_dig approach. Even if it's not the ideal solution, it fixes the immediate problem, is mod independent, and is a step in the right direction.

@afkplayer5000
Copy link
Author

Split into new pull requests #70 for the digging fix and #71 for the end wrench crash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants