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

Use game/mod-provided screwdriver handlers if present #368

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Emojigit
Copy link
Contributor

@Emojigit Emojigit commented Jul 17, 2024

This PR ports the screwdriver code from Minetest Game. In their code, nodes can provide their handler to accept, reject, or do custom rotations. This change prevents weird rotations on nodes, e.g. battery box facing upwards.

For environments without a screwdriver mod, the old behavior is kept.

Note that some servers are using (abusing) the old behavior to trick man-made apple leaves to grow fruits. With this new change, it is no longer possible.

To do

This PR is ready for review.

How to test

  1. Use the Sonic Screwdriver in Minetest Game with the debug screen on.
    1. You can't modify the param2 of non-rotational nodes.
    2. You can't make machines face up.
  2. Use the Sonic Screwdriver in VoxelLibre/Mineclonia.
    1. You can't make Technic machines face up.
    2. You can right-click on slabs to alternate between the top and bottom slabs.
    3. You can make furnaces face up due to the lack of on_rotate handler.

@S-S-X
Copy link
Member

S-S-X commented Jul 17, 2024

Better way to handle this would probably be making machines compatible with mtg screwdriver and then disabling sonic screwdriver on server. I mean sonic screwdriver is mostly used because of the fact it does not have many checks.

But still probably best to wait for more comments, this is a bit complicated topic.

@BuckarooBanzay BuckarooBanzay added Enhancement New feature or request Discussion labels Jul 18, 2024
@OgelGames
Copy link
Contributor

Being "broken" is the main point of difference of the sonic screwdriver, if it behaves almost the same as the default screwdriver, then it's just an expensive screwdriver.

I get that not all players/servers agree with the broken behavior of the sonic screwdriver and would like it fixed, but like other "feature-bugs" in technic, it's been around too long to simply get rid of it.

There's more discussion in #267 about it, but I think a setting like enable_feature_bugs (defaulting to disabled) would be good to add, to let users decide if they want the old functionality or have the bugs fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants