mirror of
https://github.com/mt-mods/coloredwood.git
synced 2025-07-23 10:00:27 +02:00
Compare commits
18 Commits
2018-11-09
...
5125b9b07b
Author | SHA1 | Date | |
---|---|---|---|
5125b9b07b | |||
8e1aec69fa | |||
c4c9a6defe | |||
7933350b60 | |||
e58317b58e | |||
63f8499203 | |||
042d2867f7 | |||
be4df6fc88 | |||
9c6fe5206b | |||
cd5e026e31 | |||
08fde44bb8 | |||
f2f5e5f73e | |||
cbb407e863 | |||
e60c24c7bc | |||
ab77976512 | |||
7f09ef4c3d | |||
b1a094b770 | |||
2eeb9f95da |
@ -1,3 +0,0 @@
|
||||
default
|
||||
unifieddyes
|
||||
moreblocks?
|
@ -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.
|
52
init.lua
52
init.lua
@ -51,6 +51,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 +63,7 @@ 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,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
@ -84,6 +88,7 @@ for _, color in ipairs(unifieddyes.HUES_WITH_GREY) do
|
||||
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},
|
||||
}
|
||||
)
|
||||
@ -97,6 +102,11 @@ local coloredwood_cuts = {}
|
||||
|
||||
if coloredwood.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
|
||||
|
||||
local chk = string.sub(i.name, 1, 20)
|
||||
@ -106,23 +116,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 +151,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 +165,19 @@ 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 +215,10 @@ unifieddyes.register_color_craft({
|
||||
}
|
||||
})
|
||||
|
||||
if minetest.get_modpath("signs_lib") then
|
||||
minetest.override_item("coloredwood:fence", {
|
||||
check_for_pole = true
|
||||
})
|
||||
end
|
||||
|
||||
print("[Colored Wood] Loaded!")
|
||||
|
5
mod.conf
5
mod.conf
@ -1 +1,6 @@
|
||||
name = coloredwood
|
||||
title = Colored Wood
|
||||
description = This mod provides a multitude of colors of wood, stairs and fences to Minetest, as per the palette outlined by my Unified Dyes mod.
|
||||
depends = default,unifieddyes
|
||||
optional_depends = moreblocks,signs_lib
|
||||
min_minetest_version = 5.2.0
|
||||
|
Reference in New Issue
Block a user