write something there

This commit is contained in:
N-Nachtigal 2025-05-04 16:01:41 +02:00
commit b4b6c08f4f
8546 changed files with 309825 additions and 0 deletions

View file

@ -0,0 +1,2 @@
# japaneseforest
A simple and pleasant little mod, which adds a japanese biome with a few more objects. And 3 new tree

View file

@ -0,0 +1,12 @@
if minetest.get_modpath("bonemeal") then
bonemeal:add_crop({
{"japaneseforest:sashimi_", 8, "japaneseforest:seed_sashimi"},
})
bonemeal:add_sapling({
{"japaneseforest:japanese_sapling", grow_new_japanese_tree_2, "soil"},
})
bonemeal:add_deco({
{"japaneseforest:japanese_dirt_with_grass", {"default:grass_1", "default:grass_2", "default:grass_3", "default:grass_4", "default:grass_5"}, {}}
})
end

View file

@ -0,0 +1,123 @@
------------Crafting
minetest.register_craft({
output = "japaneseforest:japanese_wood 4",
recipe = {
{"japaneseforest:japanese_tree"},
}
})
minetest.register_craft({
output = "japaneseforest:japanese_wood 4",
recipe = {
{"japaneseforest:japanese_tree"},
}
})
minetest.register_craft({
output = "japaneseforest:japanese_tatami 2",
recipe = {
{"japaneseforest:mud", "bambooforest:fiber_bamboo"},
{"japaneseforest:japanese_wood", "bambooforest:fiber_bamboo"},
}
})
minetest.register_craft({
output = "japaneseforest:sashimi_brick 2",
recipe = {
{"default:brick", "japaneseforest:sashimi_cooked"},
{"japaneseforest:sashimi_cooked", "japaneseforest:sashimi_cooked"},
}
})
minetest.register_craft({
output = "japaneseforest:tatami_simple 2",
recipe = {
{"japaneseforest:mud", "bambooforest:fiber_bamboo"},
{"japaneseforest:japanese_wood", "japaneseforest:japanese_wood"},
}
})
minetest.register_craft({
output = "japaneseforest:japanese_thin_wall 2",
recipe = {
{"japaneseforest:japanese_wood", "bambooforest:fiber_bamboo"},
{"bambooforest:fiber_bamboo", "bambooforest:fiber_bamboo"},
}
})
minetest.register_craft({
output = "japaneseforest:japanese_trapdoor 2",
recipe = {
{"bambooforest:fiber_bamboo", "japaneseforest:japanese_wood", "bambooforest:fiber_bamboo"},
{"japaneseforest:japanese_wood", "bambooforest:fiber_bamboo", "japaneseforest:japanese_wood"},
{"", "", ""},
}
})
minetest.register_craft({
type = "cooking",
cooktime = 3,
output = "japaneseforest:sashimi_cooked",
recipe = "japaneseforest:sashimi"
})
minetest.register_craft({
type = "cooking",
cooktime = 3,
output = "japaneseforest:racine_cooked",
recipe = "japaneseforest:racine"
})
minetest.register_craft({
type = "cooking",
cooktime = 20,
output = "japaneseforest:dark_brick_cooked 2",
recipe = "japaneseforest:dark_brick"
})
minetest.register_craft({
output = "japaneseforest:dark_brick 2",
recipe = {
{"default:brick", "default:coal_lump"},
{"dye:black", "default:brick"},
}
})
minetest.register_craft({
output = "japaneseforest:mud 2",
recipe = {
{"japaneseforest:sashimi", "default:sandstone"},
{"japaneseforest:sashimi", "japaneseforest:sashimi"},
}
})
minetest.register_craft({
output = "japaneseforest:mud_block 4",
recipe = {
{"japaneseforest:mud", "japaneseforest:mud"},
{"japaneseforest:mud", "japaneseforest:mud"},
}
})
minetest.register_craft({
output = "japaneseforest:mud_brick 4",
recipe = {
{"japaneseforest:mud", "default:brick"},
{"japaneseforest:mud", "japaneseforest:mud"},
}
})
minetest.register_craft({
output = "japaneseforest:japanese_lamp 2",
recipe = {
{"bambooforest:fiber_bamboo", "japaneseforest:japanese_wood"},
{"default:paper", "default:torch"},
}
})
minetest.register_craft({
output = "japaneseforest:truel",
recipe = {
{"japaneseforest:dark_brick_cooked", "default:brick"},
{"japaneseforest:dark_brick_cooked", "japaneseforest:dark_brick_cooked"},
}
})

View file

@ -0,0 +1,11 @@
farming.register_plant("japaneseforest:sashimi", {
description = "Sashimi Seed",
inventory_image = "seed_sashimi.png",
steps = 8,
on_use = minetest.item_eat(2),
minlight = 13,
maxlight = default.LIGHT_MAX,
fertility = {"japaneseforest", "bambooforest"},
groups = {flammable = 4, food_bread = 1},
place_param2 = 3,
})

View file

