1
0
mirror of https://github.com/mt-mods/coloredwood.git synced 2025-06-28 14:16:14 +02:00

22 Commits

Author SHA1 Message Date
2915bd9a6e Merge remote-tracking branch 'upstream/master' 2024-09-15 08:45:47 +02:00
1aeb88d6fd isn't ground content (#3) 2024-03-01 11:06:50 -05:00
2714c14444 Merge remote-tracking branch 'upstream/master' 2023-11-22 23:26:09 +01:00
f950dd5fbe add luacheck and update mod.conf
closes #1
2023-08-16 22:59:34 +10:00
5125b9b07b Add min_minetest_version = 5.2.0 to mod.conf 2022-07-08 19:07:20 +02:00
8e1aec69fa Delete depends.txt and description.txt, update mod.conf 2022-07-08 18:53:20 +02:00
c4c9a6defe Fix stack division 2021-07-03 19:23:31 +02:00
7933350b60 Tidy code 2020-09-07 00:17:31 +02:00
e58317b58e Merge branch 'nalc-1.2-dev' 2020-07-05 17:55:05 +02:00
63f8499203 Corrige crash au démarrage 2020-06-20 15:11:28 +02:00
042d2867f7 Fix stack division with moreblocks items 2020-06-18 00:20:24 +02:00
be4df6fc88 add minimum minetest version key for contentdb 2020-06-03 13:00:05 -04:00
9c6fe5206b use signs_lib's custom pole check callback feature
requires signs_lib from commit dcdee22 or later, if present
2019-09-22 03:24:24 -04:00
cd5e026e31 directly copy, modify default:wood groups
(instead of hard-coding the groups list)

fixes a wood -> slabs -> sticks -> wood multiplyier loop
2019-09-17 12:41:39 -04:00
08fde44bb8 update to use new signs_lib API -- requires signs_lib commit 4ff54c9a and above 2019-09-11 12:29:52 -04:00
f2f5e5f73e use Unified Dyes on_dig where needed - requires Unified Dyes commit 9ff40a7f or later 2019-07-18 02:22:52 -04:00
cbb407e863 fix groups handling to avoid excees redefs 2019-05-31 14:52:06 -04:00
e60c24c7bc fix airbrush not working 2019-05-14 12:45:01 -04:00
ab77976512 remove colored fence from creative inv 2019-05-14 12:42:53 -04:00
7f09ef4c3d Replace neutral fence by the default one. 2018-09-23 16:28:38 +02:00
b1a094b770 Fix colored wood and fence groups 2018-08-26 17:35:54 +02:00
2eeb9f95da Fix stack division and nodes orientation 2018-08-25 01:43:04 +02:00
7 changed files with 69 additions and 32 deletions

10
.github/workflows/luacheck.yml vendored Normal file
View File

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

1
.gitignore vendored
View File

@ -1 +0,0 @@
*~

8
.luacheckrc Normal file
View File

@ -0,0 +1,8 @@
read_globals = {
"table.copy",
"minetest",
"default",
"unifieddyes",
"stairsplus",
}

View File

@ -1,3 +0,0 @@
default
unifieddyes
moreblocks?

View File

@ -1 +0,0 @@
This mod provides a multitude of colors of wood, sticks, and fences to Minetest, as per the palette outlined by my Unified Dyes mod.

View File

@ -7,11 +7,9 @@
-- All materials are flammable and can be used as fuel.
coloredwood = {}
coloredwood.enable_stairsplus = true
local enable_stairsplus = true
if minetest.settings:get_bool("coloredwood_enable_stairsplus") == false or not minetest.get_modpath("moreblocks") then
coloredwood.enable_stairsplus = false
enable_stairsplus = false
end
-- helper functions
@ -28,7 +26,6 @@ local function is_stairsplus(name, colorized)
local class = string.sub(name, a+1, b-1) -- from colon to underscore is the class
local shape = ""
local rest
local colorshape
if class == "stair"
@ -51,6 +48,10 @@ end
-- the actual nodes!
local groups = table.copy(minetest.registered_items["default:wood"].groups)
groups.ud_param2_colorable = 1
groups.not_in_creative_inventory=1
minetest.register_node("coloredwood:wood_block", {
description = "Colored wooden planks",
tiles = { "coloredwood_base.png" },
@ -59,7 +60,8 @@ minetest.register_node("coloredwood:wood_block", {
palette = "unifieddyes_palette_extended.png",
walkable = true,
sunlight_propagates = false,
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2, not_in_creative_inventory=1, ud_param2_colorable = 1},
groups = groups,
is_ground_content = false,
sounds = default.node_sound_wood_defaults(),
})
@ -67,7 +69,7 @@ for _, color in ipairs(unifieddyes.HUES_WITH_GREY) do
-- moreblocks/stairsplus support
if coloredwood.enable_stairsplus then
if enable_stairsplus then
-- stairsplus:register_all(modname, subname, recipeitem, {fields})
@ -81,10 +83,14 @@ for _, color in ipairs(unifieddyes.HUES_WITH_GREY) do
paramtype = "light",
paramtype2 = "colorfacedir",
palette = "unifieddyes_palette_"..color.."s.png",
after_place_node = function(pos, placer, itemstack, pointed_thing)
after_place_node = function(_, placer, itemstack, pointed_thing)
minetest.rotate_node(itemstack, placer, pointed_thing)
end,
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2, not_in_creative_inventory=1, ud_param2_colorable = 1},
on_dig = unifieddyes.on_dig,
groups = {
snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=2,
not_in_creative_inventory=1, ud_param2_colorable = 1
},
}
)
end
@ -95,7 +101,12 @@ local coloredwood_cuts = {}
-- force settings for stairsplus default wood stair/slab/etc nodes
-- and fix other stuff for colored versions of stairsplus nodes
if coloredwood.enable_stairsplus then
if enable_stairsplus then
local groups2 = table.copy(minetest.registered_items["default:wood"].groups)
groups2.wood = nil
groups2.ud_param2_colorable = 1
groups2.not_in_creative_inventory=1
for _, i in pairs(minetest.registered_nodes) do
@ -106,23 +117,17 @@ if coloredwood.enable_stairsplus then
or chk == "moreblocks:panel_woo"
or chk == "moreblocks:micro_woo"
or chk == "moreblocks:slope_woo"
and not string.find(i.name, "wood_tile") then
local class = string.sub(i.name, 12, 15)
local shape = string.sub(i.name, 22)
and not string.find(i.name, "wood_tile") then
table.insert(coloredwood_cuts, i.name)
if chk ~= "moreblocks:slab_wood" then
class = string.sub(i.name, 12, 16)
shape = string.sub(i.name, 23)
end
local class, shape = is_stairsplus(i.name, false)
minetest.override_item(i.name, {
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1, not_in_creative_inventory=1, ud_param2_colorable = 1},
groups = groups2,
paramtype2 = "colorfacedir",
palette = "unifieddyes_palette_greys.png",
airbrush_replacement_node = "coloredwood:"..class.."_wood_grey_"..shape
airbrush_replacement_node = "coloredwood:"..class.."_wood_grey"..shape,
drop = "moreblocks:"..class.."_wood"..shape,
})
end
end
@ -147,10 +152,13 @@ for _, mname in ipairs(coloredwood_cuts) do
})
end
groups = table.copy(minetest.registered_items["default:wood"].groups)
groups.ud_param2_colorable = 1
minetest.override_item("default:wood", {
palette = "unifieddyes_palette_extended.png",
airbrush_replacement_node = "coloredwood:wood_block",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1, ud_param2_colorable = 1},
groups = groups,
})
default.register_fence("coloredwood:fence", {
@ -158,14 +166,22 @@ default.register_fence("coloredwood:fence", {
texture = "coloredwood_fence_base.png",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, ud_param2_colorable = 1},
groups = {
choppy = 2, oddly_breakable_by_hand = 2, flammable = 2,
ud_param2_colorable = 1, not_in_creative_inventory=1
},
sounds = default.node_sound_wood_defaults(),
material = "coloredwood:wood_block"
material = "coloredwood:wood_block",
on_dig = unifieddyes.on_dig,
})
groups = table.copy(minetest.registered_items["default:fence_wood"].groups)
groups.ud_param2_colorable = 1
minetest.override_item("default:fence_wood", {
palette = "unifieddyes_palette_extended.png",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, ud_param2_colorable = 1}
airbrush_replacement_node = "coloredwood:fence",
groups = groups
})
-- Crafts
@ -203,4 +219,8 @@ unifieddyes.register_color_craft({
}
})
print("[Colored Wood] Loaded!")
if minetest.get_modpath("signs_lib") then
minetest.override_item("coloredwood:fence", {
check_for_pole = true
})
end

View File

@ -1 +1,5 @@
name = coloredwood
description = Provides a multitude of colors of wood, stairs, and fences.
depends = default, unifieddyes
optional_depends = moreblocks, signs_lib
min_minetest_version = 5.2.0