From dbdf09485503903325588512afd4686139853057 Mon Sep 17 00:00:00 2001 From: Dirk Sohler Date: Sun, 30 Sep 2018 19:38:04 +0200 Subject: [PATCH] put replacements where they belong --- init.lua | 16 ---------------- system/use_hammer.lua | 16 ++++++++++++++-- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/init.lua b/init.lua index edc1b07..501c952 100644 --- a/init.lua +++ b/init.lua @@ -4,22 +4,6 @@ uniham.modpath = minetest.get_modpath(minetest.get_current_modname()) uniham.syspath = uniham.modpath..DIR_DELIM..'system' --- Register replacements for the hammer. Entry ID is the ID of the node to --- replace and entry value is the ID of the node to replace with. -uniham.replacements = { - -- sefault stone crushing - ['default:obsidian'] = 'default:stone', - ['default:stone'] = 'default:cobble', - ['default:cobble'] = 'default:gravel', - ['default:gravel'] = 'default:sand', - -- sandstone types to sand - ['default:sandstone'] = 'default:sand', - ['default:desert_sandstone'] = 'default:desert_cobble', - ['default:desert_cobble'] = 'default:desert_sand', - ['default:silver_sandstone'] = 'default:silver_sand', -} - - -- Load mod dofile(uniham.syspath..DIR_DELIM..'use_hammer.lua') dofile(uniham.syspath..DIR_DELIM..'register_hammer.lua') diff --git a/system/use_hammer.lua b/system/use_hammer.lua index eb36e37..2ec7d42 100644 --- a/system/use_hammer.lua +++ b/system/use_hammer.lua @@ -1,5 +1,17 @@ --- Localize -local replacements = uniham.replacements +-- Register replacements for the hammer. Entry ID is the ID of the node to +-- replace and entry value is the ID of the node to replace with. +local replacements = { + -- sefault stone crushing + ['default:obsidian'] = 'default:stone', + ['default:stone'] = 'default:cobble', + ['default:cobble'] = 'default:gravel', + ['default:gravel'] = 'default:sand', + -- sandstone types to sand + ['default:sandstone'] = 'default:sand', + ['default:desert_sandstone'] = 'default:desert_cobble', + ['default:desert_cobble'] = 'default:desert_sand', + ['default:silver_sandstone'] = 'default:silver_sand', +} -- Hammer use function