define a block and decal versions

This commit is contained in:
whosit 2025-03-02 17:34:56 +03:00
parent 5085276f3e
commit 1b2c4bfdfc
19 changed files with 128 additions and 1 deletions

9
LICENSE Normal file
View File

@ -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.

BIN
compass_rose_node_block.kra Normal file

Binary file not shown.

20
init.lua Normal file
View File

@ -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]")

94
internal.lua Normal file
View File

@ -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

View File

@ -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)

4
mod.conf Normal file
View File

@ -0,0 +1,4 @@
name = compass_rose_node
description = Adds blocks for building compass rose.
author = whosit
title = Compass rose node

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB