adminCommands: add set_param2 command
This commit is contained in:
@@ -16,6 +16,25 @@ core.register_chatcommand('list', {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
core.register_chatcommand('set_param2', {
|
||||||
|
privs = {server = true},
|
||||||
|
|
||||||
|
func = function(name, param)
|
||||||
|
local player = core.get_player_by_name(name)
|
||||||
|
if player == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local pos = player:get_pos() - vector.new(0, 0.5, 0)
|
||||||
|
pos = pos:round()
|
||||||
|
|
||||||
|
local node = core.get_node(pos)
|
||||||
|
node.param2 = param
|
||||||
|
core.set_node(pos, node)
|
||||||
|
|
||||||
|
return true, ''
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
AdminListUI:registerOnFormFieldActionMatch('%S+::item_button',function(player, fieldName, fieldValue)
|
AdminListUI:registerOnFormFieldActionMatch('%S+::item_button',function(player, fieldName, fieldValue)
|
||||||
---@type ItemStackString?
|
---@type ItemStackString?
|
||||||
local stack = string.match(fieldName, '(%S+)::item_button')
|
local stack = string.match(fieldName, '(%S+)::item_button')
|
||||||
@@ -47,8 +66,8 @@ end)
|
|||||||
core.register_on_joinplayer(function(player, last_login)
|
core.register_on_joinplayer(function(player, last_login)
|
||||||
player:set_sky({
|
player:set_sky({
|
||||||
sky_color = {
|
sky_color = {
|
||||||
day_sky = '#FCF0ED',
|
day_sky = '#b5e8ff',
|
||||||
day_horizon = '#F1D4C3',
|
day_horizon = '#80bbe2',
|
||||||
},
|
},
|
||||||
type = 'regular',
|
type = 'regular',
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user