From be33a71cd0fe2778e12e6430d494e853d395a1b7 Mon Sep 17 00:00:00 2001 From: sys4 Date: Sun, 14 Jun 2020 13:30:49 +0200 Subject: [PATCH] =?UTF-8?q?Ajoute=20param=C3=A8tre=20Minetest=20plantlike?= =?UTF-8?q?=5Fleaves=20(false=20par=20d=C3=A9faut)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init.lua | 15 ++++++++++++--- settingtypes.txt | 1 + 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 settingtypes.txt diff --git a/init.lua b/init.lua index 00ab8c4..485566f 100644 --- a/init.lua +++ b/init.lua @@ -64,12 +64,21 @@ minetest.register_node( groups = {oddly_breakable_by_hand=1, flammable=1, choppy=3, wood=1}, }) +local drawtype = "allfaces_optional" +local visual_scale = 1.3 + +if minetest.settings:get_bool("cherry_tree.plantlike_leaves") then + drawtype = "plantlike" + visual_scale = math.sqrt(2) +end + minetest.register_node( "cherry_tree:cherry_blossom_leaves", { description = "Cherry Blossom Leaves", - drawtype = "allfaces_optional", - visual_scale = 1.3, + drawtype = drawtype, + visual_scale = visual_scale, + inventory_image = minetest.inventorycube("default_cherry_blossom_leaves.png"), tiles = {"default_cherry_blossom_leaves.png"}, paramtype = "light", waving = 1, @@ -89,7 +98,7 @@ minetest.register_node( }, sounds = default.node_sound_leaves_defaults(), after_place_node = default.after_place_leaves, - }) +}) minetest.register_node( "cherry_tree:cherry_sapling", diff --git a/settingtypes.txt b/settingtypes.txt new file mode 100644 index 0000000..8ec8243 --- /dev/null +++ b/settingtypes.txt @@ -0,0 +1 @@ +cherry_tree.plantlike_leaves (Enable plantlike leaves) bool false