From 92ff6aef2faadd0e9c3fedc9001dc9f766720307 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Wed, 15 Mar 2017 09:06:39 -0600 Subject: [PATCH] random orientation of plump helmets --- plants.lua | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/plants.lua b/plants.lua index 012bbef..7825176 100644 --- a/plants.lua +++ b/plants.lua @@ -161,7 +161,10 @@ minetest.register_node("dfcaverns:plump_helmet_spawn", { fixed = { {-0.0625 + displace_x, -0.5, -0.125 + displace_z, 0.125 + displace_x, -0.375, 0.0625 + displace_z}, } - } + }, + on_construct = function(pos) + minetest.swap_node(pos, {name="dfcaverns:plump_helmet_spawn", param2 = math.random(0,3)}) + end, }) @@ -182,7 +185,10 @@ minetest.register_node("dfcaverns:plump_helmet_1", { {-0.0625 + displace_x, -0.5, -0.125 + displace_z, 0.125 + displace_x, -0.25, 0.0625 + displace_z}, -- stalk {-0.125 + displace_x, -0.4375, -0.1875 + displace_z, 0.1875 + displace_x, -0.3125, 0.125 + displace_z}, -- cap } - } + }, + on_construct = function(pos) + minetest.swap_node(pos, {name="dfcaverns:plump_helmet_1", param2 = math.random(0,3)}) + end, }) @@ -203,7 +209,10 @@ minetest.register_node("dfcaverns:plump_helmet_2", { {-0.0625 + displace_x, -0.5, -0.125 + displace_z, 0.125 + displace_x, 0, 0.0625 + displace_z}, -- stalk {-0.125 + displace_x, -0.3125, -0.1875 + displace_z, 0.1875 + displace_x, -0.0625, 0.125 + displace_z}, -- cap } - } + }, + on_construct = function(pos) + minetest.swap_node(pos, {name="dfcaverns:plump_helmet_2", param2 = math.random(0,3)}) + end, }) minetest.register_node("dfcaverns:plump_helmet_3", { @@ -223,7 +232,10 @@ minetest.register_node("dfcaverns:plump_helmet_3", { {-0.125 + displace_x, -0.5, -0.1875 + displace_z, 0.1875 + displace_x, 0.25, 0.125 + displace_z}, -- stalk {-0.1875 + displace_x, -0.125, -0.25 + displace_z, 0.25 + displace_x, 0.1875, 0.1875 + displace_z}, -- cap } - } + }, + on_construct = function(pos) + minetest.swap_node(pos, {name="dfcaverns:plump_helmet_3", param2 = math.random(0,3)}) + end, }) minetest.register_node("dfcaverns:plump_helmet_4", { @@ -244,7 +256,10 @@ minetest.register_node("dfcaverns:plump_helmet_4", { {-0.25 + displace_x, -0.0625, -0.3125 + displace_z, 0.3125 + displace_x, 0.25, 0.25 + displace_z}, -- cap {-0.1875 + displace_x, 0.25, -0.25 + displace_z, 0.25 + displace_x, 0.3125, 0.1875 + displace_z}, -- cap rounding } - } + }, + on_construct = function(pos) + minetest.swap_node(pos, {name="dfcaverns:plump_helmet_4", param2 = math.random(0,3)}) + end, })