From 7d8c33c647fc6a469ce87628e5cdf9fd860ca1cf Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 14 Dec 2020 14:27:20 +0100 Subject: [PATCH] Some minor cleanup in mcl_enchanting --- mods/ITEMS/mcl_enchanting/init.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_enchanting/init.lua b/mods/ITEMS/mcl_enchanting/init.lua index fbfc806193..2e718d8e07 100644 --- a/mods/ITEMS/mcl_enchanting/init.lua +++ b/mods/ITEMS/mcl_enchanting/init.lua @@ -103,6 +103,7 @@ minetest.register_chatcommand("enchant", { minetest.register_chatcommand("forceenchant", { description = S("Forcefully enchant an item"), params = S(" []"), + privs = {give = true}, func = function(_, param) local sparam = param:split(" ") local target_name = sparam[1] @@ -181,6 +182,11 @@ minetest.register_entity("mcl_enchanting:book", { end, }) +local rotate +if minetest.get_modpath("screwdriver") then + rotate = screwdriver.rotate_simple +end + minetest.register_node("mcl_enchanting:table", { description = S("Enchanting Table"), drawtype = "nodebox", @@ -190,8 +196,8 @@ minetest.register_node("mcl_enchanting:table", { fixed = {-0.5, -0.5, -0.5, 0.5, 0.25, 0.5}, }, sounds = mcl_sounds.node_sound_stone_defaults(), - groups = {pickaxey = 2}, - on_rotate = (rawget(_G, "screwdriver") or {}).rotate_simple, + groups = {pickaxey = 2, deco_block = 1}, + on_rotate = rotate, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) local player_meta = clicker:get_meta() local table_meta = minetest.get_meta(pos) @@ -237,7 +243,7 @@ minetest.register_craft({ }) minetest.register_abm({ - name = "Enchanting table bookshelf particles", + label = "Enchanting table bookshelf particles", interval = 1, chance = 1, nodenames = "mcl_enchanting:table",