update ambience, baked clay, cool trees, bees, bonemeal, digilines,
farming redo, function delayer, item_drop, jumping, maptools, mesecons, moreblocks, moreores, technic, unified inventory, and worldedit.master
|
@ -0,0 +1 @@
|
|||
20211128-1200
|
|
@ -91,12 +91,16 @@ end
|
|||
|
||||
-- setup table when player joins
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
playing[player:get_player_name()] = {music = -1}
|
||||
if player then
|
||||
playing[player:get_player_name()] = {music = -1}
|
||||
end
|
||||
end)
|
||||
|
||||
-- remove table when player leaves
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
playing[player:get_player_name()] = nil
|
||||
if player then
|
||||
playing[player:get_player_name()] = nil
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
|
@ -104,7 +108,8 @@ end)
|
|||
local get_ambience = function(player, tod, name)
|
||||
|
||||
-- play server or local music if music enabled and music not already playing
|
||||
if play_music and MUSICVOLUME > 0 and playing[name].music < 0 then
|
||||
if play_music and MUSICVOLUME > 0
|
||||
and playing[name] and playing[name].music < 0 then
|
||||
|
||||
-- count backwards
|
||||
playing[name].music = playing[name].music -1
|
||||
|
@ -133,13 +138,14 @@ local get_ambience = function(player, tod, name)
|
|||
-- get foot and head level nodes at player position
|
||||
local pos = player:get_pos() ; if not pos then return end
|
||||
local prop = player:get_properties()
|
||||
local eyeh = prop.eye_height or 1.47 -- eye level with fallback
|
||||
|
||||
pos.y = pos.y + prop.eye_height -- eye level
|
||||
pos.y = pos.y + eyeh
|
||||
|
||||
local nod_head = pplus and name and playerplus[name]
|
||||
and playerplus[name].nod_head or minetest.get_node(pos).name
|
||||
|
||||
pos.y = (pos.y - prop.eye_height) + 0.2 -- foot level
|
||||
pos.y = (pos.y - eyeh) + 0.2 -- foot level
|
||||
|
||||
local nod_feet = pplus and name and playerplus[name]
|
||||
and playerplus[name].nod_feet or minetest.get_node(pos).name
|
||||
|
@ -195,7 +201,7 @@ minetest.register_globalstep(function(dtime)
|
|||
local tod = minetest.get_timeofday()
|
||||
|
||||
-- loop through players
|
||||
for _, player in ipairs(minetest.get_connected_players()) do
|
||||
for _, player in pairs(minetest.get_connected_players()) do
|
||||
|
||||
player_name = player:get_player_name()
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ ambience.add_set("lava", {
|
|||
})
|
||||
|
||||
else
|
||||
print ("[Ambience] found env_sounds, flowing water sounds disabled.")
|
||||
print ("[Ambience] found env_sounds, flowing water and lava sounds disabled.")
|
||||
end
|
||||
|
||||
-- Only add fire sounds set if flame_sound is disabled or fire redo active
|
||||
|
@ -238,7 +238,7 @@ ambience.add_set("ice", {
|
|||
frequency = 250,
|
||||
|
||||
sounds = {
|
||||
{name = "icecrack", length = 23},
|
||||
{name = "icecrack", length = 23, gain = 0.7},
|
||||
{name = "desertwind", length = 8},
|
||||
{name = "wind", length = 9}
|
||||
},
|
||||
|
@ -280,7 +280,7 @@ ambience.add_set("desert", {
|
|||
end
|
||||
})
|
||||
|
||||
-- Cave sounds play when below player position Y -25
|
||||
-- Cave sounds play when below player position Y -25 and water nearby
|
||||
|
||||
ambience.add_set("cave", {
|
||||
|
||||
|
@ -293,7 +293,9 @@ ambience.add_set("cave", {
|
|||
|
||||
sound_check = function(def)
|
||||
|
||||
if def.pos.y < -25 then
|
||||
local c = (def.totals["default:water_source"] or 0)
|
||||
|
||||
if c > 0 and def.pos.y < -25 then
|
||||
return "cave"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,11 +2,13 @@ Baked Clay
|
|||
|
||||
This mod lets the player bake clay into hardened blocks and colour them with
|
||||
dye (8x baked clay and 1x dye in centre), stairs and slabs are also available.
|
||||
Cooking baked clay turns it into glazed terracotta blocks.
|
||||
|
||||
https://forum.minetest.net/viewtopic.php?id=8890
|
||||
|
||||
Changelog:
|
||||
|
||||
- 1.0 - Re-Added glazed terracotta blocks when you cook baked clay in furnace (thanks Amara2_MK), added support for sofar's flowerpot mod, missing glazed textures re-coloured by firefox.
|
||||
- 0.9 - Baked clay now works in the technic cnc machine
|
||||
- 0.8 - Cooking clay block in furnace gives natural baked clay which you can dye
|
||||
- 0.7 - Added support for stairsplus so that stairs are registered properly
|
||||
|
@ -17,7 +19,7 @@ Changelog:
|
|||
- 0.2 - Any colour of baked clay can be re-dyed into another colour
|
||||
- 0.1 - Initial Release
|
||||
|
||||
Lucky Blocks: 9
|
||||
Lucky Blocks: 10
|
||||
|
||||
|
||||
Note: Under settings you will find 'colored_clay_compatibility' switch that when enabled will register aliases for the older colored clay mod and it's stairplus stairs.
|
||||
|
|
|
@ -3,3 +3,4 @@ stairs
|
|||
moreblocks?
|
||||
lucky_block?
|
||||
technic_cnc?
|
||||
flowerpot?
|
||||
|
|
|
@ -17,7 +17,7 @@ local clay = {
|
|||
{"brown", "Brown"},
|
||||
{"pink", "Pink"},
|
||||
{"dark_grey", "Dark Grey"},
|
||||
{"dark_green", "Dark Green"},
|
||||
{"dark_green", "Dark Green"}
|
||||
}
|
||||
|
||||
local techcnc_mod = minetest.get_modpath("technic_cnc")
|
||||
|
@ -27,42 +27,50 @@ local stairsplus_mod = minetest.get_modpath("moreblocks")
|
|||
|
||||
for _, clay in pairs(clay) do
|
||||
|
||||
-- node definition
|
||||
-- node
|
||||
|
||||
minetest.register_node("bakedclay:" .. clay[1], {
|
||||
description = clay[2] .. " Baked Clay",
|
||||
tiles = {"baked_clay_" .. clay[1] ..".png"},
|
||||
groups = {cracky = 3, bakedclay = 1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
sounds = default.node_sound_stone_defaults()
|
||||
})
|
||||
|
||||
-- craft from dye and any baked clay
|
||||
-- craft recipe
|
||||
|
||||
if clay[1] ~= "natural" then
|
||||
|
||||
minetest.register_craft({
|
||||
output = "bakedclay:" .. clay[1] .. " 8",
|
||||
recipe = {
|
||||
{"group:bakedclay", "group:bakedclay", "group:bakedclay"},
|
||||
{"group:bakedclay", "dye:" .. clay[1], "group:bakedclay"},
|
||||
{"group:bakedclay", "group:bakedclay", "group:bakedclay"}
|
||||
},
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
-- register stairsplus stairs if found
|
||||
-- stairs plus
|
||||
if stairsplus_mod then
|
||||
|
||||
stairsplus:register_all("bakedclay", "baked_clay_" .. clay[1], "bakedclay:" .. clay[1], {
|
||||
stairsplus:register_all("bakedclay", "baked_clay_" .. clay[1],
|
||||
"bakedclay:" .. clay[1], {
|
||||
description = clay[2] .. " Baked Clay",
|
||||
tiles = {"baked_clay_" .. clay[1] .. ".png"},
|
||||
groups = {cracky = 3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
sounds = default.node_sound_stone_defaults()
|
||||
})
|
||||
|
||||
stairsplus:register_alias_all("bakedclay", clay[1], "bakedclay", "baked_clay_" .. clay[1])
|
||||
minetest.register_alias("stairs:slab_bakedclay_".. clay[1], "bakedclay:slab_baked_clay_" .. clay[1])
|
||||
minetest.register_alias("stairs:stair_bakedclay_".. clay[1], "bakedclay:stair_baked_clay_" .. clay[1])
|
||||
stairsplus:register_alias_all("bakedclay", clay[1],
|
||||
"bakedclay", "baked_clay_" .. clay[1])
|
||||
|
||||
-- register all stair types for stairs redo
|
||||
minetest.register_alias("stairs:slab_bakedclay_".. clay[1],
|
||||
"bakedclay:slab_baked_clay_" .. clay[1])
|
||||
|
||||
minetest.register_alias("stairs:stair_bakedclay_".. clay[1],
|
||||
"bakedclay:stair_baked_clay_" .. clay[1])
|
||||
|
||||
-- stairs redo
|
||||
elseif stairs_mod and stairs.mod then
|
||||
|
||||
stairs.register_all("bakedclay_" .. clay[1], "bakedclay:" .. clay[1],
|
||||
|
@ -71,7 +79,7 @@ for _, clay in pairs(clay) do
|
|||
clay[2] .. " Baked Clay",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
-- register stair and slab using default stairs
|
||||
-- default stairs
|
||||
elseif stairs_mod then
|
||||
|
||||
stairs.register_stair_and_slab("bakedclay_".. clay[1], "bakedclay:".. clay[1],
|
||||
|
@ -92,6 +100,39 @@ for _, clay in pairs(clay) do
|
|||
end
|
||||
end
|
||||
|
||||
-- Terracotta blocks (textures by D3monPixel, thanks for use :)
|
||||
for _, clay in pairs(clay) do
|
||||
|
||||
if clay[1] ~= "natural" then
|
||||
|
||||
local texture = "baked_clay_terracotta_" .. clay[1] ..".png"
|
||||
|
||||
minetest.register_node("bakedclay:terracotta_" .. clay[1], {
|
||||
description = clay[2] .. " Glazed Terracotta",
|
||||
tiles = {
|
||||
texture .. "",
|
||||
texture .. "",
|
||||
texture .. "^[transformR180",
|
||||
texture .. "",
|
||||
texture .. "^[transformR270",
|
||||
texture .. "^[transformR90",
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky = 3, terracotta = 1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_place = minetest.rotate_node
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "bakedclay:terracotta_" .. clay[1],
|
||||
recipe = "bakedclay:" .. clay[1]
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_alias("bakedclay:terracotta_light_blue", "bakedclay:terracotta_cyan")
|
||||
|
||||
-- cook clay block into white baked clay
|
||||
|
||||
minetest.register_craft({
|
||||
|
@ -108,34 +149,29 @@ minetest.register_craft( {
|
|||
recipe = {"dye:black", "dye:black", "dye:white"}
|
||||
})
|
||||
|
||||
-- only add light grey recipe if unifieddye mod isnt present (conflict)
|
||||
if not minetest.get_modpath("unifieddyes") then
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "dye:grey 3",
|
||||
recipe = {"dye:black", "dye:white", "dye:white"}
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "dye:green 4",
|
||||
recipe = {"default:cactus"}
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "dye:black 4",
|
||||
recipe = {"default:coal_lump"}
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "dye:brown 4",
|
||||
recipe = {"default:dry_shrub"}
|
||||
})
|
||||
|
||||
-- 2x2 red bakedclay makes 16x clay brick
|
||||
-- only add light grey recipe if unifieddye mod isnt present (conflict)
|
||||
if not minetest.get_modpath("unifieddyes") then
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "dye:grey 3",
|
||||
recipe = {"dye:black", "dye:white", "dye:white"}
|
||||
})
|
||||
end
|
||||
|
||||
-- 2x2 red baked clay makes 16x clay brick
|
||||
minetest.register_craft( {
|
||||
output = "default:clay_brick 16",
|
||||
recipe = {
|
||||
|
@ -176,10 +212,17 @@ local function add_simple_flower(name, desc, box, f_groups)
|
|||
end
|
||||
|
||||
local flowers = {
|
||||
{"delphinium", "Blue Delphinium", {-0.15, -0.5, -0.15, 0.15, 0.3, 0.15}, {color_cyan = 1}},
|
||||
{"thistle", "Thistle", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_magenta = 1}},
|
||||
{"lazarus", "Lazarus Bell", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_pink = 1}},
|
||||
{"mannagrass", "Reed Mannagrass", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_dark_green = 1}},
|
||||
{"delphinium", "Blue Delphinium",
|
||||
{-0.15, -0.5, -0.15, 0.15, 0.3, 0.15}, {color_cyan = 1}},
|
||||
|
||||
{"thistle", "Thistle",
|
||||
{-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_magenta = 1}},
|
||||
|
||||
{"lazarus", "Lazarus Bell",
|
||||
{-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_pink = 1}},
|
||||
|
||||
{"mannagrass", "Reed Mannagrass",
|
||||
{-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_dark_green = 1}}
|
||||
}
|
||||
|
||||
for _,item in pairs(flowers) do
|
||||
|
@ -202,7 +245,7 @@ minetest.register_decoration({
|
|||
},
|
||||
y_min = 10,
|
||||
y_max = 90,
|
||||
decoration = "bakedclay:delphinium",
|
||||
decoration = "bakedclay:delphinium"
|
||||
})
|
||||
|
||||
minetest.register_decoration({
|
||||
|
@ -219,7 +262,7 @@ minetest.register_decoration({
|
|||
},
|
||||
y_min = 15,
|
||||
y_max = 90,
|
||||
decoration = "bakedclay:thistle",
|
||||
decoration = "bakedclay:thistle"
|
||||
})
|
||||
|
||||
minetest.register_decoration({
|
||||
|
@ -238,7 +281,7 @@ minetest.register_decoration({
|
|||
y_max = 90,
|
||||
decoration = "bakedclay:lazarus",
|
||||
spawn_by = "default:jungletree",
|
||||
num_spawn_by = 1,
|
||||
num_spawn_by = 1
|
||||
})
|
||||
|
||||
minetest.register_decoration({
|
||||
|
@ -257,13 +300,15 @@ minetest.register_decoration({
|
|||
y_max = 15,
|
||||
decoration = "bakedclay:mannagrass",
|
||||
spawn_by = "group:water",
|
||||
num_spawn_by = 1,
|
||||
num_spawn_by = 1
|
||||
})
|
||||
|
||||
-- add lucky blocks
|
||||
-- lucky blocks
|
||||
|
||||
if minetest.get_modpath("lucky_block") then
|
||||
|
||||
local p = "bakedclay:"
|
||||
|
||||
lucky_block:add_blocks({
|
||||
{"dro", {"bakedclay:"}, 10, true},
|
||||
{"fal", {p.."black", p.."blue", p.."brown", p.."cyan", p.."dark_green",
|
||||
|
@ -295,13 +340,35 @@ lucky_block:add_blocks({
|
|||
{name = p.."red", max = 30},
|
||||
{name = p.."violet", max = 30},
|
||||
{name = p.."white", max = 30},
|
||||
{name = p.."yellow", max = 30},
|
||||
{name = p.."yellow", max = 30}
|
||||
}},
|
||||
})
|
||||
|
||||
p = "bakedclay:terracotta_"
|
||||
|
||||
lucky_block:add_blocks({
|
||||
{"nod", "default:chest", 0, {
|
||||
{name = p.."black", max = 20},
|
||||
{name = p.."blue", max = 20},
|
||||
{name = p.."brown", max = 20},
|
||||
{name = p.."cyan", max = 20},
|
||||
{name = p.."dark_green", max = 20},
|
||||
{name = p.."dark_grey", max = 20},
|
||||
{name = p.."green", max = 20},
|
||||
{name = p.."grey", max = 20},
|
||||
{name = p.."magenta", max = 20},
|
||||
{name = p.."orange", max = 20},
|
||||
{name = p.."pink", max = 20},
|
||||
{name = p.."red", max = 20},
|
||||
{name = p.."violet", max = 20},
|
||||
{name = p.."white", max = 20},
|
||||
{name = p.."yellow", max = 20}
|
||||
}}
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
-- colored clay compatibility
|
||||
|
||||
if minetest.settings:get_bool("colored_clay_compatibility") == true then
|
||||
|
||||
local cc = {
|
||||
|
@ -338,5 +405,14 @@ end
|
|||
|
||||
end
|
||||
|
||||
-- flowerpot mod
|
||||
|
||||
if minetest.get_modpath("flowerpot") then
|
||||
flowerpot.register_node("bakedclay:delphinium")
|
||||
flowerpot.register_node("bakedclay:thistle")
|
||||
flowerpot.register_node("bakedclay:lazarus")
|
||||
flowerpot.register_node("bakedclay:mannagrass")
|
||||
end
|
||||
|
||||
|
||||
print ("[MOD] Baked Clay loaded")
|
||||
|
|
|
@ -19,3 +19,10 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
Textures by Amara2_MK (Creative Commons)
|
||||
https://www.curseforge.com/minecraft/texture-packs/glazed-terracotta-revamp
|
||||
baked_clay_terracotta*.png
|
||||
|
||||
Missing gray, light gray, black and green textures re-coloured by Firefox.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name = bakedclay
|
||||
depends = default
|
||||
optional_depends = stairs, moreblocks, lucky_block, technic_cnc
|
||||
optional_depends = stairs, moreblocks, lucky_block, technic_cnc, flowerpot
|
||||
description = Adds the ability to bake clay into blocks and colour them with dye.
|
||||
|
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 81 KiB |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 573 B |
After Width: | Height: | Size: 520 B |
After Width: | Height: | Size: 591 B |
After Width: | Height: | Size: 664 B |
After Width: | Height: | Size: 534 B |
After Width: | Height: | Size: 746 B |
After Width: | Height: | Size: 659 B |
After Width: | Height: | Size: 589 B |
After Width: | Height: | Size: 490 B |
After Width: | Height: | Size: 530 B |
After Width: | Height: | Size: 520 B |
After Width: | Height: | Size: 385 B |
After Width: | Height: | Size: 641 B |
After Width: | Height: | Size: 660 B |
After Width: | Height: | Size: 569 B |
|
@ -25,8 +25,8 @@ end
|
|||
--
|
||||
|
||||
if mg_name ~= "v6" and mg_name ~= "singlenode" then
|
||||
name = "baldcypress:baldcypress_tree",
|
||||
minetest.register_decoration({
|
||||
name = "baldcypress:baldcypress_tree",
|
||||
deco_type = "schematic",
|
||||
place_on = {"default:sand"},
|
||||
sidelen = 16,
|
||||
|
@ -140,9 +140,9 @@ minetest.register_node("baldcypress:dry_branches", {
|
|||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
tiles = {"baldcypress_dry_branches.png"},
|
||||
use_texture_alpha = true,
|
||||
inventory_image = "baldcypress_dry_branches.png",
|
||||
wield_image = "baldcypress_dry_branches.png",
|
||||
use_texture_alpha = "clip",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, 0.49, 0.5, 0.5, 0.5}
|
||||
|
@ -160,9 +160,9 @@ minetest.register_node("baldcypress:liana", {
|
|||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
tiles = {"baldcypress_liana.png"},
|
||||
use_texture_alpha = true,
|
||||
inventory_image = "baldcypress_liana.png",
|
||||
wield_image = "baldcypress_liana.png",
|
||||
use_texture_alpha = "clip",
|
||||
is_ground_content = false,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
|
@ -200,15 +200,6 @@ minetest.register_craft({
|
|||
burntime = 7,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_lbm({
|
||||
name = "baldcypress:convert_baldcypress_saplings_to_node_timer",
|
||||
nodenames = {"baldcypress:sapling"},
|
||||
action = function(pos)
|
||||
minetest.get_node_timer(pos):start(math.random(1200, 2400))
|
||||
end
|
||||
})
|
||||
|
||||
default.register_leafdecay({
|
||||
trunks = {"baldcypress:trunk"},
|
||||
leaves = {"baldcypress:leaves"},
|
||||
|
@ -224,10 +215,10 @@ if minetest.settings:get_bool("cool_fences", true) then
|
|||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
}
|
||||
default.register_fence("baldcypress:fence", table.copy(fence))
|
||||
default.register_fence("baldcypress:fence", table.copy(fence))
|
||||
fence.description = S("Bald Cypress Fence Rail")
|
||||
default.register_fence_rail("baldcypress:fence_rail", table.copy(fence))
|
||||
|
||||
|
||||
if minetest.get_modpath("doors") ~= nil then
|
||||
fence.description = S("Bald Cypress Fence Gate")
|
||||
doors.register_fencegate("baldcypress:gate", table.copy(fence))
|
||||
|
@ -265,3 +256,8 @@ if minetest.get_modpath("bonemeal") ~= nil then
|
|||
{"baldcypress:sapling", grow_new_baldcypress_tree, "soil"},
|
||||
})
|
||||
end
|
||||
|
||||
-- Support for flowerpot
|
||||
if minetest.global_exists("flowerpot") then
|
||||
flowerpot.register_node("baldcypress:sapling")
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name = baldcypress
|
||||
description = Bald Cypress for Swamps
|
||||
depends = default
|
||||
optional_depends = stairs, bonemeal, swampz, doors, moreblocks
|
||||
optional_depends = stairs, bonemeal, swampz, doors, moreblocks, flowerpot
|
||||
|
|
|
@ -234,14 +234,6 @@ default.register_leafdecay({
|
|||
radius = 3,
|
||||
})
|
||||
|
||||
minetest.register_lbm({
|
||||
name = "bamboo:convert_bambootree_sprouts_to_node_timer",
|
||||
nodenames = {"bamboo:sprout"},
|
||||
action = function(pos)
|
||||
minetest.get_node_timer(pos):start(math.random(1200, 2400))
|
||||
end
|
||||
})
|
||||
|
||||
if minetest.get_modpath("bonemeal") ~= nil then
|
||||
bonemeal:add_sapling({
|
||||
{"bamboo:sprout", grow_new_bambootree_tree, "soil"},
|
||||
|
@ -257,10 +249,10 @@ if minetest.settings:get_bool("cool_fences", true) then
|
|||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
}
|
||||
default.register_fence("bamboo:fence", table.copy(fence))
|
||||
default.register_fence("bamboo:fence", table.copy(fence))
|
||||
fence.description = S("Bamboo Fence Rail")
|
||||
default.register_fence_rail("bamboo:fence_rail", table.copy(fence))
|
||||
|
||||
|
||||
if minetest.get_modpath("doors") ~= nil then
|
||||
fence.description = S("Bamboo Fence Gate")
|
||||
doors.register_fencegate("bamboo:gate", table.copy(fence))
|
||||
|
@ -290,3 +282,8 @@ if minetest.get_modpath("moreblocks") then
|
|||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
-- Support for flowerpot
|
||||
if minetest.global_exists("flowerpot") then
|
||||
flowerpot.register_node("bamboo:sprout")
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name = bamboo
|
||||
description = Bamboo Tree for Grassland
|
||||
depends = default
|
||||
optional_depends = stairs, bonemeal, doors, moreblocks
|
||||
optional_depends = stairs, bonemeal, doors, moreblocks, flowerpot
|
||||
|
|
|
@ -279,7 +279,8 @@ minetest.register_node("bees:hive_wild", {
|
|||
{items = {"bees:honey_comb"}, rarity = 5}
|
||||
}
|
||||
},
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, attached_node = 1},
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
|
||||
--, attached_node = 1},
|
||||
node_box = { -- VanessaE's wild hive nodebox contribution
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
|
|
|
@ -233,15 +233,6 @@ minetest.register_craft({
|
|||
burntime = 7,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_lbm({
|
||||
name = "birch:convert_birch_saplings_to_node_timer",
|
||||
nodenames = {"birch:sapling"},
|
||||
action = function(pos)
|
||||
minetest.get_node_timer(pos):start(math.random(1200, 2400))
|
||||
end
|
||||
})
|
||||
|
||||
default.register_leafdecay({
|
||||
trunks = {"birch:trunk"},
|
||||
leaves = {"birch:leaves"},
|
||||
|
@ -257,10 +248,10 @@ if minetest.settings:get_bool("cool_fences", true) then
|
|||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
}
|
||||
default.register_fence("birch:fence", table.copy(fence))
|
||||
default.register_fence("birch:fence", table.copy(fence))
|
||||
fence.description = S("Birch Fence Rail")
|
||||
default.register_fence_rail("birch:fence_rail", table.copy(fence))
|
||||
|
||||
|
||||
if minetest.get_modpath("doors") ~= nil then
|
||||
fence.description = S("Birch Fence Gate")
|
||||
doors.register_fencegate("birch:gate", table.copy(fence))
|
||||
|
@ -313,3 +304,8 @@ if minetest.get_modpath("doors") ~= nil then
|
|||
})
|
||||
end
|
||||
|
||||
|
||||
-- Support for flowerpot
|
||||
if minetest.global_exists("flowerpot") then
|
||||
flowerpot.register_node("birch:sapling")
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name = birch
|
||||
description = Birch Tree for Grassland
|
||||
depends = default
|
||||
optional_depends = stairs, bonemeal, rainf, doors, moreblocks
|
||||
optional_depends = stairs, bonemeal, rainf, doors, moreblocks, flowerpot
|
||||
|
|
|
@ -46,7 +46,8 @@ if farming and farming.mod and farming.mod == "redo" then
|
|||
{"farming:vanilla_", 8},
|
||||
{"farming:soy_", 7},
|
||||
{"farming:artichoke_", 5},
|
||||
{"farming:parsley_", 3}
|
||||
{"farming:parsley_", 3},
|
||||
{"farming:sunflower_", 8}
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -68,6 +69,7 @@ if minetest.get_modpath("ethereal") then
|
|||
{"ethereal:mushroom_sapling", ethereal.grow_mushroom_tree, "soil"},
|
||||
{"ethereal:willow_sapling", ethereal.grow_willow_tree, "soil"},
|
||||
{"ethereal:redwood_sapling", ethereal.grow_redwood_tree, "soil"},
|
||||
{"ethereal:giant_redwood_sapling", ethereal.grow_giant_redwood_tree, "soil"},
|
||||
{"ethereal:orange_tree_sapling", ethereal.grow_orange_tree, "soil"},
|
||||
{"ethereal:bamboo_sprout", ethereal.grow_bamboo_tree, "soil"},
|
||||
{"ethereal:birch_sapling", ethereal.grow_birch_tree, "soil"},
|
||||
|
|
|
@ -0,0 +1,540 @@
|
|||
schematic = {
|
||||
size = {x=5, y=7, z=5},
|
||||
yslice_prob = {
|
||||
{ypos=0, prob=254},
|
||||
{ypos=1, prob=254},
|
||||
{ypos=2, prob=254},
|
||||
{ypos=3, prob=254},
|
||||
{ypos=4, prob=254},
|
||||
{ypos=5, prob=254},
|
||||
{ypos=6, prob=254},
|
||||
},
|
||||
data = {
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:liana", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:flower_creeper", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:flower_creeper", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:flower_creeper", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:liana", prob=254, param2=0},
|
||||
{name="cacaotree:liana", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:pod", prob=254, param2=4},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:trunk", prob=254, param2=3},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:trunk", prob=254, param2=3},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:pod", prob=254, param2=2},
|
||||
{name="cacaotree:trunk", prob=254, param2=2},
|
||||
{name="cacaotree:pod", prob=254, param2=3},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:liana", prob=254, param2=1},
|
||||
{name="cacaotree:trunk", prob=254, param2=1},
|
||||
{name="cacaotree:liana", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:pod", prob=254, param2=5},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:flower_creeper", prob=254, param2=2},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:flower_creeper", prob=254, param2=2},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:liana", prob=254, param2=2},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:liana", prob=254, param2=2},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Cacao Tree
|
||||
--
|
||||
|
||||
local modname = "cacaotree"
|
||||
local modpath = minetest.get_modpath(modname)
|
||||
local mg_name = minetest.get_mapgen_setting("mg_name")
|
||||
|
||||
-- internationalization boilerplate
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
local grow_time_min = 2400
|
||||
local grow_time_max = 4800
|
||||
local retry_grow_time_min = 240
|
||||
local retry_grow_time_max = 600
|
||||
|
||||
--Pod
|
||||
|
||||
minetest.register_node("cacaotree:pod", {
|
||||
description = S("Cacao Pod"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
"cacaotree_bean_top.png",
|
||||
"cacaotree_bean_top.png^[transformFY",
|
||||
"cacaotree_bean_right.png",
|
||||
"cacaotree_bean_right.png^[transformFX",
|
||||
"cacaotree_bean_front.png",
|
||||
},
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.25, -0.5, 0, 0.25, 0.0625, 0.5},
|
||||
},
|
||||
},
|
||||
use_texture_alpha = "clip",
|
||||
drop = "cacaotree:cacao_beans 10",
|
||||
groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
|
||||
leafdecay = 3, leafdecay_drop = 1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
walkable = false,
|
||||
is_ground_content = false,
|
||||
})
|
||||
|
||||
--Cacao Beans
|
||||
|
||||
minetest.register_craftitem("cacaotree:cacao_beans", {
|
||||
description = S("Cacao Beans"),
|
||||
inventory_image = "cacaotree_cacao_beans.png"
|
||||
})
|
||||
|
||||
--Cocoa Powder
|
||||
|
||||
minetest.register_craftitem("cacaotree:cocoa_powder", {
|
||||
description = S("Cocoa Powder"),
|
||||
inventory_image = "cacaotree_cocoa_powder.png"
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "cacaotree:cocoa_powder",
|
||||
recipe = "cacaotree:cacao_beans",
|
||||
cooktime = 2,
|
||||
})
|
||||
|
||||
--Chocolate
|
||||
|
||||
minetest.register_craftitem("cacaotree:milk_chocolate", {
|
||||
description = S("Milk Chocolate"),
|
||||
inventory_image = "cacaotree_milk_choco.png",
|
||||
on_use = minetest.item_eat(4),
|
||||
groups = {flammable = 2, food = 2, food_chocolate = 1},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "cacaotree:milk_chocolate 6",
|
||||
recipe = {"cacaotree:cocoa_powder", "group:milk_bucket"},
|
||||
replacements = {{"group:milk_bucket", "bucket:bucket_empty"}},
|
||||
})
|
||||
|
||||
--Chocolate Cake
|
||||
|
||||
minetest.register_craftitem("cacaotree:choco_cake", {
|
||||
description = S("Choco Cake"),
|
||||
inventory_image = "cacaotree_choco_cake.png",
|
||||
on_use = minetest.item_eat(7),
|
||||
groups = {flammable = 2, food = 2, food_chocolate = 1},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "cacaotree:choco_cake",
|
||||
recipe = {"cacaotree:cocoa_powder", "group:food_egg", "farming:wheat"},
|
||||
})
|
||||
|
||||
--Cacao Grow Function
|
||||
|
||||
local function grow_new_cacao_tree(pos)
|
||||
if not default.can_grow(pos) then
|
||||
-- try a bit later again
|
||||
minetest.get_node_timer(pos):start(math.random(retry_grow_time_min, retry_grow_time_max))
|
||||
return
|
||||
end
|
||||
minetest.remove_node(pos)
|
||||
minetest.place_schematic({x = pos.x-2, y = pos.y, z = pos.z-2}, modpath.."/schematics/cacaotree.mts", "0", nil, false)
|
||||
end
|
||||
|
||||
--
|
||||
-- Decoration
|
||||
--
|
||||
|
||||
if mg_name ~= "v6" and mg_name ~= "singlenode" then
|
||||
|
||||
minetest.register_decoration({
|
||||
name = "cacao:cacaotree",
|
||||
deco_type = "schematic",
|
||||
place_on = {"default:dirt_with_rainforest_litter"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = 0.001,
|
||||
scale = 0.001,
|
||||
spread = {x = 250, y = 250, z = 250},
|
||||
seed = 6431,
|
||||
octaves = 3,
|
||||
persist = 0.66
|
||||
},
|
||||
biomes = {"rainforest"},
|
||||
y_min = 1,
|
||||
y_max = 31000,
|
||||
schematic = modpath.."/schematics/cacaotree.mts",
|
||||
flags = "place_center_x, place_center_z, force_placement",
|
||||
rotation = "random",
|
||||
place_offset_y = 1,
|
||||
})
|
||||
end
|
||||
|
||||
--
|
||||
-- Nodes
|
||||
--
|
||||
|
||||
minetest.register_node("cacaotree:sapling", {
|
||||
description = S("Cacao Tree Sapling"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {"cacaotree_sapling.png"},
|
||||
inventory_image = "cacaotree_sapling.png",
|
||||
wield_image = "cacaotree_sapling.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
on_timer = grow_new_cacao_tree,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
|
||||
},
|
||||
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
|
||||
attached_node = 1, sapling = 1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
on_construct = function(pos)
|
||||
minetest.get_node_timer(pos):start(math.random(grow_time_min, grow_time_max))
|
||||
end,
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
|
||||
"cacaotree:sapling",
|
||||
-- minp, maxp to be checked, relative to sapling pos
|
||||
-- minp_relative.y = 1 because sapling pos has been checked
|
||||
{x = -2, y = 1, z = -2},
|
||||
{x = 2, y = 6, z = 2},
|
||||
-- maximum interval of interior volume check
|
||||
4)
|
||||
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("cacaotree:trunk", {
|
||||
description = S("Cacao Tree Trunk"),
|
||||
tiles = {
|
||||
"cacaotree_trunk_top.png",
|
||||
"cacaotree_trunk_top.png",
|
||||
"cacaotree_trunk.png"
|
||||
},
|
||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
paramtype2 = "facedir",
|
||||
on_place = minetest.rotate_node,
|
||||
})
|
||||
|
||||
-- cacao wood
|
||||
minetest.register_node("cacaotree:wood", {
|
||||
description = S("Cacao Tree Wood"),
|
||||
tiles = {"cacaotree_wood.png"},
|
||||
is_ground_content = false,
|
||||
groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
-- cacao tree leaves
|
||||
minetest.register_node("cacaotree:leaves", {
|
||||
description = S("Cacao Tree Leaves"),
|
||||
drawtype = "allfaces_optional",
|
||||
tiles = {"cacaotree_leaves.png"},
|
||||
paramtype = "light",
|
||||
walkable = true,
|
||||
waving = 1,
|
||||
groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"cacaotree:sapling"}, rarity = 20},
|
||||
{items = {"cacaotree:leaves"}}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
after_place_node = default.after_place_leaves,
|
||||
})
|
||||
|
||||
--Liana
|
||||
|
||||
minetest.register_node("cacaotree:liana", {
|
||||
description = S("Cacao Tree Liana"),
|
||||
drawtype = "nodebox",
|
||||
walkable = true,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
tiles = {"cacaotree_liana.png"},
|
||||
inventory_image = "cacaotree_liana.png",
|
||||
wield_image = "cacaotree_liana.png",
|
||||
use_texture_alpha = "clip",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, 0.0, 0.5, 0.5, 0.0}
|
||||
},
|
||||
groups = {
|
||||
snappy = 2, flammable = 3, oddly_breakable_by_hand = 3, choppy = 2, carpet = 1, leafdecay = 3, leaves = 1,
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("cacaotree:flower_creeper", {
|
||||
description = S("Cacaotree Flower Creeper"),
|
||||
drawtype = "nodebox",
|
||||
walkable = true,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
tiles = {"cacaotree_flower_creeper.png"},
|
||||
inventory_image = "cacaotree_flower_creeper.png",
|
||||
wield_image = "cacaotree_flower_creeper.png",
|
||||
use_texture_alpha = "clip",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, 0.49, 0.5, 0.5, 0.5}
|
||||
},
|
||||
groups = {
|
||||
snappy = 2, flammable = 3, oddly_breakable_by_hand = 3, choppy = 2, carpet = 1, leafdecay = 3, leaves = 1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
--
|
||||
-- Craftitems
|
||||
--
|
||||
|
||||
--
|
||||
-- Recipes
|
||||
--
|
||||
|
||||
minetest.register_craft({
|
||||
output = "cacaotree:wood 4",
|
||||
recipe = {{"cacaotree:trunk"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "cacaotree:trunk",
|
||||
burntime = 30,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "cacaotree:wood",
|
||||
burntime = 7,
|
||||
})
|
||||
|
||||
default.register_leafdecay({
|
||||
trunks = {"cacaotree:trunk"},
|
||||
leaves = {"cacaotree:leaves"},
|
||||
radius = 3,
|
||||
})
|
||||
|
||||
-- Fence
|
||||
if minetest.settings:get_bool("cool_fences", true) then
|
||||
local fence = {
|
||||
description = S("Cacao Tree Wood Fence"),
|
||||
texture = "cacaotree_wood.png",
|
||||
material = "cacaotree:wood",
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
}
|
||||
default.register_fence("cacaotree:fence", table.copy(fence))
|
||||
fence.description = S("Cacao Tree Fence Rail")
|
||||
default.register_fence_rail("cacaotree:fence_rail", table.copy(fence))
|
||||
|
||||
if minetest.get_modpath("doors") ~= nil then
|
||||
fence.description = S("Cacao Tree Fence Gate")
|
||||
doors.register_fencegate("cacaotree:gate", table.copy(fence))
|
||||
end
|
||||
end
|
||||
|
||||
--Stairs
|
||||
|
||||
if minetest.get_modpath("stairs") ~= nil then
|
||||
stairs.register_stair_and_slab(
|
||||
"cacaotree_trunk",
|
||||
"cacaotree:trunk",
|
||||
{choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
||||
{"cacaotree_wood.png"},
|
||||
S("Cacao Tree Stair"),
|
||||
S("Cacao Tree Slab"),
|
||||
default.node_sound_wood_defaults()
|
||||
)
|
||||
end
|
||||
|
||||
-- stairsplus/moreblocks
|
||||
if minetest.get_modpath("moreblocks") then
|
||||
stairsplus:register_all("cacaotree", "wood", "cacaotree:wood", {
|
||||
description = "Cacao Tree",
|
||||
tiles = {"cacaotree_wood.png"},
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
-- Bonemeal
|
||||
|
||||
if minetest.get_modpath("bonemeal") ~= nil then
|
||||
bonemeal:add_sapling({
|
||||
{"cacaotree:sapling", grow_new_cacao_tree, "soil"},
|
||||
})
|
||||
end
|
||||
|
||||
-- Support for flowerpot
|
||||
if minetest.global_exists("flowerpot") then
|
||||
flowerpot.register_node("cacaotree:sapling")
|
||||
end
|
|
@ -0,0 +1,20 @@
|
|||
# textdomain: cacaotree
|
||||
Cacao Tree Sapling=Retoño de árbol de cacao
|
||||
Cacao Tree Trunk=Madera de árbol de cacao
|
||||
Cacao Tree Wood=Tablas de árbol de cacao
|
||||
Cacao Tree Liana=Liana de árbol de cacao
|
||||
Cacaotree Flower Creeper=Enredadera de árbol de cacao
|
||||
Cacao Tree Inner Stair=Escalera interior de árbol de cacao
|
||||
Cacao Tree Leaves=Hojas de árbol de cacao
|
||||
Cacao Tree Outer Stair=Escalera exterior de árbol de cacao
|
||||
Cacao Tree Slab=Losa de árbol de cacao
|
||||
Cacao Tree Stair=Escalera de árbol de cacao
|
||||
Cacao Tree Wood Fence=Cerca de madera de cacao
|
||||
Cacao Tree Fence Gate=Puerta de cerca de madera de cacao
|
||||
Cacao Tree Fence Rail=Listones de madera de cacao para cerca
|
||||
Cacao Pod=Vaina de cacao
|
||||
Cacao Beans=Granos de cacao
|
||||
Cocoa Powder=Cacao en polvo
|
||||
Milk Chocolate=Chocolate con leche
|
||||
Choco Cake=Tarta de chocolate
|
||||
Cacao Tree Wood Door=Puerta de madera de cacao
|
|
@ -0,0 +1,4 @@
|
|||
name = cacaotree
|
||||
description = Cacao Tree
|
||||
depends = default
|
||||
optional_depends = stairs, bonemeal, doors, moreblocks, flowerpot
|
|
@ -0,0 +1,189 @@
|
|||
schematic = {
|
||||
size = {x=5, y=7, z=5},
|
||||
yslice_prob = {
|
||||
{ypos=0, prob=254},
|
||||
{ypos=1, prob=254},
|
||||
{ypos=2, prob=254},
|
||||
{ypos=3, prob=254},
|
||||
{ypos=4, prob=254},
|
||||
{ypos=5, prob=254},
|
||||
{ypos=6, prob=254},
|
||||
},
|
||||
data = {
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:liana", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:flower_creeper", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:flower_creeper", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:flower_creeper", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:liana", prob=254, param2=0},
|
||||
{name="cacaotree:liana", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:pod", prob=254, param2=4},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:trunk", prob=254, param2=3},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:trunk", prob=254, param2=3},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:pod", prob=254, param2=2},
|
||||
{name="cacaotree:trunk", prob=254, param2=2},
|
||||
{name="cacaotree:pod", prob=254, param2=3},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:liana", prob=254, param2=1},
|
||||
{name="cacaotree:trunk", prob=254, param2=1},
|
||||
{name="cacaotree:liana", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:pod", prob=254, param2=5},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:flower_creeper", prob=254, param2=2},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:flower_creeper", prob=254, param2=2},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:liana", prob=254, param2=2},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:liana", prob=254, param2=2},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="cacaotree:leaves", prob=254, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
{name="air", prob=0, param2=0},
|
||||
},
|
||||
}
|
After Width: | Height: | Size: 950 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 882 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 981 B |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 4.4 KiB |
|
@ -233,15 +233,6 @@ minetest.register_craft({
|
|||
burntime = 7,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_lbm({
|
||||
name = "cherrytree:convert_cherrytree_saplings_to_node_timer",
|
||||
nodenames = {"cherrytree:sapling"},
|
||||
action = function(pos)
|
||||
minetest.get_node_timer(pos):start(math.random(1200, 2400))
|
||||
end
|
||||
})
|
||||
|
||||
default.register_leafdecay({
|
||||
trunks = {"cherrytree:trunk"},
|
||||
leaves = {"cherrytree:leaves"},
|
||||
|
@ -263,10 +254,10 @@ if minetest.settings:get_bool("cool_fences", true) then
|
|||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
}
|
||||
default.register_fence("cherrytree:fence", table.copy(fence))
|
||||
default.register_fence("cherrytree:fence", table.copy(fence))
|
||||
fence.description = S("Cherry Tree Fence Rail")
|
||||
default.register_fence_rail("cherrytree:fence_rail", table.copy(fence))
|
||||
|
||||
|
||||
if minetest.get_modpath("doors") ~= nil then
|
||||
fence.description = S("Cherry Tree Fence Gate")
|
||||
doors.register_fencegate("cherrytree:gate", table.copy(fence))
|
||||
|
@ -304,3 +295,8 @@ if minetest.get_modpath("bonemeal") ~= nil then
|
|||
{"cherrytree:sapling", grow_new_cherrytree_tree, "soil"},
|
||||
})
|
||||
end
|
||||
|
||||
-- Support for flowerpot
|
||||
if minetest.global_exists("flowerpot") then
|
||||
flowerpot.register_node("cherrytree:sapling")
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name = cherrytree
|
||||
description = Cherry Tree for Decidious Forest
|
||||
depends = default
|
||||
optional_depends = stairs, bonemeal, doors, moreblocks
|
||||
optional_depends = stairs, bonemeal, doors, moreblocks, flowerpot
|
||||
|
|
|
@ -215,15 +215,6 @@ minetest.register_craft({
|
|||
burntime = 7,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_lbm({
|
||||
name = "chestnuttree:convert_chestnuttree_saplings_to_node_timer",
|
||||
nodenames = {"chestnuttree:sapling"},
|
||||
action = function(pos)
|
||||
minetest.get_node_timer(pos):start(math.random(1200, 2400))
|
||||
end
|
||||
})
|
||||
|
||||
default.register_leafdecay({
|
||||
trunks = {"chestnuttree:trunk"},
|
||||
leaves = {"chestnuttree:leaves"},
|
||||
|
@ -239,10 +230,10 @@ if minetest.settings:get_bool("cool_fences", true) then
|
|||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
}
|
||||
default.register_fence("chestnuttree:fence", table.copy(fence))
|
||||
default.register_fence("chestnuttree:fence", table.copy(fence))
|
||||
fence.description = S("Chestnut Tree Fence Rail")
|
||||
default.register_fence_rail("chestnuttree:fence_rail", table.copy(fence))
|
||||
|
||||
|
||||
if minetest.get_modpath("doors") ~= nil then
|
||||
fence.description = S("Chestnut Tree Fence Gate")
|
||||
doors.register_fencegate("chestnuttree:gate", table.copy(fence))
|
||||
|
@ -294,3 +285,8 @@ if minetest.get_modpath("doors") ~= nil then
|
|||
}
|
||||
})
|
||||
end
|
||||
|
||||
-- Support for flowerpot
|
||||
if minetest.global_exists("flowerpot") then
|
||||
flowerpot.register_node("chestnuttree:sapling")
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name = chestnuttree
|
||||
description = Chesnut Tree for Grassland
|
||||
depends = default
|
||||
optional_depends = stairs, bonemeal, rainf, doors, moreblocks
|
||||
optional_depends = stairs, bonemeal, rainf, doors, moreblocks, flowerpot
|
||||
|
|
|
@ -178,15 +178,6 @@ minetest.register_craft({
|
|||
burntime = 7,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_lbm({
|
||||
name = "clementinetree:convert_clementinetree_saplings_to_node_timer",
|
||||
nodenames = {"clementinetree:sapling"},
|
||||
action = function(pos)
|
||||
minetest.get_node_timer(pos):start(math.random(1200, 2400))
|
||||
end
|
||||
})
|
||||
|
||||
default.register_leafdecay({
|
||||
trunks = {"clementinetree:trunk"},
|
||||
leaves = {"clementinetree:leaves"},
|
||||
|
@ -202,10 +193,10 @@ if minetest.settings:get_bool("cool_fences", true) then
|
|||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
}
|
||||
default.register_fence("clementinetree:fence", table.copy(fence))
|
||||
default.register_fence("clementinetree:fence", table.copy(fence))
|
||||
fence.description = S("Clementine Tree Fence Rail")
|
||||
default.register_fence_rail("clementinetree:fence_rail", table.copy(fence))
|
||||
|
||||
|
||||
if minetest.get_modpath("doors") ~= nil then
|
||||
fence.description = S("Clementine Tree Fence Gate")
|
||||
doors.register_fencegate("clementinetree:gate", table.copy(fence))
|
||||
|
@ -258,3 +249,8 @@ if minetest.get_modpath("doors") ~= nil then
|
|||
}
|
||||
})
|
||||
end
|
||||
|
||||
-- Support for flowerpot
|
||||
if minetest.global_exists("flowerpot") then
|
||||
flowerpot.register_node("clementinetree:sapling")
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name = clementinetree
|
||||
description = Clementine Tree for Decidious Forest
|
||||
depends = default
|
||||
optional_depends = stairs, bonemeal, doors, moreblocks
|
||||
optional_depends = stairs, bonemeal, doors, moreblocks, flowerpot
|
||||
|
|
|
@ -12,4 +12,6 @@ read_globals = {
|
|||
|
||||
globals = {
|
||||
"digilines",
|
||||
"tubelib",
|
||||
"tubelib2"
|
||||
}
|
||||
|
|
|
@ -54,6 +54,9 @@ overflow <itemstack> <count>
|
|||
Tricky situation:
|
||||
if you have a blank spot and put say 82 torches down your pipeline, followed by 99 coal, the 82 torches will go in the chest, and the chest will see that 1 more torch can fit since that would only go to 83. Since 1 more torch can fit, no "full" message will fire off. Then when the coal hits the chest, the "fail" message will fire and the coal will bounce out. The chest couldn't predict that coal would be coming next, so it couldn't know that the chest is full, for coal, while not full for torches.
|
||||
|
||||
The inventory is also compatible with [`tubelib`](https://github.com/joe7575/techpack/tree/master/tubelib), which generally works in the same way as [`pipeworks`](https://gitlab.com/VanessaE/pipeworks) but transfers happen immediately and do not "bounce". This means that the messages should be identical to the messages sent by [`pipeworks`](https://gitlab.com/VanessaE/pipeworks), except that items will not send the "lost" message when they cannot fit.
|
||||
One oddity is that "take" messages will be asynchronous because, if an item does not fit in the chest, the event will need to be canceled. This means that it is possible (though highly unlikely) to recieve a "put" message into a slot which you have not yet recieved a "take" message for, there will not actually be two stacks in the same slot, though it may briefly appear that way until the "take" message is recieved.
|
||||
|
||||
TODO:
|
||||
- make chest.lua a mixin that gets both default and locked chests
|
||||
- digiline aware furnaces
|
||||
|
|
|
@ -51,6 +51,99 @@ local last_inventory_put_stack
|
|||
-- that should be removed once that’s fixed.
|
||||
local last_inventory_take_index
|
||||
|
||||
local tube_can_insert = function(pos, _, stack, direction)
|
||||
local ret = minetest.get_meta(pos):get_inventory():room_for_item("main", stack)
|
||||
if not ret then
|
||||
-- The stack cannot be accepted. It will never be passed to
|
||||
-- insert_object, but it should be reported as a toverflow.
|
||||
-- Here, direction = direction item is moving, which is into
|
||||
-- side.
|
||||
local side = vector.multiply(direction, -1)
|
||||
send_message(pos, "toverflow", stack, nil, nil, side)
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
local tube_insert_object = function(pos, _, original_stack, direction)
|
||||
-- Here, direction = direction item is moving, which is into side.
|
||||
local side = vector.multiply(direction, -1)
|
||||
local inv = minetest.get_meta(pos):get_inventory()
|
||||
local inv_contents = inv:get_list("main")
|
||||
local any_put = false
|
||||
local stack = original_stack
|
||||
local stack_name = stack:get_name()
|
||||
local stack_count = stack:get_count()
|
||||
-- Walk the inventory, adding items to existing stacks of the same
|
||||
-- type.
|
||||
for i = 1, #inv_contents do
|
||||
local existing_stack = inv_contents[i]
|
||||
if not existing_stack:is_empty() and existing_stack:get_name() == stack_name then
|
||||
local leftover = existing_stack:add_item(stack)
|
||||
local leftover_count = leftover:get_count()
|
||||
if leftover_count ~= stack_count then
|
||||
-- We put some items into the slot. Update the slot in
|
||||
-- the inventory, tell Digilines listeners about it,
|
||||
-- and keep looking for the a place to put the
|
||||
-- leftovers if any.
|
||||
any_put = true
|
||||
inv:set_stack("main", i, existing_stack)
|
||||
local stack_that_was_put
|
||||
if leftover_count == 0 then
|
||||
stack_that_was_put = stack
|
||||
else
|
||||
stack_that_was_put = ItemStack(stack)
|
||||
stack_that_was_put:set_count(stack_count - leftover_count)
|
||||
end
|
||||
send_message(pos, "tput", stack_that_was_put, nil, i, side)
|
||||
stack = leftover
|
||||
stack_count = leftover_count
|
||||
if stack_count == 0 then
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if stack_count ~= 0 then
|
||||
-- Walk the inventory, adding items to empty slots.
|
||||
for i = 1, #inv_contents do
|
||||
local existing_stack = inv_contents[i]
|
||||
if existing_stack:is_empty() then
|
||||
local leftover = existing_stack:add_item(stack)
|
||||
local leftover_count = leftover:get_count()
|
||||
if leftover_count ~= stack_count then
|
||||
-- We put some items into the slot. Update the slot in
|
||||
-- the inventory, tell Digilines listeners about it,
|
||||
-- and keep looking for the a place to put the
|
||||
-- leftovers if any.
|
||||
any_put = true
|
||||
inv:set_stack("main", i, existing_stack)
|
||||
local stack_that_was_put
|
||||
if leftover_count == 0 then
|
||||
stack_that_was_put = stack
|
||||
else
|
||||
stack_that_was_put = ItemStack(stack)
|
||||
stack_that_was_put:set_count(stack_count - leftover_count)
|
||||
end
|
||||
send_message(pos, "tput", stack_that_was_put, nil, i, side)
|
||||
stack = leftover
|
||||
stack_count = leftover_count
|
||||
if stack_count == 0 then
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if any_put then
|
||||
check_full(pos, original_stack)
|
||||
end
|
||||
if stack_count ~= 0 then
|
||||
-- Some items could not be added and bounced back. Report them.
|
||||
send_message(pos, "toverflow", stack, nil, nil, side)
|
||||
end
|
||||
return stack
|
||||
end
|
||||
|
||||
minetest.register_alias("digilines_inventory:chest", "digilines:chest")
|
||||
minetest.register_node("digilines:chest", {
|
||||
description = "Digiline Chest",
|
||||
|
@ -109,97 +202,8 @@ minetest.register_node("digilines:chest", {
|
|||
return not pipeworks.connects.facingFront(i,param2)
|
||||
end,
|
||||
input_inventory = "main",
|
||||
can_insert = function(pos, _, stack, direction)
|
||||
local ret = minetest.get_meta(pos):get_inventory():room_for_item("main", stack)
|
||||
if not ret then
|
||||
-- The stack cannot be accepted. It will never be passed to
|
||||
-- insert_object, but it should be reported as a toverflow.
|
||||
-- Here, direction = direction item is moving, which is into
|
||||
-- side.
|
||||
local side = vector.multiply(direction, -1)
|
||||
send_message(pos, "toverflow", stack, nil, nil, side)
|
||||
end
|
||||
return ret
|
||||
end,
|
||||
insert_object = function(pos, _, original_stack, direction)
|
||||
-- Here, direction = direction item is moving, which is into side.
|
||||
local side = vector.multiply(direction, -1)
|
||||
local inv = minetest.get_meta(pos):get_inventory()
|
||||
local inv_contents = inv:get_list("main")
|
||||
local any_put = false
|
||||
local stack = original_stack
|
||||
local stack_name = stack:get_name()
|
||||
local stack_count = stack:get_count()
|
||||
-- Walk the inventory, adding items to existing stacks of the same
|
||||
-- type.
|
||||
for i = 1, #inv_contents do
|
||||
local existing_stack = inv_contents[i]
|
||||
if not existing_stack:is_empty() and existing_stack:get_name() == stack_name then
|
||||
local leftover = existing_stack:add_item(stack)
|
||||
local leftover_count = leftover:get_count()
|
||||
if leftover_count ~= stack_count then
|
||||
-- We put some items into the slot. Update the slot in
|
||||
-- the inventory, tell Digilines listeners about it,
|
||||
-- and keep looking for the a place to put the
|
||||
-- leftovers if any.
|
||||
any_put = true
|
||||
inv:set_stack("main", i, existing_stack)
|
||||
local stack_that_was_put
|
||||
if leftover_count == 0 then
|
||||
stack_that_was_put = stack
|
||||
else
|
||||
stack_that_was_put = ItemStack(stack)
|
||||
stack_that_was_put:set_count(stack_count - leftover_count)
|
||||
end
|
||||
send_message(pos, "tput", stack_that_was_put, nil, i, side)
|
||||
stack = leftover
|
||||
stack_count = leftover_count
|
||||
if stack_count == 0 then
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if stack_count ~= 0 then
|
||||
-- Walk the inventory, adding items to empty slots.
|
||||
for i = 1, #inv_contents do
|
||||
local existing_stack = inv_contents[i]
|
||||
if existing_stack:is_empty() then
|
||||
local leftover = existing_stack:add_item(stack)
|
||||
local leftover_count = leftover:get_count()
|
||||
if leftover_count ~= stack_count then
|
||||
-- We put some items into the slot. Update the slot in
|
||||
-- the inventory, tell Digilines listeners about it,
|
||||
-- and keep looking for the a place to put the
|
||||
-- leftovers if any.
|
||||
any_put = true
|
||||
inv:set_stack("main", i, existing_stack)
|
||||
local stack_that_was_put
|
||||
if leftover_count == 0 then
|
||||
stack_that_was_put = stack
|
||||
else
|
||||
stack_that_was_put = ItemStack(stack)
|
||||
stack_that_was_put:set_count(stack_count - leftover_count)
|
||||
end
|
||||
send_message(pos, "tput", stack_that_was_put, nil, i, side)
|
||||
stack = leftover
|
||||
stack_count = leftover_count
|
||||
if stack_count == 0 then
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if any_put then
|
||||
check_full(pos, original_stack)
|
||||
end
|
||||
if stack_count ~= 0 then
|
||||
-- Some items could not be added and bounced back. Report them.
|
||||
send_message(pos, "toverflow", stack, nil, nil, side)
|
||||
end
|
||||
return stack
|
||||
end,
|
||||
can_insert = tube_can_insert,
|
||||
insert_object = tube_insert_object,
|
||||
remove_items = function(pos, _, stack, dir, count)
|
||||
-- Here, stack is the ItemStack in our own inventory that is being
|
||||
-- pulled from, NOT the stack that is actually pulled out.
|
||||
|
@ -310,6 +314,96 @@ minetest.register_node("digilines:chest", {
|
|||
end
|
||||
})
|
||||
|
||||
if minetest.global_exists("tubelib") then
|
||||
local speculative_pull = nil
|
||||
local pull_succeeded = function(passed_speculative_pull)
|
||||
if passed_speculative_pull.canceled then return end
|
||||
|
||||
send_message(passed_speculative_pull.pos, "ttake", passed_speculative_pull.taken,
|
||||
passed_speculative_pull.index, nil, vector.multiply(passed_speculative_pull.dir, -1))
|
||||
check_empty(passed_speculative_pull.pos)
|
||||
end
|
||||
local function tube_side(pos, side)
|
||||
if side == "U" then return {x=0,y=-1,z=0}
|
||||
elseif side == "D" then return {x=0,y=1,z=0}
|
||||
end
|
||||
local param2 = minetest.get_node(pos).param2
|
||||
return vector.multiply(
|
||||
minetest.facedir_to_dir(
|
||||
tubelib2.side_to_dir(side, param2) - 1),
|
||||
-1)
|
||||
end
|
||||
tubelib.register_node("digilines:chest", {}, {
|
||||
on_pull_stack = function(pos, side, _)
|
||||
local inv = minetest.get_meta(pos):get_inventory()
|
||||
for i, stack in pairs(inv:get_list("main")) do
|
||||
if not stack:is_empty() then
|
||||
speculative_pull = {
|
||||
canceled = false,
|
||||
pos = pos,
|
||||
taken = stack,
|
||||
index = i,
|
||||
dir = tube_side(pos, side)
|
||||
}
|
||||
minetest.after(0, pull_succeeded, speculative_pull)
|
||||
inv:set_stack("main", i, nil)
|
||||
return stack
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end,
|
||||
on_pull_item = function(pos, side, _)
|
||||
local inv = minetest.get_meta(pos):get_inventory()
|
||||
for i, stack in pairs(inv:get_list("main")) do
|
||||
if not stack:is_empty() then
|
||||
local taken = stack:take_item(1)
|
||||
speculative_pull = {
|
||||
canceled = false,
|
||||
pos = pos,
|
||||
taken = taken,
|
||||
index = i,
|
||||
dir = tube_side(pos, side)
|
||||
}
|
||||
minetest.after(0, pull_succeeded, speculative_pull)
|
||||
inv:set_stack("main", i, stack)
|
||||
return taken
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end,
|
||||
on_push_item = function(pos, side, item, _)
|
||||
local dir_vec = tube_side(pos, side)
|
||||
if not tube_can_insert(pos, nil, item, dir_vec) then
|
||||
return false
|
||||
end
|
||||
tube_insert_object(pos, nil, item, dir_vec)
|
||||
return true
|
||||
end,
|
||||
on_unpull_item = function(pos, _, item, _)
|
||||
local inv = minetest.get_meta(pos):get_inventory()
|
||||
if not inv:room_for_item("main", item) then
|
||||
return false
|
||||
end
|
||||
|
||||
local existing_stack = inv:get_stack("main", speculative_pull.index)
|
||||
local leftover = existing_stack:add_item(item)
|
||||
if not leftover:is_empty() then
|
||||
return false
|
||||
end
|
||||
|
||||
inv:set_stack("main", speculative_pull.index, existing_stack)
|
||||
|
||||
-- Cancel speculative pull
|
||||
-- this on_unpull_item callback should be called
|
||||
-- immediately after on_pull_item if it fails
|
||||
-- so this should be procedural
|
||||
speculative_pull.canceled = true
|
||||
speculative_pull = nil
|
||||
return true
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "digilines:chest",
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
name = digilines
|
||||
depends = default
|
||||
optional_depends = tubelib,tubelib2
|
||||
description = """
|
||||
This mod adds digiline wires, an RTC (Real Time Clock), a light sensor as well as an LCD Screen.
|
||||
Can be used together with the luacontroller from mesecons.
|
||||
|
|
|
@ -64,6 +64,7 @@ minetest.register_node("ebony:sapling", {
|
|||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
on_timer = grow_new_ebony_tree,
|
||||
use_texture_alpha = "clip",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
|
||||
|
@ -146,9 +147,9 @@ minetest.register_node("ebony:creeper", {
|
|||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
tiles = {"ebony_creeper.png"},
|
||||
use_texture_alpha = true,
|
||||
inventory_image = "ebony_creeper.png",
|
||||
wield_image = "ebony_creeper.png",
|
||||
use_texture_alpha = "clip",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, 0.49, 0.5, 0.5, 0.5}
|
||||
|
@ -166,9 +167,9 @@ minetest.register_node("ebony:creeper_leaves", {
|
|||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
tiles = {"ebony_creeper_leaves.png"},
|
||||
use_texture_alpha = true,
|
||||
inventory_image = "ebony_creeper_leaves.png",
|
||||
wield_image = "ebony_creeper_leaves.png",
|
||||
use_texture_alpha = "clip",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, 0.49, 0.5, 0.5, 0.5}
|
||||
|
@ -186,9 +187,9 @@ minetest.register_node("ebony:liana", {
|
|||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
tiles = {"ebony_liana.png"},
|
||||
use_texture_alpha = true,
|
||||
inventory_image = "ebony_liana.png",
|
||||
wield_image = "ebony_liana.png",
|
||||
use_texture_alpha = "clip",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, 0.0, 0.5, 0.5, 0.0}
|
||||
|
@ -249,15 +250,6 @@ minetest.register_craft({
|
|||
burntime = 7,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_lbm({
|
||||
name = "ebony:convert_ebony_saplings_to_node_timer",
|
||||
nodenames = {"ebony:sapling"},
|
||||
action = function(pos)
|
||||
minetest.get_node_timer(pos):start(math.random(1200, 2400))
|
||||
end
|
||||
})
|
||||
|
||||
default.register_leafdecay({
|
||||
trunks = {"ebony:trunk"},
|
||||
leaves = {"ebony:leaves"},
|
||||
|
@ -273,10 +265,10 @@ if minetest.settings:get_bool("cool_fences", true) then
|
|||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
}
|
||||
default.register_fence("ebony:fence", table.copy(fence))
|
||||
default.register_fence("ebony:fence", table.copy(fence))
|
||||
fence.description = S("Ebony Fence Rail")
|
||||
default.register_fence_rail("ebony:fence_rail", table.copy(fence))
|
||||
|
||||
|
||||
if minetest.get_modpath("doors") ~= nil then
|
||||
fence.description = S("Ebony Fence Gate")
|
||||
doors.register_fencegate("ebony:gate", table.copy(fence))
|
||||
|
@ -312,3 +304,8 @@ if minetest.get_modpath("bonemeal") ~= nil then
|
|||
{"ebony:sapling", grow_new_ebony_tree, "soil"},
|
||||
})
|
||||
end
|
||||
|
||||
-- Support for flowerpot
|
||||
if minetest.global_exists("flowerpot") then
|
||||
flowerpot.register_node("ebony:sapling")
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name = ebony
|
||||
description = Ebony Tree for Rainforest Biome
|
||||
depends = default
|
||||
optional_depends = stairs, bonemeal, doors, moreblocks
|
||||
optional_depends = stairs, bonemeal, doors, moreblocks, flowerpot
|
||||
|
|
|
@ -13,7 +13,7 @@ This mod works by adding your new plant to the {growing=1} group and numbering t
|
|||
|
||||
### Changelog:
|
||||
|
||||
- 1.46 - Added min/max default light settings, added lettuce and blackberries with food items (thanks OgelGames), added soya and vanilla (thanks Felfa), added tofu, added salt crystals (thanks gorlock)
|
||||
- 1.46 - Added min/max default light settings, added lettuce and blackberries with food items (thanks OgelGames), added soya, vanilla and sunflowers (thanks Felfa), added tofu, added salt crystals (thanks gorlock)
|
||||
- 1.45 - Dirt and Hoes are more in line with default by using dry/wet/base, added cactus juice, added pasta, spaghetti, cabbage, korean bibimbap, code tidy
|
||||
options, onion soup added (thanks edcrypt), Added apple pie, added wild cotton to savanna
|
||||
- 1.44 - Added 'farming_stage_length' in mod settings for speed of crop growth, also thanks to TheDarkTiger for translation updates
|
||||
|
|
|
@ -27,7 +27,7 @@ local function place_beans(itemstack, placer, pointed_thing, plantname)
|
|||
-- thanks to Krock for helping with this issue :)
|
||||
local def = minetest.registered_nodes[under.name]
|
||||
if placer and itemstack and def and def.on_rightclick then
|
||||
return def.on_rightclick(pt.under, under, placer, itemstack)
|
||||
return def.on_rightclick(pt.under, under, placer, itemstack, pt)
|
||||
end
|
||||
|
||||
-- is player planting crop?
|
||||
|
@ -120,7 +120,7 @@ minetest.register_node("farming:beanpole", {
|
|||
-- thanks to Krock for helping with this issue :)
|
||||
local def = minetest.registered_nodes[under.name]
|
||||
if def and def.on_rightclick then
|
||||
return def.on_rightclick(pt.under, under, placer, itemstack)
|
||||
return def.on_rightclick(pt.under, under, placer, itemstack, pt)
|
||||
end
|
||||
|
||||
if minetest.is_protected(pt.above, placer:get_player_name()) then
|
||||
|
|
|
@ -22,7 +22,7 @@ local function place_cocoa(itemstack, placer, pointed_thing, plantname)
|
|||
-- thanks to Krock for helping with this issue :)
|
||||
local def = minetest.registered_nodes[under.name]
|
||||
if placer and itemstack and def and def.on_rightclick then
|
||||
return def.on_rightclick(pt.under, under, placer, itemstack)
|
||||
return def.on_rightclick(pt.under, under, placer, itemstack, pt)
|
||||
end
|
||||
|
||||
-- check if pointing at jungletree
|
||||
|
@ -135,25 +135,23 @@ local def = {
|
|||
tiles = {"farming_cocoa_1.png"},
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drop = {
|
||||
items = {
|
||||
{items = {"farming:cocoa_beans 1"}, rarity = 2},
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
||||
},
|
||||
drop = {},
|
||||
groups = {
|
||||
snappy = 3, flammable = 2, plant = 1, growing = 1,
|
||||
not_in_creative_inventory = 1, leafdecay = 1, leafdecay_drop = 1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
growth_check = function(pos, node_name)
|
||||
|
||||
if minetest.find_node_near(pos, 1, {"default:jungletree"}) then
|
||||
return false
|
||||
return false -- can grow
|
||||
end
|
||||
return true
|
||||
|
||||
return true -- cannot grow
|
||||
end
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,25 @@ minetest.register_craft({
|
|||
recipe = "group:food_corn"
|
||||
})
|
||||
|
||||
-- popcorn
|
||||
minetest.register_craftitem("farming:popcorn", {
|
||||
description = S("Popcorn"),
|
||||
inventory_image = "farming_popcorn.png",
|
||||
groups = {food_popcorn = 1, flammable = 2},
|
||||
on_use = minetest.item_eat(4)
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "farming:popcorn",
|
||||
recipe = {
|
||||
{"group:food_pot", "group:food_oil", "group:food_corn"}
|
||||
},
|
||||
replacements = {
|
||||
{"group:food_pot", "farming:pot"},
|
||||
{"group:food_oil", "vessels:glass_bottle"}
|
||||
}
|
||||
})
|
||||
|
||||
-- cornstarch
|
||||
minetest.register_craftitem("farming:cornstarch", {
|
||||
description = S("Cornstarch"),
|
||||
|
|
|
@ -22,7 +22,7 @@ local function place_grapes(itemstack, placer, pointed_thing, plantname)
|
|||
-- thanks to Krock for helping with this issue :)
|
||||
local def = minetest.registered_nodes[under.name]
|
||||
if placer and itemstack and def and def.on_rightclick then
|
||||
return def.on_rightclick(pt.under, under, placer, itemstack)
|
||||
return def.on_rightclick(pt.under, under, placer, itemstack, pt)
|
||||
end
|
||||
|
||||
-- is player planting seed?
|
||||
|
@ -115,7 +115,7 @@ minetest.register_node("farming:trellis", {
|
|||
-- thanks to Krock for helping with this issue :)
|
||||
local def = minetest.registered_nodes[under.name]
|
||||
if def and def.on_rightclick then
|
||||
return def.on_rightclick(pt.under, under, placer, itemstack)
|
||||
return def.on_rightclick(pt.under, under, placer, itemstack, pt)
|
||||
end
|
||||
|
||||
if minetest.is_protected(pt.above, placer:get_player_name()) then
|
||||
|
|
|
@ -18,6 +18,10 @@ minetest.override_item("farming:rye", {
|
|||
groups = {food_rye = 1, flammable = 4}
|
||||
})
|
||||
|
||||
minetest.override_item("farming:rye_1", {drop = {}})
|
||||
minetest.override_item("farming:rye_2", {drop = {}})
|
||||
minetest.override_item("farming:rye_3", {drop = {}})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "farming:flour",
|
||||
recipe = {
|
||||
|
@ -42,6 +46,10 @@ minetest.override_item("farming:oat", {
|
|||
groups = {food_oats = 1, flammable = 4}
|
||||
})
|
||||
|
||||
minetest.override_item("farming:oat_1", {drop = {}})
|
||||
minetest.override_item("farming:oat_2", {drop = {}})
|
||||
minetest.override_item("farming:oat_3", {drop = {}})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "farming:flour",
|
||||
recipe = {
|
||||
|
@ -66,6 +74,10 @@ minetest.override_item("farming:rice", {
|
|||
groups = {food_rice = 1, flammable = 4}
|
||||
})
|
||||
|
||||
minetest.override_item("farming:rice_1", {drop = {}})
|
||||
minetest.override_item("farming:rice_2", {drop = {}})
|
||||
minetest.override_item("farming:rice_3", {drop = {}})
|
||||
|
||||
minetest.register_craftitem("farming:rice_bread", {
|
||||
description = S("Rice Bread"),
|
||||
inventory_image = "farming_rice_bread.png",
|
||||
|
|
|
@ -42,15 +42,6 @@ minetest.register_node("farming:soy_sauce", {
|
|||
sounds = default.node_sound_glass_defaults()
|
||||
})
|
||||
|
||||
-- river water availability check
|
||||
local bucket_water
|
||||
|
||||
if minetest.get_mapgen_setting("mgname") == "valleys"
|
||||
or minetest.get_modpath("ethereal") then
|
||||
bucket_water = "bucket:bucket_river_water"
|
||||
else
|
||||
bucket_water = "bucket:bucket_water"
|
||||
end
|
||||
|
||||
-- soy sauce recipe
|
||||
minetest.register_craft( {
|
||||
|
@ -58,10 +49,10 @@ minetest.register_craft( {
|
|||
recipe = {
|
||||
{"group:food_soy", "group:food_salt", "group:food_soy"},
|
||||
{"", "group:food_juicer", ""},
|
||||
{"", bucket_water, "vessels:glass_bottle"}
|
||||
{"", "bucket:bucket_water", "vessels:glass_bottle"}
|
||||
},
|
||||
replacements = {
|
||||
{bucket_water, "bucket:bucket_empty"},
|
||||
{"bucket:bucket_water", "bucket:bucket_empty"},
|
||||
{"group:food_juicer", "farming:juicer"}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -0,0 +1,155 @@
|
|||
local S = farming.intllib
|
||||
|
||||
-- sunflower
|
||||
minetest.register_craftitem("farming:sunflower", {
|
||||
description = S("Sunflower"),
|
||||
inventory_image = "farming_sunflower.png",
|
||||
groups = {flammable = 2}
|
||||
})
|
||||
|
||||
-- sunflower seeds
|
||||
minetest.register_craftitem("farming:seed_sunflower", {
|
||||
description = S("Sunflower Seeds"),
|
||||
inventory_image = "farming_sunflower_seeds.png",
|
||||
groups = {seed = 2, food_sunflower_seeds = 1, flammable = 2},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return farming.place_seed(itemstack, placer, pointed_thing, "farming:sunflower_1")
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_alias("farming:sunflower_seeds", "farming:seed_sunflower")
|
||||
|
||||
minetest.register_craft({
|
||||
output = "farming:seed_sunflower 5",
|
||||
recipe = {{"farming:sunflower"}}
|
||||
})
|
||||
|
||||
-- sunflower seeds (toasted)
|
||||
minetest.register_craftitem("farming:sunflower_seeds_toasted", {
|
||||
description = S("Toasted Sunflower Seeds"),
|
||||
inventory_image = "farming_sunflower_seeds_toasted.png",
|
||||
groups = {food_sunflower_seeds_toasted = 1, flammable = 2},
|
||||
on_use = minetest.item_eat(1)
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
cooktime = 10,
|
||||
output = "farming:sunflower_seeds_toasted",
|
||||
recipe = "farming:seed_sunflower"
|
||||
})
|
||||
|
||||
-- sunflower oil
|
||||
minetest.register_node("farming:sunflower_oil", {
|
||||
description = S("Bottle of Sunflower Oil"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_sunflower_oil.png"},
|
||||
inventory_image = "farming_sunflower_oil.png",
|
||||
wield_image = "farming_sunflower_oil.png",
|
||||
paramtype = "light",
|
||||
is_ground_content = false,
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
|
||||
},
|
||||
groups = {
|
||||
food_oil = 1, vessel = 1, dig_immediate = 3, attached_node = 1,
|
||||
flammable = 2
|
||||
},
|
||||
sounds = default.node_sound_glass_defaults()
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "farming:sunflower_oil",
|
||||
recipe = {
|
||||
{"group:food_sunflower_seeds", "group:food_sunflower_seeds", "group:food_sunflower_seeds"},
|
||||
{"group:food_sunflower_seeds", "group:food_sunflower_seeds", "group:food_sunflower_seeds"},
|
||||
{"group:food_sunflower_seeds", "vessels:glass_bottle", "group:food_sunflower_seeds"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "farming:sunflower_oil",
|
||||
burntime = 30,
|
||||
replacements = {{"farming:sunflower_oil", "vessels:glass_bottle"}}
|
||||
})
|
||||
|
||||
-- sunflower seed bread
|
||||
minetest.register_craftitem("farming:sunflower_bread", {
|
||||
description = S("Sunflower Seed Bread"),
|
||||
inventory_image = "farming_sunflower_bread.png",
|
||||
on_use = minetest.item_eat(8),
|
||||
groups = {food_bread = 1, flammable = 2}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "farming:sunflower_bread",
|
||||
recipe = {{"group:food_sunflower_seeds_toasted", "group:food_bread", "group:food_sunflower_seeds_toasted"}}
|
||||
})
|
||||
|
||||
-- sunflower definition
|
||||
local def = {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_sunflower_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:sunflower_1", table.copy(def))
|
||||
|
||||
-- stage 2
|
||||
def.tiles = {"farming_sunflower_2.png"}
|
||||
minetest.register_node("farming:sunflower_2", table.copy(def))
|
||||
|
||||
-- stage 3
|
||||
def.tiles = {"farming_sunflower_3.png"}
|
||||
minetest.register_node("farming:sunflower_3", table.copy(def))
|
||||
|
||||
-- stage 4
|
||||
def.tiles = {"farming_sunflower_4.png"}
|
||||
minetest.register_node("farming:sunflower_4", table.copy(def))
|
||||
|
||||
-- stage 5
|
||||
def.tiles = {"farming_sunflower_5.png"}
|
||||
minetest.register_node("farming:sunflower_5", table.copy(def))
|
||||
|
||||
-- stage 6
|
||||
def.tiles = {"farming_sunflower_6.png"}
|
||||
def.visual_scale = 1.9
|
||||
minetest.register_node("farming:sunflower_6", table.copy(def))
|
||||
|
||||
-- stage 7
|
||||
def.tiles = {"farming_sunflower_7.png"}
|
||||
minetest.register_node("farming:sunflower_7", table.copy(def))
|
||||
|
||||
-- stage 8 (final)
|
||||
def.tiles = {"farming_sunflower_8.png"}
|
||||
def.groups.growing = nil
|
||||
def.drop = {
|
||||
items = {
|
||||
{items = {"farming:sunflower"}, rarity = 1},
|
||||
{items = {"farming:sunflower"}, rarity = 6}
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:sunflower_8", table.copy(def))
|
||||
|
||||
-- add to registered_plants
|
||||
farming.registered_plants["farming:sunflower"] = {
|
||||
crop = "farming:sunflower",
|
||||
seed = "farming:seed_sunflower",
|
||||
minlight = 14,
|
||||
maxlight = farming.max_light,
|
||||
steps = 8
|
||||
}
|
|
@ -37,6 +37,7 @@ farming.soy = 0.001
|
|||
farming.vanilla = 0.001
|
||||
farming.artichoke = 0.001
|
||||
farming.parsley = 0.002
|
||||
farming.sunflower = 0.001
|
||||
farming.grains = true -- true or false only
|
||||
|
||||
-- default rarety of crops on map (higher number = more crops)
|
||||
|
|
|
@ -1,6 +1,44 @@
|
|||
|
||||
local S = farming.intllib
|
||||
|
||||
--= filter sea water into river water
|
||||
minetest.register_craft({
|
||||
output = "bucket:bucket_river_water",
|
||||
recipe = {
|
||||
{"farming:hemp_fibre"},
|
||||
{"farming:hemp_fibre"},
|
||||
{"bucket:bucket_water"}
|
||||
}
|
||||
})
|
||||
|
||||
--= glass of water
|
||||
|
||||
minetest.register_craftitem("farming:glass_water", {
|
||||
description = S("Glass of Water"),
|
||||
inventory_image = "farming_water_glass.png",
|
||||
groups = {food_water_glass = 1, flammable = 3, vessel = 1}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "farming:glass_water 4",
|
||||
recipe = {
|
||||
{"vessels:drinking_glass", "vessels:drinking_glass"},
|
||||
{"vessels:drinking_glass", "vessels:drinking_glass"},
|
||||
{"bucket:bucket_river_water", ""}
|
||||
},
|
||||
replacements = {{"bucket:bucket_river_water", "bucket:bucket_empty"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "farming:glass_water 4",
|
||||
recipe = {
|
||||
{"vessels:drinking_glass", "vessels:drinking_glass"},
|
||||
{"vessels:drinking_glass", "vessels:drinking_glass"},
|
||||
{"bucket:bucket_water", "farming:hemp_fibre"}
|
||||
},
|
||||
replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}}
|
||||
})
|
||||
|
||||
--= Sugar
|
||||
|
||||
minetest.register_craftitem("farming:sugar", {
|
||||
|
@ -647,10 +685,10 @@ minetest.register_craft({
|
|||
recipe = {
|
||||
{"group:food_rice", "group:food_sugar", "group:food_rice"},
|
||||
{"", "group:food_mortar_pestle", ""},
|
||||
{"", "bucket:bucket_river_water", ""}
|
||||
{"", "farming:glass_water", ""}
|
||||
},
|
||||
replacements = {
|
||||
{"group:food_mortar_pestle", "farming:mortar_pestle"},
|
||||
{"bucket:bucket_river_water", "bucket:bucket_empty"}
|
||||
{"farming:glass_water", "vessels:drinking_glass"}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
farming = {
|
||||
mod = "redo",
|
||||
version = "20210311",
|
||||
version = "20211116",
|
||||
path = minetest.get_modpath("farming"),
|
||||
select = {
|
||||
type = "fixed",
|
||||
|
@ -340,7 +340,6 @@ function farming.plant_growth_timer(pos, elapsed, node_name)
|
|||
if max_growth == 1 or lambda < 2.0 then
|
||||
|
||||
local light = (minetest.get_node_light(light_pos) or 0)
|
||||
--print ("light level:", light)
|
||||
|
||||
if light < MIN_LIGHT or light > MAX_LIGHT then
|
||||
return true
|
||||
|
@ -426,7 +425,7 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname)
|
|||
-- thanks to Krock for helping with this issue :)
|
||||
local def = minetest.registered_nodes[under.name]
|
||||
if placer and itemstack and def and def.on_rightclick then
|
||||
return def.on_rightclick(pt.under, under, placer, itemstack)
|
||||
return def.on_rightclick(pt.under, under, placer, itemstack, pt)
|
||||
end
|
||||
|
||||
local above = minetest.get_node(pt.above)
|
||||
|
@ -635,6 +634,7 @@ farming.vanilla = 0.001
|
|||
farming.lettuce = 0.001
|
||||
farming.artichoke = 0.001
|
||||
farming.parsley = 0.002
|
||||
farming.sunflower = 0.001
|
||||
farming.grains = true
|
||||
farming.rarety = 0.002
|
||||
|
||||
|
@ -707,6 +707,7 @@ ddoo("vanilla.lua", farming.vanilla)
|
|||
ddoo("lettuce.lua", farming.lettuce)
|
||||
ddoo("artichoke.lua", farming.artichoke)
|
||||
ddoo("parsley.lua", farming.parsley)
|
||||
ddoo("sunflower.lua", farming.sunflower)
|
||||
|
||||
dofile(farming.path .. "/food.lua")
|
||||
dofile(farming.path .. "/mapgen.lua")
|
||||
|
|
|
@ -166,6 +166,7 @@ Created by Felfa (CC0)
|
|||
farming_potato_omelette.png
|
||||
farming_spanish_potatoes.png
|
||||
farming_vanilla_flan.png
|
||||
farming_sunflower*.png
|
||||
|
||||
Created by gorlock (CC0)
|
||||
farming_salt_crystal.png
|
||||
|
@ -173,3 +174,9 @@ Created by gorlock (CC0)
|
|||
Created by sirrobzeroone (CC0)
|
||||
farming_gyoza.png
|
||||
farming_pineapple_ring.png
|
||||
|
||||
Created by TechM8 (https://www.deviantart.com/techm8)
|
||||
farming_popcorn.png
|
||||
|
||||
Created by RZR0 (CC-BY-NC-SA)
|
||||
farming_blueberry_pie.png
|
||||
|
|
|
@ -21,7 +21,7 @@ Bottle of Hemp Oil=Flasche mit Hanföl
|
|||
Bowl of Chili=Chili Schale
|
||||
Bread=Brot
|
||||
Bronze Hoe=Bronzehacke
|
||||
Cabbage=Salat
|
||||
Cabbage=Weißkohl
|
||||
Cactus Juice=Kaktussaft
|
||||
Carrot=Möhre
|
||||
Carrot Juice=Möhrensaft
|
||||
|
@ -61,7 +61,7 @@ Hemp Seed=Hanfsamen
|
|||
Hoe=Hacke
|
||||
Hoe Bomb (use or throw on grassy areas to hoe land)=Hackbombe (Auf Grasland werfen oder benutzen)
|
||||
Jack 'O Lantern (punch to turn on and off)=Kürbislaterne (Punch zum Ein- und Ausschalten)
|
||||
Jaffa Cake=Jaffa-Torte
|
||||
Jaffa Cake=Jaffakeks
|
||||
Juicer=Entsafter
|
||||
Melon=Melone
|
||||
Melon Slice=Melonenscheibe
|
||||
|
@ -88,7 +88,7 @@ Pineapple=Ananas
|
|||
Pineapple Juice=Ananassaft
|
||||
Pineapple Ring=Ananasscheibe
|
||||
Pineapple Top=Ananasdeckel
|
||||
Porridge=Brei
|
||||
Porridge=Haferbrei
|
||||
Potato=Kartoffel
|
||||
Pumpkin=Kürbis
|
||||
Pumpkin Bread=Kürbisbrot
|
||||
|
|
|
@ -60,7 +60,7 @@ Hemp Rope=麻绳
|
|||
Hemp Seed=大麻籽
|
||||
Hoe=锄头
|
||||
Hoe Bomb (use or throw on grassy areas to hoe land)=锄弹(在草地上使用或扔在锄地上)
|
||||
Jack 'O Lantern (punch to turn on and off)=杰克灯(按一下开关)
|
||||
Jack 'O Lantern (punch to turn on and off)=南瓜灯(按一下开关)
|
||||
Jaffa Cake=佳发饼
|
||||
Juicer=榨汁机
|
||||
Melon=甜瓜
|
||||
|
@ -118,7 +118,7 @@ Steel Hoe=钢锄头
|
|||
Stone Hoe=石锄
|
||||
Straw=稻草
|
||||
Strawberry=草莓
|
||||
String=字符串
|
||||
String=线
|
||||
Sugar=糖
|
||||
Toast=烤面包片
|
||||
Toast Sandwich=三明治面包
|
||||
|
|
|
@ -60,7 +60,7 @@ Hemp Rope=麻繩
|
|||
Hemp Seed=大麻籽
|
||||
Hoe=鋤頭
|
||||
Hoe Bomb (use or throw on grassy areas to hoe land)=鋤彈(在草地上使用或扔在鋤地上)
|
||||
Jack 'O Lantern (punch to turn on and off)=傑克燈(按一下開關)
|
||||
Jack 'O Lantern (punch to turn on and off)=南瓜燈(按一下開關)
|
||||
Jaffa Cake=佳發餅
|
||||
Juicer=榨汁機
|
||||
Melon=甜瓜
|
||||
|
@ -118,7 +118,7 @@ Steel Hoe=鋼鋤頭
|
|||
Stone Hoe=石鋤
|
||||
Straw=稻草
|
||||
Strawberry=草莓
|
||||
String=字符串
|
||||
String=線
|
||||
Sugar=糖
|
||||
Toast=烤麵包片
|
||||
Toast Sandwich=三明治麵包
|
||||
|
|
|
@ -72,6 +72,8 @@ if minetest.get_modpath("lucky_block") then
|
|||
{name = "farming:seed_rice", max = 15},
|
||||
{name = "farming:seed_oat", max = 15},
|
||||
{name = "farming:soil_wet", max = 10},
|
||||
{name = "farming:cotton_wild", max = 5},
|
||||
{name = "farming:grapebush", max = 5},
|
||||
}},
|
||||
})
|
||||
end
|
||||
|
|
|
@ -54,6 +54,7 @@ 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("sunflower_8", 10, 40, nil, "", -1, farming.sunflower)
|
||||
register_plant("mint_4", 1, 75, {
|
||||
"default:dirt_with_grass", "default:dirt_with_coniferous_litter"},
|
||||
"group:water", 1, farming.mint)
|
||||
|
|
Before Width: | Height: | Size: 187 B After Width: | Height: | Size: 173 B |
After Width: | Height: | Size: 292 B |
After Width: | Height: | Size: 703 B |
After Width: | Height: | Size: 107 B |
After Width: | Height: | Size: 121 B |
After Width: | Height: | Size: 136 B |
After Width: | Height: | Size: 162 B |
After Width: | Height: | Size: 170 B |
After Width: | Height: | Size: 273 B |
After Width: | Height: | Size: 320 B |
After Width: | Height: | Size: 432 B |
After Width: | Height: | Size: 440 B |
After Width: | Height: | Size: 164 B |
After Width: | Height: | Size: 196 B |
After Width: | Height: | Size: 196 B |
After Width: | Height: | Size: 167 B |
|
@ -1 +0,0 @@
|
|||
default
|
|
@ -0,0 +1 @@
|
|||
name = function_delayer
|