update cool trees, plantlife, bees, digistuff, farming redo,

led_marquee, mesecons, moreblocks, stained_glass, technic, and titanium
This commit is contained in:
Vanessa Dannenberg 2021-03-28 02:14:49 -04:00
parent d1a8445e01
commit 02949e4e29
61 changed files with 663 additions and 117 deletions

1
build-date Normal file
View File

@ -0,0 +1 @@
20210328-0214

View File

@ -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"},

View File

@ -115,6 +115,7 @@ end
--
minetest.register_decoration({
name = "bamboo:bamboo_tree",
deco_type = "schematic",
place_on = {"default:dirt_with_grass"},
sidelen = 16,

View File

@ -412,7 +412,10 @@ minetest.register_node("bees:hive_wild", {
if meta:get_int("agressive") == 1
and inv:contains_item("queen", "bees:queen") then
-- 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
-- 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]

View File

@ -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)

View File

@ -104,6 +104,7 @@ else
end
minetest.register_decoration({
name = "birch:birch_tree",
deco_type = "schematic",
place_on = {place_on},
sidelen = 16,

View File

@ -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

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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.

View File

@ -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

View File

@ -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,

View File

@ -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
}

View File

@ -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({

View File

@ -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
}

View File

@ -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)

View File

@ -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"}
}
})

View File

@ -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")

View File

@ -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

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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)

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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

View File

@ -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)
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
table.insert(frontiers, {pos = np, link = l})
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,25 +428,28 @@ 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)
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:
for _, l in ipairs(mesecon.rules_link_rule_all_inverted(f.pos, r)) do
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
@ -445,11 +457,13 @@ function mesecon.turnoff(pos, link)
-- Call turnoff on neighbors
for _, l in ipairs(mesecon.rules_link_rule_all(f.pos, r)) do
table.insert(frontiers, {pos = np, link = l})
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

View File

@ -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,

View File

@ -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,

View File

@ -22,6 +22,7 @@ end
--
minetest.register_decoration({
name = "palm:palm_tree",
deco_type = "schematic",
place_on = {"default:sand"},
sidelen = 16,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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

View File

@ -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,14 +166,8 @@ 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({
local steel_to_iron = {}
for _, i in ipairs({
"default:axe_steel",
"default:pick_steel",
"default:shovel_steel",
@ -181,14 +180,13 @@ if technic.config:get_bool("enable_steel_override") then
"mesecons_doors:op_door_steel",
"mesecons_doors:sig_door_steel",
"vessels:steel_bottle",
}) do
}) do
steel_to_iron[i] = true
end
end
for_each_registered_item(function(item_name)
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)
end
end)

View File

@ -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,13 +156,7 @@ 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)
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
@ -185,6 +184,5 @@ if technic.config:get_bool("enable_steel_override") then
})
end
end
end)
end
end)

View File

@ -1,2 +0,0 @@
default
function_delayer

2
mods/titanium/mod.conf Normal file
View File

@ -0,0 +1,2 @@
name = titanium
depends = default,function_delayer

View File

@ -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,