@ -0,0 +1,755 @@
minetest.register_node("japaneseforest:red_firefly", {
description = "Red Firefly",
drawtype = "plantlike",
tiles = {{
name = "japaneseforest_red_firefly_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1.5
},
}},
inventory_image = "japaneseforest_red_firefly.png",
wield_image = "japaneseforest_red_firefly.png",
waving = 1,
paramtype = "light",
sunlight_propagates = true,
buildable_to = true,
walkable = false,
groups = {catchable = 1},
selection_box = {
type = "fixed",
fixed = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1},
},
light_source = 6,
floodable = true,
on_place = function(itemstack, placer, pointed_thing)
local player_name = placer:get_player_name()
local pos = pointed_thing.above
if not minetest.is_protected(pos, player_name) and
not minetest.is_protected(pointed_thing.under, player_name) and
minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "japaneseforest:red_firefly"})
minetest.get_node_timer(pos):start(1)
itemstack:take_item()
end
return itemstack
end,
on_timer = function(pos, elapsed)
if minetest.get_node_light(pos) > 11 then
minetest.set_node(pos, {name = "japaneseforest:hidden_red_firefly"})
end
minetest.get_node_timer(pos):start(30)
end
})
minetest.register_node("japaneseforest:hidden_red_firefly", {
description = "Hidden Red Firefly",
drawtype = "airlike",
inventory_image = "japaneseforest_red_firefly.png^default_invisible_node_overlay.png",
wield_image = "japaneseforest_red_firefly.png^default_invisible_node_overlay.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
groups = {not_in_creative_inventory = 1},
floodable = true,
on_place = function(itemstack, placer, pointed_thing)
local player_name = placer:get_player_name()
local pos = pointed_thing.above
if not minetest.is_protected(pos, player_name) and
not minetest.is_protected(pointed_thing.under, player_name) and
minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "japaneseforest:hidden_red_firefly"})
minetest.get_node_timer(pos):start(1)
itemstack:take_item()
end
return itemstack
end,
on_timer = function(pos, elapsed)
if minetest.get_node_light(pos) <= 11 then
minetest.set_node(pos, {name = "japaneseforest:red_firefly"})
end
minetest.get_node_timer(pos):start(30)
end
})
--------------------------------------------------------------------------------------------------------------------------------
minetest.register_node("japaneseforest:blue_firefly", {
description = "Blue Firefly",
drawtype = "plantlike",
tiles = {{
name = "japaneseforest_blue_firefly_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1.5
},
}},
inventory_image = "japaneseforest_blue_firefly.png",
wield_image = "japaneseforest_blue_firefly.png",
waving = 1,
paramtype = "light",
sunlight_propagates = true,
buildable_to = true,
walkable = false,
groups = {catchable = 1},
selection_box = {
type = "fixed",
fixed = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1},
},
light_source = 6,
floodable = true,
on_place = function(itemstack, placer, pointed_thing)
local player_name = placer:get_player_name()
local pos = pointed_thing.above
if not minetest.is_protected(pos, player_name) and
not minetest.is_protected(pointed_thing.under, player_name) and
minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "japaneseforest:blue_firefly"})
minetest.get_node_timer(pos):start(1)
itemstack:take_item()
end
return itemstack
end,
on_timer = function(pos, elapsed)
if minetest.get_node_light(pos) > 11 then
minetest.set_node(pos, {name = "japaneseforest:hidden_blue_firefly"})
end
minetest.get_node_timer(pos):start(30)
end
})
minetest.register_node("japaneseforest:hidden_blue_firefly", {
description = "Hidden Blue Firefly",
drawtype = "airlike",
inventory_image = "japaneseforest_blue_firefly.png^default_invisible_node_overlay.png",
wield_image = "japaneseforest_blue_firefly.png^default_invisible_node_overlay.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
groups = {not_in_creative_inventory = 1},
floodable = true,
on_place = function(itemstack, placer, pointed_thing)
local player_name = placer:get_player_name()
local pos = pointed_thing.above
if not minetest.is_protected(pos, player_name) and
not minetest.is_protected(pointed_thing.under, player_name) and
minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "japaneseforest:hidden_blue_firefly"})
minetest.get_node_timer(pos):start(1)
itemstack:take_item()
end
return itemstack
end,
on_timer = function(pos, elapsed)
if minetest.get_node_light(pos) <= 11 then
minetest.set_node(pos, {name = "japaneseforest:blue_firefly"})
end
minetest.get_node_timer(pos):start(30)
end
})
--------------------------------------------------------------------------------------------------------------------------------
minetest.register_node("japaneseforest:green_firefly", {
description = "Green Firefly",
drawtype = "plantlike",
tiles = {{
name = "japaneseforest_green_firefly_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1.5
},
}},
inventory_image = "japaneseforest_green_firefly.png",
wield_image = "japaneseforest_green_firefly.png",
waving = 1,
paramtype = "light",
sunlight_propagates = true,
buildable_to = true,
walkable = false,
groups = {catchable = 1},
selection_box = {
type = "fixed",
fixed = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1},
},
light_source = 6,
floodable = true,
on_place = function(itemstack, placer, pointed_thing)
local player_name = placer:get_player_name()
local pos = pointed_thing.above
if not minetest.is_protected(pos, player_name) and
not minetest.is_protected(pointed_thing.under, player_name) and
minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "japaneseforest:green_firefly"})
minetest.get_node_timer(pos):start(1)
itemstack:take_item()
end
return itemstack
end,
on_timer = function(pos, elapsed)
if minetest.get_node_light(pos) > 11 then
minetest.set_node(pos, {name = "japaneseforest:hidden_green_firefly"})
end
minetest.get_node_timer(pos):start(30)
end
})
minetest.register_node("japaneseforest:hidden_green_firefly", {
description = "Hidden Green Firefly",
drawtype = "airlike",
inventory_image = "japaneseforest_green_firefly.png^default_invisible_node_overlay.png",
wield_image = "japaneseforest_green_firefly.png^default_invisible_node_overlay.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
groups = {not_in_creative_inventory = 1},
floodable = true,
on_place = function(itemstack, placer, pointed_thing)
local player_name = placer:get_player_name()
local pos = pointed_thing.above
if not minetest.is_protected(pos, player_name) and
not minetest.is_protected(pointed_thing.under, player_name) and
minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "japaneseforest:hidden_green_firefly"})
minetest.get_node_timer(pos):start(1)
itemstack:take_item()
end
return itemstack
end,
on_timer = function(pos, elapsed)
if minetest.get_node_light(pos) <= 11 then
minetest.set_node(pos, {name = "japaneseforest:green_firefly"})
end
minetest.get_node_timer(pos):start(30)
end
})
--------------------------------------------------------------------------------------------------------------------------------
minetest.register_node("japaneseforest:violet_firefly", {
description = "Violet Firefly",
drawtype = "plantlike",
tiles = {{
name = "japaneseforest_violet_firefly_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1.5
},
}},
inventory_image = "japaneseforest_violet_firefly.png",
wield_image = "japaneseforest_violet_firefly.png",
waving = 1,
paramtype = "light",
sunlight_propagates = true,
buildable_to = true,
walkable = false,
groups = {catchable = 1},
selection_box = {
type = "fixed",
fixed = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1},
},
light_source = 6,
floodable = true,
on_place = function(itemstack, placer, pointed_thing)
local player_name = placer:get_player_name()
local pos = pointed_thing.above
if not minetest.is_protected(pos, player_name) and
not minetest.is_protected(pointed_thing.under, player_name) and
minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "japaneseforest:violet_firefly"})
minetest.get_node_timer(pos):start(1)
itemstack:take_item()
end
return itemstack
end,
on_timer = function(pos, elapsed)
if minetest.get_node_light(pos) > 11 then
minetest.set_node(pos, {name = "japaneseforest:hidden_violet_firefly"})
end
minetest.get_node_timer(pos):start(30)
end
})
minetest.register_node("japaneseforest:hidden_violet_firefly", {
description = "Hidden Violet Firefly",
drawtype = "airlike",
inventory_image = "japaneseforest_violet_firefly.png^default_invisible_node_overlay.png",
wield_image = "japaneseforest_violet_firefly.png^default_invisible_node_overlay.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
groups = {not_in_creative_inventory = 1},
floodable = true,
on_place = function(itemstack, placer, pointed_thing)
local player_name = placer:get_player_name()
local pos = pointed_thing.above
if not minetest.is_protected(pos, player_name) and
not minetest.is_protected(pointed_thing.under, player_name) and
minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "japaneseforest:hidden_violet_firefly"})
minetest.get_node_timer(pos):start(1)
itemstack:take_item()
end
return itemstack
end,
on_timer = function(pos, elapsed)
if minetest.get_node_light(pos) <= 11 then
minetest.set_node(pos, {name = "japaneseforest:violet_firefly"})
end
minetest.get_node_timer(pos):start(30)
end
})
--------------------------------------------------------------------------------------------------------------------------------
minetest.register_node("japaneseforest:orange_firefly", {
description = "Orange Firefly",
drawtype = "plantlike",
tiles = {{
name = "japaneseforest_orange_firefly_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1.5
},
}},
inventory_image = "japaneseforest_orange_firefly.png",
wield_image = "japaneseforest_orange_firefly.png",
waving = 1,
paramtype = "light",
sunlight_propagates = true,
buildable_to = true,
walkable = false,
groups = {catchable = 1},
selection_box = {
type = "fixed",
fixed = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1},
},
light_source = 6,
floodable = true,
on_place = function(itemstack, placer, pointed_thing)
local player_name = placer:get_player_name()
local pos = pointed_thing.above
if not minetest.is_protected(pos, player_name) and
not minetest.is_protected(pointed_thing.under, player_name) and
minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "japaneseforest:orange_firefly"})
minetest.get_node_timer(pos):start(1)
itemstack:take_item()
end
return itemstack
end,
on_timer = function(pos, elapsed)
if minetest.get_node_light(pos) > 11 then
minetest.set_node(pos, {name = "japaneseforest:hidden_orange_firefly"})
end
minetest.get_node_timer(pos):start(30)
end
})
minetest.register_node("japaneseforest:hidden_orange_firefly", {
description = "Hidden Orange Firefly",
drawtype = "airlike",
inventory_image = "japaneseforest_orange_firefly.png^default_invisible_node_overlay.png",
wield_image = "japaneseforest_orange_firefly.png^default_invisible_node_overlay.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
groups = {not_in_creative_inventory = 1},
floodable = true,
on_place = function(itemstack, placer, pointed_thing)
local player_name = placer:get_player_name()
local pos = pointed_thing.above
if not minetest.is_protected(pos, player_name) and
not minetest.is_protected(pointed_thing.under, player_name) and
minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "japaneseforest:hidden_orange_firefly"})
minetest.get_node_timer(pos):start(1)
itemstack:take_item()
end
return itemstack
end,
on_timer = function(pos, elapsed)
if minetest.get_node_light(pos) <= 11 then
minetest.set_node(pos, {name = "japaneseforest:orange_firefly"})
end
minetest.get_node_timer(pos):start(30)
end
})
-------------------------------------------------------------------------------------------------------------------------------
minetest.register_node("japaneseforest:pink_firefly", {
description = "Pink Firefly",
drawtype = "plantlike",
tiles = {{
name = "japaneseforest_pink_firefly_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1.5
},
}},
inventory_image = "japaneseforest_pink_firefly.png",
wield_image = "japaneseforest_pink_firefly.png",
waving = 1,
paramtype = "light",
sunlight_propagates = true,
buildable_to = true,
walkable = false,
groups = {catchable = 1},
selection_box = {
type = "fixed",
fixed = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1},
},
light_source = 6,
floodable = true,
on_place = function(itemstack, placer, pointed_thing)
local player_name = placer:get_player_name()
local pos = pointed_thing.above
if not minetest.is_protected(pos, player_name) and
not minetest.is_protected(pointed_thing.under, player_name) and
minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "japaneseforest:pink_firefly"})
minetest.get_node_timer(pos):start(1)
itemstack:take_item()
end
return itemstack
end,
on_timer = function(pos, elapsed)
if minetest.get_node_light(pos) > 11 then
minetest.set_node(pos, {name = "japaneseforest:hidden_pink_firefly"})
end
minetest.get_node_timer(pos):start(30)
end
})
minetest.register_node("japaneseforest:hidden_pink_firefly", {
description = "Hidden Pink Firefly",
drawtype = "airlike",
inventory_image = "japaneseforest_pink_firefly.png^default_invisible_node_overlay.png",
wield_image = "japaneseforest_pink_firefly.png^default_invisible_node_overlay.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
groups = {not_in_creative_inventory = 1},
floodable = true,
on_place = function(itemstack, placer, pointed_thing)
local player_name = placer:get_player_name()
local pos = pointed_thing.above
if not minetest.is_protected(pos, player_name) and
not minetest.is_protected(pointed_thing.under, player_name) and
minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "japaneseforest:hidden_pink_firefly"})
minetest.get_node_timer(pos):start(1)
itemstack:take_item()
end
return itemstack
end,
on_timer = function(pos, elapsed)
if minetest.get_node_light(pos) <= 11 then
minetest.set_node(pos, {name = "japaneseforest:pink_firefly"})
end
minetest.get_node_timer(pos):start(30)
end
})
-------------------------------------------------------------------------------------------------------------------------------
minetest.register_node("japaneseforest:cyan_firefly", {
description = "Cyan Firefly",
drawtype = "plantlike",
tiles = {{
name = "japaneseforest_cyan_firefly_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1.5
},
}},
inventory_image = "japaneseforest_cyan_firefly.png",
wield_image = "japaneseforest_cyan_firefly.png",
waving = 1,
paramtype = "light",
sunlight_propagates = true,
buildable_to = true,
walkable = false,
groups = {catchable = 1},
selection_box = {
type = "fixed",
fixed = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1},
},
light_source = 6,
floodable = true,
on_place = function(itemstack, placer, pointed_thing)
local player_name = placer:get_player_name()
local pos = pointed_thing.above
if not minetest.is_protected(pos, player_name) and
not minetest.is_protected(pointed_thing.under, player_name) and
minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "japaneseforest:cyan_firefly"})
minetest.get_node_timer(pos):start(1)
itemstack:take_item()
end
return itemstack
end,
on_timer = function(pos, elapsed)
if minetest.get_node_light(pos) > 11 then
minetest.set_node(pos, {name = "japaneseforest:hidden_cyan_firefly"})
end
minetest.get_node_timer(pos):start(30)
end
})
minetest.register_node("japaneseforest:hidden_cyan_firefly", {
description = "Hidden Cyan Firefly",
drawtype = "airlike",
inventory_image = "japaneseforest_cyan_firefly.png^default_invisible_node_overlay.png",
wield_image = "japaneseforest_cyan_firefly.png^default_invisible_node_overlay.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
groups = {not_in_creative_inventory = 1},
floodable = true,
on_place = function(itemstack, placer, pointed_thing)
local player_name = placer:get_player_name()
local pos = pointed_thing.above
if not minetest.is_protected(pos, player_name) and
not minetest.is_protected(pointed_thing.under, player_name) and
minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "japaneseforest:hidden_cyan_firefly"})
minetest.get_node_timer(pos):start(1)
itemstack:take_item()
end
return itemstack
end,
on_timer = function(pos, elapsed)
if minetest.get_node_light(pos) <= 11 then
minetest.set_node(pos, {name = "japaneseforest:cyan_firefly"})
end
minetest.get_node_timer(pos):start(30)
end
})
------------------------------------------------------------------------------------------------------------------------------
minetest.register_node("japaneseforest:white_firefly", {
description = "White Firefly",
drawtype = "plantlike",
tiles = {{
name = "japaneseforest_white_firefly_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1.5
},
}},
inventory_image = "japaneseforest_white_firefly.png",
wield_image = "japaneseforest_white_firefly.png",
waving = 1,
paramtype = "light",
sunlight_propagates = true,
buildable_to = true,
walkable = false,
groups = {catchable = 1},
selection_box = {
type = "fixed",
fixed = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1},
},
light_source = 6,
floodable = true,
on_place = function(itemstack, placer, pointed_thing)
local player_name = placer:get_player_name()
local pos = pointed_thing.above
if not minetest.is_protected(pos, player_name) and
not minetest.is_protected(pointed_thing.under, player_name) and
minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "japaneseforest:white_firefly"})
minetest.get_node_timer(pos):start(1)
itemstack:take_item()
end
return itemstack
end,
on_timer = function(pos, elapsed)
if minetest.get_node_light(pos) > 11 then
minetest.set_node(pos, {name = "japaneseforest:hidden_white_firefly"})
end
minetest.get_node_timer(pos):start(30)
end
})
minetest.register_node("japaneseforest:hidden_white_firefly", {
description = "Hidden White Firefly",
drawtype = "airlike",
inventory_image = "japaneseforest_white_firefly.png^default_invisible_node_overlay.png",
wield_image = "japaneseforest_white_firefly.png^default_invisible_node_overlay.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
groups = {not_in_creative_inventory = 1},
floodable = true,
on_place = function(itemstack, placer, pointed_thing)
local player_name = placer:get_player_name()
local pos = pointed_thing.above
if not minetest.is_protected(pos, player_name) and
not minetest.is_protected(pointed_thing.under, player_name) and
minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "japaneseforest:hidden_white_firefly"})
minetest.get_node_timer(pos):start(1)
itemstack:take_item()
end
return itemstack
end,
on_timer = function(pos, elapsed)
if minetest.get_node_light(pos) <= 11 then
minetest.set_node(pos, {name = "japaneseforest:white_firefly"})
end
minetest.get_node_timer(pos):start(30)
end
})
------------------------------------------------------------------------------------------------------------------------------
minetest.register_node("japaneseforest:black_firefly", {
description = "Black Firefly",
drawtype = "plantlike",
tiles = {{
name = "japaneseforest_black_firefly_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1.5
},
}},
inventory_image = "japaneseforest_black_firefly.png",
wield_image = "japaneseforest_black_firefly.png",
waving = 1,
paramtype = "light",
sunlight_propagates = true,
buildable_to = true,
walkable = false,
groups = {catchable = 1},
selection_box = {
type = "fixed",
fixed = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1},
},
light_source = 6,
floodable = true,
on_place = function(itemstack, placer, pointed_thing)
local player_name = placer:get_player_name()
local pos = pointed_thing.above
if not minetest.is_protected(pos, player_name) and
not minetest.is_protected(pointed_thing.under, player_name) and
minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "japaneseforest:black_firefly"})
minetest.get_node_timer(pos):start(1)
itemstack:take_item()
end
return itemstack
end,
on_timer = function(pos, elapsed)
if minetest.get_node_light(pos) > 11 then
minetest.set_node(pos, {name = "japaneseforest:hidden_black_firefly"})
end
minetest.get_node_timer(pos):start(30)
end
})
minetest.register_node("japaneseforest:hidden_black_firefly", {
description = "Hidden Black Firefly",
drawtype = "airlike",
inventory_image = "japaneseforest_black_firefly.png^default_invisible_node_overlay.png",
wield_image = "japaneseforest_black_firefly.png^default_invisible_node_overlay.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
groups = {not_in_creative_inventory = 1},
floodable = true,
on_place = function(itemstack, placer, pointed_thing)
local player_name = placer:get_player_name()
local pos = pointed_thing.above
if not minetest.is_protected(pos, player_name) and
not minetest.is_protected(pointed_thing.under, player_name) and
minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "japaneseforest:hidden_black_firefly"})
minetest.get_node_timer(pos):start(1)
itemstack:take_item()
end
return itemstack
end,
on_timer = function(pos, elapsed)
if minetest.get_node_light(pos) <= 11 then
minetest.set_node(pos, {name = "japaneseforest:black_firefly"})
end
minetest.get_node_timer(pos):start(30)
end
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"japaneseforest:japanese_dirt_with_grass"},
sidelen = 16,
fill_ratio = 0.02,
biomes = {"japaneseforest"},
decoration = {
"japaneseforest:red_firefly", "japaneseforest:orange_firefly", "japaneseforest:white_firefly", "japaneseforest:cyan_firefly", "japaneseforest:blue_firefly", "japaneseforest:green_firefly", "japaneseforest:pink_firefly", "japaneseforest:violet_firefly", "japaneseforest:black_firefly",
}
})

