From ccb66008c4b1e9a402b1734641a1239aebd28592 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Sun, 17 Feb 2019 16:04:58 +0100 Subject: [PATCH] removed duplicate wool and straw block in case of farming and wool beeing installed --- init.lua | 10 ++++++++++ nodes_hay.lua | 4 ++-- nodes_historic.lua | 10 +++++++--- nodes_roof.lua | 18 +++++++++++++----- nodes_straw.lua | 18 +++++++++++------- 5 files changed, 43 insertions(+), 17 deletions(-) diff --git a/init.lua b/init.lua index fd7f333..b6c412b 100644 --- a/init.lua +++ b/init.lua @@ -44,6 +44,16 @@ else cottages.sounds.stone = default.node_sound_stone_defaults() cottages.sounds.leaves = default.node_sound_leaves_defaults() end + +-- the straw from default comes with stairs as well and might replace +-- cottages:roof_connector_straw and cottages:roof_flat_straw +-- however, that does not look very good +if( false and minetest.registered_nodes["farming:straw"]) then + cottages.straw_texture = "farming_straw.png" + cottages.use_farming_straw_stairs = true +else + cottages.straw_texture = "cottages_darkage_straw.png" +end --cottages.config_use_mesh_barrel = false; --cottages.config_use_mesh_handmill = true; diff --git a/nodes_hay.lua b/nodes_hay.lua index 78da2d4..3d1f8b0 100644 --- a/nodes_hay.lua +++ b/nodes_hay.lua @@ -46,7 +46,7 @@ minetest.register_node("cottages:hay_mat", { drawtype = "nodebox", paramtype2 = "leveled", description = S("Some hay"), - tiles = {"cottages_darkage_straw.png^[multiply:#88BB88"}, + tiles = {cottages.straw_texture.."^[multiply:#88BB88"}, groups = {hay=3, snappy=2, oddly_breakable_by_hand=2, flammable=3}, sounds = cottages.sounds.leaves, -- the bale is slightly smaller than a full node @@ -73,7 +73,7 @@ minetest.register_node("cottages:hay_mat", { -- hay block, similar to straw block minetest.register_node("cottages:hay", { description = S("Hay"), - tiles = {"cottages_darkage_straw.png^[multiply:#88BB88"}, + tiles = {cottages.straw_texture.."^[multiply:#88BB88"}, groups = {hay=3, snappy=2, oddly_breakable_by_hand=2, flammable=3}, sounds = cottages.sounds.leaves, is_ground_content = false, diff --git a/nodes_historic.lua b/nodes_historic.lua index 7af2d69..af8aa3a 100644 --- a/nodes_historic.lua +++ b/nodes_historic.lua @@ -66,7 +66,7 @@ end -- right now, this block mostly serves as a placeholder minetest.register_node("cottages:straw_ground", { description = S("straw ground for animals"), - tiles = {"cottages_darkage_straw.png","cottages_loam.png","cottages_loam.png","cottages_loam.png","cottages_loam.png","cottages_loam.png"}, + tiles = {cottages.straw_texture,"cottages_loam.png","cottages_loam.png","cottages_loam.png","cottages_loam.png","cottages_loam.png"}, groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, groups = {crumbly=3}, sounds = cottages.sounds.leaves, @@ -178,12 +178,16 @@ minetest.register_node("cottages:wool_tent", { }) -- a fallback for cases in which there is no wool -minetest.register_node("cottages:wool", { +if( not( minetest.registered_nodes["wool:white"])) then + minetest.register_node("cottages:wool", { description = "Wool", tiles = {"cottages_wool.png"}, is_ground_content = false, groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3,wool=1}, -}) + }) +else + minetest.register_alias("cottages:wool", "wool:white") +end --------------------------------------------------------------------------------------- diff --git a/nodes_roof.lua b/nodes_roof.lua index 64ce581..240f94f 100644 --- a/nodes_roof.lua +++ b/nodes_roof.lua @@ -36,7 +36,8 @@ cottages.register_roof = function( name, tiles, basic_material, homedecor_altern }) -- a better roof than the normal stairs; this one is for usage directly on top of walls (it has the form of a stair) - minetest.register_node("cottages:roof_connector_"..name, { + if( name~="straw" or not(minetest.registered_nodes["stairs:stair_straw"]) or not(cottages.use_farming_straw_stairs)) then + minetest.register_node("cottages:roof_connector_"..name, { description = S("Roof connector "..name), drawtype = "nodebox", -- top, bottom, side1, side2, inner, outer @@ -60,9 +61,13 @@ cottages.register_roof = function( name, tiles, basic_material, homedecor_altern }, is_ground_content = false, }) + else + minetest.register_alias("cottages:roof_connector_straw", "stairs:stair_straw") + end -- this one is the slab version of the above roof - minetest.register_node("cottages:roof_flat_"..name, { + if( name~="straw" or not(minetest.registered_nodes["stairs:slab_straw"]) or not(cottages.use_farming_straw_stairs)) then + minetest.register_node("cottages:roof_flat_"..name, { description = S("Roof (flat) "..name), drawtype = "nodebox", -- top, bottom, side1, side2, inner, outer @@ -85,6 +90,9 @@ cottages.register_roof = function( name, tiles, basic_material, homedecor_altern }, is_ground_content = false, }) + else + minetest.register_alias("cottages:roof_flat_straw", "stairs:slab_straw") + end if( not( homedecor_alternative ) @@ -147,9 +155,9 @@ end -- of cottages.register_roof( name, tiles, basic_material ) -- add the diffrent roof types --------------------------------------------------------------------------------------- cottages.register_roof( 'straw', - {"cottages_darkage_straw.png","cottages_darkage_straw.png", - "cottages_darkage_straw.png","cottages_darkage_straw.png", - "cottages_darkage_straw.png","cottages_darkage_straw.png"}, + {cottages.straw_texture, cottages.straw_texture, + cottages.straw_texture, cottages.straw_texture, + cottages.straw_texture, cottages.straw_texture}, 'cottages:straw_mat', nil ); cottages.register_roof( 'reet', {"cottages_reet.png","cottages_reet.png", diff --git a/nodes_straw.lua b/nodes_straw.lua index 600d0de..d26f6b8 100644 --- a/nodes_straw.lua +++ b/nodes_straw.lua @@ -12,9 +12,9 @@ local S = cottages.S minetest.register_node("cottages:straw_mat", { description = S("layer of straw"), drawtype = 'nodebox', - tiles = { 'cottages_darkage_straw.png' }, -- done by VanessaE - wield_image = 'cottages_darkage_straw.png', - inventory_image = 'cottages_darkage_straw.png', + tiles = { cottages.straw_texture }, -- done by VanessaE + wield_image = cottages.straw_texture, + inventory_image = cottages.straw_texture, sunlight_propagates = true, paramtype = 'light', paramtype2 = "facedir", @@ -64,15 +64,19 @@ minetest.register_node("cottages:straw_bale", { }) -- just straw -minetest.register_node("cottages:straw", { +if( not(minetest.registered_nodes["farming:straw"])) then + minetest.register_node("cottages:straw", { drawtype = "normal", description = S("straw"), - tiles = {"cottages_darkage_straw.png"}, + tiles = {cottages.straw_texture}, groups = { hay = 3, snappy = 2, oddly_breakable_by_hand = 2, flammable=3 }, sounds = cottages.sounds.leaves, -- the bale is slightly smaller than a full node is_ground_content = false, -}) + }) +else + minetest.register_alias("cottages:straw", "farming:straw") +end local cottages_formspec_treshing_floor = @@ -239,7 +243,7 @@ minetest.register_node("cottages:threshing_floor", { end local overlay1 = "^farming_wheat.png"; - local overlay2 = "^cottages_darkage_straw.png"; + local overlay2 = "^"..cottages.straw_texture; local overlay3 = "^"..cottages.texture_wheat_seed; -- this can be enlarged by a multiplicator if desired