Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NO SQUASH] Enable luacheck & add choppy group to sliding doors #33

Merged
merged 2 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/luacheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: luacheck
on: [push, pull_request]
jobs:
luacheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Luacheck
uses: lunarmodules/luacheck@master
22 changes: 9 additions & 13 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
unused_args = false
allow_defined_top = true
max_line_length = 140

read_globals = {
"doors",
"DIR_DELIM",
"minetest", "core",
"dump",
"vector", "nodeupdate",
"VoxelManip", "VoxelArea",
"PseudoRandom", "ItemStack",
"intllib",
"minetest",
"vector",
"default",
"armor",
"doors",
"stairs",
"stairsplus",
"mesecon",
}

globals = {
core = { fields = { "do_item_eat" }},
}

"mydoors"
}
9 changes: 4 additions & 5 deletions my_door_wood/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ local door_wood = { -- color, desc, image
{"yellow", "Clear Stained", "yellow"},
{"black", "Black", "black"},
}
local function my_door_wood_block_stairs(nodename, def)
local function my_door_wood_block_stairs(nodename, def)
local mod = string.match(nodename, "(.+):")
local name = string.match(nodename, ":(.+)")
minetest.register_node(nodename, def)
Expand All @@ -23,22 +23,21 @@ local function my_door_wood_block_stairs(nodename, def)
sounds = def.sounds,
}
)
elseif minetest.get_modpath("stairs") then
elseif minetest.get_modpath("stairs") then
stairs.register_stair_and_slab(name,nodename,
def.groups,
def.tiles,
("%s Stair"):format(def.description),
("%s Slab"):format(def.description),
def.sounds
)
end
)
end
end

