Skip to content

Commit

Permalink
+ tools mod
Browse files Browse the repository at this point in the history
  • Loading branch information
orion-tux committed Jul 2, 2024
1 parent 5007e14 commit a5fc007
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 0 deletions.
45 changes: 45 additions & 0 deletions mods/core/tools/.luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
read_globals = {
"DIR_DELIM", "INIT",

"minetest", "core",
"dump", "dump2",

"Raycast",
"Settings",
"PseudoRandom",
"PerlinNoise",
"VoxelManip",
"SecureRandom",
"VoxelArea",
"PerlinNoiseMap",
"PcgRandom",
"ItemStack",
"AreaStore",

"vector",

table = {
fields = {
"copy",
"indexof",
"insert_all",
"key_value_swap",
"shuffle",
}
},

string = {
fields = {
"split",
"trim",
}
},

math = {
fields = {
"hypot",
"sign",
"factorial"
}
},
}
Empty file added mods/core/tools/LICENSE.txt
Empty file.
Empty file added mods/core/tools/README.md
Empty file.
Empty file added mods/core/tools/init.lua
Empty file.
4 changes: 4 additions & 0 deletions mods/core/tools/mod.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name = tools
description =
depends =
optional_depends =
18 changes: 18 additions & 0 deletions mods/player/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,24 @@ local function set_speed(player)
end
end

minetest.register_tool(":", {
description = "My Tool",
inventory_image = "wieldhand.png",
tool_capabilities = {
full_punch_interval = 1.5,
max_drop_level = 1,
groupcaps = {
crumbly = {
maxlevel = 2,
uses = 20,
times = { [1]=1.60, [2]=1.20, [3]=0.80 }
},
},
damage_groups = {fleshy=2},
},
})


minetest.register_globalstep(function(dtime)
for _, player in ipairs(minetest.get_connected_players()) do
set_speed(player)
Expand Down

0 comments on commit a5fc007

Please sign in to comment.