1
0
Fork 0

Tools to mcl_tools, way more efficient digging time definitions

This commit is contained in:
Wuzzy 2017-02-26 18:44:48 +01:00
parent 73308cea2b
commit 151c1e62ba
31 changed files with 421 additions and 390 deletions

View File

View File

@ -1,9 +1,21 @@
local overwrite = function() local materials = { "wood", "gold", "stone", "iron", "diamond" }
local materials = { "wood", "gold", "stone", "iron", "diamond" } local material_divisors = { 2, 12, 4, 6, 8 }
local material_divisors = { 2, 12, 4, 6, 8 } local basegroups = { "pickaxey", "axey", "shovely" }
local basegroups = { "pickaxey", "axey", "shovely" } local minigroups = { "handy", "shearsy", "swordy" }
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 for nname, ndef in pairs(minetest.registered_nodes) do
local groups_changed = false local groups_changed = false
local newgroups = table.copy(ndef.groups) local newgroups = table.copy(ndef.groups)
@ -40,19 +52,22 @@ local overwrite = function()
if time <= 0.05 then if time <= 0.05 then
time = 1 time = 1
else else
time = math.ceil(time * 20) time = math.ceil(time * 20) / 20
end end
newgroups[diggroup] = time table.insert(mcl_autogroup.digtimes[diggroup], time)
newgroups[diggroup] = #mcl_autogroup.digtimes[diggroup]
groups_changed = true groups_changed = true
end end
if not ndef.groups.handy then if not ndef.groups.handy then
local time = hardness * 5 local time = hardness * 5
if time <= 0.05 then if time <= 0.05 then
time = 1 time = 0
else else
time = math.ceil(time * 20) time = math.ceil(time * 20) / 20
end 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 end
end end

View File

@ -1,4 +1,5 @@
mcl_core mcl_core
mcl_tools
mcl_fire mcl_fire
mobs mobs
mcl_tnt mcl_tnt

View File

