From a040355dce5246019531b217c8e203673402ebbc Mon Sep 17 00:00:00 2001 From: AFCMS Date: Tue, 30 Mar 2021 01:00:51 +0200 Subject: [PATCH] Revert "Revert "Revert "improve wieldview API (!)""" This reverts commit d4e0d4d1c107d4c0ce6b6093ccac7cfe44c169ae. --- mods/ITEMS/screwdriver/init.lua | 14 +++++--------- mods/ITEMS/screwdriver/mod.conf | 3 +-- mods/PLAYER/wieldview/transform.lua | 12 +++++++----- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/mods/ITEMS/screwdriver/init.lua b/mods/ITEMS/screwdriver/init.lua index 364032a15..e6aedf19c 100644 --- a/mods/ITEMS/screwdriver/init.lua +++ b/mods/ITEMS/screwdriver/init.lua @@ -1,7 +1,5 @@ local S = minetest.get_translator("screwdriver") -local has_wieldview = minetest.get_modpath("wieldview") - screwdriver = {} screwdriver.ROTATE_FACE = 1 @@ -178,7 +176,7 @@ minetest.register_tool("screwdriver:screwdriver", { description = S("Screwdriver"), inventory_image = "screwdriver.png", wield_image = "screwdriver.png^[transformFX", - groups = { tool = 1 }, --not in creative inventory? + groups = { tool = 1, not_in_creative_inventory = 1 }, on_use = function(itemstack, user, pointed_thing) screwdriver.handler(itemstack, user, pointed_thing, screwdriver.ROTATE_FACE, 200) return itemstack @@ -199,9 +197,7 @@ minetest.register_craft({ } }) -for i = 1, 4 do - minetest.register_alias("screwdriver:screwdriver"..tostring(i), "screwdriver:screwdriver") - if has_wieldview then - wieldview.register_transform("screwdriver:screwdriver"..tostring(i), "R90") - end -end \ No newline at end of file +minetest.register_alias("screwdriver:screwdriver1", "screwdriver:screwdriver") +minetest.register_alias("screwdriver:screwdriver2", "screwdriver:screwdriver") +minetest.register_alias("screwdriver:screwdriver3", "screwdriver:screwdriver") +minetest.register_alias("screwdriver:screwdriver4", "screwdriver:screwdriver") diff --git a/mods/ITEMS/screwdriver/mod.conf b/mods/ITEMS/screwdriver/mod.conf index 5d7800c71..a18279839 100644 --- a/mods/ITEMS/screwdriver/mod.conf +++ b/mods/ITEMS/screwdriver/mod.conf @@ -1,3 +1,2 @@ name = screwdriver -depends = mcl_wip -optional_depends = wieldview \ No newline at end of file +depends = mcl_wip \ No newline at end of file diff --git a/mods/PLAYER/wieldview/transform.lua b/mods/PLAYER/wieldview/transform.lua index b55621d7e..a19956796 100644 --- a/mods/PLAYER/wieldview/transform.lua +++ b/mods/PLAYER/wieldview/transform.lua @@ -1,8 +1,10 @@ -- Wielded Item Transformations - http://dev.minetest.net/texture -wieldview.register_transform = function(item, rotation) - wieldview.transform[item] = rotation -end - -wieldview.transform = {} +wieldview.transform = { + ["screwdriver:screwdriver"]="R90", + ["screwdriver:screwdriver1"]="R90", + ["screwdriver:screwdriver2"]="R90", + ["screwdriver:screwdriver3"]="R90", + ["screwdriver:screwdriver4"]="R90", +}