diff --git a/.github/workflows/luacheck.yml b/.github/workflows/luacheck.yml new file mode 100644 index 0000000..1d5241c --- /dev/null +++ b/.github/workflows/luacheck.yml @@ -0,0 +1,18 @@ + +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 ./ \ No newline at end of file diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..4ae4370 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,25 @@ +unused_args = false +allow_defined_top = true + +exclude_files = {".luacheckrc"} + +globals = { + "minetest", "core", + + --mod provided + "abritorch", +} + +read_globals = { + string = {fields = {"split"}}, + table = {fields = {"copy", "getn"}}, + + --luac + "math", "table", + + -- Builtin + "vector", "ItemStack", "dump", "DIR_DELIM", "VoxelArea", "Settings", "PcgRandom", "VoxelManip", "PseudoRandom", + + --mod produced + "default", +} \ No newline at end of file diff --git a/crafting.lua b/crafting.lua index 682d889..ee8a853 100644 --- a/crafting.lua +++ b/crafting.lua @@ -6,9 +6,9 @@ local modname if minetest.get_modpath("caverealms") then recipe_list = { {"black", "spike",}, {"blue", "glow_crystal",}, - {"cyan", "glow_gem",}, {"green", "glow_emerald",}, - {"magenta", "salt_gem",}, {"orange", "fire_vine",}, - {"purple", "glow_amethyst",}, {"red", "glow_ruby",}, + {"cyan", "glow_gem",}, {"green", "glow_emerald",}, + {"magenta", "salt_gem",}, {"orange", "fire_vine",}, + {"purple", "glow_amethyst",}, {"red", "glow_ruby",}, {"yellow", "glow_mese",}, {"white", "glow_ore",}, } modname = "caverealms" @@ -16,9 +16,9 @@ if minetest.get_modpath("caverealms") then else recipe_list = { {"black", "black",}, {"blue", "blue",}, - {"cyan", "cyan",}, {"green", "green",}, - {"magenta", "magenta",}, {"orange", "orange",}, - {"purple", "violet",}, {"red", "red",}, + {"cyan", "cyan",}, {"green", "green",}, + {"magenta", "magenta",}, {"orange", "orange",}, + {"purple", "violet",}, {"red", "red",}, {"yellow", "yellow",}, {"white", "white",}, } modname = "dye" @@ -29,7 +29,7 @@ for i in ipairs(recipe_list) do local ingredient = recipe_list[i][2] minetest.register_craft({ - output = "abritorch:torch_"..colour.." 4", + output = "abritorch:torch_"..colour.." 4", recipe = { {"default:torch", "", "default:torch" }, {"", modname..":"..ingredient, "" }, diff --git a/depends.txt b/depends.txt deleted file mode 100644 index 331d858..0000000 --- a/depends.txt +++ /dev/null @@ -1 +0,0 @@ -default \ No newline at end of file diff --git a/init.lua b/init.lua index 24f7068..5957c31 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,8 @@ local modpath = minetest.get_modpath("abritorch").. DIR_DELIM +abritorch = {} + dofile(modpath.."torches.lua") -dofile(modpath.."crafting.lua") \ No newline at end of file +dofile(modpath.."crafting.lua") + +abritorch.init = {} \ No newline at end of file diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..92952ff --- /dev/null +++ b/mod.conf @@ -0,0 +1,3 @@ +name = abritorch +depends = default +optional_depends = caverealms \ No newline at end of file diff --git a/torches.lua b/torches.lua index 926631b..e38fc21 100644 --- a/torches.lua +++ b/torches.lua @@ -1,9 +1,9 @@ local colour_list = { {"black", "Darkened",}, {"blue", "Blue",}, - {"cyan", "Cyan",}, {"green", "Green",}, - {"magenta", "Magenta",}, {"orange", "Orange",}, - {"purple", "Purple",}, {"red", "Red",}, + {"cyan", "Cyan",}, {"green", "Green",}, + {"magenta", "Magenta",}, {"orange", "Orange",}, + {"purple", "Purple",}, {"red", "Red",}, {"yellow", "Yellow",}, {"white", "Frosted",}, } @@ -27,7 +27,7 @@ for i in ipairs(colour_list) do return itemstack end local fakestack = itemstack - local retval = false + local retval if wdir <= 1 then retval = fakestack:set_name("abritorch:floor_"..colour) else @@ -36,7 +36,7 @@ for i in ipairs(colour_list) do if not retval then return itemstack end - itemstack, retval = minetest.item_place(fakestack, placer, pointed_thing, param2) + itemstack = minetest.item_place(fakestack, placer, pointed_thing) itemstack:set_name("abritorch:torch_"..colour) return itemstack