Commit Graph

17 Commits

Author SHA1 Message Date
mruncreative
b46c589a38
Support doors and trapdoors from mods (#683)
* Support doors and trapdoors from mods

Removed hardcoded door names and instead now use the API of the door mod to meseconify all doors and trapdoors that have been registered after the mods are finished loading.

* indentation as described by sfan5
2024-10-16 00:27:20 +02:00
sfan5
ac83dead50 mesecons_doors: Don't modify doors that are already mesecon-enabled 2024-10-08 20:30:26 +02:00
Mikita Wiśniewski
a82bac7b5b
[mesecons_doors] Improve code quality and fix Voxelgarden support (#671)
now trapdoors are also overridden using their own function, and both
`meseconify_door` and `meseconify_trapdoor` are now ran inside loops
In the future, this could help refactor this mod entirely to not list doors
manually but parse through the `doors.registered_*` variables,
ensuring that every door works.

As a nice bonus, Voxelgarden support is fixed, and potentially so is
support for other games with exotic implementations of the doors mod. No
longer are we assuming that the existence of doors.get means that all
the trapdoors exist too; now, if the meseconify function doesn't find
their definition, it just returns without crashing.
2024-05-20 20:21:52 +02:00
sfan5
21ac966ee2 Fix MTG doors not reacting correctly to Mesecon power 2022-04-01 23:27:35 +02:00
Desour
b630ff9443 Fix error prone negation reported by luacheck 2022-03-30 23:25:18 +02:00
Jude Melton-Houghton
fb255d292e
Add .luacheckrc and fix issues it pointed out (#589) 2022-02-12 20:12:12 +01:00
tuedel
3202bf6786
mesecons_doors: Add MTG steel bar door and trapdoor (#523) 2020-09-19 00:27:47 +03:00
Vitaliy
c1eccba247
Make sounds ephemeral (#521)
The handles were never used anyway
2020-08-01 16:10:14 +03:00
David Leal
168a923665
Use mod.conf for dependencies (#492) 2020-06-27 02:26:14 +03:00
Jeija
e5dba66c21 Revert "Toggle trapdoors on signal, workaround for #252"
Please use the screwdriver if you want to rotate trapdoors.
This reverts commit 417a136c5e.
2016-02-28 07:16:45 +01:00
Jeija
417a136c5e Toggle trapdoors on signal, workaround for #252 2016-02-27 20:40:16 +01:00
Auke Kok
fb4c440265 Doors: Use new mesh door API if available
I've implemented a new door API in minetest_game that
performs all the needed things to assure doors are
properly openend and closed, without mods needing to
know the inner details of what needs to be done.

Mesecons can just fetch a reference to the door object
and call the appropriate open or close method, which
simplifies this code a lot.

For compatibility, this code retains the old code path
and tests whether the new API is available, so this
code remains functional if the new API is not available.

Since the metal trapdoor was only recently added, I added
it to the new API codepath only, it's unlikely to be
present on older versions of minetest_game anyway.

As a benefit from the new door API, there is now
absolutely no more accidental switching closed trapdoors
to open on power off, which could happen with the
old method - since that was just a simple toggle.
2016-02-14 11:30:52 +01:00
Jeija
0e7f68ea92 Doors: Use new sound name (fixes #236) 2015-10-04 12:21:35 +02:00
Jeija
8bf5b7d0e4 Fix #219, do not try to override unregistered doors 2015-02-14 00:02:19 +01:00
Jeija
a895715720 Prepare trapdoors code for merging, make trapdoors always toggle their
state when the mesecons signal changes, no matter what state they're in
2015-02-03 18:10:49 +01:00
MT-Modder
94604e890c Add trapdoor to mesecons_doors 2015-02-02 19:20:44 -05:00
Jeija
562cee7438 Rewrite doors:
* Enable glass and obsidian glass doors to be used with mesecons
* Doors can receive signals from a vertical wire placed two
  blocks beneath them, use this to create mesecon-controlled
  double doors
* Fix textures for both git upstream and stable minetest_game
* Shrink code size
* Rename mesecons_compatibility to mesecons_doors.
2015-01-22 17:27:29 +01:00