@ -16,7 +16,7 @@ mobs:register_mob("mobs_mc:pigman", {
mesh = "3d_armor_character.b3d", mesh = "3d_armor_character.b3d",
textures = {{"Original_Zombiepig_Man_by_Fedora_P.png", textures = {{"Original_Zombiepig_Man_by_Fedora_P.png",
"3d_armor_trans.png", "3d_armor_trans.png",
minetest.registered_items["mcl_core:sword_gold"].inventory_image, minetest.registered_items["mcl_tools:sword_gold"].inventory_image,
}}, }},
makes_footstep_sound = true, makes_footstep_sound = true,
@ -39,7 +39,7 @@ mobs:register_mob("mobs_mc:pigman", {
chance = 40, chance = 40,
min = 1, min = 1,
max = 1,}, max = 1,},
{name = "mcl_core:sword_gold", {name = "mcl_tools:sword_gold",
-- approximation to 8.5% -- approximation to 8.5%
chance = 11, chance = 11,
min = 1, min = 1,

View File

@ -164,240 +164,7 @@ minetest.register_craft({
} }
}) })
minetest.register_craft({
output = 'mcl_core:pick_wood',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'', 'mcl_core:stick', ''},
{'', 'mcl_core:stick', ''},
}
})
minetest.register_craft({
output = 'mcl_core:pick_stone',
recipe = {
{'mcl_core:cobble', 'mcl_core:cobble', 'mcl_core:cobble'},
{'', 'mcl_core:stick', ''},
{'', 'mcl_core:stick', ''},
}
})
minetest.register_craft({
output = 'mcl_core:pick_iron',
recipe = {
{'mcl_core:iron_ingot', 'mcl_core:iron_ingot', 'mcl_core:iron_ingot'},
{'', 'mcl_core:stick', ''},
{'', 'mcl_core:stick', ''},
}
})
minetest.register_craft({
output = 'mcl_core:pick_gold',
recipe = {
{'mcl_core:gold_ingot', 'mcl_core:gold_ingot', 'mcl_core:gold_ingot'},
{'', 'mcl_core:stick', ''},
{'', 'mcl_core:stick', ''},
}
})
minetest.register_craft({
output = 'mcl_core:pick_diamond',
recipe = {
{'mcl_core:diamond', 'mcl_core:diamond', 'mcl_core:diamond'},
{'', 'mcl_core:stick', ''},
{'', 'mcl_core:stick', ''},
}
})
minetest.register_craft({
output = 'mcl_core:shovel_wood',
recipe = {
{'group:wood'},
{'mcl_core:stick'},
{'mcl_core:stick'},
}
})
minetest.register_craft({
output = 'mcl_core:shovel_stone',
recipe = {
{'mcl_core:cobble'},
{'mcl_core:stick'},
{'mcl_core:stick'},
}
})
minetest.register_craft({
output = 'mcl_core:shovel_iron',
recipe = {
{'mcl_core:iron_ingot'},
{'mcl_core:stick'},
{'mcl_core:stick'},
}
})
minetest.register_craft({
output = 'mcl_core:shovel_gold',
recipe = {
{'mcl_core:gold_ingot'},
{'mcl_core:stick'},
{'mcl_core:stick'},
}
})
minetest.register_craft({
output = 'mcl_core:shovel_diamond',
recipe = {
{'mcl_core:diamond'},
{'mcl_core:stick'},
{'mcl_core:stick'},
}
})
minetest.register_craft({
output = 'mcl_core:axe_wood',
recipe = {
{'group:wood', 'group:wood'},
{'group:wood', 'mcl_core:stick'},
{'', 'mcl_core:stick'},
}
})
minetest.register_craft({
output = 'mcl_core:axe_wood',
recipe = {
{'group:wood', 'group:wood'},
{'mcl_core:stick', 'group:wood'},
{'mcl_core:stick', ''},
}
})
minetest.register_craft({
output = 'mcl_core:axe_stone',
recipe = {
{'mcl_core:cobble', 'mcl_core:cobble'},
{'mcl_core:cobble', 'mcl_core:stick'},
{'', 'mcl_core:stick'},
}
})
minetest.register_craft({
output = 'mcl_core:axe_stone',
recipe = {
{'mcl_core:cobble', 'mcl_core:cobble'},
{'mcl_core:stick', 'mcl_core:cobble'},
{'mcl_core:stick', ''},
}
})
minetest.register_craft({
output = 'mcl_core:axe_iron',
recipe = {
{'mcl_core:iron_ingot', 'mcl_core:iron_ingot'},
{'mcl_core:iron_ingot', 'mcl_core:stick'},
{'', 'mcl_core:stick'},
}
})
minetest.register_craft({
output = 'mcl_core:axe_iron',
recipe = {
{'mcl_core:iron_ingot', 'mcl_core:iron_ingot'},
{'mcl_core:stick', 'mcl_core:iron_ingot'},
{'mcl_core:stick', ''},
}
})
minetest.register_craft({
output = 'mcl_core:axe_gold',
recipe = {
{'mcl_core:gold_ingot', 'mcl_core:gold_ingot'},
{'mcl_core:gold_ingot', 'mcl_core:stick'},
{'', 'mcl_core:stick'},
}
})
minetest.register_craft({
output = 'mcl_core:axe_gold',
recipe = {
{'mcl_core:gold_ingot', 'mcl_core:gold_ingot'},
{'mcl_core:stick', 'mcl_core:gold_ingot'},
{'mcl_core:stick', ''},
}
})
minetest.register_craft({
output = 'mcl_core:axe_diamond',
recipe = {
{'mcl_core:diamond', 'mcl_core:diamond'},
{'mcl_core:diamond', 'mcl_core:stick'},
{'', 'mcl_core:stick'},
}
})
minetest.register_craft({
output = 'mcl_core:axe_diamond',
recipe = {
{'mcl_core:diamond', 'mcl_core:diamond'},
{'mcl_core:stick', 'mcl_core:diamond'},
{'mcl_core:stick', ''},
}
})
minetest.register_craft({
output = 'mcl_core:sword_wood',
recipe = {
{'group:wood'},
{'group:wood'},
{'mcl_core:stick'},
}
})
minetest.register_craft({
output = 'mcl_core:sword_stone',
recipe = {
{'mcl_core:cobble'},
{'mcl_core:cobble'},
{'mcl_core:stick'},
}
})
minetest.register_craft({
output = 'mcl_core:sword_iron',
recipe = {
{'mcl_core:iron_ingot'},
{'mcl_core:iron_ingot'},
{'mcl_core:stick'},
}
})
minetest.register_craft({
output = 'mcl_core:sword_gold',
recipe = {
{'mcl_core:gold_ingot'},
{'mcl_core:gold_ingot'},
{'mcl_core:stick'},
}
})
minetest.register_craft({
output = 'mcl_core:sword_diamond',
recipe = {
{'mcl_core:diamond'},
{'mcl_core:diamond'},
{'mcl_core:stick'},
}
})
minetest.register_craft({
output = 'mcl_core:shears',
recipe = {
{ 'mcl_core:iron_ingot', '' },
{ '', 'mcl_core:iron_ingot', },
}
})
minetest.register_craft({
output = 'mcl_core:shears',
recipe = {
{ '', 'mcl_core:iron_ingot', },
{ 'mcl_core:iron_ingot', '' },
}
})
minetest.register_craft({ minetest.register_craft({
output = 'mcl_core:coalblock', output = 'mcl_core:coalblock',
@ -708,64 +475,6 @@ minetest.register_craft({
cooktime = 10, cooktime = 10,
}) })
minetest.register_craft({
type = "cooking",
output = "mcl_core:gold_nugget",
recipe = "mcl_core:sword_gold",
cooktime = 10,
})
minetest.register_craft({
type = "cooking",
output = "mcl_core:gold_nugget",
recipe = "mcl_core:axe_gold",
cooktime = 10,
})
minetest.register_craft({
type = "cooking",
output = "mcl_core:gold_nugget",
recipe = "mcl_core:shovel_gold",
cooktime = 10,
})
minetest.register_craft({
type = "cooking",
output = "mcl_core:gold_nugget",
recipe = "mcl_core:pick_gold",
cooktime = 10,
})
minetest.register_craft({
type = "cooking",
output = "mcl_core:iron_nugget",
recipe = "mcl_core:sword_iron",
cooktime = 10,
})
minetest.register_craft({
type = "cooking",
output = "mcl_core:iron_nugget",
recipe = "mcl_core:axe_iron",
cooktime = 10,
})
minetest.register_craft({
type = "cooking",
output = "mcl_core:iron_nugget",
recipe = "mcl_core:shovel_iron",
cooktime = 10,
})
minetest.register_craft({
type = "cooking",
output = "mcl_core:iron_nugget",
recipe = "mcl_core:pick_iron",
cooktime = 10,
})
-- --
-- Fuels -- Fuels
-- --
@ -812,29 +521,7 @@ minetest.register_craft({
burntime = 5, burntime = 5,
}) })
minetest.register_craft({
type = "fuel",
recipe = "mcl_core:pick_wood",
burntime = 10,
})
minetest.register_craft({
type = "fuel",
recipe = "mcl_core:shovel_wood",
burntime = 10,
})
minetest.register_craft({
type = "fuel",
recipe = "mcl_core:sword_wood",
burntime = 10,
})
minetest.register_craft({
type = "fuel",
recipe = "mcl_core:axe_wood",
burntime = 10,
})
minetest.register_craft({ minetest.register_craft({
type = "fuel", type = "fuel",

View File

@ -6,6 +6,5 @@ mcl_core.repair = 0.05
-- Load files -- Load files
dofile(minetest.get_modpath("mcl_core").."/functions.lua") dofile(minetest.get_modpath("mcl_core").."/functions.lua")
dofile(minetest.get_modpath("mcl_core").."/nodes.lua") dofile(minetest.get_modpath("mcl_core").."/nodes.lua")
dofile(minetest.get_modpath("mcl_core").."/tools.lua")
dofile(minetest.get_modpath("mcl_core").."/craftitems.lua") dofile(minetest.get_modpath("mcl_core").."/craftitems.lua")
dofile(minetest.get_modpath("mcl_core").."/crafting.lua") dofile(minetest.get_modpath("mcl_core").."/crafting.lua")

View File

@ -0,0 +1,338 @@
minetest.register_craft({
output = 'mcl_tools:pick_wood',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'', 'mcl_tools:stick', ''},
{'', 'mcl_tools:stick', ''},
}
})
minetest.register_craft({
output = 'mcl_tools:pick_stone',
recipe = {
{'mcl_tools:cobble', 'mcl_tools:cobble', 'mcl_tools:cobble'},
{'', 'mcl_tools:stick', ''},
{'', 'mcl_tools:stick', ''},
}
})
minetest.register_craft({
output = 'mcl_tools:pick_iron',
recipe = {
{'mcl_tools:iron_ingot', 'mcl_tools:iron_ingot', 'mcl_tools:iron_ingot'},
{'', 'mcl_tools:stick', ''},
{'', 'mcl_tools:stick', ''},
}
})
minetest.register_craft({
output = 'mcl_tools:pick_gold',
recipe = {
{'mcl_tools:gold_ingot', 'mcl_tools:gold_ingot', 'mcl_tools:gold_ingot'},
{'', 'mcl_tools:stick', ''},
{'', 'mcl_tools:stick', ''},
}
})
minetest.register_craft({
output = 'mcl_tools:pick_diamond',
recipe = {
{'mcl_tools:diamond', 'mcl_tools:diamond', 'mcl_tools:diamond'},
{'', 'mcl_tools:stick', ''},
{'', 'mcl_tools:stick', ''},
}
})
minetest.register_craft({
output = 'mcl_tools:shovel_wood',
recipe = {
{'group:wood'},
{'mcl_tools:stick'},
{'mcl_tools:stick'},
}
})
minetest.register_craft({
output = 'mcl_tools:shovel_stone',
recipe = {
{'mcl_tools:cobble'},
{'mcl_tools:stick'},
{'mcl_tools:stick'},
}
})
minetest.register_craft({
output = 'mcl_tools:shovel_iron',
recipe = {
{'mcl_tools:iron_ingot'},
{'mcl_tools:stick'},
{'mcl_tools:stick'},
}
})
minetest.register_craft({
output = 'mcl_tools:shovel_gold',
recipe = {
{'mcl_tools:gold_ingot'},
{'mcl_tools:stick'},
{'mcl_tools:stick'},
}
})
minetest.register_craft({
output = 'mcl_tools:shovel_diamond',
recipe = {
{'mcl_tools:diamond'},
{'mcl_tools:stick'},
{'mcl_tools:stick'},
}
})
minetest.register_craft({
output = 'mcl_tools:axe_wood',
recipe = {
{'group:wood', 'group:wood'},
{'group:wood', 'mcl_tools:stick'},
{'', 'mcl_tools:stick'},
}
})
minetest.register_craft({
output = 'mcl_tools:axe_wood',
recipe = {
{'group:wood', 'group:wood'},
{'mcl_tools:stick', 'group:wood'},
{'mcl_tools:stick', ''},
}
})
minetest.register_craft({
output = 'mcl_tools:axe_stone',
recipe = {
{'mcl_tools:cobble', 'mcl_tools:cobble'},
{'mcl_tools:cobble', 'mcl_tools:stick'},
{'', 'mcl_tools:stick'},
}
})
minetest.register_craft({
output = 'mcl_tools:axe_stone',
recipe = {
{'mcl_tools:cobble', 'mcl_tools:cobble'},
{'mcl_tools:stick', 'mcl_tools:cobble'},
{'mcl_tools:stick', ''},
}
})
minetest.register_craft({
output = 'mcl_tools:axe_iron',
recipe = {
{'mcl_tools:iron_ingot', 'mcl_tools:iron_ingot'},
{'mcl_tools:iron_ingot', 'mcl_tools:stick'},
{'', 'mcl_tools:stick'},
}
})
minetest.register_craft({
output = 'mcl_tools:axe_iron',
recipe = {
{'mcl_tools:iron_ingot', 'mcl_tools:iron_ingot'},
{'mcl_tools:stick', 'mcl_tools:iron_ingot'},
{'mcl_tools:stick', ''},
}
})
minetest.register_craft({
output = 'mcl_tools:axe_gold',
recipe = {
{'mcl_tools:gold_ingot', 'mcl_tools:gold_ingot'},
{'mcl_tools:gold_ingot', 'mcl_tools:stick'},
{'', 'mcl_tools:stick'},
}
})
minetest.register_craft({
output = 'mcl_tools:axe_gold',
recipe = {
{'mcl_tools:gold_ingot', 'mcl_tools:gold_ingot'},
{'mcl_tools:stick', 'mcl_tools:gold_ingot'},
{'mcl_tools:stick', ''},
}
})
minetest.register_craft({
output = 'mcl_tools:axe_diamond',
recipe = {
{'mcl_tools:diamond', 'mcl_tools:diamond'},
{'mcl_tools:diamond', 'mcl_tools:stick'},
{'', 'mcl_tools:stick'},
}
})
minetest.register_craft({
output = 'mcl_tools:axe_diamond',
recipe = {
{'mcl_tools:diamond', 'mcl_tools:diamond'},
{'mcl_tools:stick', 'mcl_tools:diamond'},
{'mcl_tools:stick', ''},
}
})
minetest.register_craft({
output = 'mcl_tools:sword_wood',
recipe = {
{'group:wood'},
{'group:wood'},
{'mcl_tools:stick'},
}
})
minetest.register_craft({
output = 'mcl_tools:sword_stone',
recipe = {
{'mcl_tools:cobble'},
{'mcl_tools:cobble'},
{'mcl_tools:stick'},
}
})
minetest.register_craft({
output = 'mcl_tools:sword_iron',
recipe = {
{'mcl_tools:iron_ingot'},
{'mcl_tools:iron_ingot'},
{'mcl_tools:stick'},
}
})
minetest.register_craft({
output = 'mcl_tools:sword_gold',
recipe = {
{'mcl_tools:gold_ingot'},
{'mcl_tools:gold_ingot'},
{'mcl_tools:stick'},
}
})
minetest.register_craft({
output = 'mcl_tools:sword_diamond',
recipe = {
{'mcl_tools:diamond'},
{'mcl_tools:diamond'},
{'mcl_tools:stick'},
}
})
minetest.register_craft({
output = 'mcl_tools:shears',
recipe = {
{ 'mcl_tools:iron_ingot', '' },
{ '', 'mcl_tools:iron_ingot', },
}
})
minetest.register_craft({
output = 'mcl_tools:shears',
recipe = {
{ '', 'mcl_tools:iron_ingot', },
{ 'mcl_tools:iron_ingot', '' },
}
})
minetest.register_craft({
type = "fuel",
recipe = "mcl_tools:pick_wood",
burntime = 10,
})
minetest.register_craft({
type = "fuel",
recipe = "mcl_tools:shovel_wood",
burntime = 10,
})
minetest.register_craft({
type = "fuel",
recipe = "mcl_tools:sword_wood",
burntime = 10,
})
minetest.register_craft({
type = "fuel",
recipe = "mcl_tools:axe_wood",
burntime = 10,
})
minetest.register_craft({
type = "cooking",
output = "mcl_tools:gold_nugget",
recipe = "mcl_tools:sword_gold",
cooktime = 10,
})
minetest.register_craft({
type = "cooking",
output = "mcl_tools:gold_nugget",
recipe = "mcl_tools:axe_gold",
cooktime = 10,
})
minetest.register_craft({
type = "cooking",
output = "mcl_tools:gold_nugget",
recipe = "mcl_tools:shovel_gold",
cooktime = 10,
})
minetest.register_craft({
type = "cooking",
output = "mcl_tools:gold_nugget",
recipe = "mcl_tools:pick_gold",
cooktime = 10,
})
minetest.register_craft({
type = "cooking",
output = "mcl_tools:iron_nugget",
recipe = "mcl_tools:sword_iron",
cooktime = 10,
})
minetest.register_craft({
type = "cooking",
output = "mcl_tools:iron_nugget",
recipe = "mcl_tools:axe_iron",
cooktime = 10,
})
minetest.register_craft({
type = "cooking",
output = "mcl_tools:iron_nugget",
recipe = "mcl_tools:shovel_iron",
cooktime = 10,
})
minetest.register_craft({
type = "cooking",
output = "mcl_tools:iron_nugget",
recipe = "mcl_tools:pick_iron",
cooktime = 10,
})
minetest.register_craft({
type = "fuel",
recipe = "mcl_tools:pick_wood",
burntime = 10,
})
minetest.register_craft({
type = "fuel",
recipe = "mcl_tools:shovel_wood",
burntime = 10,
})
minetest.register_craft({
type = "fuel",
recipe = "mcl_tools:sword_wood",
burntime = 10,
})
minetest.register_craft({
type = "fuel",
recipe = "mcl_tools:axe_wood",
burntime = 10,
})

View File

@ -0,0 +1,2 @@
mcl_sounds
mcl_autogroup

View File

@ -13,19 +13,6 @@
- 5: Diamond - 5: Diamond
]] ]]
-- Table for tool digging times, everything from 0 to 250
-- Minecraft digging times are always multiples of 0.05
local tooltimes = {}
for i=1,5000 do
local time
if i == 1 then
time = 0
else
time = i*0.05
end
table.insert(tooltimes, time)
end
-- TODO: Add legacy support for Minetest Game groups like crumbly, snappy, cracky, etc. for all tools -- TODO: Add legacy support for Minetest Game groups like crumbly, snappy, cracky, etc. for all tools
-- The hand -- The hand
@ -37,7 +24,7 @@ if minetest.setting_getbool("creative_mode") then
} }
else else
groupcaps = { groupcaps = {
handy_dig = {times=tooltimes, uses=0}, handy_dig = {times=mcl_autogroup.digtimes.handy_dig, uses=0},
} }
end end
minetest.register_item(":", { minetest.register_item(":", {
@ -54,7 +41,7 @@ minetest.register_item(":", {
}) })
-- Picks -- Picks
minetest.register_tool("mcl_core:pick_wood", { minetest.register_tool("mcl_tools:pick_wood", {
description = "Wooden Pickaxe", description = "Wooden Pickaxe",
inventory_image = "default_tool_woodpick.png", inventory_image = "default_tool_woodpick.png",
groups = { tool=1 }, groups = { tool=1 },
@ -63,13 +50,13 @@ minetest.register_tool("mcl_core:pick_wood", {
full_punch_interval = 0.83333333, full_punch_interval = 0.83333333,
max_drop_level=1, max_drop_level=1,
groupcaps={ groupcaps={
pickaxey_dig_wood = {times=tooltimes, uses=0}, pickaxey_dig_wood = {times=mcl_autogroup.digtimes.pickaxey_dig_wood, uses=0},
}, },
damage_groups = {fleshy=2}, damage_groups = {fleshy=2},
}, },
sound = { breaks = "default_tool_breaks" }, sound = { breaks = "default_tool_breaks" },
}) })
minetest.register_tool("mcl_core:pick_stone", { minetest.register_tool("mcl_tools:pick_stone", {
description = "Stone Pickaxe", description = "Stone Pickaxe",
inventory_image = "default_tool_stonepick.png", inventory_image = "default_tool_stonepick.png",
groups = { tool=1 }, groups = { tool=1 },
@ -78,13 +65,13 @@ minetest.register_tool("mcl_core:pick_stone", {
full_punch_interval = 0.83333333, full_punch_interval = 0.83333333,
max_drop_level=3, max_drop_level=3,
groupcaps={ groupcaps={
pickaxey_dig_stone = {times=tooltimes, uses=0}, pickaxey_dig_stone = {times=mcl_autogroup.digtimes.pickaxey_dig_stone , uses=0},
}, },
damage_groups = {fleshy=3}, damage_groups = {fleshy=3},
}, },
sound = { breaks = "default_tool_breaks" }, sound = { breaks = "default_tool_breaks" },
}) })
minetest.register_tool("mcl_core:pick_iron", { minetest.register_tool("mcl_tools:pick_iron", {
description = "Iron Pickaxe", description = "Iron Pickaxe",
inventory_image = "default_tool_steelpick.png", inventory_image = "default_tool_steelpick.png",
groups = { tool=1 }, groups = { tool=1 },
@ -93,13 +80,13 @@ minetest.register_tool("mcl_core:pick_iron", {
full_punch_interval = 0.83333333, full_punch_interval = 0.83333333,
max_drop_level=4, max_drop_level=4,
groupcaps={ groupcaps={
pickaxey_dig_iron = {times=tooltimes, uses=0}, pickaxey_dig_iron = {times=mcl_autogroup.digtimes.pickaxey_dig_iron , uses=0},
}, },
damage_groups = {fleshy=4}, damage_groups = {fleshy=4},
}, },
sound = { breaks = "default_tool_breaks" }, sound = { breaks = "default_tool_breaks" },
}) })
minetest.register_tool("mcl_core:pick_gold", { minetest.register_tool("mcl_tools:pick_gold", {
description = "Golden Pickaxe", description = "Golden Pickaxe",
inventory_image = "default_tool_goldpick.png", inventory_image = "default_tool_goldpick.png",
groups = { tool=1 }, groups = { tool=1 },
@ -108,13 +95,13 @@ minetest.register_tool("mcl_core:pick_gold", {
full_punch_interval = 0.83333333, full_punch_interval = 0.83333333,
max_drop_level=2, max_drop_level=2,
groupcaps={ groupcaps={
pickaxey_dig_gold = {times=tooltimes, uses=0}, pickaxey_dig_gold = {times=mcl_autogroup.digtimes.pickaxey_dig_gold , uses=0},
}, },
damage_groups = {fleshy=2}, damage_groups = {fleshy=2},
}, },
sound = { breaks = "default_tool_breaks" }, sound = { breaks = "default_tool_breaks" },
}) })
minetest.register_tool("mcl_core:pick_diamond", { minetest.register_tool("mcl_tools:pick_diamond", {
description = "Diamond Pickaxe", description = "Diamond Pickaxe",
inventory_image = "default_tool_diamondpick.png", inventory_image = "default_tool_diamondpick.png",
groups = { tool=1 }, groups = { tool=1 },
@ -123,7 +110,7 @@ minetest.register_tool("mcl_core:pick_diamond", {
full_punch_interval = 0.83333333, full_punch_interval = 0.83333333,
max_drop_level=5, max_drop_level=5,
groupcaps={ groupcaps={
pickaxey_dig_diamond = {times=tooltimes, uses=0}, pickaxey_dig_diamond = {times=mcl_autogroup.digtimes.pickaxey_dig_diamond , uses=0},
}, },
damage_groups = {fleshy=5}, damage_groups = {fleshy=5},
}, },
@ -131,7 +118,7 @@ minetest.register_tool("mcl_core:pick_diamond", {
}) })
local make_grass_path = function(itemstack, placer, pointed_thing) local make_grass_path = function(itemstack, placer, pointed_thing)
if minetest.get_node(pointed_thing.under).name == "mcl_core:dirt_with_grass" and pointed_thing.above.y == pointed_thing.under.y then if minetest.get_node(pointed_thing.under).name == "mcl_tools:dirt_with_grass" and pointed_thing.above.y == pointed_thing.under.y then
local above = table.copy(pointed_thing.under) local above = table.copy(pointed_thing.under)
above.y = above.y + 1 above.y = above.y + 1
if minetest.get_node(above).name == "air" then if minetest.get_node(above).name == "air" then
@ -145,14 +132,14 @@ local make_grass_path = function(itemstack, placer, pointed_thing)
itemstack:add_wear(wear) itemstack:add_wear(wear)
end end
minetest.sound_play({name="default_grass_footstep", gain=1}, {pos = above}) minetest.sound_play({name="default_grass_footstep", gain=1}, {pos = above})
minetest.swap_node(pointed_thing.under, {name="mcl_core:grass_path"}) minetest.swap_node(pointed_thing.under, {name="mcl_tools:grass_path"})
end end
end end
return itemstack return itemstack
end end
-- Shovels -- Shovels
minetest.register_tool("mcl_core:shovel_wood", { minetest.register_tool("mcl_tools:shovel_wood", {
description = "Wooden Shovel", description = "Wooden Shovel",
inventory_image = "default_tool_woodshovel.png", inventory_image = "default_tool_woodshovel.png",
wield_image = "default_tool_woodshovel.png^[transformR90", wield_image = "default_tool_woodshovel.png^[transformR90",
@ -161,14 +148,14 @@ minetest.register_tool("mcl_core:shovel_wood", {
full_punch_interval = 1, full_punch_interval = 1,
max_drop_level=1, max_drop_level=1,
groupcaps={ groupcaps={
shovely_dig_wood = {times=tooltimes, uses=0}, shovely_dig_wood = {times=mcl_autogroup.digtimes.shovely_dig_wood, uses=0},
}, },
damage_groups = {fleshy=2}, damage_groups = {fleshy=2},
}, },
on_place = make_grass_path, on_place = make_grass_path,
sound = { breaks = "default_tool_breaks" }, sound = { breaks = "default_tool_breaks" },
}) })
minetest.register_tool("mcl_core:shovel_stone", { minetest.register_tool("mcl_tools:shovel_stone", {
description = "Stone Shovel", description = "Stone Shovel",
inventory_image = "default_tool_stoneshovel.png", inventory_image = "default_tool_stoneshovel.png",
wield_image = "default_tool_stoneshovel.png^[transformR90", wield_image = "default_tool_stoneshovel.png^[transformR90",
@ -177,14 +164,14 @@ minetest.register_tool("mcl_core:shovel_stone", {
full_punch_interval = 1, full_punch_interval = 1,
max_drop_level=3, max_drop_level=3,
groupcaps={ groupcaps={
shovely_dig_stone = {times=tooltimes, uses=0}, shovely_dig_stone = {times=mcl_autogroup.digtimes.shovely_dig_stone, uses=0},
}, },
damage_groups = {fleshy=3}, damage_groups = {fleshy=3},
}, },
on_place = make_grass_path, on_place = make_grass_path,
sound = { breaks = "default_tool_breaks" }, sound = { breaks = "default_tool_breaks" },
}) })
minetest.register_tool("mcl_core:shovel_iron", { minetest.register_tool("mcl_tools:shovel_iron", {
description = "Iron Shovel", description = "Iron Shovel",
inventory_image = "default_tool_steelshovel.png", inventory_image = "default_tool_steelshovel.png",
wield_image = "default_tool_steelshovel.png^[transformR90", wield_image = "default_tool_steelshovel.png^[transformR90",
@ -193,14 +180,14 @@ minetest.register_tool("mcl_core:shovel_iron", {
full_punch_interval = 1, full_punch_interval = 1,
max_drop_level=4, max_drop_level=4,
groupcaps={ groupcaps={
shovely_dig_iron= {times=tooltimes, uses=0}, shovely_dig_iron = {times=mcl_autogroup.digtimes.shovely_dig_iron, uses=0},
}, },
damage_groups = {fleshy=4}, damage_groups = {fleshy=4},
}, },
on_place = make_grass_path, on_place = make_grass_path,
sound = { breaks = "default_tool_breaks" }, sound = { breaks = "default_tool_breaks" },
}) })
minetest.register_tool("mcl_core:shovel_gold", { minetest.register_tool("mcl_tools:shovel_gold", {
description = "Golden Shovel", description = "Golden Shovel",
inventory_image = "default_tool_goldshovel.png", inventory_image = "default_tool_goldshovel.png",
wield_image = "default_tool_goldshovel.png^[transformR90", wield_image = "default_tool_goldshovel.png^[transformR90",
@ -209,14 +196,14 @@ minetest.register_tool("mcl_core:shovel_gold", {
full_punch_interval = 1, full_punch_interval = 1,
max_drop_level=2, max_drop_level=2,
groupcaps={ groupcaps={
shovely_dig_gold = {times=tooltimes, uses=0}, shovely_dig_gold = {times=mcl_autogroup.digtimes.shovely_dig_gold, uses=0},
}, },
damage_groups = {fleshy=2}, damage_groups = {fleshy=2},
}, },
on_place = make_grass_path, on_place = make_grass_path,
sound = { breaks = "default_tool_breaks" }, sound = { breaks = "default_tool_breaks" },
}) })
minetest.register_tool("mcl_core:shovel_diamond", { minetest.register_tool("mcl_tools:shovel_diamond", {
description = "Diamond Shovel", description = "Diamond Shovel",
inventory_image = "default_tool_diamondshovel.png", inventory_image = "default_tool_diamondshovel.png",
wield_image = "default_tool_diamondshovel.png^[transformR90", wield_image = "default_tool_diamondshovel.png^[transformR90",
@ -225,7 +212,7 @@ minetest.register_tool("mcl_core:shovel_diamond", {
full_punch_interval = 1, full_punch_interval = 1,
max_drop_level=5, max_drop_level=5,
groupcaps={ groupcaps={
shovely_dig_diamond = {times=tooltimes, uses=0}, shovely_dig_diamond = {times=mcl_autogroup.digtimes.shovely_dig_diamond, uses=0},
}, },
damage_groups = {fleshy=5}, damage_groups = {fleshy=5},
}, },
@ -234,7 +221,7 @@ minetest.register_tool("mcl_core:shovel_diamond", {
}) })
-- Axes -- Axes
minetest.register_tool("mcl_core:axe_wood", { minetest.register_tool("mcl_tools:axe_wood", {
description = "Wooden Axe", description = "Wooden Axe",
inventory_image = "default_tool_woodaxe.png", inventory_image = "default_tool_woodaxe.png",
groups = { tool=1 }, groups = { tool=1 },
@ -242,13 +229,13 @@ minetest.register_tool("mcl_core:axe_wood", {
full_punch_interval = 1.25, full_punch_interval = 1.25,
max_drop_level=1, max_drop_level=1,
groupcaps={ groupcaps={
axey_dig_wood = {times=tooltimes, uses=0}, axey_dig_wood = {times=mcl_autogroup.digtimes.axey_dig_wood, uses=0},
}, },
damage_groups = {fleshy=7}, damage_groups = {fleshy=7},
}, },
sound = { breaks = "default_tool_breaks" }, sound = { breaks = "default_tool_breaks" },
}) })
minetest.register_tool("mcl_core:axe_stone", { minetest.register_tool("mcl_tools:axe_stone", {
description = "Stone Axe", description = "Stone Axe",
inventory_image = "default_tool_stoneaxe.png", inventory_image = "default_tool_stoneaxe.png",
groups = { tool=1 }, groups = { tool=1 },
@ -256,13 +243,13 @@ minetest.register_tool("mcl_core:axe_stone", {
full_punch_interval = 1.25, full_punch_interval = 1.25,
max_drop_level=3, max_drop_level=3,
groupcaps={ groupcaps={
axey_dig_stone = {times=tooltimes, uses=0}, axey_dig_stone = {times=mcl_autogroup.digtimes.axey_dig_stone, uses=0},
}, },
damage_groups = {fleshy=9}, damage_groups = {fleshy=9},
}, },
sound = { breaks = "default_tool_breaks" }, sound = { breaks = "default_tool_breaks" },
}) })
minetest.register_tool("mcl_core:axe_iron", { minetest.register_tool("mcl_tools:axe_iron", {
description = "Iron Axe", description = "Iron Axe",
inventory_image = "default_tool_steelaxe.png", inventory_image = "default_tool_steelaxe.png",
groups = { tool=1 }, groups = { tool=1 },
@ -271,13 +258,13 @@ minetest.register_tool("mcl_core:axe_iron", {
full_punch_interval = 1.11111111, full_punch_interval = 1.11111111,
max_drop_level=4, max_drop_level=4,
groupcaps={ groupcaps={
axey_dig_iron = {times=tooltimes, uses=0}, axey_dig_iron = {times=mcl_autogroup.digtimes.axey_dig_iron, uses=0},
}, },
damage_groups = {fleshy=9}, damage_groups = {fleshy=9},
}, },
sound = { breaks = "default_tool_breaks" }, sound = { breaks = "default_tool_breaks" },
}) })
minetest.register_tool("mcl_core:axe_gold", { minetest.register_tool("mcl_tools:axe_gold", {
description = "Golden Axe", description = "Golden Axe",
inventory_image = "default_tool_goldaxe.png", inventory_image = "default_tool_goldaxe.png",
groups = { tool=1 }, groups = { tool=1 },
@ -285,13 +272,13 @@ minetest.register_tool("mcl_core:axe_gold", {
full_punch_interval = 1.0, full_punch_interval = 1.0,
max_drop_level=2, max_drop_level=2,
groupcaps={ groupcaps={
axey_dig_gold = {times=tooltimes, uses=0}, axey_dig_gold= {times=mcl_autogroup.digtimes.axey_dig_gold, uses=0},
}, },
damage_groups = {fleshy=7}, damage_groups = {fleshy=7},
}, },
sound = { breaks = "default_tool_breaks" }, sound = { breaks = "default_tool_breaks" },
}) })
minetest.register_tool("mcl_core:axe_diamond", { minetest.register_tool("mcl_tools:axe_diamond", {
description = "Diamond Axe", description = "Diamond Axe",
inventory_image = "default_tool_diamondaxe.png", inventory_image = "default_tool_diamondaxe.png",
groups = { tool=1 }, groups = { tool=1 },
@ -299,7 +286,7 @@ minetest.register_tool("mcl_core:axe_diamond", {
full_punch_interval = 1.0, full_punch_interval = 1.0,
max_drop_level=5, max_drop_level=5,
groupcaps={ groupcaps={
axey_dig_diamond = {times=tooltimes, uses=0}, axey_dig_diamond = {times=mcl_autogroup.digtimes.axey_dig_diamond, uses=0},
}, },
damage_groups = {fleshy=9}, damage_groups = {fleshy=9},
}, },
@ -307,7 +294,7 @@ minetest.register_tool("mcl_core:axe_diamond", {
}) })
-- Swords -- Swords
minetest.register_tool("mcl_core:sword_wood", { minetest.register_tool("mcl_tools:sword_wood", {
description = "Wooden Sword", description = "Wooden Sword",
inventory_image = "default_tool_woodsword.png", inventory_image = "default_tool_woodsword.png",
groups = { weapon=1 }, groups = { weapon=1 },
@ -315,14 +302,14 @@ minetest.register_tool("mcl_core:sword_wood", {
full_punch_interval = 0.625, full_punch_interval = 0.625,
max_drop_level=1, max_drop_level=1,
groupcaps={ groupcaps={
swordy_dig = {times=tooltimes, uses=0}, swordy_dig = {times=mcl_autogroup.digtimes.swordy_dig , uses=0},
swordy_cobweb_dig = {times=tooltimes, uses=0}, swordy_cobweb_dig = {times=mcl_autogroup.digtimes.swordy_cobweb_dig , uses=0},
}, },
damage_groups = {fleshy=4}, damage_groups = {fleshy=4},
}, },
sound = { breaks = "default_tool_breaks" }, sound = { breaks = "default_tool_breaks" },
}) })
minetest.register_tool("mcl_core:sword_stone", { minetest.register_tool("mcl_tools:sword_stone", {
description = "Stone Sword", description = "Stone Sword",
inventory_image = "default_tool_stonesword.png", inventory_image = "default_tool_stonesword.png",
groups = { weapon=1 }, groups = { weapon=1 },
@ -330,14 +317,14 @@ minetest.register_tool("mcl_core:sword_stone", {
full_punch_interval = 0.625, full_punch_interval = 0.625,
max_drop_level=3, max_drop_level=3,
groupcaps={ groupcaps={
swordy_dig = {times=tooltimes, uses=0}, swordy_dig = {times=mcl_autogroup.digtimes.swordy_dig , uses=0},
swordy_cobweb_dig = {times=tooltimes, uses=0}, swordy_cobweb_dig = {times=mcl_autogroup.digtimes.swordy_cobweb_dig , uses=0},
}, },
damage_groups = {fleshy=5}, damage_groups = {fleshy=5},
}, },
sound = { breaks = "default_tool_breaks" }, sound = { breaks = "default_tool_breaks" },
}) })
minetest.register_tool("mcl_core:sword_iron", { minetest.register_tool("mcl_tools:sword_iron", {
description = "Iron Sword", description = "Iron Sword",
inventory_image = "default_tool_steelsword.png", inventory_image = "default_tool_steelsword.png",
groups = { weapon=1 }, groups = { weapon=1 },
@ -345,14 +332,14 @@ minetest.register_tool("mcl_core:sword_iron", {
full_punch_interval = 0.625, full_punch_interval = 0.625,
max_drop_level=4, max_drop_level=4,
groupcaps={ groupcaps={
swordy_dig = {times=tooltimes, uses=0}, swordy_dig = {times=mcl_autogroup.digtimes.swordy_dig , uses=0},
swordy_cobweb_dig = {times=tooltimes, uses=0}, swordy_cobweb_dig = {times=mcl_autogroup.digtimes.swordy_cobweb_dig , uses=0},
}, },
damage_groups = {fleshy=6}, damage_groups = {fleshy=6},
}, },
sound = { breaks = "default_tool_breaks" }, sound = { breaks = "default_tool_breaks" },
}) })
minetest.register_tool("mcl_core:sword_gold", { minetest.register_tool("mcl_tools:sword_gold", {
description = "Golden Sword", description = "Golden Sword",
inventory_image = "default_tool_goldsword.png", inventory_image = "default_tool_goldsword.png",
groups = { weapon=1 }, groups = { weapon=1 },
@ -360,14 +347,14 @@ minetest.register_tool("mcl_core:sword_gold", {
full_punch_interval = 0.625, full_punch_interval = 0.625,
max_drop_level=2, max_drop_level=2,
groupcaps={ groupcaps={
swordy_dig = {times=tooltimes, uses=0}, swordy_dig = {times=mcl_autogroup.digtimes.swordy_dig , uses=0},
swordy_cobweb_dig = {times=tooltimes, uses=0}, swordy_cobweb_dig = {times=mcl_autogroup.digtimes.swordy_cobweb_dig , uses=0},
}, },
damage_groups = {fleshy=4}, damage_groups = {fleshy=4},
}, },
sound = { breaks = "default_tool_breaks" }, sound = { breaks = "default_tool_breaks" },
}) })
minetest.register_tool("mcl_core:sword_diamond", { minetest.register_tool("mcl_tools:sword_diamond", {
description = "Diamond Sword", description = "Diamond Sword",
inventory_image = "default_tool_diamondsword.png", inventory_image = "default_tool_diamondsword.png",
groups = { weapon=1 }, groups = { weapon=1 },
@ -375,8 +362,8 @@ minetest.register_tool("mcl_core:sword_diamond", {
full_punch_interval = 0.625, full_punch_interval = 0.625,
max_drop_level=5, max_drop_level=5,
groupcaps={ groupcaps={
swordy_dig = {times=tooltimes, uses=0}, swordy_dig = {times=mcl_autogroup.digtimes.swordy_dig , uses=0},
swordy_cobweb_dig = {times=tooltimes, uses=0}, swordy_cobweb_dig = {times=mcl_autogroup.digtimes.swordy_cobweb_dig , uses=0},
}, },
damage_groups = {fleshy=7}, damage_groups = {fleshy=7},
}, },
@ -384,7 +371,7 @@ minetest.register_tool("mcl_core:sword_diamond", {
}) })
--Shears --Shears
minetest.register_tool("mcl_core:shears", { minetest.register_tool("mcl_tools:shears", {
description = "Shears", description = "Shears",
inventory_image = "default_tool_shears.png", inventory_image = "default_tool_shears.png",
wield_image = "default_tool_shears.png", wield_image = "default_tool_shears.png",
@ -394,11 +381,12 @@ minetest.register_tool("mcl_core:shears", {
full_punch_interval = 0.5, full_punch_interval = 0.5,
max_drop_level=1, max_drop_level=1,
groupcaps={ groupcaps={
shearsy_dig = {times=tooltimes, uses=0}, shearsy_dig = {times=mcl_autogroup.digtimes.shearsy_dig, uses=0},
shearsy_wool_dig = {times=tooltimes, uses=0}, shearsy_wool_dig = {times=mcl_autogroup.digtimes.shearsy_wool_dig, uses=0},
} }
}, },
sound = { breaks = "default_tool_breaks" }, sound = { breaks = "default_tool_breaks" },
}) })
dofile(minetest.get_modpath("mcl_tools").."/crafting.lua")

View File

@ -0,0 +1 @@
name = mcl_tools

View File

Before

Width:  |  Height:  |  Size: 255 B

After

Width:  |  Height:  |  Size: 255 B

View File

Before

Width:  |  Height:  |  Size: 275 B

After

Width:  |  Height:  |  Size: 275 B

View File

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 232 B

View File

Before

Width:  |  Height:  |  Size: 262 B

After

Width:  |  Height:  |  Size: 262 B

View File

Before

Width:  |  Height:  |  Size: 254 B

After

Width:  |  Height:  |  Size: 254 B

View File

Before

Width:  |  Height:  |  Size: 275 B

After

Width:  |  Height:  |  Size: 275 B

View File

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 232 B

View File

Before

Width:  |  Height:  |  Size: 263 B

After

Width:  |  Height:  |  Size: 263 B

View File

Before

Width:  |  Height:  |  Size: 292 B

After

Width:  |  Height:  |  Size: 292 B

View File

Before

Width:  |  Height:  |  Size: 254 B

After

Width:  |  Height:  |  Size: 254 B

View File

Before

Width:  |  Height:  |  Size: 275 B

After

Width:  |  Height:  |  Size: 275 B

View File

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 232 B

View File

Before

Width:  |  Height:  |  Size: 259 B

After

Width:  |  Height:  |  Size: 259 B

View File

Before

Width:  |  Height:  |  Size: 255 B

After

Width:  |  Height:  |  Size: 255 B

View File

Before

Width:  |  Height:  |  Size: 275 B

After

Width:  |  Height:  |  Size: 275 B

View File

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 232 B

View File

Before

Width:  |  Height:  |  Size: 262 B

After

Width:  |  Height:  |  Size: 262 B

View File

Before

Width:  |  Height:  |  Size: 255 B

After

Width:  |  Height:  |  Size: 255 B

View File

Before

Width:  |  Height:  |  Size: 275 B

After

Width:  |  Height:  |  Size: 275 B

View File

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 232 B

View File

Before

Width:  |  Height:  |  Size: 261 B

After

Width:  |  Height:  |  Size: 261 B