Add lua language server checks

This commit is contained in:
Juraj Vajda 2022-11-03 18:14:15 +00:00
commit f7e0ec6b33
46 changed files with 2022 additions and 728 deletions

2
.gitignore vendored
View File

@ -4,3 +4,5 @@ docs/build
*.blend2 *.blend2
*.old *.old
node_modules node_modules
*.log
logs

View File

@ -2,6 +2,19 @@ unused_args = false
allow_defined_top = true allow_defined_top = true
max_line_length = false max_line_length = false
exclude_files = {
'./scripts',
'./bin',
'./logs',
'./node_modules',
'./sounds',
'./textures',
'./models',
'./docs',
'./locale',
'./types',
}
globals = { globals = {
'XBows', 'XBows',
'XBowsQuiver', 'XBowsQuiver',

100
.luarc.json Normal file
View File

@ -0,0 +1,100 @@
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"runtime": {
"version": "Lua 5.1",
"path": [
"?.lua",
"?/init.lua"
],
"pathStrict": true
},
"workspace": {
"maxPreload": 1600,
"preloadFileSize": 1000,
"ignoreDir": [
"/locale/",
"/libs/",
"/3rd",
"/.vscode",
"/meta",
"/.git",
"/docs",
"/bin"
],
"checkThirdParty": false
},
"typeFormat": {
"config": {
"format_line": "false"
}
},
"type": {
"castNumberToInteger": true
},
"doc": {
"privateName": [
"_*"
]
},
"diagnostics": {
"disable": [
"close-non-object"
],
"groupFileStatus": {
"ambiguity": "Any",
"await": "Any",
"duplicate": "Any",
"global": "Any",
"luadoc": "Any",
"redefined": "Any",
"strict": "Any",
"type-check": "Any",
"unbalanced": "Any",
"unused": "Any"
},
"ignoredFiles": "Disable",
"libraryFiles": "Disable",
"neededFileStatus": {
"codestyle-check": "Any"
},
"disableScheme": [
"git",
"type"
],
"globals": [
"DIR_DELIM",
"INIT",
"minetest",
"core",
"dump",
"dump2",
"Raycast",
"Settings",
"PseudoRandom",
"PerlinNoise",
"VoxelManip",
"SecureRandom",
"VoxelArea",
"PerlinNoiseMap",
"PcgRandom",
"ItemStack",
"AreaStore",
"unpack",
"vector",
"player_monoids",
"playerphysics",
"hb",
"mesecon",
"armor",
"default",
"i3",
"unified_inventory",
"player_api",
"u_skins",
"wardrobe",
"3d_armor",
"skinsdb",
"skins"
]
}
}

153
api.lua
View File

@ -51,7 +51,9 @@ XBows = {
x_bows_show_3d_quiver = minetest.settings:get_bool('x_bows_show_3d_quiver', true) x_bows_show_3d_quiver = minetest.settings:get_bool('x_bows_show_3d_quiver', true)
}, },
charge_sound_after_job = {}, charge_sound_after_job = {},
fallback_quiver = not minetest.global_exists('sfinv') and not minetest.global_exists('unified_inventory') and not minetest.global_exists('i3') fallback_quiver = not minetest.global_exists('sfinv')
and not minetest.global_exists('unified_inventory')
and not minetest.global_exists('i3')
} }
XBows.__index = XBows XBows.__index = XBows
@ -135,7 +137,11 @@ function XBows.reset_charged_bow(self, player, includeWielded)
local x_bows_registered_bow_def = self.registered_bows[st_name] local x_bows_registered_bow_def = self.registered_bows[st_name]
local reset = _includeWielded or player:get_wield_index() ~= i local reset = _includeWielded or player:get_wield_index() ~= i
if not st:is_empty() and x_bows_registered_bow_def and reset and minetest.get_item_group(st_name, 'bow_charged') ~= 0 then if not st:is_empty()
and x_bows_registered_bow_def
and reset
and minetest.get_item_group(st_name, 'bow_charged') ~= 0
then
local item_meta = st:get_meta() local item_meta = st:get_meta()
local arrow_itemstack = ItemStack(minetest.deserialize(item_meta:get_string('arrow_itemstack_string'))) local arrow_itemstack = ItemStack(minetest.deserialize(item_meta:get_string('arrow_itemstack_string')))
@ -144,7 +150,11 @@ function XBows.reset_charged_bow(self, player, includeWielded)
if inv:room_for_item('main', { name = arrow_itemstack:get_name() }) then if inv:room_for_item('main', { name = arrow_itemstack:get_name() }) then
inv:add_item('main', arrow_itemstack:get_name()) inv:add_item('main', arrow_itemstack:get_name())
else else
minetest.item_drop(ItemStack({name=arrow_itemstack:get_name(), count=1}), player, player:get_pos()) minetest.item_drop(
ItemStack({ name = arrow_itemstack:get_name(), count = 1 }),
player,
player:get_pos()
)
end end
end end
@ -176,7 +186,10 @@ function XBows.register_bow(self, name, def, override)
def.description = override and def.short_description or (def.description or name) def.description = override and def.short_description or (def.description or name)
def.custom.uses = def.custom.uses or 150 def.custom.uses = def.custom.uses or 150
def.groups = mergeTables({ bow = 1, flammable = 1 }, def.groups or {}) def.groups = mergeTables({ bow = 1, flammable = 1 }, def.groups or {})
def.custom.groups_charged = mergeTables({bow_charged = 1, flammable = 1, not_in_creative_inventory = 1}, def.groups or {}) def.custom.groups_charged = mergeTables(
{ bow_charged = 1, flammable = 1, not_in_creative_inventory = 1 },
def.groups or {}
)
def.custom.strength = def.custom.strength or 30 def.custom.strength = def.custom.strength or 30
def.custom.allowed_ammunition = def.custom.allowed_ammunition or nil def.custom.allowed_ammunition = def.custom.allowed_ammunition or nil
def.custom.sound_load = def.custom.sound_load or 'x_bows_bow_load' def.custom.sound_load = def.custom.sound_load or 'x_bows_bow_load'
@ -261,7 +274,11 @@ function XBows.register_bow(self, name, def, override)
---return arrow ---return arrow
if arrow_itemstack and not self:is_creative(dropper:get_player_name()) then if arrow_itemstack and not self:is_creative(dropper:get_player_name()) then
minetest.item_drop(ItemStack({name=arrow_itemstack:get_name(), count=1}), dropper, {x=pos.x + 0.5, y=pos.y + 0.5, z=pos.z + 0.5}) minetest.item_drop(
ItemStack({ name = arrow_itemstack:get_name(), count = 1 }),
dropper,
{ x = pos.x + 0.5, y = pos.y + 0.5, z = pos.z + 0.5 }
)
end end
itemstack:set_name(def.custom.name) itemstack:set_name(def.custom.name)
@ -363,16 +380,24 @@ function XBows.register_quiver(self, name, def)
def.description = def.description or name def.description = def.description or name
def.short_description = def.short_description or name def.short_description = def.short_description or name
def.groups = mergeTables({ quiver = 1, flammable = 1 }, def.groups or {}) def.groups = mergeTables({ quiver = 1, flammable = 1 }, def.groups or {})
def.custom.groups_charged = mergeTables({quiver = 1, quiver_open = 1, flammable = 1, not_in_creative_inventory = 1}, def.groups or {}) def.custom.groups_charged = mergeTables({
quiver = 1, quiver_open = 1, flammable = 1, not_in_creative_inventory = 1
},
def.groups or {}
)
if def.custom.faster_arrows then if def.custom.faster_arrows then
def.description = def.description .. '\n' .. minetest.colorize('#00FF00', S('Faster Arrows') .. ': ' .. (1 / def.custom.faster_arrows) * 100 .. '%') def.description = def.description .. '\n' .. minetest.colorize('#00FF00', S('Faster Arrows') ..
def.short_description = def.short_description .. '\n' .. minetest.colorize('#00FF00', S('Faster Arrows') .. ': ' .. (1 / def.custom.faster_arrows) * 100 .. '%') ': ' .. (1 / def.custom.faster_arrows) * 100 .. '%')
def.short_description = def.short_description .. '\n' .. minetest.colorize('#00FF00', S('Faster Arrows') ..
': ' .. (1 / def.custom.faster_arrows) * 100 .. '%')
end end
if def.custom.add_damage then if def.custom.add_damage then
def.description = def.description .. '\n' .. minetest.colorize('#FF8080', S('Arrow Damage') .. ': +' .. def.custom.add_damage) def.description = def.description .. '\n' .. minetest.colorize('#FF8080', S('Arrow Damage') ..
def.short_description = def.short_description .. '\n' .. minetest.colorize('#FF8080', S('Arrow Damage') .. ': +' .. def.custom.add_damage) ': +' .. def.custom.add_damage)
def.short_description = def.short_description .. '\n' .. minetest.colorize('#FF8080', S('Arrow Damage') ..
': +' .. def.custom.add_damage)
end end
self.registered_quivers[def.custom.name] = def self.registered_quivers[def.custom.name] = def
@ -424,6 +449,10 @@ function XBows.register_quiver(self, name, def)
---@param pos Vector ---@param pos Vector
---@return ItemStack ---@return ItemStack
on_drop = function(itemstack, dropper, pos) on_drop = function(itemstack, dropper, pos)
if not dropper then
return itemstack
end
local replace_item = XBowsQuiver:get_replacement_item(itemstack, 'x_bows:quiver') local replace_item = XBowsQuiver:get_replacement_item(itemstack, 'x_bows:quiver')
return minetest.item_drop(replace_item, dropper, pos) return minetest.item_drop(replace_item, dropper, pos)
end end
@ -489,9 +518,9 @@ function XBows.load(self, itemstack, user, pointed_thing)
XBowsQuiver:udate_or_create_hud(user, inv:get_list('x_bows:arrow_inv')) XBowsQuiver:udate_or_create_hud(user, inv:get_list('x_bows:arrow_inv'))
else else
---no ammo (fake stack) ---no ammo (fake stack)
XBowsQuiver:udate_or_create_hud(user, {ItemStack({ XBowsQuiver:udate_or_create_hud(user, {
name = 'x_bows:no_ammo' ItemStack({ name = 'x_bows:no_ammo' })
})}) })
end end
---find itemstack arrow in players inventory ---find itemstack arrow in players inventory
@ -544,7 +573,9 @@ function XBows.load(self, itemstack, user, pointed_thing)
wielded_item:set_name(v_bow_name .. '_charged') wielded_item:set_name(v_bow_name .. '_charged')
v_user:set_wielded_item(wielded_item) v_user:set_wielded_item(wielded_item)
if not self:is_creative(v_user:get_player_name()) and v_itemstack_arrow_meta:get_int('is_arrow_from_quiver') ~= 1 then if not self:is_creative(v_user:get_player_name())
and v_itemstack_arrow_meta:get_int('is_arrow_from_quiver') ~= 1
then
v_itemstack_arrow:take_item() v_itemstack_arrow:take_item()
v_inv:set_stack('x_bows:arrow_inv', v_itemstack_arrows[1].idx, v_itemstack_arrow) v_inv:set_stack('x_bows:arrow_inv', v_itemstack_arrows[1].idx, v_itemstack_arrow)
end end
@ -563,7 +594,8 @@ function XBows.load(self, itemstack, user, pointed_thing)
end end
---sound plays when charge time reaches full punch interval time ---sound plays when charge time reaches full punch interval time
table.insert(self.charge_sound_after_job[player_name], minetest.after(_tool_capabilities.full_punch_interval, function(v_user, v_bow_name) table.insert(self.charge_sound_after_job[player_name], minetest.after(_tool_capabilities.full_punch_interval,
function(v_user, v_bow_name)
local wielded_item = v_user:get_wielded_item() local wielded_item = v_user:get_wielded_item()
local wielded_item_name = wielded_item:get_name() local wielded_item_name = wielded_item:get_name()
@ -625,9 +657,9 @@ function XBows.shoot(self, itemstack, user, pointed_thing)
XBowsQuiver:udate_or_create_hud(user, inv:get_list('x_bows:arrow_inv')) XBowsQuiver:udate_or_create_hud(user, inv:get_list('x_bows:arrow_inv'))
else else
---no ammo (fake stack just for the HUD) ---no ammo (fake stack just for the HUD)
XBowsQuiver:udate_or_create_hud(user, {ItemStack({ XBowsQuiver:udate_or_create_hud(user, {
name = 'x_bows:no_ammo' ItemStack({ name = 'x_bows:no_ammo' })
})}) })
end end
end end
@ -954,7 +986,8 @@ function XBowsEntityDef.on_death(self, selfObj, killer)
minetest.item_drop(ItemStack(selfObj._arrow_name), nil, vector.round(selfObj._old_pos)) minetest.item_drop(ItemStack(selfObj._arrow_name), nil, vector.round(selfObj._old_pos))
end end
--- Function receive a "luaentity" table as `self`. Called on every server tick, after movement and collision processing. `dtime`: elapsed time since last call. `moveresult`: table with collision info (only available if physical=true). --- Function receive a "luaentity" table as `self`. Called on every server tick, after movement and collision processing.
---`dtime`: elapsed time since last call. `moveresult`: table with collision info (only available if physical=true).
---@param self XBows ---@param self XBows
---@param selfObj EnityCustomAttrDef ---@param selfObj EnityCustomAttrDef
---@param dtime number ---@param dtime number
@ -1049,7 +1082,10 @@ function XBowsEntityDef.on_step(self, selfObj, dtime)
and pointed_thing.ref ~= selfObj.object and pointed_thing.ref ~= selfObj.object
and pointed_thing.ref:get_hp() > 0 and pointed_thing.ref:get_hp() > 0
and ( and (
(pointed_thing.ref:is_player() and pointed_thing.ref:get_player_name() ~= selfObj._user:get_player_name()) (
pointed_thing.ref:is_player()
and pointed_thing.ref:get_player_name() ~= selfObj._user:get_player_name()
)
or ( or (
pointed_thing.ref:get_luaentity() pointed_thing.ref:get_luaentity()
and pointed_thing.ref:get_luaentity().physical and pointed_thing.ref:get_luaentity().physical
@ -1199,7 +1235,8 @@ function XBowsEntityDef.on_step(self, selfObj, dtime)
return return
end end
---normalize arrow scale when attached to scaled entity (prevents huge arrows when attached to scaled up entity models) ---normalize arrow scale when attached to scaled entity
---(prevents huge arrows when attached to scaled up entity models)
local obj_props = selfObj.object:get_properties() local obj_props = selfObj.object:get_properties()
local obj_to_props = pointed_thing.ref:get_properties() local obj_to_props = pointed_thing.ref:get_properties()
local vs = vector.divide(obj_props.visual_size, obj_to_props.visual_size) local vs = vector.divide(obj_props.visual_size, obj_to_props.visual_size)
@ -1316,7 +1353,10 @@ function XBowsEntityDef.on_step(self, selfObj, dtime)
local projectile_entity = self.registered_arrows[selfObj._arrow_name].custom.projectile_entity local projectile_entity = self.registered_arrows[selfObj._arrow_name].custom.projectile_entity
for _, object in ipairs(minetest.get_objects_inside_radius(pointed_thing.under, 1)) do for _, object in ipairs(minetest.get_objects_inside_radius(pointed_thing.under, 1)) do
if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == projectile_entity then if not object:is_player()
and object:get_luaentity()
and object:get_luaentity().name == projectile_entity
then
table.insert(children, object) table.insert(children, object)
end end
end end
@ -1373,7 +1413,9 @@ function XBowsEntityDef.on_step(self, selfObj, dtime)
selfObj._old_pos = pos selfObj._old_pos = pos
end end
---Function receive a "luaentity" table as `self`. Called when somebody punches the object. Note that you probably want to handle most punches using the automatic armor group system. Can return `true` to prevent the default damage mechanism. ---Function receive a "luaentity" table as `self`. Called when somebody punches the object.
---Note that you probably want to handle most punches using the automatic armor group system.
---Can return `true` to prevent the default damage mechanism.
---@param self XBows ---@param self XBows
---@param selfObj EnityCustomAttrDef ---@param selfObj EnityCustomAttrDef
---@param puncher ObjectRef|nil ---@param puncher ObjectRef|nil
@ -1510,6 +1552,7 @@ end
---Gets arrow from quiver ---Gets arrow from quiver
---@param self XBowsQuiver ---@param self XBowsQuiver
---@param player ObjectRef ---@param player ObjectRef
---@diagnostic disable-next-line: codestyle-check
---@return {["found_arrow_stack"]: ItemStack|nil, ["quiver_id"]: string|nil, ["quiver_name"]: string|nil, ["found_arrow_stack_idx"]: number} ---@return {["found_arrow_stack"]: ItemStack|nil, ["quiver_id"]: string|nil, ["quiver_name"]: string|nil, ["found_arrow_stack_idx"]: number}
function XBowsQuiver.get_itemstack_arrow_from_quiver(self, player) function XBowsQuiver.get_itemstack_arrow_from_quiver(self, player)
local player_inv = player:get_inventory() local player_inv = player:get_inventory()
@ -1591,7 +1634,10 @@ function XBowsQuiver.get_itemstack_arrow_from_quiver(self, player)
table.insert(prev_detached_inv_list, detached_inv:get_stack('main', j)) table.insert(prev_detached_inv_list, detached_inv:get_stack('main', j))
if not qst:is_empty() and not found_arrow_stack then if not qst:is_empty() and not found_arrow_stack then
local is_allowed_ammunition = self:is_allowed_ammunition(wielded_stack:get_name(), qst:get_name()) local is_allowed_ammunition = self:is_allowed_ammunition(
wielded_stack:get_name(),
qst:get_name()
)
if is_allowed_ammunition then if is_allowed_ammunition then
quiver_name = st:get_name() quiver_name = st:get_name()
@ -1990,7 +2036,9 @@ function XBowsQuiver.save(self, inv, player, quiver_is_closed)
local quiver_item_name = quiver_is_closed and 'x_bows:quiver' or 'x_bows:quiver_open' local quiver_item_name = quiver_is_closed and 'x_bows:quiver' or 'x_bows:quiver_open'
local player_quiver_inv_stack = player_inv:get_stack('x_bows:quiver_inv', 1) local player_quiver_inv_stack = player_inv:get_stack('x_bows:quiver_inv', 1)
if not player_quiver_inv_stack:is_empty() and player_quiver_inv_stack:get_meta():get_string('quiver_id') == inv_loc.name then if not player_quiver_inv_stack:is_empty()
and player_quiver_inv_stack:get_meta():get_string('quiver_id') == inv_loc.name
then
local st_meta = player_quiver_inv_stack:get_meta() local st_meta = player_quiver_inv_stack:get_meta()
---save inventory items in quiver item meta ---save inventory items in quiver item meta
local string_from_inventory_result = self:get_string_from_inv(inv) local string_from_inventory_result = self:get_string_from_inv(inv)
@ -1998,7 +2046,8 @@ function XBowsQuiver.save(self, inv, player, quiver_is_closed)
st_meta:set_string('quiver_items', string_from_inventory_result.inv_string) st_meta:set_string('quiver_items', string_from_inventory_result.inv_string)
---update description ---update description
local new_description = player_quiver_inv_stack:get_short_description()..'\n'..string_from_inventory_result.content_description..'\n' local new_description = player_quiver_inv_stack:get_short_description() .. '\n' ..
string_from_inventory_result.content_description .. '\n'
st_meta:set_string('description', new_description) st_meta:set_string('description', new_description)
player_inv:set_stack('x_bows:quiver_inv', 1, player_quiver_inv_stack) player_inv:set_stack('x_bows:quiver_inv', 1, player_quiver_inv_stack)
@ -2009,14 +2058,17 @@ function XBowsQuiver.save(self, inv, player, quiver_is_closed)
for i, st in ipairs(inv_list) do for i, st in ipairs(inv_list) do
local st_meta = st:get_meta() local st_meta = st:get_meta()
if not st:is_empty() and st:get_name() == quiver_item_name and st_meta:get_string('quiver_id') == inv_loc.name then if not st:is_empty() and st:get_name() == quiver_item_name
and st_meta:get_string('quiver_id') == inv_loc.name
then
---save inventory items in quiver item meta ---save inventory items in quiver item meta
local string_from_inventory_result = self:get_string_from_inv(inv) local string_from_inventory_result = self:get_string_from_inv(inv)
st_meta:set_string('quiver_items', string_from_inventory_result.inv_string) st_meta:set_string('quiver_items', string_from_inventory_result.inv_string)
---update description ---update description
local new_description = st:get_short_description()..'\n'..string_from_inventory_result.content_description..'\n' local new_description = st:get_short_description() .. '\n' ..
string_from_inventory_result.content_description .. '\n'
st_meta:set_string('description', new_description) st_meta:set_string('description', new_description)
player_inv:set_stack('main', i, st) player_inv:set_stack('main', i, st)
@ -2037,7 +2089,9 @@ function XBowsQuiver.quiver_can_allow(self, inv, player)
local inv_loc = inv:get_location() local inv_loc = inv:get_location()
local player_quiver_inv_stack = player_inv:get_stack('x_bows:quiver_inv', 1) local player_quiver_inv_stack = player_inv:get_stack('x_bows:quiver_inv', 1)
if not player_quiver_inv_stack:is_empty() and player_quiver_inv_stack:get_meta():get_string('quiver_id') == inv_loc.name then if not player_quiver_inv_stack:is_empty()
and player_quiver_inv_stack:get_meta():get_string('quiver_id') == inv_loc.name
then
---find quiver in player `quiver_inv` inv list ---find quiver in player `quiver_inv` inv list
return true return true
elseif player_inv and player_inv:contains_item('main', 'x_bows:quiver_open') then elseif player_inv and player_inv:contains_item('main', 'x_bows:quiver_open') then
@ -2048,7 +2102,9 @@ function XBowsQuiver.quiver_can_allow(self, inv, player)
for i, st in ipairs(inv_list) do for i, st in ipairs(inv_list) do
local st_meta = st:get_meta() local st_meta = st:get_meta()
if not st:is_empty() and st:get_name() == 'x_bows:quiver_open' and st_meta:get_string('quiver_id') == inv_loc.name then if not st:is_empty() and st:get_name() == 'x_bows:quiver_open'
and st_meta:get_string('quiver_id') == inv_loc.name
then
return true return true
end end
end end
@ -2120,7 +2176,9 @@ function XBowsQuiver.sfinv_register_page(self)
local x_bows_registered_arrow_def = self.registered_arrows[context._itemstack_arrow:get_name()] local x_bows_registered_arrow_def = self.registered_arrows[context._itemstack_arrow:get_name()]
if x_bows_registered_arrow_def then if x_bows_registered_arrow_def then
formspec[#formspec + 1] = 'label[0,1.5;' .. minetest.formspec_escape(context._itemstack_arrow:get_short_description()) .. '\n'.. minetest.formspec_escape(x_bows_registered_arrow_def.custom.description_abilities) ..']' formspec[#formspec + 1] = 'label[0,1.5;' ..
minetest.formspec_escape(context._itemstack_arrow:get_short_description()) .. '\n' ..
minetest.formspec_escape(x_bows_registered_arrow_def.custom.description_abilities) .. ']'
end end
end end
@ -2130,7 +2188,8 @@ function XBowsQuiver.sfinv_register_page(self)
local quiver_id = st_meta:get_string('quiver_id') local quiver_id = st_meta:get_string('quiver_id')
---description ---description
formspec[#formspec + 1] = 'label[3.5,1.5;' .. minetest.formspec_escape(context._itemstack_quiver:get_short_description()) .. ']' formspec[#formspec + 1] = 'label[3.5,1.5;' ..
minetest.formspec_escape(context._itemstack_quiver:get_short_description()) .. ']'
formspec[#formspec + 1] = 'list[detached:' .. quiver_id .. ';main;4.5,0.5;3,1;]' formspec[#formspec + 1] = 'list[detached:' .. quiver_id .. ';main;4.5,0.5;3,1;]'
formspec[#formspec + 1] = 'listring[detached:' .. quiver_id .. ';main]' formspec[#formspec + 1] = 'listring[detached:' .. quiver_id .. ';main]'
formspec[#formspec + 1] = 'listring[current_player;main]' formspec[#formspec + 1] = 'listring[current_player;main]'
@ -2187,7 +2246,9 @@ function XBowsQuiver.i3_register_page(self)
local x_bows_registered_arrow_def = self.registered_arrows[context._itemstack_arrow:get_name()] local x_bows_registered_arrow_def = self.registered_arrows[context._itemstack_arrow:get_name()]
if x_bows_registered_arrow_def then if x_bows_registered_arrow_def then
formspec[#formspec + 1] = 'label[0.5,3;' .. minetest.formspec_escape(context._itemstack_arrow:get_short_description()) .. '\n'.. minetest.formspec_escape(x_bows_registered_arrow_def.custom.description_abilities) ..']' formspec[#formspec + 1] = 'label[0.5,3;' ..
minetest.formspec_escape(context._itemstack_arrow:get_short_description()) .. '\n' ..
minetest.formspec_escape(x_bows_registered_arrow_def.custom.description_abilities) .. ']'
end end
end end
@ -2197,7 +2258,8 @@ function XBowsQuiver.i3_register_page(self)
local quiver_id = st_meta:get_string('quiver_id') local quiver_id = st_meta:get_string('quiver_id')
---description ---description
formspec[#formspec + 1] = 'label[5,3;' .. minetest.formspec_escape(context._itemstack_quiver:get_short_description()) .. ']' formspec[#formspec + 1] = 'label[5,3;' ..
minetest.formspec_escape(context._itemstack_quiver:get_short_description()) .. ']'
formspec[#formspec + 1] = 'list[detached:' .. quiver_id .. ';main;6.3,1.5;3,1;]' formspec[#formspec + 1] = 'list[detached:' .. quiver_id .. ';main;6.3,1.5;3,1;]'
formspec[#formspec + 1] = 'listring[detached:' .. quiver_id .. ';main]' formspec[#formspec + 1] = 'listring[detached:' .. quiver_id .. ';main]'
formspec[#formspec + 1] = 'listring[current_player;main]' formspec[#formspec + 1] = 'listring[current_player;main]'
@ -2239,7 +2301,9 @@ function XBowsQuiver.ui_register_page(self)
local x_bows_registered_arrow_def = self.registered_arrows[context._itemstack_arrow:get_name()] local x_bows_registered_arrow_def = self.registered_arrows[context._itemstack_arrow:get_name()]
if x_bows_registered_arrow_def then if x_bows_registered_arrow_def then
formspec[#formspec + 1] = 'label[0.5,2.5;' .. minetest.formspec_escape(context._itemstack_arrow:get_short_description()) .. '\n'.. minetest.formspec_escape(x_bows_registered_arrow_def.custom.description_abilities) ..']' formspec[#formspec + 1] = 'label[0.5,2.5;' ..
minetest.formspec_escape(context._itemstack_arrow:get_short_description()) .. '\n' ..
minetest.formspec_escape(x_bows_registered_arrow_def.custom.description_abilities) .. ']'
end end
end end
@ -2249,7 +2313,8 @@ function XBowsQuiver.ui_register_page(self)
local quiver_id = st_meta:get_string('quiver_id') local quiver_id = st_meta:get_string('quiver_id')
---description ---description
formspec[#formspec + 1] = 'label[5,2.5;' .. minetest.formspec_escape(context._itemstack_quiver:get_short_description()) .. ']' formspec[#formspec + 1] = 'label[5,2.5;' ..
minetest.formspec_escape(context._itemstack_quiver:get_short_description()) .. ']'
formspec[#formspec + 1] = unified_inventory.single_slot(6.4, 0.9) formspec[#formspec + 1] = unified_inventory.single_slot(6.4, 0.9)
formspec[#formspec + 1] = unified_inventory.single_slot(7.65, 0.9) formspec[#formspec + 1] = unified_inventory.single_slot(7.65, 0.9)
formspec[#formspec + 1] = unified_inventory.single_slot(8.9, 0.9) formspec[#formspec + 1] = unified_inventory.single_slot(8.9, 0.9)
@ -2291,7 +2356,9 @@ function XBowsQuiver.show_3d_quiver(self, player, props)
---cleanup ---cleanup
for index, value in ipairs(textures) do for index, value in ipairs(textures) do
if value == 'x_bows_quiver_blank_mesh.png' or value == 'x_bows_quiver_mesh.png' or value == 'x_bows_quiver_empty_mesh.png' then if value == 'x_bows_quiver_blank_mesh.png' or value == 'x_bows_quiver_mesh.png'
or value == 'x_bows_quiver_empty_mesh.png'
then
table.remove(textures, index) table.remove(textures, index)
end end
end end
@ -2350,7 +2417,9 @@ function XBowsQuiver.show_3d_quiver(self, player, props)
---cleanup ---cleanup
for index, value in ipairs(textures) do for index, value in ipairs(textures) do
if value == 'x_bows_quiver_blank_mesh.png' or value == 'x_bows_quiver_mesh.png' or value == 'x_bows_quiver_empty_mesh.png' then if value == 'x_bows_quiver_blank_mesh.png' or value == 'x_bows_quiver_mesh.png'
or value == 'x_bows_quiver_empty_mesh.png'
then
table.remove(textures, index) table.remove(textures, index)
end end
end end
@ -2385,7 +2454,9 @@ function XBowsQuiver.hide_3d_quiver(self, player)
---cleanup ---cleanup
for index, value in ipairs(textures) do for index, value in ipairs(textures) do
if value == 'x_bows_quiver_mesh.png' or value == 'x_bows_quiver_blank_mesh.png' or value == 'x_bows_quiver_empty_mesh.png' then if value == 'x_bows_quiver_mesh.png' or value == 'x_bows_quiver_blank_mesh.png'
or value == 'x_bows_quiver_empty_mesh.png'
then
table.remove(textures, index) table.remove(textures, index)
end end
end end
@ -2433,7 +2504,9 @@ function XBowsQuiver.hide_3d_quiver(self, player)
---cleanup ---cleanup
for index, value in ipairs(textures) do for index, value in ipairs(textures) do
if value == 'x_bows_quiver_mesh.png' or value == 'x_bows_quiver_blank_mesh.png' or value == 'x_bows_quiver_empty_mesh.png' then if value == 'x_bows_quiver_mesh.png' or value == 'x_bows_quiver_blank_mesh.png'
or value == 'x_bows_quiver_empty_mesh.png'
then
table.remove(textures, index) table.remove(textures, index)
end end
end end

Binary file not shown.

View File

@ -3,34 +3,6 @@ image: atlassian/default-image:3
pipelines: pipelines:
pull-requests: pull-requests:
"**": "**":
- step:
name: Lint code
script:
- apt-get update
- apt-get -y install lua5.1
- apt-get -y install luarocks
- luarocks install luacheck
- luacheck .
branches:
master:
- step:
name: Lint code
script:
- apt-get update
- apt-get -y install lua5.1
- apt-get -y install luarocks
- luarocks install luacheck
- luacheck .
tags:
"*":
- step:
name: Lint code
script:
- apt-get update
- apt-get -y install lua5.1
- apt-get -y install luarocks
- luarocks install luacheck
- luacheck .
- step: - step:
name: Install Node Dependencies name: Install Node Dependencies
caches: caches:
@ -41,6 +13,84 @@ pipelines:
- nvm install v17.2.0 - nvm install v17.2.0
- npm i -g npm@8 - npm i -g npm@8
- npm ci - npm ci
- parallel:
- step:
name: Lua Check
script:
- apt-get update
- apt-get -y install lua5.1
- apt-get -y install luarocks
- luarocks install luacheck
- luacheck .
- step:
name: Lua Diagnostics
caches:
- node-modules
- npm
- nvm
script:
- nvm use v17.2.0
- npm run lua-diagnostics
branches:
master:
- step:
name: Install Node Dependencies
caches:
- node-modules
- npm
- nvm
script:
- nvm install v17.2.0
- npm i -g npm@8
- npm ci
- parallel:
- step:
name: Lua Check
script:
- apt-get update
- apt-get -y install lua5.1
- apt-get -y install luarocks
- luarocks install luacheck
- luacheck .
- step:
name: Lua Diagnostics
caches:
- node-modules
- npm
- nvm
script:
- nvm use v17.2.0
- npm run lua-diagnostics
tags:
"*":
- step:
name: Install Node Dependencies
caches:
- node-modules
- npm
- nvm
script:
- nvm install v17.2.0
- npm i -g npm@8
- npm ci
- parallel:
- step:
name: Lua Check
script:
- apt-get update
- apt-get -y install lua5.1
- apt-get -y install luarocks
- luarocks install luacheck
- luacheck .
- step:
name: Lua Diagnostics
caches:
- node-modules
- npm
- nvm
script:
- nvm use v17.2.0
- npm run lua-diagnostics
- step: - step:
name: Deploy to ContentDB name: Deploy to ContentDB
caches: caches:

View File

@ -311,7 +311,9 @@ minetest.register_globalstep(function(dtime)
XBows.player_bow_sneak[player_name] = {} XBows.player_bow_sneak[player_name] = {}
end end
if minetest.get_item_group(wielded_stack_name, 'bow_charged') ~= 0 and not XBows.player_bow_sneak[player_name].sneak then if minetest.get_item_group(wielded_stack_name, 'bow_charged') ~= 0
and not XBows.player_bow_sneak[player_name].sneak
then
--charged weapon --charged weapon
if XBows.playerphysics then if XBows.playerphysics then
playerphysics.add_physics_factor(player, 'speed', 'x_bows:bow_charged_speed', 0.25) playerphysics.add_physics_factor(player, 'speed', 'x_bows:bow_charged_speed', 0.25)
@ -321,7 +323,9 @@ minetest.register_globalstep(function(dtime)
XBows.player_bow_sneak[player_name].sneak = true XBows.player_bow_sneak[player_name].sneak = true
player:set_fov(0.9, true, 0.4) player:set_fov(0.9, true, 0.4)
elseif minetest.get_item_group(wielded_stack_name, 'bow_charged') == 0 and XBows.player_bow_sneak[player_name].sneak then elseif minetest.get_item_group(wielded_stack_name, 'bow_charged') == 0
and XBows.player_bow_sneak[player_name].sneak
then
if XBows.playerphysics then if XBows.playerphysics then
playerphysics.remove_physics_factor(player, 'speed', 'x_bows:bow_charged_speed') playerphysics.remove_physics_factor(player, 'speed', 'x_bows:bow_charged_speed')
elseif XBows.player_monoids then elseif XBows.player_monoids then

925
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,8 @@
}, },
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"push:ci": "node ./scripts/deploy" "push:ci": "node ./scripts/deploy",
"lua-diagnostics": "node ./scripts/lls-check"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -26,6 +27,7 @@
}, },
"homepage": "https://bitbucket.org/minetest_gamers/x_bows#readme", "homepage": "https://bitbucket.org/minetest_gamers/x_bows#readme",
"devDependencies": { "devDependencies": {
"jaguar": "^6.0.1",
"node-fetch": "^3.2.10", "node-fetch": "^3.2.10",
"yargs": "^17.6.1" "yargs": "^17.6.1"
} }

93
scripts/lls-check.js Normal file
View File

@ -0,0 +1,93 @@
import * as path from 'node:path'
import * as fs from 'node:fs'
import {exec} from 'node:child_process'
import yargs from 'yargs/yargs'
import {hideBin} from 'yargs/helpers'
import jaguar from 'jaguar'
const argv = yargs(hideBin(process.argv)).argv
const cwd = process.cwd()
const logPath = path.join(cwd, 'logs')
// Extract lua language server
const from = path.join(cwd, 'bin/lua-language-server-3.5.6-linux-x64.tar.gz');
const to = path.join(cwd, 'bin', 'lua-language-server-3.5.6-linux-x64');
const extract = jaguar.extract(from, to)
// extract.on('file', (name) => {
// console.log(name)
// })
extract.on('start', () => {
console.log('Extracting...')
})
// extract.on('progress', (percent) => {
// console.log(percent + '%')
// })
extract.on('error', (error) => {
console.error(error)
process.exit(1)
})
extract.on('end', () => {
console.log('Extracting: Done')
// Delete directory recursively
try {
fs.rmSync(logPath, { recursive: true, force: true })
console.log(`Removed folder: ${logPath}`)
} catch (err) {
console.error(`Error while deleting ${logPath}.`)
console.error(err)
}
let command = './bin/lua-language-server-3.5.6-linux-x64/bin/lua-language-server'
if (argv.local) {
command = 'lua-language-server'
}
exec(`${command} --logpath "${logPath}" --check "${cwd}"`, (error, stdout, stderr) => {
if (error) {
console.log(`error: ${error.message}`)
process.exit(1)
}
if (stderr) {
console.log(`stderr: ${stderr}`)
process.exit(1)
}
console.log(`\n${stdout}`)
if (fs.existsSync('./logs/check.json')) {
const rawdata = fs.readFileSync('./logs/check.json')
const diagnosticsJson = JSON.parse(rawdata)
Object.keys(diagnosticsJson).forEach((key) => {
console.log(key)
diagnosticsJson[key].forEach((errObj) => {
console.log(`line: ${errObj.range.start.line} - ${errObj.message}`)
})
})
console.error('Fix the errors/warnings above.')
process.exit(1)
}
// Delete directory recursively
const llsFolder = path.join(cwd, 'bin', 'lua-language-server-3.5.6-linux-x64')
try {
fs.rmSync(llsFolder, { recursive: true, force: true })
console.log(`Removed folder: ${llsFolder}`)
} catch (err) {
console.error(`Error while deleting ${llsFolder}.`)
console.error(err)
process.exit(1)
}
})
})

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---@alias ColorSpec string|ColorSpecTable A ColorSpec specifies a 32-bit color. It can be written in any of the following forms: `colorspec = {a=255, r=0, g=255, b=0}`, numerical form: The raw integer value of an ARGB8 quad: `colorspec = 0xFF00FF00`, string form: A ColorString (defined above): `colorspec = "green"` ---@alias ColorSpec string|ColorSpecTable A ColorSpec specifies a 32-bit color. It can be written in any of the following forms: `colorspec = {a=255, r=0, g=255, b=0}`, numerical form: The raw integer value of an ARGB8 quad: `colorspec = 0xFF00FF00`, string form: A ColorString (defined above): `colorspec = "green"`

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---Crafting recipes ---Crafting recipes

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---The varying types of decorations that can be placed. ---The varying types of decorations that can be placed.

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---Entity definition ---Entity definition

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---@alias Dump fun(obj: any, dumped?: any): string returns a string which makes `obj` human-readable, `obj`: arbitrary variable, `dumped`: table, default: `{}` ---@alias Dump fun(obj: any, dumped?: any): string returns a string which makes `obj` human-readable, `obj`: arbitrary variable, `dumped`: table, default: `{}`

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
--An `InvRef` is a reference to an inventory. --An `InvRef` is a reference to an inventory.

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---Minetest item definition. Used by `minetest.register_node`, `minetest.register_craftitem`, and `minetest.register_tool`. ---Minetest item definition. Used by `minetest.register_node`, `minetest.register_craftitem`, and `minetest.register_tool`.

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---A native C++ format with many helper methods. Useful for converting between formats. ---A native C++ format with many helper methods. Useful for converting between formats.

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
--- In a game, a certain number of these must be set to tell core mapgens which of the game's nodes are to be used for core mapgen generation. --- In a game, a certain number of these must be set to tell core mapgens which of the game's nodes are to be used for core mapgen generation.

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check, duplicate-doc-alias
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---@alias mathlib mathlib|MathAbstract ---@alias mathlib mathlib|MathAbstract

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---@alias ItemStackMetaRef MetaDataRef|ItemStackMetaRefAbstract ---@alias ItemStackMetaRef MetaDataRef|ItemStackMetaRefAbstract

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---Minetest globals ---Minetest globals
@ -68,7 +69,7 @@
---@field register_on_player_receive_fields fun(func: fun(player: ObjectRef, formname: string, fields: table)): nil Called when the server received input from `player` in a formspec with the given `formname`. Specifically, this is called on any of the following events: a button was pressed, Enter was pressed while the focus was on a text field, a checkbox was toggled, something was selected in a dropdown list, a different tab was selected, selection was changed in a textlist or table, an entry was double-clicked in a textlist or table, a scrollbar was moved, or the form was actively closed by the player. ---@field register_on_player_receive_fields fun(func: fun(player: ObjectRef, formname: string, fields: table)): nil Called when the server received input from `player` in a formspec with the given `formname`. Specifically, this is called on any of the following events: a button was pressed, Enter was pressed while the focus was on a text field, a checkbox was toggled, something was selected in a dropdown list, a different tab was selected, selection was changed in a textlist or table, an entry was double-clicked in a textlist or table, a scrollbar was moved, or the form was actively closed by the player.
---@field get_inventory fun(location: {['"type"']: 'player'|'node'|'detached', ['"name"']: string|nil, ['"pos"']: Vector|nil}): InvRef ---@field get_inventory fun(location: {['"type"']: 'player'|'node'|'detached', ['"name"']: string|nil, ['"pos"']: Vector|nil}): InvRef
---@field dir_to_wallmounted fun(dir: Vector): number Convert a vector to a wallmounted value, used for `paramtype2="wallmounted"` ---@field dir_to_wallmounted fun(dir: Vector): number Convert a vector to a wallmounted value, used for `paramtype2="wallmounted"`
---@field item_place_node fun(itemstack: ItemStack, placer: ObjectRef, pointed_thing: PointedThingDef, param2?: , prevent_after_place?: boolean): Vector|nil Place item as a node, `param2` overrides `facedir` and wallmounted `param2`, `prevent_after_place`: if set to `true`, `after_place_node` is not called or the newly placed node to prevent a callback and placement loop. returns `itemstack, position`, `position`: the location the node was placed to. `nil` if nothing was placed. ---@field item_place_node fun(itemstack: ItemStack, placer: ObjectRef, pointed_thing: PointedThingDef, param2?: string , prevent_after_place?: boolean): Vector|nil Place item as a node, `param2` overrides `facedir` and wallmounted `param2`, `prevent_after_place`: if set to `true`, `after_place_node` is not called or the newly placed node to prevent a callback and placement loop. returns `itemstack, position`, `position`: the location the node was placed to. `nil` if nothing was placed.
---@field unregister_item fun(name: string): nil Unregisters the item from the engine, and deletes the entry with key `name` from `minetest.registered_items` and from the associated item table according to its nature: `minetest.registered_nodes`, etc. ---@field unregister_item fun(name: string): nil Unregisters the item from the engine, and deletes the entry with key `name` from `minetest.registered_items` and from the associated item table according to its nature: `minetest.registered_nodes`, etc.
---@field register_allow_player_inventory_action fun(func: fun(player: ObjectRef, action: string, inventory: InvRef, inventory_info: {["from_list"]: string, ["to_list"]: string, ["from_index"]: number, ["to_index"]: number, ["count"]: number} | {["listname"]: string, ["index"]: number, ["stack"]: ItemStack}): number): nil Determines how much of a stack may be taken, put or moved to a player inventory. `player` (type `ObjectRef`) is the player who modified the inventory, `inventory` (type `InvRef`). List of possible `action` (string) values and their `inventory_info` (table) contents: `move`: `{from_list=string, to_list=string, from_index=number, to_index=number, count=number}`, `put`: `{listname=string, index=number, stack=ItemStack}`, `take`: Same as `put`. Return a numeric value to limit the amount of items to be taken, put or moved. A value of `-1` for `take` will make the source stack infinite. ---@field register_allow_player_inventory_action fun(func: fun(player: ObjectRef, action: string, inventory: InvRef, inventory_info: {["from_list"]: string, ["to_list"]: string, ["from_index"]: number, ["to_index"]: number, ["count"]: number} | {["listname"]: string, ["index"]: number, ["stack"]: ItemStack}): number): nil Determines how much of a stack may be taken, put or moved to a player inventory. `player` (type `ObjectRef`) is the player who modified the inventory, `inventory` (type `InvRef`). List of possible `action` (string) values and their `inventory_info` (table) contents: `move`: `{from_list=string, to_list=string, from_index=number, to_index=number, count=number}`, `put`: `{listname=string, index=number, stack=ItemStack}`, `take`: Same as `put`. Return a numeric value to limit the amount of items to be taken, put or moved. A value of `-1` for `take` will make the source stack infinite.
---@field register_on_player_inventory_action fun(func: fun(player: ObjectRef, action: string, inventory: InvRef, inventory_info: {["from_list"]: string, ["to_list"]: string, ["from_index"]: number, ["to_index"]: number, ["count"]: number} | {["listname"]: string, ["index"]: number, ["stack"]: ItemStack}): nil): nil Called after a take, put or move event from/to/in a player inventory. Function arguments: see `minetest.register_allow_player_inventory_action`. Does not accept or handle any return value. ---@field register_on_player_inventory_action fun(func: fun(player: ObjectRef, action: string, inventory: InvRef, inventory_info: {["from_list"]: string, ["to_list"]: string, ["from_index"]: number, ["to_index"]: number, ["count"]: number} | {["listname"]: string, ["index"]: number, ["stack"]: ItemStack}): nil): nil Called after a take, put or move event from/to/in a player inventory. Function arguments: see `minetest.register_allow_player_inventory_action`. Does not accept or handle any return value.

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---Minetest game creative mod ---Minetest game creative mod

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---Minetest game default mod ---Minetest game default mod

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---Minetest game dungeon loot mod API ---Minetest game dungeon loot mod API

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---Minetest game farming mod ---Minetest game farming mod

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---The player API can register player models and update the player's appearance. ---The player API can register player models and update the player's appearance.
---@class MtgPlayerApi ---@class MtgPlayerApi
---@field globalstep fun(dtime: number, ...): nil The function called by the globalstep that controls player animations. You can override this to replace the globalstep with your own implementation. Receives all args that minetest.register_globalstep() passes ---@field globalstep fun(dtime: number, ...): nil The function called by the globalstep that controls player animations. You can override this to replace the globalstep with your own implementation. Receives all args that minetest.register_globalstep() passes

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---Minetest game screwdriver mod ---Minetest game screwdriver mod

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---Sfinv API ---Sfinv API
---@class Sfinv ---@class Sfinv
---@field register_page fun(name: string, def: SfinvDef): nil Register a page ---@field register_page fun(name: string, def: SfinvDef): nil Register a page

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---Minetest game stairs mod ---Minetest game stairs mod

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---@alias NodeDef NodeDefAbstract | NodeDefMtgFarming ---@alias NodeDef NodeDefAbstract | NodeDefMtgFarming

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---Node Timers: a high resolution persistent per-node timer. Can be gotten via `minetest.get_node_timer(pos)`. ---Node Timers: a high resolution persistent per-node timer. Can be gotten via `minetest.get_node_timer(pos)`.

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---@alias ObjectRef ObjectRefAbstract | ObjectRefLuaEntityRef ---@alias ObjectRef ObjectRefAbstract | ObjectRefLuaEntityRef

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
--- ParticleSpawner definition --- ParticleSpawner definition

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---Pointed thing definition ---Pointed thing definition

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---A raycast on the map. It works with selection boxes. The map is loaded as the ray advances. If the map is modified after the `Raycast` is created, the changes may or may not have an effect on the object. ---A raycast on the map. It works with selection boxes. The map is loaded as the ray advances. If the map is modified after the `Raycast` is created, the changes may or may not have an effect on the object.

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---Specifies a sound name, gain (=volume) and pitch. This is either a string or a table. In string form, you just specify the sound name or the empty string for no sound. ---Specifies a sound name, gain (=volume) and pitch. This is either a string or a table. In string form, you just specify the sound name or the empty string for no sound.

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check, duplicate-doc-alias
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---@alias string string|StringAbstract ---@alias string string|StringAbstract

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check, duplicate-doc-alias
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
---@alias tablelib tablelib|TableAbstract ---@alias tablelib tablelib|TableAbstract

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---Base class Unified Inventory ---Base class Unified Inventory
---@class UnifiedInventory ---@class UnifiedInventory
---@field set_inventory_formspec fun(player: ObjectRef, formspecname: string): nil ---@field set_inventory_formspec fun(player: ObjectRef, formspecname: string): nil

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---https://github.com/sumneko/lua-language-server/wiki ---https://github.com/sumneko/lua-language-server/wiki
------All `vector.*` functions allow vectors `{x = X, y = Y, z = Z}` without metatables. Returned vectors always have a metatable set. ------All `vector.*` functions allow vectors `{x = X, y = Y, z = Z}` without metatables. Returned vectors always have a metatable set.

View File

@ -1,3 +1,4 @@
---@diagnostic disable: codestyle-check
---Base class XBows ---Base class XBows
---@class XBows ---@class XBows
---@field pvp boolean ---@field pvp boolean
@ -16,7 +17,7 @@
---@field registered_particle_spawners table<string, ParticlespawnerDef|ParticlespawnerDefCustom> ---@field registered_particle_spawners table<string, ParticlespawnerDef|ParticlespawnerDefCustom>
---@field registered_entities table<string, XBowsEntityDef> ---@field registered_entities table<string, XBowsEntityDef>
---@field player_bow_sneak table<string, table<string, boolean>> ---@field player_bow_sneak table<string, table<string, boolean>>
---@field settings {["x_bows_attach_arrows_to_entities"]: boolean, ["x_bows_show_damage_numbers"]: boolean, ["x_bows_show_3d_quiver"]: boolean} ---@field settings {["x_bows_attach_arrows_to_entities"]: boolean | nil, ["x_bows_show_damage_numbers"]: boolean | nil, ["x_bows_show_3d_quiver"]: boolean | nil}
---@field quiver table Quiver class ---@field quiver table Quiver class
---@field charge_sound_after_job table<string, JobTable> ---@field charge_sound_after_job table<string, JobTable>
---@field is_allowed_ammunition fun(self: XBows, weapon_name: string, ammo_name: string): boolean Check if ammunition is allowed to charge this weapon ---@field is_allowed_ammunition fun(self: XBows, weapon_name: string, ammo_name: string): boolean Check if ammunition is allowed to charge this weapon