forked from VoxeLibre/VoxeLibre
Prevent placement of meshhand nodes
This commit is contained in:
parent
748b5d4a4b
commit
e64ef6e254
|
@ -6,18 +6,34 @@ local def = minetest.registered_items[""]
|
||||||
if has_mcl_skins == true then
|
if has_mcl_skins == true then
|
||||||
--generate a node for every skin
|
--generate a node for every skin
|
||||||
for _,texture in pairs(mcl_skins.list) do
|
for _,texture in pairs(mcl_skins.list) do
|
||||||
|
-- This is a fake node that should never be placed in the world
|
||||||
minetest.register_node("mcl_meshhand:"..texture, {
|
minetest.register_node("mcl_meshhand:"..texture, {
|
||||||
description = "",
|
description = "",
|
||||||
tiles = {texture..".png"},
|
tiles = {texture..".png"},
|
||||||
inventory_image = "blank.png",
|
inventory_image = "wieldhand.png",
|
||||||
visual_scale = 1,
|
visual_scale = 1,
|
||||||
wield_scale = {x=1,y=1,z=1},
|
wield_scale = {x=1,y=1,z=1},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
drawtype = "mesh",
|
drawtype = "mesh",
|
||||||
mesh = "mcl_meshhand.b3d",
|
mesh = "mcl_meshhand.b3d",
|
||||||
|
-- Prevent placement
|
||||||
node_placement_prediction = "",
|
node_placement_prediction = "",
|
||||||
|
on_construct = function(pos)
|
||||||
|
minetest.log("error", "[mcl_meshhand] Trying to construct mcl_meshhand:"..texture.." at "..minetest.pos_to_string(pos))
|
||||||
|
minetest.remove_node(pos)
|
||||||
|
end,
|
||||||
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
|
local spos = "<somewhere>"
|
||||||
|
if pointed_thing.above then
|
||||||
|
spos = minetest.pos_to_string(pointed_thing.above)
|
||||||
|
end
|
||||||
|
minetest.log("error", "[mcl_meshhand] Player tried to place mcl_meshhand:"..texture.." at "..spos)
|
||||||
|
itemstack:set_count(0)
|
||||||
|
return itemstack
|
||||||
|
end,
|
||||||
|
groups = { dig_immediate = 3, not_in_creative_inventory = 1 },
|
||||||
range = def.range,
|
range = def.range,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
--change the player's hand to their skin
|
--change the player's hand to their skin
|
||||||
mcl_skins.register_on_set_skin(function(player, skin)
|
mcl_skins.register_on_set_skin(function(player, skin)
|
||||||
|
@ -30,13 +46,28 @@ else
|
||||||
minetest.register_node("mcl_meshhand:hand", {
|
minetest.register_node("mcl_meshhand:hand", {
|
||||||
description = "",
|
description = "",
|
||||||
tiles = {"character.png"},
|
tiles = {"character.png"},
|
||||||
inventory_image = "blank.png",
|
inventory_image = "wieldhand.png",
|
||||||
visual_scale = 1,
|
visual_scale = 1,
|
||||||
wield_scale = {x=1,y=1,z=1},
|
wield_scale = {x=1,y=1,z=1},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
drawtype = "mesh",
|
drawtype = "mesh",
|
||||||
mesh = "mcl_meshhand.b3d",
|
mesh = "mcl_meshhand.b3d",
|
||||||
|
-- Prevent placement
|
||||||
node_placement_prediction = "",
|
node_placement_prediction = "",
|
||||||
|
on_construct = function(pos)
|
||||||
|
minetest.log("error", "[mcl_meshhand] Trying to construct mcl_meshhand:hand at "..minetest.pos_to_string(pos))
|
||||||
|
minetest.remove_node(pos)
|
||||||
|
end,
|
||||||
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
|
local spos = "<somewhere>"
|
||||||
|
if pointed_thing.above then
|
||||||
|
spos = minetest.pos_to_string(pointed_thing.above )
|
||||||
|
end
|
||||||
|
minetest.log("error", "[mcl_meshhand] Player tried to place mcl_meshhand:hand at "..spos)
|
||||||
|
itemstack:set_count(0)
|
||||||
|
return itemstack
|
||||||
|
end,
|
||||||
|
groups = { dig_immediate = 3, not_in_creative_inventory = 1 },
|
||||||
range = def.range,
|
range = def.range,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue