From dc0908e5fa86334226c982877e71aec8cfaf92ce Mon Sep 17 00:00:00 2001 From: Vanessa Dannenberg Date: Wed, 15 Aug 2018 18:15:28 -0400 Subject: update plantlife, farming_redo, nixie tubes add my led_marquee mod --- farming/compatibility.lua | 172 ++++++++++++++++++++++------------------------ 1 file changed, 84 insertions(+), 88 deletions(-) (limited to 'farming/compatibility.lua') diff --git a/farming/compatibility.lua b/farming/compatibility.lua index afa98d6..808000d 100644 --- a/farming/compatibility.lua +++ b/farming/compatibility.lua @@ -1,8 +1,13 @@ --- wait until mods are finished loading -minetest.after(0, function() +--= Helpers + +local eth = minetest.get_modpath("ethereal") +local alias = function(orig, new) + minetest.register_alias(orig, new) +end + +--= Overrides (add food_* group to apple and brown mushroom) --- add food group to default apple and brown mushroom minetest.override_item("default:apple", { groups = {food_apple = 1, fleshy = 3, dig_immediate = 3, flammable = 2, leafdecay = 3, leafdecay_drop = 1}, @@ -15,14 +20,13 @@ minetest.override_item("flowers:mushroom_brown", { }) end --- is Ethereal mod installed? -local eth = minetest.get_modpath("ethereal") +--= Aliases -- Banana if eth then - minetest.register_alias("farming_plus:banana_sapling", "ethereal:banana_tree_sapling") - minetest.register_alias("farming_plus:banana_leaves", "ethereal:bananaleaves") - minetest.register_alias("farming_plus:banana", "ethereal:banana") + alias("farming_plus:banana_sapling", "ethereal:banana_tree_sapling") + alias("farming_plus:banana_leaves", "ethereal:bananaleaves") + alias("farming_plus:banana", "ethereal:banana") else minetest.register_node(":ethereal:banana", { description = "Banana", @@ -42,35 +46,45 @@ else sounds = default.node_sound_leaves_defaults(), }) - minetest.register_alias("farming_plus:banana_sapling", "default:sapling") - minetest.register_alias("farming_plus:banana_leaves", "default:leaves") - minetest.register_alias("farming_plus:banana", "ethereal:banana") + minetest.register_node(":ethereal:bananaleaves", { + description = "Banana Leaves", + tiles = {"banana_leaf.png"}, + inventory_image = "banana_leaf.png", + wield_image = "banana_leaf.png", + paramtype = "light", + waving = 1, + groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2}, + sounds = default.node_sound_leaves_defaults(), + }) + + alias("farming_plus:banana_sapling", "default:sapling") + alias("farming_plus:banana_leaves", "ethereal:bananaleaves") + alias("farming_plus:banana", "ethereal:banana") end -- Carrot -minetest.register_alias("farming_plus:carrot_seed", "farming:carrot") -minetest.register_alias("farming_plus:carrot_1", "farming:carrot_1") -minetest.register_alias("farming_plus:carrot_2", "farming:carrot_4") -minetest.register_alias("farming_plus:carrot_3", "farming:carrot_6") -minetest.register_alias("farming_plus:carrot", "farming:carrot_8") -minetest.register_alias("farming_plus:carrot_item", "farming:carrot") +alias("farming_plus:carrot_seed", "farming:carrot") +alias("farming_plus:carrot_1", "farming:carrot_1") +alias("farming_plus:carrot_2", "farming:carrot_4") +alias("farming_plus:carrot_3", "farming:carrot_6") +alias("farming_plus:carrot", "farming:carrot_8") +alias("farming_plus:carrot_item", "farming:carrot") -- Cocoa -minetest.register_alias("farming_plus:cocoa_sapling", "farming:cocoa_2") -minetest.register_alias("farming_plus:cocoa_leaves", "default:leaves") -minetest.register_alias("farming_plus:cocoa", "default:apple") -minetest.register_alias("farming_plus:cocoa_bean", "farming:cocoa_beans") +alias("farming_plus:cocoa_sapling", "farming:cocoa_beans") +alias("farming_plus:cocoa_leaves", "default:leaves") +alias("farming_plus:cocoa", "default:apple") +alias("farming_plus:cocoa_bean", "farming:cocoa_beans") -- Orange -minetest.register_alias("farming_plus:orange_1", "farming:tomato_1") -minetest.register_alias("farming_plus:orange_2", "farming:tomato_4") -minetest.register_alias("farming_plus:orange_3", "farming:tomato_6") ---minetest.register_alias("farming_plus:orange", "farming:tomato_8") +alias("farming_plus:orange_1", "farming:tomato_1") +alias("farming_plus:orange_2", "farming:tomato_4") +alias("farming_plus:orange_3", "farming:tomato_6") if eth then - minetest.register_alias("farming_plus:orange_item", "ethereal:orange") - minetest.register_alias("farming_plus:orange", "ethereal:orange") - minetest.register_alias("farming_plus:orange_seed", "ethereal:orange_tree_sapling") + alias("farming_plus:orange_item", "ethereal:orange") + alias("farming_plus:orange", "ethereal:orange") + alias("farming_plus:orange_seed", "ethereal:orange_tree_sapling") else minetest.register_node(":ethereal:orange", { description = "Orange", @@ -90,45 +104,45 @@ else sounds = default.node_sound_leaves_defaults(), }) - minetest.register_alias("farming_plus:orange_item", "ethereal:orange") - minetest.register_alias("farming_plus:orange", "ethereal:orange") - minetest.register_alias("farming_plus:orange_seed", "default:sapling") + alias("farming_plus:orange_item", "ethereal:orange") + alias("farming_plus:orange", "ethereal:orange") + alias("farming_plus:orange_seed", "default:sapling") end -- Potato -minetest.register_alias("farming_plus:potato_item", "farming:potato") -minetest.register_alias("farming_plus:potato_1", "farming:potato_1") -minetest.register_alias("farming_plus:potato_2", "farming:potato_2") -minetest.register_alias("farming_plus:potato", "farming:potato_3") -minetest.register_alias("farming_plus:potato_seed", "farming:potato") +alias("farming_plus:potato_item", "farming:potato") +alias("farming_plus:potato_1", "farming:potato_1") +alias("farming_plus:potato_2", "farming:potato_2") +alias("farming_plus:potato", "farming:potato_3") +alias("farming_plus:potato_seed", "farming:potato") -- Pumpkin -minetest.register_alias("farming:pumpkin_seed", "farming:pumpkin_slice") -minetest.register_alias("farming:pumpkin_face", "farming:jackolantern") -minetest.register_alias("farming:pumpkin_face_light", "farming:jackolantern_on") -minetest.register_alias("farming:big_pumpkin", "farming:pumpkin") -minetest.register_alias("farming:big_pumpkin_side", "air") -minetest.register_alias("farming:big_pumpkin_corner", "air") -minetest.register_alias("farming:big_pumpkin_top", "air") -minetest.register_alias("farming:scarecrow", "farming:jackolantern") -minetest.register_alias("farming:scarecrow_light", "farming:jackolantern_on") -minetest.register_alias("farming:pumpkin_flour", "farming:pumpkin_dough") +alias("farming:pumpkin_seed", "farming:pumpkin_slice") +alias("farming:pumpkin_face", "farming:jackolantern") +alias("farming:pumpkin_face_light", "farming:jackolantern_on") +alias("farming:big_pumpkin", "farming:jackolantern") +alias("farming:big_pumpkin_side", "air") +alias("farming:big_pumpkin_top", "air") +alias("farming:big_pumpkin_corner", "air") +alias("farming:scarecrow", "farming:jackolantern") +alias("farming:scarecrow_light", "farming:jackolantern_on") +alias("farming:pumpkin_flour", "farming:pumpkin_dough") -- Rhubarb -minetest.register_alias("farming_plus:rhubarb_seed", "farming:rhubarb") -minetest.register_alias("farming_plus:rhubarb_1", "farming:rhubarb_1") -minetest.register_alias("farming_plus:rhubarb_2", "farming:rhubarb_2") -minetest.register_alias("farming_plus:rhubarb", "farming:rhubarb_3") -minetest.register_alias("farming_plus:rhubarb_item", "farming:rhubarb") +alias("farming_plus:rhubarb_seed", "farming:rhubarb") +alias("farming_plus:rhubarb_1", "farming:rhubarb_1") +alias("farming_plus:rhubarb_2", "farming:rhubarb_2") +alias("farming_plus:rhubarb", "farming:rhubarb_3") +alias("farming_plus:rhubarb_item", "farming:rhubarb") -- Strawberry if eth then - minetest.register_alias("farming_plus:strawberry_item", "ethereal:strawberry") - minetest.register_alias("farming_plus:strawberry_seed", "ethereal:strawberry") - minetest.register_alias("farming_plus:strawberry_1", "ethereal:strawberry_1") - minetest.register_alias("farming_plus:strawberry_2", "ethereal:strawberry_3") - minetest.register_alias("farming_plus:strawberry_3", "ethereal:strawberry_5") - minetest.register_alias("farming_plus:strawberry", "ethereal:strawberry_7") + alias("farming_plus:strawberry_item", "ethereal:strawberry") + alias("farming_plus:strawberry_seed", "ethereal:strawberry") + alias("farming_plus:strawberry_1", "ethereal:strawberry_1") + alias("farming_plus:strawberry_2", "ethereal:strawberry_3") + alias("farming_plus:strawberry_3", "ethereal:strawberry_5") + alias("farming_plus:strawberry", "ethereal:strawberry_7") else minetest.register_craftitem(":ethereal:strawberry", { description = "Strawberry", @@ -138,39 +152,21 @@ else on_use = minetest.item_eat(1), }) - minetest.register_alias("farming_plus:strawberry_item", "ethereal:strawberry") - minetest.register_alias("farming_plus:strawberry_seed", "ethereal:strawberry") - minetest.register_alias("farming_plus:strawberry_1", "farming:raspberry_1") - minetest.register_alias("farming_plus:strawberry_2", "farming:raspberry_2") - minetest.register_alias("farming_plus:strawberry_3", "farming:raspberry_3") - minetest.register_alias("farming_plus:strawberry", "farming:raspberry_4") + alias("farming_plus:strawberry_item", "ethereal:strawberry") + alias("farming_plus:strawberry_seed", "ethereal:strawberry") + alias("farming_plus:strawberry_1", "farming:raspberry_1") + alias("farming_plus:strawberry_2", "farming:raspberry_2") + alias("farming_plus:strawberry_3", "farming:raspberry_3") + alias("farming_plus:strawberry", "farming:raspberry_4") end -minetest.register_alias("bushes:strawberry", "ethereal:strawberry") - - -- Tomato -minetest.register_alias("farming_plus:tomato_seed", "farming:tomato") -minetest.register_alias("farming_plus:tomato_item", "farming:tomato") -minetest.register_alias("farming_plus:tomato_1", "farming:tomato_2") -minetest.register_alias("farming_plus:tomato_2", "farming:tomato_4") -minetest.register_alias("farming_plus:tomato_3", "farming:tomato_6") -minetest.register_alias("farming_plus:tomato", "farming:tomato_8") +alias("farming_plus:tomato_seed", "farming:tomato") +alias("farming_plus:tomato_item", "farming:tomato") +alias("farming_plus:tomato_1", "farming:tomato_2") +alias("farming_plus:tomato_2", "farming:tomato_4") +alias("farming_plus:tomato_3", "farming:tomato_6") +alias("farming_plus:tomato", "farming:tomato_8") -- Weed -minetest.register_alias("farming:weed", "default:grass_2") - ---[[ Classic Bushes compatibility -if minetest.get_modpath("bushes_classic") then - - if eth then - minetest.register_alias("bushes:strawberry", "farming:strawberry") - else - minetest.register_alias("bushes:strawberry", "farming:raspberries") - end - - minetest.register_alias("bushes:blueberry", "farming:blueberries") - minetest.register_alias("bushes:raspberry", "farming:raspberries") -end]] - -end) +alias("farming:weed", "default:grass_2") -- cgit v1.2.3