diff --git a/build-date b/build-date new file mode 100644 index 00000000..1f69bee2 --- /dev/null +++ b/build-date @@ -0,0 +1 @@ +20210328-0214 diff --git a/mods/baldcypress/init.lua b/mods/baldcypress/init.lua index 9e559750..bf499517 100644 --- a/mods/baldcypress/init.lua +++ b/mods/baldcypress/init.lua @@ -25,6 +25,7 @@ end -- if mg_name ~= "v6" and mg_name ~= "singlenode" then + name = "baldcypress:baldcypress_tree", minetest.register_decoration({ deco_type = "schematic", place_on = {"default:sand"}, diff --git a/mods/bamboo/init.lua b/mods/bamboo/init.lua index f34dce92..eedb2ad5 100644 --- a/mods/bamboo/init.lua +++ b/mods/bamboo/init.lua @@ -115,6 +115,7 @@ end -- minetest.register_decoration({ + name = "bamboo:bamboo_tree", deco_type = "schematic", place_on = {"default:dirt_with_grass"}, sidelen = 16, diff --git a/mods/bees/init.lua b/mods/bees/init.lua index 2928b44a..c2b93828 100644 --- a/mods/bees/init.lua +++ b/mods/bees/init.lua @@ -412,7 +412,10 @@ minetest.register_node("bees:hive_wild", { if meta:get_int("agressive") == 1 and inv:contains_item("queen", "bees:queen") then - clicker:set_hp(clicker:get_hp() - 4) + -- damage inside timer to stop death duplication glitch + minetest.after(0.1, function() + clicker:set_hp(clicker:get_hp() - 4) + end, clicker) else meta:set_int("agressive", 1) end @@ -509,7 +512,10 @@ minetest.register_node("bees:hive_artificial", { if meta:get_int("agressive") == 1 and inv:contains_item("queen", "bees:queen") then - clicker:set_hp(clicker:get_hp() - 4) + -- damage inside timer to stop death duplication glitch + minetest.after(0.1, function() + clicker:set_hp(clicker:get_hp() - 4) + end, clicker) else meta:set_int("agressive", 1) end @@ -691,16 +697,23 @@ minetest.register_abm({ minetest.register_abm({ nodenames = {"group:leaves"}, neighbors = {"air"}, - interval = 800, - chance = 10, + interval = 300, + chance = 4, action = function(pos) - if floor(pos.x / 40) ~= pos.x / 40 - or floor(pos.z / 40) ~= pos.z / 40 - or floor(pos.y / 5) ~= pos.y / 5 then return end + if floor(pos.x / 20) ~= pos.x / 20 + or floor(pos.z / 20) ~= pos.z / 20 + or floor(pos.y / 3) ~= pos.y / 3 then return end local p = {x = pos.x, y = pos.y - 1, z = pos.z} + + -- skip if nearby hive found + if minetest.find_node_near(p, 25, {"bees:hive_artificial", "bees:hive_wild", + "bees:hive_industrial"}) then + return + end + local nod = minetest.get_node_or_nil(p) local def = nod and minetest.registered_nodes[nod.name] diff --git a/mods/bees/readme.txt b/mods/bees/readme.txt index 5c2636f5..a0668c17 100644 --- a/mods/bees/readme.txt +++ b/mods/bees/readme.txt @@ -14,6 +14,7 @@ FEATURES - Make wild hive abm less intensive (thanks VanessaE) - Added 9x Lucky Blocks - Smokers have 200 uses before breaking +- Hives are spread out 20 blocks apart, 3 high and only spawn when no other hives around 2.2.2 - Pipeworks compatibility (Industrial beehive) diff --git a/mods/birch/init.lua b/mods/birch/init.lua index 58b5b44e..4f2e6907 100644 --- a/mods/birch/init.lua +++ b/mods/birch/init.lua @@ -104,6 +104,7 @@ else end minetest.register_decoration({ + name = "birch:birch_tree", deco_type = "schematic", place_on = {place_on}, sidelen = 16, diff --git a/mods/bonemeal/mods.lua b/mods/bonemeal/mods.lua index 9e3a63ce..dfbcd6ff 100644 --- a/mods/bonemeal/mods.lua +++ b/mods/bonemeal/mods.lua @@ -44,7 +44,9 @@ if farming and farming.mod and farming.mod == "redo" then {"farming:lettuce_", 5}, {"farming:blackberry_", 4}, {"farming:vanilla_", 8}, - {"farming:soy_", 7} + {"farming:soy_", 7}, + {"farming:artichoke_", 5}, + {"farming:parsley_", 3} }) end diff --git a/mods/cherrytree/init.lua b/mods/cherrytree/init.lua index 995bc697..4b217081 100644 --- a/mods/cherrytree/init.lua +++ b/mods/cherrytree/init.lua @@ -70,6 +70,7 @@ end if mg_name ~= "v6" and mg_name ~= "singlenode" then minetest.register_decoration({ + name = "cherrytree:cherry_tree", deco_type = "schematic", place_on = {"default:dirt_with_grass"}, sidelen = 16, diff --git a/mods/chestnuttree/init.lua b/mods/chestnuttree/init.lua index e323a540..25fa5448 100644 --- a/mods/chestnuttree/init.lua +++ b/mods/chestnuttree/init.lua @@ -86,6 +86,7 @@ if mg_name ~= "v6" and mg_name ~= "singlenode" then end minetest.register_decoration({ + name = "chestnuttree:chestnut_tree", deco_type = "schematic", place_on = {place_on}, sidelen = 16, diff --git a/mods/clementinetree/init.lua b/mods/clementinetree/init.lua index 195540ab..19d5bf58 100644 --- a/mods/clementinetree/init.lua +++ b/mods/clementinetree/init.lua @@ -50,6 +50,7 @@ end if mg_name ~= "v6" and mg_name ~= "singlenode" then minetest.register_decoration({ + name = "clementinetree:clementine_tree", deco_type = "schematic", place_on = {"default:dirt_with_grass"}, sidelen = 16, diff --git a/mods/digistuff/docs/gpu.txt b/mods/digistuff/docs/gpu.txt index a2ea3c76..80c88526 100644 --- a/mods/digistuff/docs/gpu.txt +++ b/mods/digistuff/docs/gpu.txt @@ -147,3 +147,26 @@ y1 [integer 1-64]: The Y position of the start of the line. y2 [integer 1-64]: The Y position of the end of the line. color [hex color, default "000000"]: The nominal color of the line (may not be the color of every pixel, see the "antialias" setting) antialias [boolean, default false]: Whether to apply a (very) crude smoothing algorithm to the line to reduce jagged edges at the expense of making the line slightly blurry. + +Command: sendpacked +------------------- + +Converts the image in a buffer into a string representation that can be loaded again later with the "loadpacked" command. +The result uses 4 bytes per pixel and consists entirely of printable characters (A-Z, a-z, 0-9, +, and /). + +Parameters: +buffer [integer 0-7]: The buffer to convert. +channel [string]: The digilines channel to send the packed image on. + +Command: loadpacked +------------------- + +Load a string representation of an image (created by the "sendpacked" command) back into a buffer. + +Parameters: +buffer [integer 0-7]: The buffer to load the image into. +x [integer 1-64]: The X position of the left side of the image. +y [integer 1-64]: The Y position of the top of the image. +xsize [integer 1-64]: The width of the image. Must be the same as the original image or the image will be severely distorted. +ysize [integer 1-64]: The height of the image. Should be the same as the original image. +data [string]: The packed image to load. diff --git a/mods/digistuff/gpu.lua b/mods/digistuff/gpu.lua index 4d0e3459..7b68b8cd 100644 --- a/mods/digistuff/gpu.lua +++ b/mods/digistuff/gpu.lua @@ -1,21 +1,70 @@ local font = dofile(minetest.get_modpath("digistuff")..DIR_DELIM.."gpu-font.lua") -local function explodebits(input) +local function explodebits(input,count) local output = {} - for i=0,7,1 do + if not count then count = 8 end + for i=0,count-1,1 do output[i] = input%(2^(i+1)) >= 2^i end return output end -local function implodebits(input) +local function implodebits(input,count) local output = 0 - for i=0,7,1 do + if not count then count = 8 end + for i=0,count-1,1 do output = output + (input[i] and 2^i or 0) end return output end +local packtable = {} +local unpacktable = {} +for i=0,25,1 do + packtable[i] = string.char(i+65) + packtable[i+26] = string.char(i+97) + unpacktable[string.char(i+65)] = i + unpacktable[string.char(i+97)] = i+26 +end +for i=0,9,1 do + packtable[i+52] = tostring(i) + unpacktable[tostring(i)] = i+52 +end +packtable[62] = "+" +packtable[63] = "/" +unpacktable["+"] = 62 +unpacktable["/"] = 63 + +local function packpixel(pixel) + pixel = tonumber(pixel,16) + if not pixel then return "AAAA" end + local bits = explodebits(pixel,24) + local block1 = {} + local block2 = {} + local block3 = {} + local block4 = {} + for i=0,5,1 do + block1[i] = bits[i] + block2[i] = bits[i+6] + block3[i] = bits[i+12] + block4[i] = bits[i+18] + end + local char1 = packtable[implodebits(block1,6)] or "A" + local char2 = packtable[implodebits(block2,6)] or "A" + local char3 = packtable[implodebits(block3,6)] or "A" + local char4 = packtable[implodebits(block4,6)] or "A" + return char1..char2..char3..char4 +end + +local function unpackpixel(pack) + local block1 = unpacktable[pack:sub(1,1)] or 0 + local block2 = unpacktable[pack:sub(2,2)] or 0 + local block3 = unpacktable[pack:sub(3,3)] or 0 + local block4 = unpacktable[pack:sub(4,4)] or 0 + local out = block1+(2^6*block2)+(2^12*block3)+(2^18*block4) + return string.format("%06X",out) +end + local function rgbtohsv(r,g,b) r = r/255 g = g/255 @@ -416,6 +465,49 @@ local function runcommand(pos,meta,command) end end meta:set_string("buffer"..bufnum,minetest.serialize(buffer)) + elseif command.command == "sendpacked" then + if type(command.buffer) ~= "number" or type(command.channel) ~= "string" then return end + local bufnum = math.floor(command.buffer) + if bufnum < 0 or bufnum > 7 then return end + local buffer = meta:get_string("buffer"..bufnum) + if string.len(buffer) == 0 then return end + buffer = minetest.deserialize(buffer) + if type(buffer) == "table" then + local packeddata = "" + for y=1,buffer.ysize,1 do + for x=1,buffer.xsize,1 do + packeddata = packeddata..packpixel(buffer[y][x]) + end + end + digiline:receptor_send(pos,digiline.rules.default,command.channel,packeddata) + end + elseif command.command == "loadpacked" then + if type(command.buffer) ~= "number" or type(command.data) ~= "string" then return end + if type(command.x) ~= "number" or type(command.y) ~= "number" or type(command.xsize) ~= "number" or type(command.ysize) ~= "number" then return end + command.x = math.floor(command.x) + command.y = math.floor(command.y) + command.xsize = math.floor(command.xsize) + command.ysize = math.floor(command.ysize) + if command.x < 1 or command.y < 1 or command.xsize < 1 or command.ysize < 1 then return end + local bufnum = math.floor(command.buffer) + if bufnum < 0 or bufnum > 7 then return end + local buffer = meta:get_string("buffer"..bufnum) + if string.len(buffer) == 0 then return end + buffer = minetest.deserialize(buffer) + if type(buffer) == "table" then + if command.x + command.xsize - 1 > buffer.xsize then return end + if command.y + command.ysize - 1 > buffer.ysize then return end + for y=0,command.ysize-1,1 do + local dsty = command.y+y + for x=0,command.xsize-1,1 do + local dstx = command.x+x + local packidx = (y*command.xsize+x)*4+1 + local packeddata = string.sub(command.data,packidx,packidx+3) + buffer[dsty][dstx] = unpackpixel(packeddata) + end + end + meta:set_string("buffer"..bufnum,minetest.serialize(buffer)) + end end end diff --git a/mods/ebony/init.lua b/mods/ebony/init.lua index a22fa2ac..8a70052b 100644 --- a/mods/ebony/init.lua +++ b/mods/ebony/init.lua @@ -27,6 +27,7 @@ end if mg_name ~= "v6" and mg_name ~= "singlenode" then minetest.register_decoration({ + name = "ebony:ebony_tree", deco_type = "schematic", place_on = {"default:dirt_with_rainforest_litter"}, sidelen = 16, diff --git a/mods/farming/crops/artichoke.lua b/mods/farming/crops/artichoke.lua new file mode 100644 index 00000000..92143f62 --- /dev/null +++ b/mods/farming/crops/artichoke.lua @@ -0,0 +1,64 @@ +local S = farming.intllib + +-- item definition +minetest.register_craftitem("farming:artichoke", { + description = S("Artichoke"), + inventory_image = "farming_artichoke.png", + groups = {seed = 2, food_artichoke = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:artichoke_1") + end, + on_use = minetest.item_eat(4) +}) + +-- crop definition +local def = { + drawtype = "plantlike", + tiles = {"farming_artichoke_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:artichoke_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_artichoke_2.png"} +minetest.register_node("farming:artichoke_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_artichoke_3.png"} +minetest.register_node("farming:artichoke_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_artichoke_4.png"} +minetest.register_node("farming:artichoke_4", table.copy(def)) + +-- stage 5 (final) +def.tiles = {"farming_artichoke_5.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:artichoke 2"}, rarity = 1}, + {items = {"farming:artichoke"}, rarity = 2} + } +} +minetest.register_node("farming:artichoke_5", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:artichoke"] = { + crop = "farming:artichoke", + seed = "farming:artichoke", + minlight = 13, + maxlight = 15, + steps = 5 +} diff --git a/mods/farming/crops/corn.lua b/mods/farming/crops/corn.lua index 0999fb99..ce000c4a 100644 --- a/mods/farming/crops/corn.lua +++ b/mods/farming/crops/corn.lua @@ -36,7 +36,7 @@ minetest.register_craft({ minetest.register_craftitem("farming:cornstarch", { description = S("Cornstarch"), inventory_image = "farming_cornstarch.png", - groups = {food_cornstarch = 1, flammable = 2} + groups = {food_cornstarch = 1, food_gelatin = 1, food_flammable = 2} }) minetest.register_craft({ diff --git a/mods/farming/crops/parsley.lua b/mods/farming/crops/parsley.lua new file mode 100644 index 00000000..0bc20eba --- /dev/null +++ b/mods/farming/crops/parsley.lua @@ -0,0 +1,56 @@ +local S = farming.intllib + +-- item definition +minetest.register_craftitem("farming:parsley", { + description = S("Parsley"), + inventory_image = "farming_parsley.png", + groups = {seed = 2, food_parsley = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:parsley_1") + end +}) + +-- crop definition +local def = { + drawtype = "plantlike", + tiles = {"farming_parsley_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:parsley_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_parsley_2.png"} +minetest.register_node("farming:parsley_2", table.copy(def)) + +-- stage 3 (final) +def.tiles = {"farming_parsley_3.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:parsley 2"}, rarity = 1}, + {items = {"farming:parsley"}, rarity = 2}, + {items = {"farming:parsley"}, rarity = 3} + } +} +minetest.register_node("farming:parsley_3", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:parsley"] = { + crop = "farming:parsley", + seed = "farming:parsley", + minlight = 13, + maxlight = 15, + steps = 3 +} diff --git a/mods/farming/farming.conf_example b/mods/farming/farming.conf_example index bea7ada8..9a804a91 100644 --- a/mods/farming/farming.conf_example +++ b/mods/farming/farming.conf_example @@ -35,6 +35,8 @@ farming.blackberry = 0.002 farming.lettuce = 0.001 farming.soy = 0.001 farming.vanilla = 0.001 +farming.artichoke = 0.001 +farming.parsley = 0.002 farming.grains = true -- true or false only -- default rarety of crops on map (higher number = more crops) diff --git a/mods/farming/food.lua b/mods/farming/food.lua index 7f63b8a2..2a1c2862 100644 --- a/mods/farming/food.lua +++ b/mods/farming/food.lua @@ -16,6 +16,19 @@ minetest.register_craft({ recipe = "default:papyrus" }) +--= Sugar caramel + +minetest.register_craftitem("farming:caramel", { + description = S("Caramel"), + inventory_image = "farming_caramel.png", +}) + +minetest.register_craft({ + type = "cooking", + cooktime = 6, + output = "farming:caramel", + recipe = "group:food_sugar", +}) --= Salt @@ -180,7 +193,7 @@ minetest.register_craft({ recipe = { {"group:food_gelatin", "group:food_sugar", "group:food_gelatin"}, {"group:food_sugar", "group:food_rose_water", "group:food_sugar"}, - {"group:food_cornstarch", "group:food_sugar", "dye:pink"} + {"group:food_sugar", "dye:pink", "group:food_sugar"} }, replacements = { {"group:food_cornstarch", "farming:bowl"}, @@ -472,3 +485,157 @@ minetest.register_craft({ "vessels:drinking_glass" } }) + +-- Patatas a la importancia + +minetest.register_craftitem("farming:spanish_potatoes", { + description = S("Spanish Potatoes"), + inventory_image = "farming_spanish_potatoes.png", + on_use = minetest.item_eat(8, "farming:bowl"), +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:spanish_potatoes", + recipe = { + "farming:potato", "group:food_parsley", "farming:potato", + "group:food_egg", "group:food_flour", "farming:onion", + "farming:garlic_clove", "group:food_bowl", "group:food_skillet" + }, + replacements = {{"group:food_skillet", "farming:skillet"}} +}) + +-- Potato omelet + +minetest.register_craftitem("farming:potato_omelet", { + description = S("Potato omelet"), + inventory_image = "farming_potato_omelet.png", + on_use = minetest.item_eat(6, "farming:bowl"), +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:potato_omelet", + recipe = { + "group:food_egg", "farming:potato", "group:food_onion", + "group:food_skillet", "group:food_bowl"}, + replacements = {{"group:food_skillet", "farming:skillet"}} +}) + +-- Paella + +minetest.register_craftitem("farming:paella", { + description = S("Paella"), + inventory_image = "farming_paella.png", + on_use = minetest.item_eat(8, "farming:bowl") +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:paella", + recipe = { + "group:food_rice", "dye:orange", "farming:pepper_red", + "group:food_peas", "group:food_chicken", "group:food_bowl", "group:food_skillet" + }, + replacements = {{"group:food_skillet", "farming:skillet"}} +}) + +-- Flan + +minetest.register_craftitem("farming:flan", { + description = S("Vanilla Flan"), + inventory_image = "farming_vanilla_flan.png", + on_use = minetest.item_eat(6) +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:flan", + recipe = { + "group:food_sugar", "group:food_milk", "farming:caramel", + "group:food_egg", "group:food_egg", "farming:vanilla_extract" + }, + replacements = { + {"cucina_vegana:soy_milk", "vessels:drinking_glass"}, + {"group:food_milk", "bucket:bucket_empty"}, + {"farming:vanilla_extract", "vessels:glass_bottle"} + } +}) + +-- Vegan Cheese + +minetest.register_craftitem("farming:cheese_vegan", { + description = S("Vegan Cheese"), + inventory_image = "farming_cheese_vegan.png", + on_use = minetest.item_eat(2), + groups = {food_cheese = 1, flammable = 2}, +}) + + +minetest.register_craft({ + type = "shapeless", + output = "farming:cheese_vegan", + recipe = { + "farming:soy_milk", "farming:soy_milk", "farming:soy_milk", + "group:food_salt", "group:food_peppercorn", "farming:bottle_ethanol", + "group:food_gelatin", "group:food_pot" + }, + replacements = { + {"farming:soy_milk", "vessels:drinking_glass 3"}, + {"farming:pot", "farming:pot"}, + {"farming:bottle_ethanol", "vessels:glass_bottle"} + } +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:cheese_vegan", + recipe = { + "farming:soy_milk", "farming:soy_milk", "farming:soy_milk", + "group:food_salt", "group:food_peppercorn", "group:food_lemon", + "group:food_gelatin", "group:food_pot" + }, + replacements = { + {"farming:soy_milk", "vessels:drinking_glass 3"}, + {"farming:pot", "farming:pot"}, + } +}) + +-- Onigiri + +minetest.register_craftitem("farming:onigiri", { + description = S("Onirigi"), + inventory_image = "farming_onigiri.png", + on_use = minetest.item_eat(2), + groups = {flammable = 2}, +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:onigiri", + recipe = { + "group:food_rice", "group:food_rice", "group:food_seaweed", "group:food_salt" + } +}) + +-- Gyoza + +minetest.register_craftitem("farming:gyoza", { + description = S("Gyoza"), + inventory_image = "farming_gyoza.png", + on_use = minetest.item_eat(4), + groups = {flammable = 2}, +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:gyoza 4", + recipe = { + "group:food_cabbage", "group:food_garlic_clove", "group:food_onion", + "group:food_meat_raw", "group:food_salt", "group:food_skillet", + "group:food_flour" + }, + replacements = { + {"group:food_skillet", "farming:skillet"} + } +}) diff --git a/mods/farming/init.lua b/mods/farming/init.lua index 973c807e..9b9306c9 100644 --- a/mods/farming/init.lua +++ b/mods/farming/init.lua @@ -7,7 +7,7 @@ farming = { mod = "redo", - version = "20201213", + version = "20210311", path = minetest.get_modpath("farming"), select = { type = "fixed", @@ -633,6 +633,8 @@ farming.blackberry = 0.002 farming.soy = 0.001 farming.vanilla = 0.001 farming.lettuce = 0.001 +farming.artichoke = 0.001 +farming.parsley = 0.002 farming.grains = true farming.rarety = 0.002 @@ -703,6 +705,8 @@ ddoo("blackberry.lua", farming.blackberry) ddoo("soy.lua", farming.soy) ddoo("vanilla.lua", farming.vanilla) ddoo("lettuce.lua", farming.lettuce) +ddoo("artichoke.lua", farming.artichoke) +ddoo("parsley.lua", farming.parsley) dofile(farming.path .. "/food.lua") dofile(farming.path .. "/mapgen.lua") diff --git a/mods/farming/license.txt b/mods/farming/license.txt index 49606b68..7ef6164b 100644 --- a/mods/farming/license.txt +++ b/mods/farming/license.txt @@ -155,6 +155,12 @@ Created by Felfa (CC0) farming_burger.png farming_soy*.png farming_vanilla*.png + farming_artichoke*.png + farming_parsley*.png + farming_paella.png + farming_potato_omelette.png + farming_spanish_potatoes.png + farming_vanilla_flan.png Created by gorlock (CC0) farming_salt_crystal.png diff --git a/mods/farming/mapgen.lua b/mods/farming/mapgen.lua index 7febaa13..c32eebc3 100644 --- a/mods/farming/mapgen.lua +++ b/mods/farming/mapgen.lua @@ -53,6 +53,7 @@ register_plant("cabbage_6", 2, 10, nil, "", -1, farming.cabbage) register_plant("lettuce_5", 5, 30, nil, "", -1, farming.lettuce) register_plant("blackberry_4", 3, 10, nil, "", -1, farming.blackberry) register_plant("vanilla_7", 5, 35, nil, "", -1, farming.vanilla) +register_plant("parsley_3", 10, 40, nil, "", -1, farming.parsley) register_plant("mint_4", 1, 75, { "default:dirt_with_grass", "default:dirt_with_coniferous_litter"}, "group:water", 1, farming.mint) @@ -127,6 +128,28 @@ minetest.register_decoration({ end +if farming.artichoke then +minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = 0, + scale = tonumber(farming.artichoke) or farming.rarety, + spread = {x = 100, y = 100, z = 100}, + seed = 448, + octaves = 3, + persist = 0.6 + }, + y_min = 1, + y_max = 13, + decoration = {"farming:artichoke_5"}, + spawn_by = "group:tree", + num_spawn_by = 1, +}) +end + + if farming.pepper then local tmp1 = {"default:dirt_with_rainforest_litter"} -- v7 diff --git a/mods/farming/textures/farming_artichoke.png b/mods/farming/textures/farming_artichoke.png new file mode 100644 index 00000000..74af38b7 Binary files /dev/null and b/mods/farming/textures/farming_artichoke.png differ diff --git a/mods/farming/textures/farming_artichoke_1.png b/mods/farming/textures/farming_artichoke_1.png new file mode 100644 index 00000000..b7f2e020 Binary files /dev/null and b/mods/farming/textures/farming_artichoke_1.png differ diff --git a/mods/farming/textures/farming_artichoke_2.png b/mods/farming/textures/farming_artichoke_2.png new file mode 100644 index 00000000..653637e0 Binary files /dev/null and b/mods/farming/textures/farming_artichoke_2.png differ diff --git a/mods/farming/textures/farming_artichoke_3.png b/mods/farming/textures/farming_artichoke_3.png new file mode 100644 index 00000000..2d203e90 Binary files /dev/null and b/mods/farming/textures/farming_artichoke_3.png differ diff --git a/mods/farming/textures/farming_artichoke_4.png b/mods/farming/textures/farming_artichoke_4.png new file mode 100644 index 00000000..9a44e928 Binary files /dev/null and b/mods/farming/textures/farming_artichoke_4.png differ diff --git a/mods/farming/textures/farming_artichoke_5.png b/mods/farming/textures/farming_artichoke_5.png new file mode 100644 index 00000000..dac25ddf Binary files /dev/null and b/mods/farming/textures/farming_artichoke_5.png differ diff --git a/mods/farming/textures/farming_caramel.png b/mods/farming/textures/farming_caramel.png new file mode 100644 index 00000000..bc7d1648 Binary files /dev/null and b/mods/farming/textures/farming_caramel.png differ diff --git a/mods/farming/textures/farming_cheese_vegan.png b/mods/farming/textures/farming_cheese_vegan.png new file mode 100644 index 00000000..22c439e3 Binary files /dev/null and b/mods/farming/textures/farming_cheese_vegan.png differ diff --git a/mods/farming/textures/farming_gyoza.png b/mods/farming/textures/farming_gyoza.png new file mode 100644 index 00000000..2005e799 Binary files /dev/null and b/mods/farming/textures/farming_gyoza.png differ diff --git a/mods/farming/textures/farming_onigiri.png b/mods/farming/textures/farming_onigiri.png new file mode 100644 index 00000000..86ee7c68 Binary files /dev/null and b/mods/farming/textures/farming_onigiri.png differ diff --git a/mods/farming/textures/farming_paella.png b/mods/farming/textures/farming_paella.png new file mode 100644 index 00000000..1362ac74 Binary files /dev/null and b/mods/farming/textures/farming_paella.png differ diff --git a/mods/farming/textures/farming_parsley.png b/mods/farming/textures/farming_parsley.png new file mode 100644 index 00000000..183ecb75 Binary files /dev/null and b/mods/farming/textures/farming_parsley.png differ diff --git a/mods/farming/textures/farming_parsley_1.png b/mods/farming/textures/farming_parsley_1.png new file mode 100644 index 00000000..632928c8 Binary files /dev/null and b/mods/farming/textures/farming_parsley_1.png differ diff --git a/mods/farming/textures/farming_parsley_2.png b/mods/farming/textures/farming_parsley_2.png new file mode 100644 index 00000000..fddbf00b Binary files /dev/null and b/mods/farming/textures/farming_parsley_2.png differ diff --git a/mods/farming/textures/farming_parsley_3.png b/mods/farming/textures/farming_parsley_3.png new file mode 100644 index 00000000..e4aacb94 Binary files /dev/null and b/mods/farming/textures/farming_parsley_3.png differ diff --git a/mods/farming/textures/farming_potato_omelet.png b/mods/farming/textures/farming_potato_omelet.png new file mode 100644 index 00000000..abdacada Binary files /dev/null and b/mods/farming/textures/farming_potato_omelet.png differ diff --git a/mods/farming/textures/farming_spanish_potatoes.png b/mods/farming/textures/farming_spanish_potatoes.png new file mode 100644 index 00000000..198b50e4 Binary files /dev/null and b/mods/farming/textures/farming_spanish_potatoes.png differ diff --git a/mods/farming/textures/farming_vanilla_flan.png b/mods/farming/textures/farming_vanilla_flan.png new file mode 100644 index 00000000..c8b9ff06 Binary files /dev/null and b/mods/farming/textures/farming_vanilla_flan.png differ diff --git a/mods/hollytree/init.lua b/mods/hollytree/init.lua index 74ca96d7..012cc6e8 100644 --- a/mods/hollytree/init.lua +++ b/mods/hollytree/init.lua @@ -44,6 +44,7 @@ if mg_name ~= "v6" and mg_name ~= "singlenode" then end minetest.register_decoration({ + name = "hollytree:holly_tree", deco_type = "schematic", place_on = {place_on}, sidelen = 16, diff --git a/mods/jacaranda/init.lua b/mods/jacaranda/init.lua index b5737522..655882b7 100644 --- a/mods/jacaranda/init.lua +++ b/mods/jacaranda/init.lua @@ -26,6 +26,7 @@ end if mg_name ~= "v6" and mg_name ~= "singlenode" then minetest.register_decoration({ + name = "jacaranda:jacaranda_tree", deco_type = "schematic", place_on = {"default:dirt_with_rainforest_litter"}, sidelen = 16, diff --git a/mods/larch/init.lua b/mods/larch/init.lua index 818c7abb..cedefc61 100644 --- a/mods/larch/init.lua +++ b/mods/larch/init.lua @@ -26,6 +26,7 @@ end if mg_name ~= "v6" and mg_name ~= "singlenode" then minetest.register_decoration({ + name = "larch:larch_tree", deco_type = "schematic", place_on = {"default:dirt_with_coniferous_litter"}, sidelen = 16, diff --git a/mods/led_marquee/init.lua b/mods/led_marquee/init.lua index 013848c5..bc19b47a 100644 --- a/mods/led_marquee/init.lua +++ b/mods/led_marquee/init.lua @@ -388,7 +388,7 @@ local on_digiline_receive_string = function(pos, node, channel, msg) end else local asc = string.byte(msg) - if asc > 29 and asc < 256 then + if asc > 30 and asc < 256 then minetest.swap_node(pos, { name = "led_marquee:char_"..asc, param2 = fdir + (last_color*8)}) meta:set_string("last_msg", tostring(msg)) meta:set_int("index", 1) diff --git a/mods/lemontree/init.lua b/mods/lemontree/init.lua index 89acf7f9..93faa3ff 100644 --- a/mods/lemontree/init.lua +++ b/mods/lemontree/init.lua @@ -69,6 +69,7 @@ end if mg_name ~= "v6" and mg_name ~= "singlenode" then minetest.register_decoration({ + name = "lemontree:lemon_tree", deco_type = "schematic", place_on = {"default:dirt_with_grass"}, sidelen = 16, diff --git a/mods/mahogany/init.lua b/mods/mahogany/init.lua index 254b35d4..b989af3a 100644 --- a/mods/mahogany/init.lua +++ b/mods/mahogany/init.lua @@ -28,6 +28,7 @@ end if mg_name ~= "v6" and mg_name ~= "singlenode" then minetest.register_decoration({ + name = "mahogany:mahogany_tree", deco_type = "schematic", place_on = {"default:dirt_with_rainforest_litter"}, sidelen = 16, diff --git a/mods/maple/init.lua b/mods/maple/init.lua index 3c32fbab..efe4bb33 100644 --- a/mods/maple/init.lua +++ b/mods/maple/init.lua @@ -40,6 +40,7 @@ if mg_name ~= "v6" and mg_name ~= "singlenode" then end minetest.register_decoration({ + name = "maple:maple_tree", deco_type = "schematic", place_on = {place_on}, sidelen = 16, diff --git a/mods/mesecons/fifo_queue.lua b/mods/mesecons/fifo_queue.lua new file mode 100644 index 00000000..a71c71bc --- /dev/null +++ b/mods/mesecons/fifo_queue.lua @@ -0,0 +1,62 @@ + +-- a simple first-in-first-out queue +-- very similar to the one in https://github.com/minetest/minetest/pull/7683 + +local fifo_queue = {} + +local metatable = {__index = fifo_queue} + +-- creates a new empty queue +function fifo_queue.new() + local q = {n_in = 0, n_out = 0, i_out = 1, buf_in = {}, buf_out = {}} + setmetatable(q, metatable) + return q +end + +-- adds an element to the queue +function fifo_queue.add(self, v) + local n = self.n_in + 1 + self.n_in = n + self.buf_in[n] = v +end + +-- removes and returns the next element, or nil of empty +function fifo_queue.take(self) + local i_out = self.i_out + if i_out <= self.n_out then + local v = self.buf_out[i_out] + self.i_out = i_out + 1 + self.buf_out[i_out] = true + return v + end + + -- buf_out is empty, try to swap + self.i_out = 1 + self.n_out = 0 + if self.n_in == 0 then + return nil -- empty + end + + -- swap + self.n_out = self.n_in + self.n_in = 0 + self.buf_out, self.buf_in = self.buf_in, self.buf_out + + local v = self.buf_out[1] + self.i_out = 2 + self.buf_out[1] = true + return v +end + +-- returns whether the queue is empty +function fifo_queue.is_empty(self) + return self.n_out == self.i_out + 1 and self.n_in == 0 +end + +-- returns stuff for iteration in a for loop, like pairs +-- adding new elements while iterating is no problem +function fifo_queue.iter(self) + return fifo_queue.take, self, nil +end + +return fifo_queue diff --git a/mods/mesecons/internal.lua b/mods/mesecons/internal.lua index 044e3bfa..ba19e5bc 100644 --- a/mods/mesecons/internal.lua +++ b/mods/mesecons/internal.lua @@ -11,7 +11,7 @@ -- RECEPTORS -- mesecon.is_receptor(nodename) --> Returns true if nodename is a receptor --- mesecon.is_receptor_on(nodename --> Returns true if nodename is an receptor with state = mesecon.state.on +-- mesecon.is_receptor_on(nodename) --> Returns true if nodename is an receptor with state = mesecon.state.on -- mesecon.is_receptor_off(nodename) --> Returns true if nodename is an receptor with state = mesecon.state.off -- mesecon.receptor_get_rules(node) --> Returns the rules of the receptor (mesecon.rules.default if none specified) @@ -46,6 +46,8 @@ -- mesecon.rotate_rules_down(rules) -- These functions return rules that have been rotated in the specific direction +local fifo_queue = dofile(minetest.get_modpath("mesecons").."/fifo_queue.lua") + -- General function mesecon.get_effector(nodename) if minetest.registered_nodes[nodename] @@ -371,32 +373,39 @@ end -- Follow all all conductor paths replacing conductors that were already -- looked at, activating / changing all effectors along the way. function mesecon.turnon(pos, link) - local frontiers = {{pos = pos, link = link}} + local frontiers = fifo_queue.new() + frontiers:add({pos = pos, link = link}) + local pos_can_be_skipped = {} local depth = 1 - while frontiers[1] do - local f = table.remove(frontiers, 1) + for f in frontiers:iter() do local node = mesecon.get_node_force(f.pos) if not node then -- Area does not exist; do nothing + pos_can_be_skipped[minetest.hash_node_position(f.pos)] = true elseif mesecon.is_conductor_off(node, f.link) then local rules = mesecon.conductor_get_rules(node) -- Call turnon on neighbors for _, r in ipairs(mesecon.rule2meta(f.link, rules)) do local np = vector.add(f.pos, r) - for _, l in ipairs(mesecon.rules_link_rule_all(f.pos, r)) do - table.insert(frontiers, {pos = np, link = l}) + if not pos_can_be_skipped[minetest.hash_node_position(np)] then + for _, l in ipairs(mesecon.rules_link_rule_all(f.pos, r)) do + frontiers:add({pos = np, link = l}) + end end end mesecon.swap_node_force(f.pos, mesecon.get_conductor_on(node, f.link)) + pos_can_be_skipped[minetest.hash_node_position(f.pos)] = true elseif mesecon.is_effector(node.name) then mesecon.changesignal(f.pos, node, f.link, mesecon.state.on, depth) if mesecon.is_effector_off(node.name) then mesecon.activate(f.pos, node, f.link, depth) end + else + pos_can_be_skipped[minetest.hash_node_position(f.pos)] = true end depth = depth + 1 end @@ -419,37 +428,42 @@ end -- depth = indicates order in which signals wire fired, higher is later -- } function mesecon.turnoff(pos, link) - local frontiers = {{pos = pos, link = link}} + local frontiers = fifo_queue.new() + frontiers:add({pos = pos, link = link}) local signals = {} + local pos_can_be_skipped = {} local depth = 1 - while frontiers[1] do - local f = table.remove(frontiers, 1) + for f in frontiers:iter() do local node = mesecon.get_node_force(f.pos) if not node then -- Area does not exist; do nothing + pos_can_be_skipped[minetest.hash_node_position(f.pos)] = true elseif mesecon.is_conductor_on(node, f.link) then local rules = mesecon.conductor_get_rules(node) for _, r in ipairs(mesecon.rule2meta(f.link, rules)) do local np = vector.add(f.pos, r) - -- Check if an onstate receptor is connected. If that is the case, - -- abort this turnoff process by returning false. `receptor_off` will - -- discard all the changes that we made in the voxelmanip: - for _, l in ipairs(mesecon.rules_link_rule_all_inverted(f.pos, r)) do - if mesecon.is_receptor_on(mesecon.get_node_force(np).name) then - return false + if not pos_can_be_skipped[minetest.hash_node_position(np)] then + -- Check if an onstate receptor is connected. If that is the case, + -- abort this turnoff process by returning false. `receptor_off` will + -- discard all the changes that we made in the voxelmanip: + if mesecon.rules_link_rule_all_inverted(f.pos, r)[1] then + if mesecon.is_receptor_on(mesecon.get_node_force(np).name) then + return false + end end - end - -- Call turnoff on neighbors - for _, l in ipairs(mesecon.rules_link_rule_all(f.pos, r)) do - table.insert(frontiers, {pos = np, link = l}) + -- Call turnoff on neighbors + for _, l in ipairs(mesecon.rules_link_rule_all(f.pos, r)) do + frontiers:add({pos = np, link = l}) + end end end mesecon.swap_node_force(f.pos, mesecon.get_conductor_off(node, f.link)) + pos_can_be_skipped[minetest.hash_node_position(f.pos)] = true elseif mesecon.is_effector(node.name) then table.insert(signals, { pos = f.pos, @@ -457,6 +471,8 @@ function mesecon.turnoff(pos, link) link = f.link, depth = depth }) + else + pos_can_be_skipped[minetest.hash_node_position(f.pos)] = true end depth = depth + 1 end diff --git a/mods/moreblocks/nodes.lua b/mods/moreblocks/nodes.lua index 79abcb57..fbe66dcc 100644 --- a/mods/moreblocks/nodes.lua +++ b/mods/moreblocks/nodes.lua @@ -194,7 +194,7 @@ local nodes = { description = S("Iron Glass"), drawtype = "glasslike_framed_optional", tiles = {"default_glass.png^[colorize:#DEDEDE", "default_glass_detail.png^[colorize:#DEDEDE"}, - use_texture_alpha = true, + use_texture_alpha = "clip", paramtype = "light", sunlight_propagates = true, is_ground_content = false, @@ -205,7 +205,7 @@ local nodes = { description = S("Coal Glass"), drawtype = "glasslike_framed_optional", tiles = {"default_glass.png^[colorize:#828282", "default_glass_detail.png^[colorize:#828282"}, - use_texture_alpha = true, + use_texture_alpha = "clip", paramtype = "light", sunlight_propagates = true, is_ground_content = false, @@ -216,7 +216,7 @@ local nodes = { description = S("Clean Glass"), drawtype = "glasslike_framed_optional", tiles = {"moreblocks_clean_glass.png", "moreblocks_clean_glass_detail.png"}, - use_texture_alpha = true, + use_texture_alpha = "clip", paramtype = "light", sunlight_propagates = true, is_ground_content = false, @@ -316,7 +316,7 @@ local nodes = { description = S("Trap Glass"), drawtype = "glasslike_framed_optional", tiles = {"default_glass.png^moreblocks_trap_box_glass.png", "default_glass_detail.png"}, - use_texture_alpha = true, + use_texture_alpha = "clip", paramtype = "light", sunlight_propagates = true, is_ground_content = false, @@ -329,7 +329,7 @@ local nodes = { description = S("Trap Obsidian Glass"), drawtype = "glasslike_framed_optional", tiles = {"default_obsidian_glass.png^moreblocks_trap_box_glass.png", "default_obsidian_glass_detail.png"}, - use_texture_alpha = true, + use_texture_alpha = "clip", paramtype = "light", sunlight_propagates = true, is_ground_content = false, @@ -353,7 +353,7 @@ local nodes = { description = S("Trap Clean Glass"), drawtype = "glasslike_framed_optional", tiles = {"moreblocks_clean_glass.png^moreblocks_trap_box_glass.png", "moreblocks_clean_glass_detail.png"}, - use_texture_alpha = true, + use_texture_alpha = "clip", paramtype = "light", sunlight_propagates = true, is_ground_content = false, @@ -412,7 +412,7 @@ local nodes = { description = S("Glow Glass"), drawtype = "glasslike_framed_optional", tiles = {"default_glass.png^[colorize:#E9CD61", "default_glass_detail.png^[colorize:#E9CD61"}, - use_texture_alpha = true, + use_texture_alpha = "clip", paramtype = "light", sunlight_propagates = true, is_ground_content = false, @@ -424,7 +424,7 @@ local nodes = { description = S("Clean Glow Glass"), drawtype = "glasslike_framed_optional", tiles = {"moreblocks_clean_glass.png^[colorize:#E9CD61", "moreblocks_clean_glass_detail.png^[colorize:#E9CD61"}, - use_texture_alpha = true, + use_texture_alpha = "clip", paramtype = "light", sunlight_propagates = true, is_ground_content = false, @@ -436,7 +436,7 @@ local nodes = { description = S("Trap Glow Glass"), drawtype = "glasslike_framed_optional", tiles = {"default_glass.png^[colorize:#E9CD61^moreblocks_trap_box_glass.png", "default_glass_detail.png^[colorize:#E9CD61"}, - use_texture_alpha = true, + use_texture_alpha = "clip", paramtype = "light", sunlight_propagates = true, is_ground_content = false, @@ -450,7 +450,7 @@ local nodes = { description = S("Trap Clean Glow Glass"), drawtype = "glasslike_framed_optional", tiles = {"moreblocks_clean_glass.png^[colorize:#E9CD61^moreblocks_trap_box_glass.png", "moreblocks_clean_glass_detail.png^[colorize:#E9CD61"}, - use_texture_alpha = true, + use_texture_alpha = "clip", paramtype = "light", sunlight_propagates = true, is_ground_content = false, @@ -464,7 +464,7 @@ local nodes = { description = S("Super Glow Glass"), drawtype = "glasslike_framed_optional", tiles = {"default_glass.png^[colorize:#FFFF78", "default_glass_detail.png^[colorize:#FFFF78"}, - use_texture_alpha = true, + use_texture_alpha = "clip", paramtype = "light", sunlight_propagates = true, is_ground_content = false, @@ -476,7 +476,7 @@ local nodes = { description = S("Clean Super Glow Glass"), drawtype = "glasslike_framed_optional", tiles = {"moreblocks_clean_glass.png^[colorize:#FFFF78", "moreblocks_clean_glass_detail.png^[colorize:#FFFF78"}, - use_texture_alpha = true, + use_texture_alpha = "clip", paramtype = "light", sunlight_propagates = true, is_ground_content = false, @@ -488,7 +488,7 @@ local nodes = { description = S("Trap Super Glow Glass"), drawtype = "glasslike_framed_optional", tiles = {"default_glass.png^[colorize:#FFFF78^moreblocks_trap_box_glass.png", "default_glass_detail.png^[colorize:#FFFF78"}, - use_texture_alpha = true, + use_texture_alpha = "clip", paramtype = "light", sunlight_propagates = true, is_ground_content = false, @@ -502,7 +502,7 @@ local nodes = { description = S("Trap Clean Super Glow Glass"), drawtype = "glasslike_framed_optional", tiles = {"moreblocks_clean_glass.png^[colorize:#FFFF78^moreblocks_trap_box_glass.png", "moreblocks_clean_glass_detail.png^[colorize:#FFFF78"}, - use_texture_alpha = true, + use_texture_alpha = "clip", paramtype = "light", sunlight_propagates = true, is_ground_content = false, diff --git a/mods/oak/init.lua b/mods/oak/init.lua index 57400f2e..a345ca7e 100644 --- a/mods/oak/init.lua +++ b/mods/oak/init.lua @@ -65,6 +65,7 @@ if mg_name ~= "v6" and mg_name ~= "singlenode" then end minetest.register_decoration({ + name = "oak:oak_tree", deco_type = "schematic", place_on = {place_on}, sidelen = 16, diff --git a/mods/palm/init.lua b/mods/palm/init.lua index b1e0e601..eb032a1a 100644 --- a/mods/palm/init.lua +++ b/mods/palm/init.lua @@ -22,6 +22,7 @@ end -- minetest.register_decoration({ + name = "palm:palm_tree", deco_type = "schematic", place_on = {"default:sand"}, sidelen = 16, diff --git a/mods/pineapple/init.lua b/mods/pineapple/init.lua index 6c048e3c..151820a1 100644 --- a/mods/pineapple/init.lua +++ b/mods/pineapple/init.lua @@ -27,6 +27,7 @@ end if mg_name ~= "v6" and mg_name ~= "singlenode" then minetest.register_decoration({ + name = "pineapple:pineapple_shrub", deco_type = "schematic", place_on = {"default:dirt_with_rainforest_litter"}, sidelen = 16, diff --git a/mods/plumtree/init.lua b/mods/plumtree/init.lua index fb9cc551..2dad620c 100644 --- a/mods/plumtree/init.lua +++ b/mods/plumtree/init.lua @@ -88,6 +88,7 @@ if minetest.get_modpath("rainf") then end minetest.register_decoration({ + name = "plumtree:plum_tree", deco_type = "schematic", place_on = {place_on}, sidelen = 16, diff --git a/mods/pomegranate/init.lua b/mods/pomegranate/init.lua index 45561b24..386cb789 100644 --- a/mods/pomegranate/init.lua +++ b/mods/pomegranate/init.lua @@ -50,6 +50,7 @@ end if mg_name ~= "v6" and mg_name ~= "singlenode" then minetest.register_decoration({ + name = "pomegranate:pomegranate_tree", deco_type = "schematic", place_on = {"default:dry_dirt"}, sidelen = 16, diff --git a/mods/stained_glass/init.lua b/mods/stained_glass/init.lua index 1de7b270..b3ffd4ec 100644 --- a/mods/stained_glass/init.lua +++ b/mods/stained_glass/init.lua @@ -52,7 +52,7 @@ minetest.register_node("stained_glass:stained_glass", { paramtype2 = "color", palette = "unifieddyes_palette_extended.png", sunlight_propagates = true, - use_texture_alpha = true, + use_texture_alpha = "blend", light_source = myglow, is_ground_content = true, walkable = true, @@ -78,7 +78,7 @@ minetest.register_node("stained_glass:stained_trap_glass", { paramtype2 = "color", palette = "unifieddyes_palette_extended.png", sunlight_propagates = true, - use_texture_alpha = true, + use_texture_alpha = "blend", light_source = myglow, is_ground_content = true, walkable = false, diff --git a/mods/technic_worldgen/config.lua b/mods/technic_worldgen/config.lua index 6f8fbd83..4ac748cd 100644 --- a/mods/technic_worldgen/config.lua +++ b/mods/technic_worldgen/config.lua @@ -6,7 +6,6 @@ local defaults = { enable_granite_generation = "true", enable_marble_generation = "true", enable_rubber_tree_generation = "true", - enable_steel_override = "true", } for k, v in pairs(defaults) do diff --git a/mods/technic_worldgen/crafts.lua b/mods/technic_worldgen/crafts.lua index 69cecdde..0590e70f 100644 --- a/mods/technic_worldgen/crafts.lua +++ b/mods/technic_worldgen/crafts.lua @@ -50,6 +50,11 @@ minetest.register_craftitem(":technic:sulfur_lump", { minetest.register_alias("technic:wrought_iron_ingot", "default:steel_ingot") +minetest.override_item("default:steel_ingot", { + description = S("Wrought Iron Ingot"), + inventory_image = "technic_wrought_iron_ingot.png", +}) + minetest.register_craftitem(":technic:cast_iron_ingot", { description = S("Cast Iron Ingot"), inventory_image = "technic_cast_iron_ingot.png", @@ -161,34 +166,27 @@ local function for_each_registered_item(action) end end -if technic.config:get_bool("enable_steel_override") then - minetest.override_item("default:steel_ingot", { - description = S("Wrought Iron Ingot"), - inventory_image = "technic_wrought_iron_ingot.png", - }) - - local steel_to_iron = {} - for _, i in ipairs({ - "default:axe_steel", - "default:pick_steel", - "default:shovel_steel", - "default:sword_steel", - "doors:door_steel", - "farming:hoe_steel", - "glooptest:hammer_steel", - "glooptest:handsaw_steel", - "glooptest:reinforced_crystal_glass", - "mesecons_doors:op_door_steel", - "mesecons_doors:sig_door_steel", - "vessels:steel_bottle", - }) do - steel_to_iron[i] = true - end - - for_each_registered_item(function(item_name) - local item_def = minetest.registered_items[item_name] - if steel_to_iron[item_name] and string.find(item_def.description, "Steel") then - minetest.override_item(item_name, { description = string.gsub(item_def.description, "Steel", S("Iron")) }) - end - end) +local steel_to_iron = {} +for _, i in ipairs({ + "default:axe_steel", + "default:pick_steel", + "default:shovel_steel", + "default:sword_steel", + "doors:door_steel", + "farming:hoe_steel", + "glooptest:hammer_steel", + "glooptest:handsaw_steel", + "glooptest:reinforced_crystal_glass", + "mesecons_doors:op_door_steel", + "mesecons_doors:sig_door_steel", + "vessels:steel_bottle", +}) do + steel_to_iron[i] = true end + +for_each_registered_item(function(item_name) + local item_def = minetest.registered_items[item_name] + if steel_to_iron[item_name] and string.find(item_def.description, "Steel") then + minetest.override_item(item_name, { description = string.gsub(item_def.description, "Steel", S("Iron")) }) + end +end) diff --git a/mods/technic_worldgen/nodes.lua b/mods/technic_worldgen/nodes.lua index a5cdbfa3..d4d3e4c7 100644 --- a/mods/technic_worldgen/nodes.lua +++ b/mods/technic_worldgen/nodes.lua @@ -104,6 +104,11 @@ minetest.register_node(":technic:lead_block", { minetest.register_alias("technic:wrought_iron_block", "default:steelblock") +minetest.override_item("default:steelblock", { + description = S("Wrought Iron Block"), + tiles = { "technic_wrought_iron_block.png" }, +}) + minetest.register_node(":technic:cast_iron_block", { description = S("Cast Iron Block"), tiles = { "technic_cast_iron_block.png" }, @@ -151,40 +156,33 @@ local function for_each_registered_node(action) end end -if technic.config:get_bool("enable_steel_override") then - minetest.override_item("default:steelblock", { - description = S("Wrought Iron Block"), - tiles = { "technic_wrought_iron_block.png" }, - }) - - for_each_registered_node(function(node_name, node_def) - if node_name ~= "default:steelblock" and - node_name:find("steelblock", 1, true) and - node_def.description:find("Steel", 1, true) then +for_each_registered_node(function(node_name, node_def) + if node_name ~= "default:steelblock" and + node_name:find("steelblock", 1, true) and + node_def.description:find("Steel", 1, true) then + minetest.override_item(node_name, { + description = node_def.description:gsub("Steel", S("Wrought Iron")), + }) + end + local tiles = node_def.tiles or node_def.tile_images + if tiles then + local new_tiles = {} + local do_override = false + if type(tiles) == "string" then + tiles = {tiles} + end + for i, t in ipairs(tiles) do + if type(t) == "string" and t == "default_steel_block.png" then + do_override = true + t = "technic_wrought_iron_block.png" + end + table.insert(new_tiles, t) + end + if do_override then minetest.override_item(node_name, { - description = node_def.description:gsub("Steel", S("Wrought Iron")), + tiles = new_tiles }) end - local tiles = node_def.tiles or node_def.tile_images - if tiles then - local new_tiles = {} - local do_override = false - if type(tiles) == "string" then - tiles = {tiles} - end - for i, t in ipairs(tiles) do - if type(t) == "string" and t == "default_steel_block.png" then - do_override = true - t = "technic_wrought_iron_block.png" - end - table.insert(new_tiles, t) - end - if do_override then - minetest.override_item(node_name, { - tiles = new_tiles - }) - end - end - end) -end + end +end) diff --git a/mods/titanium/depends.txt b/mods/titanium/depends.txt deleted file mode 100644 index 9824a646..00000000 --- a/mods/titanium/depends.txt +++ /dev/null @@ -1,2 +0,0 @@ -default -function_delayer diff --git a/mods/titanium/mod.conf b/mods/titanium/mod.conf new file mode 100644 index 00000000..71517e23 --- /dev/null +++ b/mods/titanium/mod.conf @@ -0,0 +1,2 @@ +name = titanium +depends = default,function_delayer diff --git a/mods/willow/init.lua b/mods/willow/init.lua index 4114d3a1..4688b0e7 100644 --- a/mods/willow/init.lua +++ b/mods/willow/init.lua @@ -27,6 +27,7 @@ end if mg_name ~= "v6" and mg_name ~= "singlenode" then minetest.register_decoration({ + name = "willow:willow_tree", deco_type = "schematic", place_on = {"default:dirt"}, sidelen = 16,