use more descriptive function/file name

This commit is contained in:
Dirk Sohler 2018-09-30 19:42:44 +02:00
parent dbdf094855
commit 691790c8a6
No known key found for this signature in database
GPG Key ID: B9751241BD7D4E1A
3 changed files with 6 additions and 6 deletions

@ -5,7 +5,7 @@ uniham.syspath = uniham.modpath..DIR_DELIM..'system'
-- Load mod
dofile(uniham.syspath..DIR_DELIM..'use_hammer.lua')
dofile(uniham.syspath..DIR_DELIM..'crush_nodes.lua')
dofile(uniham.syspath..DIR_DELIM..'register_hammer.lua')
dofile(uniham.syspath..DIR_DELIM..'registry.lua')
@ -16,4 +16,4 @@ dofile(uniham.syspath..DIR_DELIM..'registry.lua')
uniham.replacements = nil
uniham.syspath = nil
uniham.modpath = nil
uniham.use_hammer = nil
uniham.crush_nodes = nil

@ -25,7 +25,7 @@ local replacements = {
-- @param pointed_thing The `pointed_thing` as per on_use definition
-- @see <https://dev.minetest.net/on_use#on_use>
-- @return itemstack|void
uniham.use_hammer = function (itemstack, player, pointed_thing)
uniham.crush_nodes = function (itemstack, player, pointed_thing)
if pointed_thing.type ~= 'node' then return end
local node_pos = minetest.get_pointed_thing_position(pointed_thing)
local node_name = minetest.get_node(node_pos).name

@ -1,5 +1,5 @@
-- Localize
local use_hammer = uniham.use_hammer
local crush_nodes = uniham.crush_nodes
-- Register a new hammer
@ -41,7 +41,7 @@ local use_hammer = uniham.use_hammer
-- modify and return the itemstack as needed.
--
-- If no function is provided the default function (replace nodes by the table
-- provided as `uniham.use_hammer` in mod loading state).
-- provided as `uniham.crush_nodes` in mod loading state).
--
-- `uses` is added as `_uniham.uses` to the hammers item definition and can
-- be used by the custom `on_use` function. The built-in function (replacing
@ -53,7 +53,7 @@ local use_hammer = uniham.use_hammer
-- @see <https://dev.minetest.net/minetest.register_craft>
-- @return void
uniham.register_hammer = function (short_id, definition)
local on_use = definition.on_use or use_hammer
local on_use = definition.on_use or crush_nodes
local autotexture = '([combine:16x16:-1,1=+s)^((+h^+m)^[makealpha:0,0,0)'
local hammer_id = minetest.get_current_modname()..':'..short_id
local texture = ''