local function add_door(color, desc, img)
my_door_wood_block_stairs("my_door_wood:wood_"..color, {
description = desc.." Wood",
drawtype = "normal",
paramtype = "light",
tiles = {"mydoors_"..img.."_wood.png"},
paramtype = "light",
groups = {cracky = 2, choppy = 2, wood = 1},
Expand Down
2 changes: 1 addition & 1 deletion my_future_doors/framed.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ local function add_door(col)
on_place = function(itemstack, placer, pointed_thing)
local pos1 = pointed_thing.above
local pos2 = vector.add(pos1, {x=0,y=1,z=0})

if not placer or not placer:is_player() then
return
end
Expand Down
2 changes: 1 addition & 1 deletion my_future_doors/sliding.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ local function add_door(doora, doorb, doorc, doord, num, des, recipe)
local function onplace(itemstack, placer, pointed_thing)
local pos1 = pointed_thing.above
local pos2 = vector.add(pos1, {x=0,y=1,z=0})

if not placer or not placer:is_player() then
return
end
Expand Down
6 changes: 3 additions & 3 deletions my_garage_door/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ minetest.register_node("my_garage_door:garage_door", {
on_place = function(itemstack, placer, pointed_thing)
local pos1 = pointed_thing.above
local pos2 = vector.add(pos1, {x=0,y=1,z=0})

if not placer or not placer:is_player() then
return
end
Expand Down Expand Up @@ -75,7 +75,7 @@ minetest.register_node("my_garage_door:garage_door", {

local t1 = vector.add(above, dir)
local t2 = vector.add(t1, dir)

if not player or not player:is_player() then
return
end
Expand Down Expand Up @@ -153,7 +153,7 @@ minetest.register_node("my_garage_door:garage_door_open", {

local t1 = vector.add(pos, dir)
local t2 = vector.subtract(t1, {x=0,y=1,z=0})

if not player or not player:is_player() then
return
end
Expand Down
2 changes: 1 addition & 1 deletion my_saloon_doors/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ local function add_door(col, des, tint, craft)
on_place = function(itemstack, placer, pointed_thing)
local pos1 = pointed_thing.above
local pos2 = vector.add(pos1, {x=0,y=1,z=0})

if not placer or not placer:is_player() then
return
end
Expand Down
22 changes: 11 additions & 11 deletions my_sliding_doors/jdoors1.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
local par = minetest.dir_to_facedir(placer:get_look_dir())
local par2 = par + 2
local above = vector.add(pos, {x=0,y=1,z=0})

if not placer or not placer:is_player() then
return
end
Expand Down Expand Up @@ -106,7 +106,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = {cracky = 3},
groups = {choppy = 3, cracky = 3},
node_box = {
type = "fixed",
fixed = {
Expand Down Expand Up @@ -150,7 +150,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = {cracky = 1},
groups = {choppy = 1, cracky = 1},
node_box = {
type = "fixed",
fixed = {
Expand Down Expand Up @@ -188,7 +188,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
paramtype2 = "facedir",
sunlight_propagates = true,
drop = doora,
groups = {cracky = 1},
groups = {choppy = 1, cracky = 1},
node_box = {
type = "fixed",
fixed = {
Expand Down Expand Up @@ -228,7 +228,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = {cracky = 1},
groups = {choppy = 1, cracky = 1},
node_box = {
type = "fixed",
fixed = {
Expand Down Expand Up @@ -268,7 +268,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = {cracky = 3},
groups = {choppy = 3, cracky = 3},
node_box = {
type = "fixed",
fixed = {
Expand All @@ -286,7 +286,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
local pos = pointed_thing.above
local pos2 = vector.add(pos, {x=0,y=1,z=0})
local na = minetest.get_node(pos2)

if not placer or not placer:is_player() then
return
end
Expand Down Expand Up @@ -337,7 +337,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
paramtype2 = "facedir",
sunlight_propagates = true,
drop = "",
groups = {cracky = 3},
groups = {choppy = 3, cracky = 3},
node_box = {
type = "fixed",
fixed = {
Expand Down Expand Up @@ -370,7 +370,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = {cracky = 3},
groups = {choppy = 3, cracky = 3},
node_box = {
type = "fixed",
fixed = {
Expand All @@ -394,7 +394,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
local pos = pointed_thing.above
local pos2 = vector.add(pos, {x=0,y=1,z=0})
local na = minetest.get_node(pos2)

if not placer or not placer:is_player() then
return
end
Expand Down Expand Up @@ -445,7 +445,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
paramtype2 = "facedir",
sunlight_propagates = true,
drop = "",
groups = {cracky = 3},
groups = {choppy = 3, cracky = 3},
node_box = {
type = "fixed",
fixed = {
Expand Down
13 changes: 6 additions & 7 deletions my_sliding_doors/jdoors2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ local doors = {
local function add_door(doora, doorb, doorc, doord, num)
local function onplace(itemstack, placer, pointed_thing)
local pos1 = pointed_thing.above
local pos2 = vector.add(pos, {x=0,y=1,z=0})
local pos2 = vector.add(pos1, {x=0,y=1,z=0})

if not placer or not placer:is_player() then
return
end
Expand All @@ -20,7 +20,6 @@ local function add_door(doora, doorb, doorc, doord, num)
end

local p2 = minetest.dir_to_facedir(placer:get_look_dir())
local p4 = (p2+2)%4
local pos3 = vector.add(pos1, minetest.facedir_to_dir((p2-1)%4))

local player_name = placer:get_player_name()
Expand Down Expand Up @@ -110,7 +109,7 @@ local function add_door(doora, doorb, doorc, doord, num)
paramtype2 = "facedir",
drop = doora,
sunlight_propagates = true,
groups = {cracky = 3},
groups = {choppy = 3, cracky = 3},
node_box = {
type = "fixed",
fixed = {
Expand Down Expand Up @@ -154,7 +153,7 @@ local function add_door(doora, doorb, doorc, doord, num)
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = {cracky = 1},
groups = {choppy = 1, cracky = 1},
node_box = {
type = "fixed",
fixed = {
Expand Down Expand Up @@ -192,7 +191,7 @@ local function add_door(doora, doorb, doorc, doord, num)
paramtype2 = "facedir",
sunlight_propagates = true,
drop = doora,
groups = {cracky = 1},
groups = {choppy = 1, cracky = 1},
node_box = {
type = "fixed",
fixed = {
Expand Down Expand Up @@ -232,7 +231,7 @@ local function add_door(doora, doorb, doorc, doord, num)
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = {cracky = 1},
groups = {choppy = 1, cracky = 1},
node_box = {
type = "fixed",
fixed = {
Expand Down