luacheck, workflow and badge
This commit is contained in:
parent
1fe04f2eba
commit
49baa55bd6
17
.github/workflows/luacheck.yml
vendored
Normal file
17
.github/workflows/luacheck.yml
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
name: luacheck
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
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 ./
|
25
.luacheckrc
Normal file
25
.luacheckrc
Normal file
@ -0,0 +1,25 @@
|
||||
unused = false
|
||||
|
||||
globals = {
|
||||
"minetest",
|
||||
"default",
|
||||
"protector",
|
||||
"register_door",
|
||||
"register_trapdoor"
|
||||
}
|
||||
|
||||
read_globals = {
|
||||
-- Stdlib
|
||||
string = {fields = {"split"}},
|
||||
table = {fields = {"copy", "getn"}},
|
||||
|
||||
-- Minetest
|
||||
"vector", "ItemStack",
|
||||
"dump", "VoxelArea",
|
||||
|
||||
-- deps
|
||||
"intllib",
|
||||
"mesecon",
|
||||
"screwdriver",
|
||||
"lucky_block"
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
Protector Redo mod [protect]
|
||||
|
||||
![](https://github.com/S-S-X/protector/workflows/luacheck/badge.svg)
|
||||
|
||||
Protector redo for minetest is a mod that protects a players builds by placing
|
||||
a block that stops other players from digging or placing blocks in that area.
|
||||
|
||||
|
@ -119,12 +119,12 @@ minetest.register_chatcommand("protector_show", {
|
||||
func = function(name, param)
|
||||
|
||||
local player = minetest.get_player_by_name(name)
|
||||
local pos = player:get_pos()
|
||||
local ppos = player:get_pos()
|
||||
|
||||
-- find the protector nodes
|
||||
local pos = minetest.find_nodes_in_area(
|
||||
{x = pos.x - r, y = pos.y - r, z = pos.z - r},
|
||||
{x = pos.x + r, y = pos.y + r, z = pos.z + r},
|
||||
{x = ppos.x - r, y = ppos.y - r, z = ppos.z - r},
|
||||
{x = ppos.x + r, y = ppos.y + r, z = ppos.z + r},
|
||||
{"protector:protect", "protector:protect2"})
|
||||
|
||||
local meta, owner
|
||||
|
@ -87,9 +87,9 @@ function register_door(name, def)
|
||||
local tt = def.tiles_top
|
||||
local tb = def.tiles_bottom
|
||||
|
||||
local function after_dig_node(pos, name, digger)
|
||||
local function after_dig_node(pos, node_name, digger)
|
||||
local node = minetest.get_node(pos)
|
||||
if node.name == name then
|
||||
if node.name == node_name then
|
||||
minetest.node_dig(pos, node, digger)
|
||||
end
|
||||
end
|
||||
@ -340,7 +340,7 @@ end
|
||||
|
||||
-- Protected Steel Door
|
||||
|
||||
local name = "protector:door_steel"
|
||||
name = "protector:door_steel"
|
||||
|
||||
register_door(name, {
|
||||
description = S("Protected Steel Door"),
|
||||
@ -382,9 +382,9 @@ end
|
||||
|
||||
----trapdoor----
|
||||
|
||||
function register_trapdoor(name, def)
|
||||
local name_closed = name
|
||||
local name_opened = name.."_open"
|
||||
function register_trapdoor(node_name, def)
|
||||
local name_closed = node_name
|
||||
local name_opened = node_name.."_open"
|
||||
|
||||
def.on_rightclick = function (pos, node, clicker, itemstack, pointed_thing)
|
||||
if minetest.is_protected(pos, clicker:get_player_name()) then
|
||||
|
2
init.lua
2
init.lua
@ -217,7 +217,7 @@ protector.can_dig = function(r, pos, digger, onlyowner, infolevel)
|
||||
end
|
||||
|
||||
-- find the protector nodes
|
||||
local pos = minetest.find_nodes_in_area(
|
||||
pos = minetest.find_nodes_in_area(
|
||||
{x = pos.x - r, y = pos.y - r, z = pos.z - r},
|
||||
{x = pos.x + r, y = pos.y + r, z = pos.z + r},
|
||||
{"protector:protect", "protector:protect2"})
|
||||
|
Loading…
x
Reference in New Issue
Block a user