mirror of
https://repo.or.cz/minetest_no_fall_damage.git
synced 2024-11-08 16:23:47 +01:00
Initial commit
This commit is contained in:
commit
41f60c96a0
11
README.md
Normal file
11
README.md
Normal file
@ -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.
|
14
init.lua
Normal file
14
init.lua
Normal file
@ -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)
|
2
mod.conf
Normal file
2
mod.conf
Normal file
@ -0,0 +1,2 @@
|
||||
name = no_fall_damage
|
||||
description = Disables fall damage.
|
Loading…
Reference in New Issue
Block a user