mirror of
https://github.com/mt-mods/spacesuit.git
synced 2026-05-04 05:46:52 -06:00
luacheck and fixes / no dep on vacuum
This commit is contained in:
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
name: luacheck
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: apt
|
||||
run: sudo apt-get install -y luarocks
|
||||
- name: luacheck install
|
||||
run: luarocks install --local luacheck
|
||||
- name: luacheck run
|
||||
run: $HOME/.luarocks/bin/luacheck ./
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
unused_args = false
|
||||
allow_defined_top = true
|
||||
|
||||
globals = {
|
||||
"spacesuit",
|
||||
}
|
||||
|
||||
read_globals = {
|
||||
-- Stdlib
|
||||
string = {fields = {"split"}},
|
||||
table = {fields = {"copy", "getn"}},
|
||||
"call",
|
||||
|
||||
-- Minetest
|
||||
"minetest",
|
||||
"vector", "ItemStack",
|
||||
"dump", "VoxelArea",
|
||||
|
||||
-- Deps
|
||||
"unified_inventory", "default", "monitoring",
|
||||
"armor"
|
||||
}
|
||||
@@ -1,3 +1,2 @@
|
||||
default
|
||||
3d_armor
|
||||
vacuum?
|
||||
|
||||
+2
-4
@@ -8,9 +8,7 @@ minetest.register_globalstep(function(dtime)
|
||||
local t0 = minetest.get_us_time()
|
||||
|
||||
for _,player in ipairs(minetest.get_connected_players()) do
|
||||
local name = player:get_player_name()
|
||||
|
||||
local name, armor_inv = armor.get_valid_player(armor, player, "[spacesuit]")
|
||||
local _, armor_inv = armor.get_valid_player(armor, player, "[spacesuit]")
|
||||
|
||||
local has_helmet = armor_inv:contains_item("armor", "spacesuit:helmet")
|
||||
local has_chestplate = armor_inv:contains_item("armor", "spacesuit:chestplate")
|
||||
@@ -30,7 +28,7 @@ minetest.register_globalstep(function(dtime)
|
||||
if not stack:is_empty() then
|
||||
local name = stack:get_name()
|
||||
if name:sub(1, 10) == "spacesuit:" then
|
||||
local use = minetest.get_item_group(name, "armor_use") * timer or 0
|
||||
local use = minetest.get_item_group(name, "armor_use") * timer or 0
|
||||
armor:damage(player, i, stack, use)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -161,9 +161,6 @@ spacesuit.set_player_wearing = function(player, has_full_suit, has_helmet, armor
|
||||
-- player wears it
|
||||
update_hud(player, has_full_suit, armor_list)
|
||||
|
||||
elseif not hud_data and not has_helmet then
|
||||
-- player does not wear it
|
||||
|
||||
elseif hud_data and not has_helmet then
|
||||
-- player stopped wearing
|
||||
remove_hud(player)
|
||||
@@ -177,5 +174,3 @@ spacesuit.set_player_wearing = function(player, has_full_suit, has_helmet, armor
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
# Intro
|
||||
|
||||
Spacesuit for minetest
|
||||
Spacesuit mod for minetest
|
||||
|
||||
# Dependencies
|
||||
* 3d_armor
|
||||
* vacuum?
|
||||
|
||||
# Features
|
||||
* Breathe in vacuum or water
|
||||
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
local has_vacuum = minetest.get_modpath("vacuum")
|
||||
|
||||
if has_vacuum then
|
||||
|
||||
function repair_recipe(partname)
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = partname,
|
||||
recipe = {
|
||||
"vacuum:air_bottle",
|
||||
partname
|
||||
},
|
||||
replacements = {
|
||||
{"vacuum:air_bottle", "vessels:steel_bottle"}
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
repair_recipe("spacesuit:helmet")
|
||||
repair_recipe("spacesuit:chestplate")
|
||||
repair_recipe("spacesuit:pants")
|
||||
repair_recipe("spacesuit:boots")
|
||||
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user