From d669edca2484638e9348e9465d776508a48521fb Mon Sep 17 00:00:00 2001 From: Juraj Vajda Date: Mon, 6 Mar 2023 14:32:33 -0500 Subject: [PATCH] Adjust to new x_faming API --- mod_support_x_farming.lua | 110 ++++++++++++++++++++++++++++++++++---- 1 file changed, 99 insertions(+), 11 deletions(-) diff --git a/mod_support_x_farming.lua b/mod_support_x_farming.lua index e1964b8..ecadf4b 100644 --- a/mod_support_x_farming.lua +++ b/mod_support_x_farming.lua @@ -27,7 +27,15 @@ x_farming.x_bonemeal:register_tree_defs({ -- 1 out of `chance`, e.g. 2 = 50% chance chance = 3, -- grow tree from sapling - grow_tree = Everness.grow_sapling + grow_tree = function(pos) + if not x_farming.x_bonemeal.is_on_soil(pos) then + return false + end + + Everness.grow_coral_tree(pos) + + return true + end }, { -- sapling name @@ -35,7 +43,15 @@ x_farming.x_bonemeal:register_tree_defs({ -- 1 out of `chance`, e.g. 2 = 50% chance chance = 3, -- grow tree from sapling - grow_tree = Everness.grow_sapling + grow_tree = function(pos) + if not x_farming.x_bonemeal.is_on_soil(pos) then + return false + end + + Everness.coral_tree_bioluminescent(pos) + + return true + end }, { -- sapling name @@ -43,7 +59,15 @@ x_farming.x_bonemeal:register_tree_defs({ -- 1 out of `chance`, e.g. 2 = 50% chance chance = 3, -- grow tree from sapling - grow_tree = Everness.grow_sapling + grow_tree = function(pos) + if not x_farming.x_bonemeal.is_on_soil(pos) then + return false + end + + Everness.grow_crystal_bush(pos) + + return true + end }, { -- sapling name @@ -51,7 +75,15 @@ x_farming.x_bonemeal:register_tree_defs({ -- 1 out of `chance`, e.g. 2 = 50% chance chance = 3, -- grow tree from sapling - grow_tree = Everness.grow_sapling + grow_tree = function(pos) + if not x_farming.x_bonemeal.is_on_soil(pos) then + return false + end + + Everness.grow_cursed_bush(pos) + + return true + end }, { -- sapling name @@ -59,7 +91,15 @@ x_farming.x_bonemeal:register_tree_defs({ -- 1 out of `chance`, e.g. 2 = 50% chance chance = 3, -- grow tree from sapling - grow_tree = Everness.grow_sapling + grow_tree = function(pos) + if not x_farming.x_bonemeal.is_on_soil(pos) then + return false + end + + Everness.grow_baobab_tree(pos) + + return true + end }, { -- sapling name @@ -67,7 +107,15 @@ x_farming.x_bonemeal:register_tree_defs({ -- 1 out of `chance`, e.g. 2 = 50% chance chance = 3, -- grow tree from sapling - grow_tree = Everness.grow_sapling + grow_tree = function(pos) + if not x_farming.x_bonemeal.is_on_soil(pos) then + return false + end + + Everness.grow_dry_tree(pos) + + return true + end }, { -- sapling name @@ -75,7 +123,15 @@ x_farming.x_bonemeal:register_tree_defs({ -- 1 out of `chance`, e.g. 2 = 50% chance chance = 3, -- grow tree from sapling - grow_tree = Everness.grow_sapling + grow_tree = function(pos) + if not x_farming.x_bonemeal.is_on_soil(pos) then + return false + end + + Everness.grow_willow_tree(pos) + + return true + end }, { -- sapling name @@ -83,7 +139,15 @@ x_farming.x_bonemeal:register_tree_defs({ -- 1 out of `chance`, e.g. 2 = 50% chance chance = 3, -- grow tree from sapling - grow_tree = Everness.grow_sapling + grow_tree = function(pos) + if not x_farming.x_bonemeal.is_on_soil(pos) then + return false + end + + Everness.grow_sequoia_tree(pos) + + return true + end }, { -- sapling name @@ -91,7 +155,15 @@ x_farming.x_bonemeal:register_tree_defs({ -- 1 out of `chance`, e.g. 2 = 50% chance chance = 3, -- grow tree from sapling - grow_tree = Everness.grow_sapling + grow_tree = function(pos) + if not x_farming.x_bonemeal.is_on_soil(pos) then + return false + end + + Everness.grow_crystal_tree(pos) + + return true + end }, { -- sapling name @@ -99,7 +171,15 @@ x_farming.x_bonemeal:register_tree_defs({ -- 1 out of `chance`, e.g. 2 = 50% chance chance = 3, -- grow tree from sapling - grow_tree = Everness.grow_sapling + grow_tree = function(pos) + if not x_farming.x_bonemeal.is_on_soil(pos) then + return false + end + + Everness.grow_crystal_large_tree(pos) + + return true + end }, { -- sapling name @@ -107,7 +187,15 @@ x_farming.x_bonemeal:register_tree_defs({ -- 1 out of `chance`, e.g. 2 = 50% chance chance = 3, -- grow tree from sapling - grow_tree = Everness.grow_sapling + grow_tree = function(pos) + if not x_farming.x_bonemeal.is_on_soil(pos) then + return false + end + + Everness.grow_cursed_dream_tree(pos) + + return true + end }, })