Initial commit
commit
41f60c96a0
|
@ -0,0 +1,11 @@
|
||||||
|
# Disable Fall Damage [`no_fall_damage`]
|
||||||
|
Version: 1.0.0
|
||||||
|
|
||||||
|
This mod disables fall damage completely.
|
||||||
|
|
||||||
|
## Technical notes
|
||||||
|
This mod only works if no other mod overwrites the
|
||||||
|
`fall_damage_add_percent` group (unlikely).
|
||||||
|
|
||||||
|
## License
|
||||||
|
This mod is licenced under the MIT License.
|
|
@ -0,0 +1,14 @@
|
||||||
|
-- Removing fall damage is done by overwriting the group
|
||||||
|
-- fall_damage_add_percent of all nodes. ]]
|
||||||
|
function remove_fall_damage()
|
||||||
|
for itemstring, def in pairs(minetest.registered_nodes) do
|
||||||
|
local groups = def.groups and table.copy(def.groups)
|
||||||
|
if groups then
|
||||||
|
groups.fall_damage_add_percent = -100
|
||||||
|
-- Let's hack the node!
|
||||||
|
minetest.override_item(itemstring, { groups = groups })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_on_mods_loaded(remove_fall_damage)
|
Loading…
Reference in New Issue