Tools to mcl_tools, way more efficient digging time definitions
This commit is contained in:
parent
73308cea2b
commit
151c1e62ba
31 changed files with 421 additions and 390 deletions
0
mods/CORE/mcl_autogroup/depends.txt
Normal file
0
mods/CORE/mcl_autogroup/depends.txt
Normal file
|
@ -1,9 +1,21 @@
|
|||
local overwrite = function()
|
||||
local materials = { "wood", "gold", "stone", "iron", "diamond" }
|
||||
local material_divisors = { 2, 12, 4, 6, 8 }
|
||||
local basegroups = { "pickaxey", "axey", "shovely" }
|
||||
local minigroups = { "handy", "shearsy", "swordy" }
|
||||
local materials = { "wood", "gold", "stone", "iron", "diamond" }
|
||||
local material_divisors = { 2, 12, 4, 6, 8 }
|
||||
local basegroups = { "pickaxey", "axey", "shovely" }
|
||||
local minigroups = { "handy", "shearsy", "swordy" }
|
||||
|
||||
mcl_autogroup = {}
|
||||
mcl_autogroup.digtimes = {}
|
||||
|
||||
for m=1, #materials do
|
||||
for g=1, #basegroups do
|
||||
mcl_autogroup.digtimes[basegroups[g].."_dig_"..materials[m]] = {}
|
||||
end
|
||||
end
|
||||
for g=1, #minigroups do
|
||||
mcl_autogroup.digtimes[minigroups[g].."_dig"] = {}
|
||||
end
|
||||
|
||||
local overwrite = function()
|
||||
for nname, ndef in pairs(minetest.registered_nodes) do
|
||||
local groups_changed = false
|
||||
local newgroups = table.copy(ndef.groups)
|
||||
|
@ -40,19 +52,22 @@ local overwrite = function()
|
|||
if time <= 0.05 then
|
||||
time = 1
|
||||
else
|
||||
time = math.ceil(time * 20)
|
||||
time = math.ceil(time * 20) / 20
|
||||
end
|
||||
newgroups[diggroup] = time
|
||||
table.insert(mcl_autogroup.digtimes[diggroup], time)
|
||||
newgroups[diggroup] = #mcl_autogroup.digtimes[diggroup]
|
||||
groups_changed = true
|
||||
end
|
||||
if not ndef.groups.handy then
|
||||
local time = hardness * 5
|
||||
if time <= 0.05 then
|
||||
time = 1
|
||||
time = 0
|
||||
else
|
||||
time = math.ceil(time * 20)
|
||||
time = math.ceil(time * 20) / 20
|
||||
end
|
||||
newgroups.handy_dig = time
|
||||
table.insert(mcl_autogroup.digtimes.handy_dig, time)
|
||||
newgroups.handy_dig = #mcl_autogroup.digtimes.handy_dig
|
||||
groups_changed = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue