1
0
mirror of https://github.com/mt-mods/coloredwood.git synced 2025-07-03 00:20:36 +02:00

6 Commits

Author SHA1 Message Date
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
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 21 additions and 36 deletions

View File

@ -1,10 +0,0 @@
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 Normal file
View File

@ -0,0 +1 @@
*~

View File

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

4
depends.txt Normal file
View File

@ -0,0 +1,4 @@
default
unifieddyes
moreblocks?
signs_lib?

1
description.txt Normal file
View File

@ -0,0 +1 @@
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,9 +7,11 @@
-- All materials are flammable and can be used as fuel.
local enable_stairsplus = true
coloredwood = {}
coloredwood.enable_stairsplus = true
if minetest.settings:get_bool("coloredwood_enable_stairsplus") == false or not minetest.get_modpath("moreblocks") then
enable_stairsplus = false
coloredwood.enable_stairsplus = false
end
-- helper functions
@ -26,6 +28,7 @@ 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"
@ -61,7 +64,6 @@ minetest.register_node("coloredwood:wood_block", {
walkable = true,
sunlight_propagates = false,
groups = groups,
is_ground_content = false,
sounds = default.node_sound_wood_defaults(),
})
@ -69,7 +71,7 @@ for _, color in ipairs(unifieddyes.HUES_WITH_GREY) do
-- moreblocks/stairsplus support
if enable_stairsplus then
if coloredwood.enable_stairsplus then
-- stairsplus:register_all(modname, subname, recipeitem, {fields})
@ -83,14 +85,11 @@ for _, color in ipairs(unifieddyes.HUES_WITH_GREY) do
paramtype = "light",
paramtype2 = "colorfacedir",
palette = "unifieddyes_palette_"..color.."s.png",
after_place_node = function(_, placer, itemstack, pointed_thing)
after_place_node = function(pos, placer, itemstack, pointed_thing)
minetest.rotate_node(itemstack, placer, pointed_thing)
end,
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
},
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2, not_in_creative_inventory=1, ud_param2_colorable = 1},
}
)
end
@ -101,7 +100,7 @@ local coloredwood_cuts = {}
-- force settings for stairsplus default wood stair/slab/etc nodes
-- and fix other stuff for colored versions of stairsplus nodes
if enable_stairsplus then
if coloredwood.enable_stairsplus then
local groups2 = table.copy(minetest.registered_items["default:wood"].groups)
groups2.wood = nil
@ -129,11 +128,13 @@ if enable_stairsplus then
shape = string.sub(i.name, 23)
end
local s1, s2 = is_stairsplus(i.name, false)
minetest.override_item(i.name, {
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:"..s1.."_wood"..s2 -- NALC: Fix stack division with moreblocks
})
end
end
@ -172,10 +173,7 @@ 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, not_in_creative_inventory=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",
on_dig = unifieddyes.on_dig,
@ -230,3 +228,5 @@ if minetest.get_modpath("signs_lib") then
check_for_pole = true
})
end
print("[Colored Wood] Loaded!")

View File

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