mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-07-17 23:20:23 +02:00
[pclasses] Remove active detection, introduce class switch orbs
This commit is contained in:
20
mods/pclasses/nodes.lua
Normal file
20
mods/pclasses/nodes.lua
Normal file
@ -0,0 +1,20 @@
|
||||
function pclasses.register_class_switch_orb(cname, color)
|
||||
color = color or { r = 255, g = 255, b = 255 }
|
||||
local txtcolor = string.format("#%02x%02x%02x", color.r, color.g, color.b)
|
||||
local overlay = "pclasses_class_switch_orb_overlay.png"
|
||||
minetest.register_node(":pclasses:class_switch_orb_" .. cname, {
|
||||
description = "Class switch orb (" .. cname .. ")",
|
||||
tiles = {overlay .. "^[colorize:" .. txtcolor .. "^" .. overlay},
|
||||
drop = "",
|
||||
can_dig = function() return false end,
|
||||
diggable = false,
|
||||
sunlight_propagates = true,
|
||||
light_source = 10,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
groups = {not_in_creative_inventory=1},
|
||||
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||
-- TODO implement timeout logic
|
||||
pclasses.api.set_player_class(player:get_player_name(), cname)
|
||||
end
|
||||
})
|
||||
end
|
Reference in New Issue
Block a user