View file

@ -0,0 +1,23 @@
local path = minetest.get_modpath("japaneseforest")
--------------------Biome
dofile(path .. "/farm.lua")
dofile(path .. "/mapgen.lua")
--dofile(path .. "/fireflies.lua")
dofile(path .. "/crafting.lua")
dofile(path .. "/item.lua")
dofile(path .. "/nodes.lua")
dofile(path .. "/tree.lua")
dofile(path .. "/bonemeal.lua")
dofile(path .. "/moreblocks.lua")
-------Bonus
dofile(path .. "/tools.lua")

View file

@ -0,0 +1,18 @@
minetest.register_craftitem("japaneseforest:sashimi_cooked", {
description = "Sashimi Cooked",
inventory_image = "japaneseforest_sashimi_cooked.png",
on_use = minetest.item_eat(5),
groups = {food_bread = 1, flammable = 2},
})
minetest.register_craftitem("japaneseforest:racine_cooked", {
description = "Racine Cooked",
inventory_image = "racine_cooked.png",
on_use = minetest.item_eat(3),
groups = {food_bread = 1, flammable = 2},
})
minetest.register_craftitem("japaneseforest:dark_brick_cooked", {
description = "Dark Brick Cooked",
inventory_image = "dark_brick_cooked.png",
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 KiB

View file

@ -0,0 +1,18 @@
License
------------------------------------------------------------------------------------------------------------------------
Copyright (C) 2021-2022: Atlante - AFL-1.1
License for code: AFL-1.1
Attribution — You must give appropriate credit, provide a link to the license, and
indicate if changes were made. You may do so in any reasonable manner, but not in any way
that suggests the licensor endorses you or your use.
ShareAlike — If you remix, transform, or build upon the material, you must distribute
your contributions under the same license as the original.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Anyone can fix the mod. My Discord "Atlante#1952" And my Mail Address "AtlanteEtDocteur@gmail.com"

View file

@ -0,0 +1,140 @@
minetest.register_decoration({
name = "japaneseforest:japanese_tree_1_1",
deco_type = "schematic",
place_on = {"japaneseforest:japanese_dirt_with_grass"},
place_offset_y = 0,
sidelen = 16,
fill_ratio = 0.009365,
biomes = {"japaneseforest"},
y_max = 31000,
y_min = -20,
schematic = minetest.get_modpath("japaneseforest").."/schematics/japanese_tree_1_1.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_decoration({
name = "japaneseforest:japanese_tree_1_2",
deco_type = "schematic",
place_on = {"japaneseforest:japanese_dirt_with_grass"},
place_offset_y = 0,
sidelen = 16,
fill_ratio = 0.009365,
biomes = {"japaneseforest"},
y_max = 31000,
y_min = -20,
schematic = minetest.get_modpath("japaneseforest").."/schematics/japanese_tree_1_2.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_decoration({
name = "japaneseforest:japanese_tree_1_3",
deco_type = "schematic",
place_on = {"japaneseforest:japanese_dirt_with_grass"},
place_offset_y = 0,
sidelen = 16,
fill_ratio = 0.007365,
biomes = {"japaneseforest"},
y_max = 31000,
y_min = -20,
schematic = minetest.get_modpath("japaneseforest").."/schematics/japanese_tree_1_3.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_decoration({
name = "japaneseforest:japanese_tree_3_2",
deco_type = "schematic",
place_on = {"japaneseforest:japanese_dirt_with_grass"},
place_offset_y = 0,
sidelen = 16,
fill_ratio = 0.008365,
biomes = {"japaneseforest"},
y_max = 31000,
y_min = -20,
schematic = minetest.get_modpath("japaneseforest").."/schematics/japanese_tree_3_2.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_decoration({
name = "japaneseforest:japanese_tree_2_1",
deco_type = "schematic",
place_on = {"japaneseforest:japanese_dirt_with_grass"},
place_offset_y = 0,
sidelen = 16,
fill_ratio = 0.008365,
biomes = {"japaneseforest"},
y_max = 31000,
y_min = -20,
schematic = minetest.get_modpath("japaneseforest").."/schematics/japanese_tree_2_1.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
--[[minetest.register_decoration({
name = "japaneseforest:bamboo",
deco_type = "schematic",
place_on = {"japaneseforest:japanese_dirt_with_grass"},
place_offset_y = 0,
sidelen = 16,
fill_ratio = 0.009265,
biomes = {"japaneseforest"},
y_max = 31000,
y_min = -20,
schematic = minetest.get_modpath("bambooforest").."/schematics/bamboo_tree_5.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})]]
minetest.register_decoration({
deco_type = "simple",
place_on = {"japaneseforest:japanese_dirt_with_grass"},
sidelen = 16,
fill_ratio = 0.1,
biomes = {"japaneseforest"},
decoration = {
"japaneseforest:racine"
}
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"japaneseforest:japanese_dirt_with_grass"},
sidelen = 16,
fill_ratio = 0.1,
biomes = {"japaneseforest"},
decoration = {
"default:junglegrass"
}
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"japaneseforest:japanese_dirt_with_grass"},
sidelen = 16,
fill_ratio = 0.3,
biomes = {"japaneseforest"},
decoration = {
"default:grass_1", "default:grass_2",
"default:grass_3", "default:grass_4",
"default:grass_5",
}
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"japaneseforest:japanese_dirt_with_grass", "bambooforest:dirt_with_bamboo"},
sidelen = 16,
fill_ratio = 0.05,
biomes = {"japaneseforest", "bambooforest"},
decoration = {
"japaneseforest:sashimi_8",
}
})

View file

@ -0,0 +1,8 @@
author = Atlante
name = japaneseforest
description = Adds a japanese biome with a few more objects. And 3 new trees.
title = Japanese Forest
depends = default, doors, stairs, xpanes
optional_depends = moreblocks, bonemeal

View file

@ -0,0 +1,68 @@
-----------------Moreblock
if minetest.get_modpath("moreblocks") then
stairsplus:register_all("japanese_wood", "wood", "japaneseforest:japanese_wood", {
description = "Japanese Wood",
tiles = {"japanese_wood.png"},
groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
stairsplus:register_all("japanese_tree", "tree", "japaneseforest:japanese_tree", {
description = "Japanese Tree",
tiles = {"japanese_tree_top.png", "japanese_tree_top.png",
"japanese_tree.png"},
groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
stairsplus:register_all("mud", "stone", "japaneseforest:mud", {
description = "Mud",
tiles = {"mud.png"},
groups = {cracky = 3, stone = 1},
sounds = default.node_sound_stone_defaults(),
})
stairsplus:register_all("mud_block", "stone", "japaneseforest:mud_block", {
description = "Mud Block",
tiles = {"mud_block.png"},
groups = {cracky = 3, stone = 1},
sounds = default.node_sound_stone_defaults(),
})
stairsplus:register_all("mud_brick", "stone", "japaneseforest:mud_brick", {
description = "Mud Brick",
tiles = {"mud_brick.png"},
groups = {cracky = 3, stone = 1},
sounds = default.node_sound_stone_defaults(),
})
stairsplus:register_all("dark_brick", "stone", "japaneseforest:dark_brick", {
description = "Dark Brick",
tiles = {"japaneseforest_path_top.png"},
groups = {cracky = 3, stone = 1},
sounds = default.node_sound_stone_defaults(),
})
stairsplus:register_all("sashimi_brick", "stone", "japaneseforest:sashimi_brick", {
description = "Sashimi Brick",
tiles = {"sashimi_brick.png"},
groups = {cracky = 3, stone = 1},
sounds = default.node_sound_stone_defaults(),
})
stairsplus:register_all("japanese_lamp", "wood", "japaneseforest:japanese_lamp", {
description = "Japanese Lamp",
tiles = {"japanese_lamp.png"},
groups = {choppy = 3, oddly_breakable_by_hand = 2, stone = 1},
sounds = default.node_sound_wood_defaults(),
})
stairsplus:register_all("japanese_tatami", "wood", "japaneseforest:japanese_tatami", {
description = "Japanese Tatami",
tiles = {"tatami.png"},
groups = {choppy = 3, oddly_breakable_by_hand = 2, stone = 1},
sounds = default.node_sound_wood_defaults(),
})
end

View file

@ -0,0 +1,221 @@
minetest.register_node("japaneseforest:japanese_tree", {
description = "Japanese Tree",
tiles = {"japanese_tree_top.png", "japanese_tree_top.png",
"japanese_tree.png"},
paramtype2 = "facedir",
is_ground_content = false,
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
minetest.register_node("japaneseforest:japanese_wood", {
description = "Japanese Wood",
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"japanese_wood.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("japaneseforest:sashimi_brick", {
description = "Sashimi Brick",
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"sashimi_brick.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("japaneseforest:tatami_simple", {
description = "Japanese Simple Tatami",
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"tatami_simple.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("japaneseforest:japanese_tatami", {
description = "Japanese Tatami",
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"tatami.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
doors.register_trapdoor("japaneseforest:japanese_trapdoor", {
description = "Japanese Trapdoor",
inventory_image = "japanese_trapdoor.png",
wield_image = "japanese_trapdoor.png",
tile_front = "japanese_trapdoor.png",
tile_side = "japanese_trapdoor_side.png",
gain_open = 0.06,
gain_close = 0.13,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, door = 1},
})
doors.register("japanese_door", {
tiles = {{ name = "doors_japanese_door.png", backface_culling = true }},
description = "Japanese Door",
inventory_image = "doors_item_japanese.png",
groups = {node = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
gain_open = 0.06,
gain_close = 0.13,
recipe = {
{"bambooforest:fiber_bamboo", "japaneseforest:japanese_wood"},
{"japaneseforest:japanese_wood", "bambooforest:fiber_bamboo"},
{"bambooforest:fiber_bamboo", "japaneseforest:japanese_wood"},
}
})
xpanes.register_pane("japanese_small_wall", {
description = "Japanese Small Wall",
textures = {"small_wall.png", "", "side_small_wall.png"},
inventory_image = "small_wall.png",
wield_image = "small_wall.png",
sounds = default.node_sound_wood_defaults(),
groups = {choppy=1, oddly_breakable_by_hand=2, flammable = 3},
recipe = {
{"bambooforest:fiber_bamboo", "bambooforest:fiber_bamboo", "bambooforest:fiber_bamboo"},
{"dye:magenta", "japaneseforest:japanese_wood", "dye:magenta"},
}
})
stairs.register_stair_and_slab(
"japanese_wood",
"japaneseforest:japanese_wood",
{choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
{"japanese_wood.png"},
"Japanese Wood Stair",
"Japanese Wood Slab",
default.node_sound_wood_defaults(),
true
)
doors.register_fencegate("japaneseforest:gate_japanese", {
description = "Japanese Wood Fence Gate",
texture = "japanese_wood_fence.png",
material = "japaneseforest:japanese_wood",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}
})
default.register_fence("japaneseforest:fence_japanese_wood", {
description = "Japanese Wood Fence",
texture = "japanese_wood_fence.png",
inventory_image = "japaneseforest_fence_overlay.png^japanese_wood_fence.png^" ..
"japaneseforest_fence_overlay.png^[makealpha:255,126,126",
wield_image = "japaneseforest_fence_overlay.png^japanese_wood_fence.png^" ..
"japaneseforest_fence_overlay.png^[makealpha:255,126,126",
material = "japaneseforest:japanese_wood",
groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
sounds = default.node_sound_wood_defaults()
})
default.register_fence_rail("japaneseforest:fence_rail_japanese_wood", {
description = "Japanese Wood Fence Rail",
texture = "japanese_wood_fence.png",
inventory_image = "japaneseforest_fence_rail_overlay.png^japanese_wood_fence.png^" ..
"japaneseforest_fence_rail_overlay.png^[makealpha:255,126,126",
wield_image = "japaneseforest_fence_rail_overlay.png^japanese_wood_fence.png^" ..
"japaneseforest_fence_rail_overlay.png^[makealpha:255,126,126",
material = "japaneseforest:japanese_wood",
groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
sounds = default.node_sound_wood_defaults()
})
minetest.register_node("japaneseforest:racine", {
description = "Racine",
drawtype = "signlike",
waving = 1,
tiles = {"racine.png"},
-- Use texture of a taller grass stage in inventory
inventory_image = "racine_inv.png",
wield_image = "racine.png",
on_use = minetest.item_eat(1),
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy = 3, attached_node = 1, oddly_breakable_by_hand=3,
flammable = 1, food_bread = 1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type="wallmounted",
wall_top = {-0.5, 0.49, -0.5, 0.5, 0.5, 0.5},
wall_bottom = {-0.5, -0.5, -0.5, 0.5, -0.49, 0.5},
wall_side = {-0.5, -0.5, -0.5, -0.49, 0.5, 0.5},
},
})
minetest.register_node("japaneseforest:mud", {
description = "Japanese Mud",
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"mud.png"},
is_ground_content = false,
groups = {cracky = 2, stone = 1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("japaneseforest:mud_block", {
description = "Japanese Mud Block",
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"mud_block.png"},
is_ground_content = false,
groups = {cracky = 2, stone = 1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("japaneseforest:mud_brick", {
description = "Japanese Mud Brick",
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"mud_brick.png"},
is_ground_content = false,
groups = {cracky = 2, stone = 1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("japaneseforest:japanese_dirt_with_grass", {
description = "Japanese Dirt With Grass",
tiles = {"japaneseforest_japanese_grass.png", "default_dirt.png",
{name = "default_dirt.png^japaneseforest_japanese_grass_side.png",
tileable_vertical = false}},
groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
drop = "default:dirt",
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_grass_footstep", gain = 0.25},
}),
})
minetest.register_node("japaneseforest:japanese_lamp", {
description = "Japanese Lamp",
drawtype = "glasslike",
tiles = {"japanese_lamp.png"},
paramtype = "light",
sunlight_propagates = true,
is_ground_content = false,
groups = {cracky = 3, oddly_breakable_by_hand = 3},
sounds = default.node_sound_wood_defaults(),
light_source = default.LIGHT_MAX,
})
minetest.register_node("japaneseforest:dark_brick", {
description = "Japanese Dark Brick",
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"japaneseforest_path_top.png"},
is_ground_content = false,
groups = {cracky = 2, stone = 1},
sounds = default.node_sound_stone_defaults(),
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 443 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,013 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,013 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

View file

@ -0,0 +1,405 @@
japaneseforest = {}
-- save how many bullets owner fired
japaneseforest.fired_table = {}
local enable_particles = minetest.settings:get_bool("enable_particles")
local function bound(x, minb, maxb)
if x < minb then
return minb
elseif x > maxb then
return maxb
else
return x
end
end
--- Punch damage calculator.
-- By default, this just calculates damage in the vanilla way. Switch it out for something else to change the default damage mechanism for mobs.
-- @param ObjectRef player
-- @param ?ObjectRef puncher
-- @param number time_from_last_punch
-- @param table tool_capabilities
-- @param ?vector direction
-- @param ?Id attacker
-- @return number The calculated damage
-- @author raymoo
function japaneseforest.damage_calculator(player, puncher, tflp, caps, direction, attacker)
local a_groups = player:get_armor_groups() or {}
local full_punch_interval = caps.full_punch_interval or 1.4
local time_prorate = bound(tflp / full_punch_interval, 0, 1)
local damage = 0
for group, damage_rating in pairs(caps.damage_groups or {}) do
local armor_rating = a_groups[group] or 0
damage = damage + damage_rating * (armor_rating / 100)
end
return math.floor(damage * time_prorate)
end
-- particles
function japaneseforest.add_effects(pos)
if not enable_particles then return end
return minetest.add_particlespawner({
amount = 2,
time = 0,
minpos = {x=pos.x-1, y=pos.y+0.5, z=pos.z-1},
maxpos = {x=pos.x+1, y=pos.y+1.5, z=pos.z+1},
minvel = {x=-0.1, y=-0.1, z=-0.1},
maxvel = {x=0.3, y=-0.3, z=0.3},
minacc = vector.new(),
maxacc = vector.new(),
minexptime = 1,
maxexptime = 5,
minsize = .5,
maxsize = 1.5,
texture = "japaneseforest_chest_particle.png",
glow = 7
})
end
-- check for player near by to activate particles
function japaneseforest.check_around_radius(pos)
local player_near = false
for _,obj in ipairs(minetest.get_objects_inside_radius(pos, 16)) do
if obj:is_player() then
player_near = true
break
end
end
return player_near
end
-- check if within physical map limits (-30911 to 30927)
function japaneseforest.within_limits(pos, radius)
if (pos.x - radius) > -30913
and (pos.x + radius) < 30928
and (pos.y - radius) > -30913
and (pos.y + radius) < 30928
and (pos.z - radius) > -30913
and (pos.z + radius) < 30928 then
return true -- within limits
end
return false -- beyond limits
end
function japaneseforest.add_wear(itemstack, pos)
-- wear tool
local wdef = itemstack:get_definition()
itemstack:add_wear(65535/4300)
-- Tool break sound
if itemstack:get_count() == 0 and wdef.sound and wdef.sound.breaks then
minetest.sound_play(wdef.sound.breaks, {pos = pos, gain = 0.5})
end
return itemstack
end
-- prevent pick axe engraved of placing item when clicken on one of the items from this list
local pick_engraved_place_blacklist = {
["xdecor:itemframe"] = true
}
function japaneseforest.pick_engraved_place(itemstack, placer, pointed_thing)
local idx = placer:get_wield_index() + 1 -- item to right of wielded tool
local inv = placer:get_inventory()
local stack = inv:get_stack("main", idx) -- stack to right of tool
local stack_name = stack:get_name()
local under = pointed_thing.under
local above = pointed_thing.above
local node_under = minetest.get_node(under)
local udef = {}
local temp_stack = ""
-- handle nodes
if pointed_thing.type == "node" then
local pos = minetest.get_pointed_thing_position(pointed_thing)
local pointed_node = minetest.get_node(pos)
-- check if we have to use default on_place first
if pick_engraved_place_blacklist[pointed_node.name] ~= nil then
return minetest.item_place(itemstack, placer, pointed_thing)
end
if pointed_node ~= nil and stack_name ~= "" then
local stack_def = minetest.registered_nodes[stack_name]
local stack_name_split = string.split(stack_name, ":")
local stack_mod = stack_name_split[1]
udef = minetest.registered_nodes[stack_name]
-- print(dump(udef))
-- not for farming - that should be part of a hoe
if stack_mod ~= "farming" or stack_mod ~= "farming_addons" then
if udef and udef.on_place then
temp_stack = udef.on_place(stack, placer, pointed_thing) or stack
inv:set_stack("main", idx, temp_stack)
-- itemstack = japaneseforest.add_wear(itemstack)
-- play sound
-- if udef.sounds then
-- if udef.sounds.place then
-- udef.sounds.place.to_player = placer:get_player_name()
-- minetest.sound_play(udef.sounds.place)
-- end
-- end
return itemstack
elseif udef and udef.on_use then
temp_stack = udef.on_use(stack, placer, pointed_thing) or stack
inv:set_stack("main", idx, temp_stack)
-- itemstack = japaneseforest.add_wear(itemstack)
return itemstack
end
end
-- handle default torch placement
if stack_name == "default:torch" then
local wdir = minetest.dir_to_wallmounted(vector.subtract(under, above))
local fakestack = stack
if wdir == 0 then
fakestack:set_name("default:torch_ceiling")
elseif wdir == 1 then
fakestack:set_name("default:torch")
else
fakestack:set_name("default:torch_wall")
end
temp_stack = minetest.item_place(fakestack, placer, pointed_thing, wdir)
temp_stack:set_name("default:torch")
inv:set_stack("main", idx, temp_stack)
-- itemstack = japaneseforest.add_wear(itemstack)
-- play sound
-- if udef and udef.sounds then
-- if udef.sounds.place then
-- udef.sounds.place.to_player = placer:get_player_name()
-- minetest.sound_play(udef.sounds.place)
-- end
-- end
return itemstack
end
end
-- if everything else fails use default on_place
stack = minetest.item_place(stack, placer, pointed_thing)
inv:set_stack("main", idx, stack)
-- play sound
-- if udef and udef.sounds then
-- if udef.sounds.place then
-- udef.sounds.place.to_player = placer:get_player_name()
-- minetest.sound_play(udef.sounds.place)
-- end
-- end
return itemstack
end
end
function japaneseforest.shovel_place(itemstack, placer, pointed_thing)
local pt = pointed_thing
-- check if pointing at a node
if not pt then
return
end
if pt.type ~= "node" then
return
end
local under = minetest.get_node(pt.under)
local p = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z}
local above = minetest.get_node(p)
-- return if any of the nodes is not registered
if not minetest.registered_nodes[under.name] then
return
end
if not minetest.registered_nodes[above.name] then
return
end
-- check if the node above the pointed thing is air
if above.name ~= "air" then
return
end
if minetest.is_protected(pt.under, placer:get_player_name()) then
minetest.record_protection_violation(pt.under, placer:get_player_name())
return
end
if under.name == "default:dirt" and
under.name ~= "japaneseforest:paths" then
minetest.set_node(pt.under, {name = "japaneseforest:paths"})
elseif (under.name == "default:dirt_with_grass" or
under.name == "default:dirt_with_grass_footsteps" or
under.name == "default:dirt_with_dry_grass" or
under.name == "default:dirt_with_snow" or
under.name == "default:dirt_with_rainforest_litter") and
under.name ~= "japaneseforest:paths" then
minetest.set_node(pt.under, {name = "japaneseforest:paths"})
elseif under.name == "default:dry_dirt_with_dry_grass" and
under.name ~= "japaneseforest:paths" then
minetest.set_node(pt.under, {name = "japaneseforest:paths"})
elseif under.name == "default:dirt_with_coniferous_litter" and
under.name ~= "japaneseforest:paths" then
minetest.set_node(pt.under, {name = "japaneseforest:paths"})
elseif under.name == "japaneseforest:japanese_dirt_with_grass" and
under.name ~= "japaneseforest:paths" then
minetest.set_node(pt.under, {name = "japaneseforest:paths"})
elseif under.name == "bambooforest:dirt_with_bamboo" and
under.name ~= "japaneseforest:paths" then
minetest.set_node(pt.under, {name = "japaneseforest:paths"})
else
return
end
-- play sound
minetest.sound_play("default_dig_crumbly", {
pos = pt.under,
gain = 0.5
})
-- add wear
itemstack = japaneseforest.add_wear(itemstack)
return itemstack
end
-- Taken from WorldEdit
-- Determines the axis in which a player is facing, returning an axis ("x", "y", or "z") and the sign (1 or -1)
function japaneseforest.player_axis(player)
local dir = player:get_look_dir()
local x, y, z = math.abs(dir.x), math.abs(dir.y), math.abs(dir.z)
if x > y then
if x > z then
return "x", dir.x > 0 and 1 or -1
end
elseif y > z then
return "y", dir.y > 0 and 1 or -1
end
return "z", dir.z > 0 and 1 or -1
end
function japaneseforest.hoe_on_use(itemstack, user, pointed_thing)
local pt = pointed_thing
-- check if pointing at a node
if not pt then
return
end
if pt.type ~= "node" then
return
end
local under = minetest.get_node(pt.under)
local p = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z}
local above = minetest.get_node(p)
-- return if any of the nodes is not registered
if not minetest.registered_nodes[under.name] then
return
end
if not minetest.registered_nodes[above.name] then
return
end
-- check if the node above the pointed thing is air
if above.name ~= "air" then
return
end
-- check if pointing at soil
if minetest.get_item_group(under.name, "soil") ~= 1 then
return
end
-- check if (wet) soil defined
local regN = minetest.registered_nodes
if regN[under.name].soil == nil or regN[under.name].soil.wet == nil or regN[under.name].soil.dry == nil then
return
end
if minetest.is_protected(pt.under, user:get_player_name()) then
minetest.record_protection_violation(pt.under, user:get_player_name())
return
end
if minetest.is_protected(pt.above, user:get_player_name()) then
minetest.record_protection_violation(pt.above, user:get_player_name())
return
end
-- turn the node into soil and play sound
minetest.set_node(pt.under, {name = regN[under.name].soil.dry})
minetest.sound_play("default_dig_crumbly", {
pos = pt.under,
gain = 0.5,
})
end
-- shovel
minetest.register_tool("japaneseforest:truel", {
description = "Allows you to create Japanese paths",
inventory_image = "japaneseforest_truel.png",
wield_image = "japaneseforest_truel_90.png^[transformR90",
wield_scale = {x=1.0, y=1.0, z=1.0},
tool_capabilities = {
full_punch_interval = 1,
max_drop_level=1,
groupcaps={
crumbly = {times={[1]=1.5, [2]=1.50, [3]=1.50}, uses=15, maxlevel=3},
},
damage_groups = {fleshy=4},
},
sound = {breaks = "default_tool_breaks"},
on_place = japaneseforest.shovel_place
})
-- japanese path
minetest.register_node("japaneseforest:paths", {
description = "Path",
drawtype = "nodebox",
tiles = {"japaneseforest_path_top.png", "default_dirt.png", "default_dirt.png^japaneseforest_japaneseforest_side.png"},
is_ground_content = false,
paramtype = "light",
node_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 1/2, 1/2-1/16, 1/2},
},
collision_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 1/2, 1/2-1/16, 1/2},
},
selection_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 1/2, 1/2-1/16, 1/2},
},
drop = "japaneseforest:paths",
is_ground_content = false,
groups = {crumbly = 3, cracky = 2},
sounds = default.node_sound_stone_defaults(),
})

View file

@ -0,0 +1,117 @@
-------------Trees
local mpath = minetest.get_modpath("japaneseforest")
local mod_bonemeal = minetest.get_modpath("bonemeal")
local trees = {
{
kana = "いち",
grow_function = function(pos)
local path = mpath .. "/schematics/japanese_tree_1_3.mts"
minetest.remove_node(pos)
minetest.place_schematic({x = pos.x - 2, y = pos.y, z = pos.z - 2},
path, "random", nil, false)
end,
},
{
kana = "",
grow_function = function(pos)
local path = mpath .. "/schematics/japanese_tree_2_1.mts"
minetest.remove_node(pos)
minetest.place_schematic({x = pos.x - 5, y = pos.y, z = pos.z - 5},
path, "random", nil, false)
end,
},
{
kana = "さん",
grow_function = function(pos)
local path = mpath .. "/schematics/japanese_tree_3_2.mts"
minetest.remove_node(pos)
minetest.place_schematic({x = pos.x - 3, y = pos.y - 1, z = pos.z - 3},
path, "random", nil, false)
end,
},
}
for index,def in ipairs(trees) do
local sapling = "japaneseforest:japanese_sapling_" .. index
local image = "japanese_sapling_" .. index .. ".png"
local leaves = "japaneseforest:japanese_leaves_" .. index
-- Register leaves
minetest.register_node(leaves, {
description = "Japanese Leaves " .. def.kana,
drawtype = "allfaces_optional",
waving = 1,
tiles = {"japanese_leaves_" .. index .. ".png"},
paramtype = "light",
is_ground_content = false,
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
drop = {
max_items = 1,
items = {
{items = {sapling}, rarity = 20},
{items = {leaves}}
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
})
-- Register sapling
minetest.register_node(sapling, {
description = "Japanese Sapling " .. def.kana,
drawtype = "plantlike",
tiles = {image},
inventory_image = image,
wield_image = image,
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = function(pos)
if not default.can_grow(pos) then
-- try a bit later again
minetest.get_node_timer(pos):start(math.random(240, 600))
else
def.grow_function(pos)
end
end,
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(300, 1500))
end,
on_place = function(itemstack, placer, pointed_thing)
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
sapling,
{x = -2, y = 1, z = -2},
{x = 2, y = 15, z = 2},
4)
return itemstack
end,
})
-- Register sapling crafting recipe
minetest.register_craft({
output = sapling,
recipe = {
{"", leaves, ""},
{leaves, "default:stick", leaves}
},
})
-- Add bonemeal integration if supported
if mod_bonemeal then
bonemeal:add_sapling({
{sapling, def.grow_function, "soil"},
})
end
end