diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2059d76 --- /dev/null +++ b/LICENSE @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) 2025 whosit + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/compass_rose.kra b/compass_rose_decal_light.kra similarity index 70% rename from compass_rose.kra rename to compass_rose_decal_light.kra index 4152f8a..dfcf227 100644 Binary files a/compass_rose.kra and b/compass_rose_decal_light.kra differ diff --git a/compass_rose_node_block.kra b/compass_rose_node_block.kra new file mode 100644 index 0000000..4379a35 Binary files /dev/null and b/compass_rose_node_block.kra differ diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..0d9968e --- /dev/null +++ b/init.lua @@ -0,0 +1,20 @@ +local mod_start_time = core.get_us_time() +core.log("action", "[MOD] compass_rose_node loading") + +compass_rose_node = {} +compass_rose_node.error = {} +local modpath = core.get_modpath("compass_rose_node") .. DIR_DELIM + +compass_rose_node.information = {} +compass_rose_node.information.version = "0.1" +compass_rose_node.information.author = "whosit" +compass_rose_node.information.license = "MIT" +compass_rose_node.information.name = "Adds compass rose blocks" +compass_rose_node.information.source = "https://gitea.your-land.de/whosit/compass_rose_node" +compass_rose_node.information.additional = "Adds decorative blocks for building a 'compass rose' ." + +dofile(modpath .. "internal.lua") +--dofile(modpath .. "blockdefinitions.lua") + +local mod_end_time = (core.get_us_time() - mod_start_time) / 1000000 +core.log("action", "[MOD] compass_rose_node loaded in [" .. mod_end_time .. "s]") diff --git a/internal.lua b/internal.lua new file mode 100644 index 0000000..4332a7a --- /dev/null +++ b/internal.lua @@ -0,0 +1,94 @@ +-- local function on_place(itemstack, placer, pointed_thing) +-- if not minetest.is_player(placer) then +-- return minetest.item_place(itemstack, placer, pointed_thing) +-- end + +-- local look_dir = placer:get_look_dir() + +-- if not vector.check(look_dir) then +-- return minetest.item_place(itemstack, placer, pointed_thing) +-- end + +-- local facedir = minetest.dir_to_facedir(look_dir) +-- local aim_dir = pointed_thing.under - pointed_thing.above + +-- local param2 +-- if aim_dir.x == -1 then +-- param2 = 15 +-- elseif aim_dir.x == 1 then +-- param2 = 17 +-- elseif aim_dir.y == -1 then +-- param2 = facedir +-- elseif aim_dir.y == 1 then +-- param2 = 20 + ((2 - facedir) % 4) +-- elseif aim_dir.z == -1 then +-- param2 = 6 +-- elseif aim_dir.z == 1 then +-- param2 = 8 +-- end + +-- return minetest.item_place(itemstack, placer, pointed_thing, param2) +-- end + +-- function compass_rose_node.register_eye(name) + minetest.register_node(":compass_rose_node:" .. "block", { + description = "Compass rose block", + --drawtype = "nodebox", + --use_texture_alpha = "blend", + tiles = { + "compass_rose_node_block_side1.png", + "compass_rose_node_block_side2.png", + "compass_rose_node_block_side3.png", + "compass_rose_node_block_side0.png", + "compass_rose_node_block_side4.png", + "compass_rose_node_block_side5.png", + }, + is_ground_content = false, + --inventory_image = "compass_rose_node_" .. name .. ".png", + --wield_image = "compass_rose_node_" .. name .. ".png", + paramtype = "light", + paramtype2 = "facedir", + --walkable = false, + --climbable = false, + --sunlight_propagates = true, + -- node_box = { + -- type = "fixed", + -- fixed = {-0.5, -0.4375, -0.5, 0.5, -0.4375, 0.5} + -- }, + -- selection_box = { + -- type = "fixed", + -- fixed = {-0.5, -0.375, -0.5, 0.5, -0.5, 0.5} + -- }, + groups = {choppy = 3, dig_immediate = 2}, + --on_place = on_place + }) +--end + +for i=0,5 do + minetest.register_node(":compass_rose_node:decal_light_" .. tostring(i), { + description = "Compass rose block", + drawtype = "nodebox", + use_texture_alpha = "blend", + tiles = { + "compass_rose_decal_light_side" .. tostring(i) .. ".png", + }, + is_ground_content = false, + --inventory_image = "compass_rose_node_" .. name .. ".png", + --wield_image = "compass_rose_node_" .. name .. ".png", + paramtype = "light", + paramtype2 = "facedir", + walkable = false, + climbable = false, + sunlight_propagates = true, + node_box = { + type = "fixed", + fixed = {-0.5, -0.4375, -0.5, 0.5, -0.4375, 0.5} + }, + selection_box = { + type = "fixed", + fixed = {-0.5, -0.375, -0.5, 0.5, -0.5, 0.5} + }, + groups = {choppy = 3, dig_immediate = 2}, + --on_place = on_place + }) +end \ No newline at end of file diff --git a/krita_save_cube_sides.py b/krita_save_cube_sides.py index 2d1382f..6f768de 100644 --- a/krita_save_cube_sides.py +++ b/krita_save_cube_sides.py @@ -8,7 +8,7 @@ currentDocument = Krita.instance().activeDocument() import os.path filepath = currentDocument.fileName() filename = os.path.splitext(os.path.basename(filepath))[0] -dir = os.path.dirname(filepath) +dir = os.path.join(os.path.dirname(filepath), 'textures') print(dir) currentDocument.setBatchmode(True) diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..762b0cc --- /dev/null +++ b/mod.conf @@ -0,0 +1,4 @@ +name = compass_rose_node +description = Adds blocks for building compass rose. +author = whosit +title = Compass rose node \ No newline at end of file diff --git a/textures/compass_rose_decal_light_side0.png b/textures/compass_rose_decal_light_side0.png new file mode 100644 index 0000000..e179d0c Binary files /dev/null and b/textures/compass_rose_decal_light_side0.png differ diff --git a/textures/compass_rose_decal_light_side1.png b/textures/compass_rose_decal_light_side1.png new file mode 100644 index 0000000..c91599c Binary files /dev/null and b/textures/compass_rose_decal_light_side1.png differ diff --git a/textures/compass_rose_decal_light_side2.png b/textures/compass_rose_decal_light_side2.png new file mode 100644 index 0000000..ece7b51 Binary files /dev/null and b/textures/compass_rose_decal_light_side2.png differ diff --git a/textures/compass_rose_decal_light_side3.png b/textures/compass_rose_decal_light_side3.png new file mode 100644 index 0000000..385cc8f Binary files /dev/null and b/textures/compass_rose_decal_light_side3.png differ diff --git a/textures/compass_rose_decal_light_side4.png b/textures/compass_rose_decal_light_side4.png new file mode 100644 index 0000000..0100ca6 Binary files /dev/null and b/textures/compass_rose_decal_light_side4.png differ diff --git a/textures/compass_rose_decal_light_side5.png b/textures/compass_rose_decal_light_side5.png new file mode 100644 index 0000000..ddedbee Binary files /dev/null and b/textures/compass_rose_decal_light_side5.png differ diff --git a/textures/compass_rose_node_block_side0.png b/textures/compass_rose_node_block_side0.png new file mode 100644 index 0000000..e36445e Binary files /dev/null and b/textures/compass_rose_node_block_side0.png differ diff --git a/textures/compass_rose_node_block_side1.png b/textures/compass_rose_node_block_side1.png new file mode 100644 index 0000000..52b929f Binary files /dev/null and b/textures/compass_rose_node_block_side1.png differ diff --git a/textures/compass_rose_node_block_side2.png b/textures/compass_rose_node_block_side2.png new file mode 100644 index 0000000..4f9a351 Binary files /dev/null and b/textures/compass_rose_node_block_side2.png differ diff --git a/textures/compass_rose_node_block_side3.png b/textures/compass_rose_node_block_side3.png new file mode 100644 index 0000000..8733022 Binary files /dev/null and b/textures/compass_rose_node_block_side3.png differ diff --git a/textures/compass_rose_node_block_side4.png b/textures/compass_rose_node_block_side4.png new file mode 100644 index 0000000..26c920f Binary files /dev/null and b/textures/compass_rose_node_block_side4.png differ diff --git a/textures/compass_rose_node_block_side5.png b/textures/compass_rose_node_block_side5.png new file mode 100644 index 0000000..a74dc7c Binary files /dev/null and b/textures/compass_rose_node_block_side5.png differ