mirror of
https://github.com/minetest/minetest_game.git
synced 2024-12-22 22:22:25 +01:00
creative: Override hand after mods loaded... (#2984)
Prevents other mods from overwriting changes & removes dependence on default.
This commit is contained in:
parent
97130f4c1c
commit
fdcf458b56
@ -46,34 +46,36 @@ end
|
|||||||
dofile(minetest.get_modpath("creative") .. "/inventory.lua")
|
dofile(minetest.get_modpath("creative") .. "/inventory.lua")
|
||||||
|
|
||||||
if minetest.is_creative_enabled("") then
|
if minetest.is_creative_enabled("") then
|
||||||
-- Dig time is modified according to difference (leveldiff) between tool
|
minetest.register_on_mods_loaded(function()
|
||||||
-- 'maxlevel' and node 'level'. Digtime is divided by the larger of
|
-- Dig time is modified according to difference (leveldiff) between tool
|
||||||
-- leveldiff and 1.
|
-- 'maxlevel' and node 'level'. Digtime is divided by the larger of
|
||||||
-- To speed up digging in creative, hand 'maxlevel' and 'digtime' have been
|
-- leveldiff and 1.
|
||||||
-- increased such that nodes of differing levels have an insignificant
|
-- To speed up digging in creative, hand 'maxlevel' and 'digtime' have been
|
||||||
-- effect on digtime.
|
-- increased such that nodes of differing levels have an insignificant
|
||||||
local digtime = 42
|
-- effect on digtime.
|
||||||
local caps = {times = {digtime, digtime, digtime}, uses = 0, maxlevel = 256}
|
local digtime = 42
|
||||||
|
local caps = {times = {digtime, digtime, digtime}, uses = 0, maxlevel = 256}
|
||||||
|
|
||||||
-- Override the hand tool
|
-- Override the hand tool
|
||||||
minetest.override_item("", {
|
minetest.override_item("", {
|
||||||
range = 10,
|
range = 10,
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
full_punch_interval = 0.5,
|
full_punch_interval = 0.5,
|
||||||
max_drop_level = 3,
|
max_drop_level = 3,
|
||||||
groupcaps = {
|
groupcaps = {
|
||||||
crumbly = caps,
|
crumbly = caps,
|
||||||
cracky = caps,
|
cracky = caps,
|
||||||
snappy = caps,
|
snappy = caps,
|
||||||
choppy = caps,
|
choppy = caps,
|
||||||
oddly_breakable_by_hand = caps,
|
oddly_breakable_by_hand = caps,
|
||||||
-- dig_immediate group doesn't use value 1. Value 3 is instant dig
|
-- dig_immediate group doesn't use value 1. Value 3 is instant dig
|
||||||
dig_immediate =
|
dig_immediate =
|
||||||
{times = {[2] = digtime, [3] = 0}, uses = 0, maxlevel = 256},
|
{times = {[2] = digtime, [3] = 0}, uses = 0, maxlevel = 256},
|
||||||
},
|
},
|
||||||
damage_groups = {fleshy = 10},
|
damage_groups = {fleshy = 10},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Unlimited node placement
|
-- Unlimited node placement
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
name = creative
|
name = creative
|
||||||
description = Minetest Game mod: creative
|
description = Minetest Game mod: creative
|
||||||
depends = sfinv
|
depends = sfinv
|
||||||
optional_depends = default
|
|
||||||
|
Loading…
Reference in New Issue
Block a user