Update Fork #9

Merged
chmodsayshello merged 403 commits from MineClone5/MineClone5:master into master 2022-08-02 15:50:37 +02:00
16 changed files with 664 additions and 483 deletions
Showing only changes of commit b4bc3e70b3 - Show all commits

View File

@ -417,6 +417,7 @@ function mcl_util.deal_damage(target, damage, mcl_reason)
-- target:punch(puncher, 1.0, {full_punch_interval = 1.0, damage_groups = {fleshy = damage}}, vector.direction(puncher:get_pos(), target:get_pos()), damage) -- target:punch(puncher, 1.0, {full_punch_interval = 1.0, damage_groups = {fleshy = damage}}, vector.direction(puncher:get_pos(), target:get_pos()), damage)
if luaentity.health > 0 then if luaentity.health > 0 then
luaentity.health = luaentity.health - damage luaentity.health = luaentity.health - damage
luaentity.pause_timer = 0.4
end end
return return
end end

View File

@ -246,4 +246,4 @@ water-16,
water) water)
--spawn egg --spawn egg
mobs:register_egg("extra_mobs:dolphin", S("dolphin"), "extra_mobs_spawn_icon_dolphin.png", 0) mobs:register_egg("extra_mobs:dolphin", S("Dolphin"), "extra_mobs_spawn_icon_dolphin.png", 0)

View File

@ -296,5 +296,5 @@ minetest.LIGHT_MAX+1,
mobs_mc.spawn_height.nether_min, mobs_mc.spawn_height.nether_min,
mobs_mc.spawn_height.nether_max) mobs_mc.spawn_height.nether_max)
-- spawn eggs -- spawn eggs
mobs:register_egg("extra_mobs:piglin", S("piglin"), "extra_mobs_spawn_icon_piglin.png", 0) mobs:register_egg("extra_mobs:piglin", S("Piglin"), "extra_mobs_spawn_icon_piglin.png", 0)
mobs:register_egg("extra_mobs:piglin_brute", S("piglin Brute"), "extra_mobs_spawn_icon_piglin.png", 0) mobs:register_egg("extra_mobs:piglin_brute", S("Piglin Brute"), "extra_mobs_spawn_icon_piglin.png", 0)

View File

@ -65,6 +65,8 @@ mcl_item_entity.register_pickup_achievement("tree", "mcl:mineWood")
mcl_item_entity.register_pickup_achievement("mcl_mobitems:blaze_rod", "mcl:blazeRod") mcl_item_entity.register_pickup_achievement("mcl_mobitems:blaze_rod", "mcl:blazeRod")
mcl_item_entity.register_pickup_achievement("mcl_mobitems:leather", "mcl:killCow") mcl_item_entity.register_pickup_achievement("mcl_mobitems:leather", "mcl:killCow")
mcl_item_entity.register_pickup_achievement("mcl_core:diamond", "mcl:diamonds") mcl_item_entity.register_pickup_achievement("mcl_core:diamond", "mcl:diamonds")
mcl_item_entity.register_pickup_achievement("mcl_core:crying_obsidian", "mcl:whosCuttingOnions")
mcl_item_entity.register_pickup_achievement("mcl_nether:ancient_debris", "mcl:hiddenInTheDepths")
local function check_pickup_achievements(object, player) local function check_pickup_achievements(object, player)
if has_awards then if has_awards then

View File

@ -101,6 +101,18 @@ awards.register_achievement("mcl:bookcase", {
} }
}) })
awards.register_achievement("mcl:buildIronPickaxe", {
title = S("Isn't It Iron Pick"),
-- TODO: This achievement should support all non-wood pickaxes
description = S("Craft a iron pickaxe using sticks and iron."),
icon = "default_tool_steelpick.png",
trigger = {
type = "craft",
item = "mcl_tools:pick_iron",
target = 1
}
})
-- Item pickup achievements: These are awarded when picking up a certain item. -- Item pickup achievements: These are awarded when picking up a certain item.
-- The achivements are manually given in the mod mcl_item_entity. -- The achivements are manually given in the mod mcl_item_entity.
awards.register_achievement("mcl:diamonds", { awards.register_achievement("mcl:diamonds", {
@ -125,6 +137,24 @@ awards.register_achievement("mcl:mineWood", {
icon = "default_tree.png", icon = "default_tree.png",
}) })
awards.register_achievement("mcl:whosCuttingOnions", {
title = S("Who is Cutting Onions?"),
description = S("Pick up a crying obsidian from the floor."),
icon = "default_obsidian.png^mcl_core_crying_obsidian.png",
})
awards.register_achievement("mcl:hiddenInTheDepths", {
title = S("Hidden in the Depths"),
description = S("Pick up an Ancient Debris from the floor."),
icon = "mcl_nether_ancient_debris_side.png",
})
awards.register_achievement("mcl:notQuiteNineLives", {
title = S('Not Quite "Nine" Lives'),
description = S("Charge a Respawn Anchor to the maximum."),
icon = "respawn_anchor_side4.png",
})
-- Smelting achivements: These are awarded when picking up an item from a furnace -- Smelting achivements: These are awarded when picking up an item from a furnace
-- output. They are given in mcl_furnaces. -- output. They are given in mcl_furnaces.
awards.register_achievement("mcl:acquireIron", { awards.register_achievement("mcl:acquireIron", {
@ -163,6 +193,12 @@ awards.register_achievement("mcl:buildNetherPortal", {
icon = "default_obsidian.png", icon = "default_obsidian.png",
}) })
awards.register_achievement("mcl:enterEndPortal", {
title = S("The End?"),
description = S("Or the beginning?\nHint: Enter an end portal."),
icon = "mcl_end_end_stone.png",
})
-- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.) -- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.)
if non_pc_achievements then if non_pc_achievements then

View File

@ -5,14 +5,14 @@
minetest.register_node("mcl_beds:respawn_anchor",{ minetest.register_node("mcl_beds:respawn_anchor",{
description="respawn anchor", description="Respawn Anchor",
tiles = { tiles = {
"respawn_anchor_top_off.png", "respawn_anchor_top_off.png",
"respawn_anchor_bottom.png", "respawn_anchor_bottom.png",
"respawn_anchor_side0.png" "respawn_anchor_side0.png"
}, },
drawtype = "nodebox", drawtype = "nodebox",
node_box= { --Reused the composter nodebox, since it is basicly the same node_box= { --Reused the composter nodebox, since it is basicly the same
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall {-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall
@ -22,28 +22,28 @@ minetest.register_node("mcl_beds:respawn_anchor",{
{-0.5, -0.5, -0.5, 0.5, -0.47, 0.5}, -- Bottom level, -0.47 because -0.5 is so low that you can see the texture of the block below through {-0.5, -0.5, -0.5, 0.5, -0.47, 0.5}, -- Bottom level, -0.47 because -0.5 is so low that you can see the texture of the block below through
} }
}, },
on_rightclick = function(pos, node, player, itemstack) on_rightclick = function(pos, node, player, itemstack)
if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then
minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_1"}) minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_1"})
itemstack:take_item() itemstack:take_item()
else else
if pos.y < -29077 or pos.y > -28933 then if pos.y < -29077 or pos.y > -28933 then
mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true}) mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true})
end end
end end
end, end,
groups = {pickaxey=1, material_stone=1}, groups = {pickaxey=1, material_stone=1},
_mcl_hardness = 22.5 _mcl_hardness = 22.5
}) })
minetest.register_node("mcl_beds:respawn_anchor_charged_1",{ minetest.register_node("mcl_beds:respawn_anchor_charged_1",{
description="respawn anchor", description="Respawn Anchor",
tiles = { tiles = {
"portal.png", "portal.png",
"respawn_anchor_bottom.png", "respawn_anchor_bottom.png",
"respawn_anchor_side1.png" "respawn_anchor_side1.png"
}, },
drawtype = "nodebox", drawtype = "nodebox",
node_box= { --Reused the composter nodebox, since it is basicly the same node_box= { --Reused the composter nodebox, since it is basicly the same
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall {-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall
@ -53,31 +53,31 @@ minetest.register_node("mcl_beds:respawn_anchor_charged_1",{
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Bottom level {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Bottom level
} }
}, },
on_rightclick = function(pos, node, player, itemstack) on_rightclick = function(pos, node, player, itemstack)
if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then
minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_2"}) minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_2"})
itemstack:take_item() itemstack:take_item()
else else
if pos.y < -29077 or pos.y > -28933 then if pos.y < -29077 or pos.y > -28933 then
mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true}) mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true})
else else
mcl_spawn.set_spawn_pos(player, pos, nil) mcl_spawn.set_spawn_pos(player, pos, nil)
end end
end end
end, end,
groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1}, groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1},
_mcl_hardness = 22.5 _mcl_hardness = 22.5
}) })
minetest.register_node("mcl_beds:respawn_anchor_charged_2",{ minetest.register_node("mcl_beds:respawn_anchor_charged_2",{
description="respawn anchor", description="Respawn Anchor",
tiles = { tiles = {
"portal.png", "portal.png",
"respawn_anchor_bottom.png", "respawn_anchor_bottom.png",
"respawn_anchor_side2.png" "respawn_anchor_side2.png"
}, },
drawtype = "nodebox", drawtype = "nodebox",
node_box= { --Reused the composter nodebox, since it is basicly the same node_box= { --Reused the composter nodebox, since it is basicly the same
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall {-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall
@ -87,31 +87,31 @@ minetest.register_node("mcl_beds:respawn_anchor_charged_2",{
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Bottom level {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Bottom level
} }
}, },
on_rightclick = function(pos, node, player, itemstack) on_rightclick = function(pos, node, player, itemstack)
if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then
minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_3"}) minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_3"})
itemstack:take_item() itemstack:take_item()
else else
if pos.y < -29077 or pos.y > -28933 then if pos.y < -29077 or pos.y > -28933 then
mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true}) mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true})
else else
mcl_spawn.set_spawn_pos(player, pos, nil) mcl_spawn.set_spawn_pos(player, pos, nil)
end end
end end
end, end,
groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1}, groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1},
_mcl_hardness = 22.5 _mcl_hardness = 22.5
}) })
minetest.register_node("mcl_beds:respawn_anchor_charged_3",{ minetest.register_node("mcl_beds:respawn_anchor_charged_3",{
description="respawn anchor", description="Respawn Anchor",
tiles = { tiles = {
"portal.png", "portal.png",
"respawn_anchor_bottom.png", "respawn_anchor_bottom.png",
"respawn_anchor_side3.png" "respawn_anchor_side3.png"
}, },
drawtype = "nodebox", drawtype = "nodebox",
node_box= { --Reused the composter nodebox, since it is basicly the same node_box= { --Reused the composter nodebox, since it is basicly the same
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall {-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall
@ -121,52 +121,56 @@ minetest.register_node("mcl_beds:respawn_anchor_charged_3",{
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Bottom level {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Bottom level
} }
}, },
on_rightclick = function(pos, node, player, itemstack) on_rightclick = function(pos, node, player, itemstack)
if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then
minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_4"}) minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_4"})
itemstack:take_item() itemstack:take_item()
else else
if pos.y < -29077 or pos.y > -28933 then if pos.y < -29077 or pos.y > -28933 then
mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true}) mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true})
else else
mcl_spawn.set_spawn_pos(player, pos, nil) mcl_spawn.set_spawn_pos(player, pos, nil)
end end
end end
end, end,
groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1}, groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1},
_mcl_hardness = 22.5 _mcl_hardness = 22.5
}) })
minetest.register_node("mcl_beds:respawn_anchor_charged_4",{ minetest.register_node("mcl_beds:respawn_anchor_charged_4",{
description="respawn anchor", description="Respawn Anchor",
tiles = { tiles = {
"portal.png", "portal.png",
"respawn_anchor_bottom.png", "respawn_anchor_bottom.png",
"respawn_anchor_side4.png" "respawn_anchor_side4.png"
}, },
drawtype = "nodebox", drawtype = "nodebox",
node_box= { --Reused the composter nodebox, since it is basicly the same node_box= { --Reused the composter nodebox, since it is basicly the same
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall {-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall
{ 0.375, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Right wall { 0.375, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Right wall
{-0.375, -0.5, 0.375, 0.375, 0.5, 0.5}, -- Back wall {-0.375, -0.5, 0.375, 0.375, 0.5, 0.5}, -- Back wall
{-0.375, -0.5, -0.5, 0.375, 0.5, -0.375}, -- Front wall {-0.375, -0.5, -0.5, 0.375, 0.5, -0.375}, -- Front wall
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Bottom level {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Bottom level
} }
}, },
on_rightclick = function(pos, node, player, itemstack) on_rightclick = function(pos, node, player, itemstack)
if pos.y < -29077 or pos.y > -28933 then if pos.y < -29077 or pos.y > -28933 then
mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true}) mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true})
else else
mcl_spawn.set_spawn_pos(player, pos, nil) mcl_spawn.set_spawn_pos(player, pos, nil)
end awards.unlock(player:get_player_name(), "mcl:notQuiteNineLives")
end, end
groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1}, end,
_mcl_hardness = 22.5 groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1},
_mcl_hardness = 22.5
}) })
minetest.register_craft({ output = "mcl_beds:respawn_anchor", minetest.register_craft({ output = "mcl_beds:respawn_anchor",
recipe = { {"mcl_core:crying_obsidian", "mcl_core:crying_obsidian", "mcl_core:crying_obsidian"}, recipe = {
{"mcl_nether:glowstone", "mcl_nether:glowstone", "mcl_nether:glowstone"}, {"mcl_core:crying_obsidian", "mcl_core:crying_obsidian", "mcl_core:crying_obsidian"},
{"mcl_core:crying_obsidian", "mcl_core:crying_obsidian", "mcl_core:crying_obsidian"} } }) {"mcl_nether:glowstone", "mcl_nether:glowstone", "mcl_nether:glowstone"},
{"mcl_core:crying_obsidian", "mcl_core:crying_obsidian", "mcl_core:crying_obsidian"}
}
})

View File

@ -1,3 +1,5 @@
--TODO: Add advancement
local S = minetest.get_translator(minetest.get_current_modname()) local S = minetest.get_translator(minetest.get_current_modname())
mcl_compass = {} mcl_compass = {}
@ -9,28 +11,58 @@ local compass_frames = 32
-- Timer for random compass spinning -- Timer for random compass spinning
local random_timer = 0 local random_timer = 0
local random_timer_trigger = 0.5 -- random compass spinning tick in seconds. Increase if there are performance problems local random_timer_trigger = 0.5 -- random compass spinning tick in seconds. Incr ease if there are performance problems
local random_frame = math.random(0, compass_frames-1) local random_frame = math.random(0, compass_frames-1)
function mcl_compass.get_compass_image(pos, dir) function mcl_compass.get_compass_image(pos, dir, x, y, z)
-- Compasses do not work in certain zones -- Compasses do not work in certain zones
if mcl_worlds.compass_works(pos) then if mcl_worlds.compass_works(pos) and x ~= nil and y ~= nil and z ~= nil then
local spawn = {x=0,y=0,z=0} local _, dim = mcl_worlds.y_to_layer(y)
local ssp = minetest.setting_get_pos("static_spawnpoint") local _, playerdim = mcl_worlds.y_to_layer(pos.y)
if ssp then
spawn = ssp if dim == playerdim then --Check if player and compass target are in the same dimension, above check is just if the diemension is valid for the non lodestone compass
if type(spawn) ~= "table" or type(spawn.x) ~= "number" or type(spawn.y) ~= "number" or type(spawn.z) ~= "number" then local spawn = {x=x,y=y,z=z}
spawn = {x=0,y=0,z=0} local ssp = minetest.setting_get_pos("static_spawnpoint")
if ssp and x == 0 and y == 0 and z == 0 then
spawn = ssp
if type(spawn) ~= "table" or type(spawn.x) ~= "number" or type(spawn.y) ~= "number" or type(spawn.z) ~= "number" then
spawn = {x=0,y=0,z=0}
end
end end
local angle_north = math.deg(math.atan2(spawn.x - pos.x, spawn.z - pos.z))
if angle_north < 0 then angle_north = angle_north + 360 end
local angle_dir = -math.deg(dir)
local angle_relative = (angle_north - angle_dir + 180) % 360
return math.floor((angle_relative/11.25) + 0.5) % compass_frames
else
return random_frame
end end
local angle_north = math.deg(math.atan2(spawn.x - pos.x, spawn.z - pos.z))
if angle_north < 0 then angle_north = angle_north + 360 end
local angle_dir = -math.deg(dir)
local angle_relative = (angle_north - angle_dir + 180) % 360
return math.floor((angle_relative/11.25) + 0.5) % compass_frames
else else
return random_frame if x ~= 0 and y ~= 0 and z~= 0 and x ~= nil and y ~= nil and x~= nil then
local _, dim = mcl_worlds.y_to_layer(y)
local _, playerdim = mcl_worlds.y_to_layer(pos.y)
if dim == playerdim then --already explained that very same if statement above
local spawn = {x=x,y=y,z=z}
local ssp = minetest.setting_get_pos("static_spawnpoint")
if ssp and x == 0 and y == 0 and z == 0 then
spawn = ssp
if type(spawn) ~= "table" or type(spawn.x) ~= "number" or type(spawn.y) ~= "number" or type(spawn.z) ~= "number" then
spawn = {x=0,y=0,z=0}
end
end
local angle_north = math.deg(math.atan2(spawn.x - pos.x, spawn.z - pos.z))
if angle_north < 0 then angle_north = angle_north + 360 end
local angle_dir = -math.deg(dir)
local angle_relative = (angle_north - angle_dir + 180) % 360
return math.floor((angle_relative/11.25) + 0.5) % compass_frames
else
return random_frame
end
else
return random_frame
end
end end
end end
@ -52,9 +84,39 @@ minetest.register_globalstep(function(dtime)
end end
if has_compass(player) then if has_compass(player) then
local pos = player:get_pos() local pos = player:get_pos()
local compass_image = mcl_compass.get_compass_image(pos, player:get_look_horizontal())
for j,stack in pairs(player:get_inventory():get_list("main")) do for j,stack in pairs(player:get_inventory():get_list("main")) do
x = stack:get_meta():get_string("x") -- i know i could write the pos in meta, but i like this method more, and it is basicly the same, since else there would be one table with 3 values, and i have 3 values on their own
y = stack:get_meta():get_string("y")
z = stack:get_meta():get_string("z")
x = tonumber(x)
y = tonumber(y)
z = tonumber(z)
if x == nil or y == nil or z == nil then --checking if the compass has lodestone meta
compass_image = mcl_compass.get_compass_image(pos, player:get_look_horizontal(), 0, 0, 0) --no lodestone meta
else
checkblock = {x = x, y = y, z = z}
local function get_far_node(pos) --function that tries to read node normally, and does it even if its unloaded https://dev.minetest.net/minetest.get_node
local node = minetest.get_node(pos)
if node.name == "ignore" then
minetest.get_voxel_manip():read_from_map(pos, pos)
node = minetest.get_node(pos)
end
return node
end
if get_far_node(checkblock).name == "mcl_compass:lodestone" then --check if lodestone still exists
compass_image = mcl_compass.get_compass_image(pos, player:get_look_horizontal(), x, y, z)
compass_image = compass_image .. "_lodestone"
else -- lodestone got destroyed
compass_image = random_frame .. "_lodestone"
end
end
if minetest.get_item_group(stack:get_name(), "compass") ~= 0 and if minetest.get_item_group(stack:get_name(), "compass") ~= 0 and
minetest.get_item_group(stack:get_name(), "compass")-1 ~= compass_image then minetest.get_item_group(stack:get_name(), "compass")-1 ~= compass_image then
local itemname = "mcl_compass:"..compass_image local itemname = "mcl_compass:"..compass_image
@ -81,8 +143,8 @@ for i,img in ipairs(images) do
inv = 0 inv = 0
end end
local use_doc, longdesc, tt local use_doc, longdesc, tt
--Why is there no usage help? This should be fixed. --Why is there no usage help? This should be fixed.
--local usagehelp --local usagehelp
use_doc = i == stereotype_frame use_doc = i == stereotype_frame
if use_doc then if use_doc then
tt = S("Points to the world origin") tt = S("Points to the world origin")
@ -100,6 +162,18 @@ for i,img in ipairs(images) do
stack_max = 64, stack_max = 64,
groups = {not_in_creative_inventory=inv, compass=i, tool=1, disable_repair=1 } groups = {not_in_creative_inventory=inv, compass=i, tool=1, disable_repair=1 }
}) })
minetest.register_craftitem(itemstring .. "_lodestone", {
description = S("Lodestone Compass"),
_tt_help = tt,
_doc_items_create_entry = use_doc,
_doc_items_longdesc = longdesc,
--_doc_items_usagehelp = usagehelp,
inventory_image = img .. "^[colorize:purple:50",
wield_image = img .. "^[colorize:purple:50",
stack_max = 64,
groups = {not_in_creative_inventory=1, compass=i, tool=1, disable_repair=1 }
})
-- Help aliases. Makes sure the lookup tool works correctly -- Help aliases. Makes sure the lookup tool works correctly
if not use_doc and doc_mod then if not use_doc and doc_mod then
@ -116,9 +190,42 @@ minetest.register_craft({
} }
}) })
minetest.register_craft({
output = "mcl_compass:lodestone",
recipe = {
{"mcl_core:stonebrickcarved","mcl_core:stonebrickcarved","mcl_core:stonebrickcarved"},
{"mcl_core:stonebrickcarved", "mcl_nether:netherite_ingot", "mcl_core:stonebrickcarved"},
{"mcl_core:stonebrickcarved", "mcl_core:stonebrickcarved", "mcl_core:stonebrickcarved"}
}
})
minetest.register_alias("mcl_compass:compass", "mcl_compass:"..stereotype_frame) minetest.register_alias("mcl_compass:compass", "mcl_compass:"..stereotype_frame)
-- Export stereotype item for other mods to use -- Export stereotype item for other mods to use
mcl_compass.stereotype = "mcl_compass:"..tostring(stereotype_frame) mcl_compass.stereotype = "mcl_compass:"..tostring(stereotype_frame)
minetest.register_node("mcl_compass:lodestone",{
description="Lodestone",
on_rightclick = function(pos, node, player, itemstack)
if itemstack.get_name(itemstack).match(itemstack.get_name(itemstack),"mcl_compass:") then
if itemstack.get_name(itemstack) ~= "mcl_compass:lodestone" then
itemstack:get_meta():set_string("x", pos.x)
itemstack:get_meta():set_string("y", pos.y)
itemstack:get_meta():set_string("z", pos.z)
end
end
end,
tiles = {
"lodestone_top.png",
"lodestone_bottom.png",
"lodestone_side1.png",
"lodestone_side2.png",
"lodestone_side3.png",
"lodestone_side4.png"
},
groups = {pickaxey=1, material_stone=1},
_mcl_hardness = 1.5,
_mcl_blast_resistance = 6,
sounds = mcl_sounds.node_sound_stone_defaults()
})

View File

@ -1,4 +1,4 @@
name = mcl_compass name = mcl_compass
description = A compass item which points towards the world origin. description = A compass item which points towards the world origin.
depends = mcl_core, mcl_worlds, mesecons depends = mcl_core, mcl_worlds, mesecons, mcl_nether, mcl_sounds
optional_depends = doc optional_depends = doc

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@ -3,7 +3,7 @@ local S = minetest.get_translator("mcl_mushroom")
-- function grow() -- function grow()
function grow_twisting_vines(pos, moreontop) function grow_twisting_vines(pos, moreontop)
local y = pos.y + 1 local y = pos.y + 1
while not (moreontop == 0) do while not (moreontop == 0) do
if minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "air" then if minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "air" then
minetest.set_node({x = pos.x, y = y, z = pos.z}, {name="mcl_mushroom:twisting_vines"}) minetest.set_node({x = pos.x, y = y, z = pos.z}, {name="mcl_mushroom:twisting_vines"})
moreontop = moreontop - 1 moreontop = moreontop - 1
@ -13,18 +13,18 @@ function grow_twisting_vines(pos, moreontop)
else else
moreontop = 0 moreontop = 0
end end
end end
end end
-- Warped fungus -- Warped fungus
-- Crimson fungus -- Crimson fungus
--Functions and Biomes -- Functions and Biomes
-- WARNING: The most comments are in german. Please Translate with an translater if you don't speak good german -- WARNING: The most comments are in german. Please Translate with an translater if you don't speak good german
minetest.register_node("mcl_mushroom:warped_fungus", { minetest.register_node("mcl_mushroom:warped_fungus", {
description = S("Warped Fungus Mushroom"), description = S("Warped Fungus Mushroom"),
drawtype = "plantlike", drawtype = "plantlike",
tiles = { "farming_warped_fungus.png" }, tiles = { "farming_warped_fungus.png" },
inventory_image = "farming_warped_fungus.png", inventory_image = "farming_warped_fungus.png",
@ -33,7 +33,6 @@ minetest.register_node("mcl_mushroom:warped_fungus", {
paramtype = "light", paramtype = "light",
walkable = false, walkable = false,
groups = {dig_immediate=3,mushroom=1,attached_node=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,deco_block=1, compostability=65}, groups = {dig_immediate=3,mushroom=1,attached_node=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,deco_block=1, compostability=65},
light_source = 1, light_source = 1,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
@ -43,22 +42,22 @@ minetest.register_node("mcl_mushroom:warped_fungus", {
on_rightclick = function(pos, node, pointed_thing, itemstack) on_rightclick = function(pos, node, pointed_thing, itemstack)
if pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then if pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then
itemstack:take_item() itemstack:take_item()
local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}) local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z})
if nodepos.name == "mcl_mushroom:warped_nylium" or nodepos.name == "mcl_nether:netherrack" then if nodepos.name == "mcl_mushroom:warped_nylium" or nodepos.name == "mcl_nether:netherrack" then
local random = math.random(1, 5) local random = math.random(1, 5)
if random == 1 then if random == 1 then
generate_warped_tree(pos) generate_warped_tree(pos)
end end
end end
end end
end, end,
_mcl_blast_resistance = 0, _mcl_blast_resistance = 0,
stack_max = 64, stack_max = 64,
}) })
minetest.register_node("mcl_mushroom:twisting_vines", { minetest.register_node("mcl_mushroom:twisting_vines", {
description = S("Twisting Vines"), description = S("Twisting Vines"),
drawtype = "plantlike", drawtype = "plantlike",
tiles = { "twisting_vines_plant.png" }, tiles = { "twisting_vines_plant.png" },
inventory_image = "twisting_vines.png", inventory_image = "twisting_vines.png",
@ -92,15 +91,15 @@ minetest.register_node("mcl_mushroom:twisting_vines", {
_mcl_shears_drop = true, _mcl_shears_drop = true,
_mcl_silk_touch_drop = true, _mcl_silk_touch_drop = true,
_mcl_fortune_drop = { items = {{items = {"mcl_mushroom:twisting_vines"}, rarity = 3},}, _mcl_fortune_drop = { items = {{items = {"mcl_mushroom:twisting_vines"}, rarity = 3},},
items = {{items = {"mcl_mushroom:twisting_vines"}, rarity = 1.8181818181818181},}, items = {{items = {"mcl_mushroom:twisting_vines"}, rarity = 1.8181818181818181},},
"mcl_mushroom:twisting_vines", "mcl_mushroom:twisting_vines",
"mcl_mushroom:twisting_vines"}, "mcl_mushroom:twisting_vines"},
_mcl_blast_resistance = 0, _mcl_blast_resistance = 0,
stack_max = 64, stack_max = 64,
}) })
minetest.register_node("mcl_mushroom:nether_sprouts", { minetest.register_node("mcl_mushroom:nether_sprouts", {
description = S("Nether Sprouts"), description = S("Nether Sprouts"),
drawtype = "plantlike", drawtype = "plantlike",
tiles = { "nether_sprouts.png" }, tiles = { "nether_sprouts.png" },
inventory_image = "nether_sprouts.png", inventory_image = "nether_sprouts.png",
@ -117,12 +116,12 @@ minetest.register_node("mcl_mushroom:nether_sprouts", {
drop = "", drop = "",
_mcl_shears_drop = true, _mcl_shears_drop = true,
_mcl_silk_touch_drop = false, _mcl_silk_touch_drop = false,
_mcl_blast_resistance = 0, _mcl_blast_resistance = 0,
stack_max = 64, stack_max = 64,
}) })
minetest.register_node("mcl_mushroom:warped_roots", { minetest.register_node("mcl_mushroom:warped_roots", {
description = S("Warped Roots"), description = S("Warped Roots"),
drawtype = "plantlike", drawtype = "plantlike",
tiles = { "warped_roots.png" }, tiles = { "warped_roots.png" },
inventory_image = "warped_roots.png", inventory_image = "warped_roots.png",
@ -137,104 +136,107 @@ minetest.register_node("mcl_mushroom:warped_roots", {
}, },
node_placement_prediction = "", node_placement_prediction = "",
_mcl_silk_touch_drop = false, _mcl_silk_touch_drop = false,
_mcl_blast_resistance = 0, _mcl_blast_resistance = 0,
stack_max = 64, stack_max = 64,
}) })
minetest.register_node("mcl_mushroom:warped_wart_block", { minetest.register_node("mcl_mushroom:warped_wart_block", {
description = S("Warped Wart Block"), description = S("Warped Wart Block"),
tiles = {"warped_wart_block.png"}, tiles = {"warped_wart_block.png"},
groups = {handy=1,hoe=7,swordy=1, compostability=85, deco_block=1, }, groups = {handy=1,hoe=7,swordy=1, compostability=85, deco_block=1, },
stack_max = 64, stack_max = 64,
_mcl_hardness = 2, _mcl_hardness = 2,
}) })
minetest.register_node("mcl_mushroom:shroomlight", { minetest.register_node("mcl_mushroom:shroomlight", {
description = S("Shroomlight"), description = S("Shroomlight"),
tiles = {"shroomlight.png"}, tiles = {"shroomlight.png"},
groups = {handy=1,hoe=7,swordy=1, leaves=1, deco_block=1, compostability=65, }, groups = {handy=1,hoe=7,swordy=1, leaves=1, deco_block=1, compostability=65, },
stack_max = 64, stack_max = 64,
_mcl_hardness = 2, _mcl_hardness = 2,
-- this is 15 in Minecraft -- this is 15 in Minecraft
light_source = 14, light_source = 14,
}) })
minetest.register_node("mcl_mushroom:warped_hyphae", { minetest.register_node("mcl_mushroom:warped_hyphae", {
description = S("Warped Hyphae"), description = S("Warped Hyphae"),
tiles = {"warped_hyphae.png", tiles = {
"warped_hyphae.png", "warped_hyphae.png",
"warped_hyphae_side.png", "warped_hyphae.png",
"warped_hyphae_side.png", "warped_hyphae_side.png",
"warped_hyphae_side.png", "warped_hyphae_side.png",
"warped_hyphae_side.png", "warped_hyphae_side.png",
}, "warped_hyphae_side.png",
groups = {handy=5,axey=1, bark=1, building_block=1, material_wood=1,}, },
paramtype2 = "facedir", groups = {handy=5,axey=1, bark=1, building_block=1, material_wood=1,},
stack_max = 64, paramtype2 = "facedir",
_mcl_hardness = 2, stack_max = 64,
_mcl_hardness = 2,
}) })
minetest.register_node("mcl_mushroom:warped_nylium", { minetest.register_node("mcl_mushroom:warped_nylium", {
description = S("Warped Nylium"), description = S("Warped Nylium"),
tiles = {"warped_nylium.png", tiles = {
"mcl_nether_netherrack.png", "warped_nylium.png",
"mcl_nether_netherrack.png^warped_nylium_side.png", "mcl_nether_netherrack.png",
"mcl_nether_netherrack.png^warped_nylium_side.png", "mcl_nether_netherrack.png^warped_nylium_side.png",
"mcl_nether_netherrack.png^warped_nylium_side.png", "mcl_nether_netherrack.png^warped_nylium_side.png",
"mcl_nether_netherrack.png^warped_nylium_side.png", "mcl_nether_netherrack.png^warped_nylium_side.png",
}, "mcl_nether_netherrack.png^warped_nylium_side.png",
groups = {pickaxey=1, building_block=1, material_stone=1}, },
paramtype2 = "facedir", groups = {pickaxey=1, building_block=1, material_stone=1},
stack_max = 64, paramtype2 = "facedir",
_mcl_hardness = 0.4, stack_max = 64,
_mcl_blast_resistance = 0.4, _mcl_hardness = 0.4,
is_ground_content = true, _mcl_blast_resistance = 0.4,
drop = "mcl_nether:netherrack", is_ground_content = true,
_mcl_silk_touch_drop = true, drop = "mcl_nether:netherrack",
_mcl_silk_touch_drop = true,
}) })
minetest.register_node("mcl_mushroom:warped_checknode", { minetest.register_node("mcl_mushroom:warped_checknode", {
description = S("Warped Checknode - only to check!"), description = S("Warped Checknode - only to check!"),
tiles = {"mcl_nether_netherrack.png", tiles = {
"mcl_nether_netherrack.png", "mcl_nether_netherrack.png",
"mcl_nether_netherrack.png", "mcl_nether_netherrack.png",
"mcl_nether_netherrack.png", "mcl_nether_netherrack.png",
"mcl_nether_netherrack.png", "mcl_nether_netherrack.png",
"mcl_nether_netherrack.png", "mcl_nether_netherrack.png",
}, "mcl_nether_netherrack.png",
groups = {pickaxey=1, building_block=1, material_stone=1, not_in_creative_inventory=1}, },
paramtype2 = "facedir", groups = {pickaxey=1, building_block=1, material_stone=1, not_in_creative_inventory=1},
stack_max = 64, paramtype2 = "facedir",
_mcl_hardness = 0.4, stack_max = 64,
_mcl_blast_resistance = 0.4, _mcl_hardness = 0.4,
is_ground_content = true, _mcl_blast_resistance = 0.4,
drop = "mcl_nether:netherrack" is_ground_content = true,
drop = "mcl_nether:netherrack"
}) })
minetest.register_node("mcl_mushroom:warped_hyphae_wood", { minetest.register_node("mcl_mushroom:warped_hyphae_wood", {
description = S("Warped Hyphae Wood"), description = S("Warped Hyphae Wood"),
tiles = {"warped_hyphae_wood.png"}, tiles = {"warped_hyphae_wood.png"},
groups = {handy=5,axey=1, flammable=3,wood=1,building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=20}, groups = {handy=5,axey=1, flammable=3,wood=1,building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=20},
paramtype2 = "facedir", --paramtype2 = "facedir",
stack_max = 64, stack_max = 64,
_mcl_hardness = 2, _mcl_hardness = 2,
}) })
mcl_stairs.register_stair_and_slab_simple("warped_hyphae_wood", "mcl_mushroom:warped_hyphae_wood", S("Warped Stair"), S("Warped Slab"), S("Double Warped Slab")) mcl_stairs.register_stair_and_slab_simple("warped_hyphae_wood", "mcl_mushroom:warped_hyphae_wood", S("Warped Stair"), S("Warped Slab"), S("Double Warped Slab"), "woodlike")
minetest.register_craft({ minetest.register_craft({
output = "mcl_mushroom:warped_hyphae_wood 4", output = "mcl_mushroom:warped_hyphae_wood 4",
recipe = { recipe = {
{"mcl_mushroom:warped_hyphae"}, {"mcl_mushroom:warped_hyphae"},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "mcl_mushroom:warped_nylium 2", output = "mcl_mushroom:warped_nylium 2",
recipe = { recipe = {
{"mcl_mushroom:warped_wart_block"}, {"mcl_mushroom:warped_wart_block"},
{"mcl_nether:netherrack"}, {"mcl_nether:netherrack"},
} }
}) })
minetest.register_abm({ minetest.register_abm({
@ -245,11 +247,11 @@ minetest.register_abm({
action = function(pos) action = function(pos)
local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}) local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z})
if nodepos.name == "mcl_mushroom:warped_nylium" or nodepos.name == "mcl_nether:netherrack" then if nodepos.name == "mcl_mushroom:warped_nylium" or nodepos.name == "mcl_nether:netherrack" then
if pos.y < -28400 then if pos.y < -28400 then
generate_warped_tree(pos) generate_warped_tree(pos)
end end
end end
end end
}) })
minetest.register_abm({ minetest.register_abm({
@ -260,27 +262,26 @@ minetest.register_abm({
action = function(pos) action = function(pos)
local nodepos = minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}) local nodepos = minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z})
if nodepos.name == "air" then if nodepos.name == "air" then
minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_mushroom:warped_nylium" }) minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_mushroom:warped_nylium" })
local randomg = math.random(1, 400) local randomg = math.random(1, 400)
if randomg <= 5 then if randomg <= 5 then
minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:warped_fungus" }) minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:warped_fungus" })
elseif randomg > 5 and randomg <= 15 then elseif randomg > 5 and randomg <= 15 then
local pos1 = { x = pos.x, y = pos.y + 1, z = pos.z } local pos1 = { x = pos.x, y = pos.y + 1, z = pos.z }
generate_warped_tree(pos1) generate_warped_tree(pos1)
elseif randomg > 15 and randomg <= 45 then elseif randomg > 15 and randomg <= 45 then
grow_twisting_vines({ x = pos.x, y = pos.y, z = pos.z } ,math.random(1, 4)) grow_twisting_vines({ x = pos.x, y = pos.y, z = pos.z } ,math.random(1, 4))
elseif randomg > 45 and randomg <= 50 then elseif randomg > 45 and randomg <= 50 then
minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:crimson_fungus" }) minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:crimson_fungus" })
elseif randomg > 50 and randomg <= 150 then elseif randomg > 50 and randomg <= 150 then
minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:nether_sprouts" }) minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:nether_sprouts" })
elseif randomg > 150 and randomg <= 250 then elseif randomg > 150 and randomg <= 250 then
minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:warped_roots" }) minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:warped_roots" })
end end
else else
minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_nether:netherrack" }) minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_nether:netherrack" })
end end
end end
}) })
@ -297,7 +298,7 @@ minetest.register_abm({
minetest.register_node("mcl_mushroom:crimson_fungus", { minetest.register_node("mcl_mushroom:crimson_fungus", {
description = S("Crimson Fungus Mushroom"), description = S("Crimson Fungus Mushroom"),
drawtype = "plantlike", drawtype = "plantlike",
tiles = { "farming_crimson_fungus.png" }, tiles = { "farming_crimson_fungus.png" },
inventory_image = "farming_crimson_fungus.png", inventory_image = "farming_crimson_fungus.png",
@ -306,7 +307,6 @@ minetest.register_node("mcl_mushroom:crimson_fungus", {
paramtype = "light", paramtype = "light",
walkable = false, walkable = false,
groups = {dig_immediate=3,mushroom=1,attached_node=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,enderman_takable=1,deco_block=1, compostability=65}, groups = {dig_immediate=3,mushroom=1,attached_node=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,enderman_takable=1,deco_block=1, compostability=65},
light_source = 1, light_source = 1,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
@ -315,23 +315,22 @@ minetest.register_node("mcl_mushroom:crimson_fungus", {
node_placement_prediction = "", node_placement_prediction = "",
on_rightclick = function(pos, node, pointed_thing, itemstack) on_rightclick = function(pos, node, pointed_thing, itemstack)
if pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then if pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then
itemstack:take_item() itemstack:take_item()
local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}) local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z})
if nodepos.name == "mcl_mushroom:crimson_nylium" or nodepos.name == "mcl_nether:netherrack" then if nodepos.name == "mcl_mushroom:crimson_nylium" or nodepos.name == "mcl_nether:netherrack" then
local random = math.random(1, 5) local random = math.random(1, 5)
if random == 1 then if random == 1 then
generate_crimson_tree(pos) generate_crimson_tree(pos)
end end
end end
end end
end, end,
_mcl_blast_resistance = 0, _mcl_blast_resistance = 0,
stack_max = 64,
stack_max = 64,
}) })
minetest.register_node("mcl_mushroom:crimson_roots", { minetest.register_node("mcl_mushroom:crimson_roots", {
description = S("Crimson Roots"), description = S("Crimson Roots"),
drawtype = "plantlike", drawtype = "plantlike",
tiles = { "crimson_roots.png" }, tiles = { "crimson_roots.png" },
inventory_image = "crimson_roots.png", inventory_image = "crimson_roots.png",
@ -346,87 +345,90 @@ minetest.register_node("mcl_mushroom:crimson_roots", {
}, },
node_placement_prediction = "", node_placement_prediction = "",
_mcl_silk_touch_drop = false, _mcl_silk_touch_drop = false,
_mcl_blast_resistance = 0, _mcl_blast_resistance = 0,
stack_max = 64, stack_max = 64,
}) })
minetest.register_node("mcl_mushroom:crimson_hyphae", { minetest.register_node("mcl_mushroom:crimson_hyphae", {
description = S("Crimson Hyphae"), description = S("Crimson Hyphae"),
tiles = {"crimson_hyphae.png", tiles = {
"crimson_hyphae.png", "crimson_hyphae.png",
"crimson_hyphae_side.png", "crimson_hyphae.png",
"crimson_hyphae_side.png", "crimson_hyphae_side.png",
"crimson_hyphae_side.png", "crimson_hyphae_side.png",
"crimson_hyphae_side.png", "crimson_hyphae_side.png",
}, "crimson_hyphae_side.png",
groups = {handy=5,axey=1, bark=1, building_block=1, material_wood=1,}, },
paramtype2 = "facedir", groups = {handy=5,axey=1, bark=1, building_block=1, material_wood=1,},
stack_max = 64, paramtype2 = "facedir",
_mcl_hardness = 2, stack_max = 64,
_mcl_hardness = 2,
}) })
minetest.register_node("mcl_mushroom:crimson_hyphae_wood", { minetest.register_node("mcl_mushroom:crimson_hyphae_wood", {
description = S("Crimson Hyphae Wood"), description = S("Crimson Hyphae Wood"),
tiles = {"crimson_hyphae_wood.png"}, tiles = {"crimson_hyphae_wood.png"},
groups = {handy=5,axey=1, wood=1,building_block=1, material_wood=1,}, groups = {handy=5,axey=1, wood=1,building_block=1, material_wood=1,},
paramtype2 = "facedir", paramtype2 = "facedir",
stack_max = 64, stack_max = 64,
_mcl_hardness = 2, _mcl_hardness = 2,
}) })
minetest.register_node("mcl_mushroom:crimson_nylium", { minetest.register_node("mcl_mushroom:crimson_nylium", {
description = S("Crimson Nylium"), description = S("Crimson Nylium"),
tiles = {"crimson_nylium.png", tiles = {
"mcl_nether_netherrack.png", "crimson_nylium.png",
"mcl_nether_netherrack.png^crimson_nylium_side.png", "mcl_nether_netherrack.png",
"mcl_nether_netherrack.png^crimson_nylium_side.png", "mcl_nether_netherrack.png^crimson_nylium_side.png",
"mcl_nether_netherrack.png^crimson_nylium_side.png", "mcl_nether_netherrack.png^crimson_nylium_side.png",
"mcl_nether_netherrack.png^crimson_nylium_side.png", "mcl_nether_netherrack.png^crimson_nylium_side.png",
}, "mcl_nether_netherrack.png^crimson_nylium_side.png",
groups = {pickaxey=1, building_block=1, material_stone=1}, },
paramtype2 = "facedir", groups = {pickaxey=1, building_block=1, material_stone=1},
stack_max = 64, paramtype2 = "facedir",
_mcl_hardness = 0.4, stack_max = 64,
_mcl_blast_resistance = 0.4, _mcl_hardness = 0.4,
is_ground_content = true, _mcl_blast_resistance = 0.4,
drop = "mcl_nether:netherrack", is_ground_content = true,
_mcl_silk_touch_drop = true, drop = "mcl_nether:netherrack",
_mcl_silk_touch_drop = true,
}) })
minetest.register_node("mcl_mushroom:crimson_checknode", { minetest.register_node("mcl_mushroom:crimson_checknode", {
description = S("Crimson Checknode - only to check!"), description = S("Crimson Checknode - only to check!"),
tiles = {"mcl_nether_netherrack.png", tiles = {
"mcl_nether_netherrack.png", "mcl_nether_netherrack.png",
"mcl_nether_netherrack.png", "mcl_nether_netherrack.png",
"mcl_nether_netherrack.png", "mcl_nether_netherrack.png",
"mcl_nether_netherrack.png", "mcl_nether_netherrack.png",
"mcl_nether_netherrack.png", "mcl_nether_netherrack.png",
}, "mcl_nether_netherrack.png",
groups = {pickaxey=1, building_block=1, material_stone=1, not_in_creative_inventory=1}, },
paramtype2 = "facedir", groups = {pickaxey=1, building_block=1, material_stone=1, not_in_creative_inventory=1},
stack_max = 64, paramtype2 = "facedir",
_mcl_hardness = 0.4, stack_max = 64,
_mcl_blast_resistance = 0.4, _mcl_hardness = 0.4,
is_ground_content = true, _mcl_blast_resistance = 0.4,
drop = "mcl_nether:netherrack" is_ground_content = true,
drop = "mcl_nether:netherrack"
}) })
minetest.register_craft({ minetest.register_craft({
output = "mcl_mushroom:crimson_hyphae_wood 4", output = "mcl_mushroom:crimson_hyphae_wood 4",
recipe = { recipe = {
{"mcl_mushroom:crimson_hyphae"}, {"mcl_mushroom:crimson_hyphae"},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "mcl_mushroom:crimson_nylium 2", output = "mcl_mushroom:crimson_nylium 2",
recipe = { recipe = {
{"mcl_nether:nether_wart"}, {"mcl_nether:nether_wart"},
{"mcl_nether:netherrack"}, {"mcl_nether:netherrack"},
} }
}) })
mcl_stairs.register_stair_and_slab_simple("crimson_hyphae_wood", "mcl_mushroom:crimson_hyphae_wood", "Crimson Stair", "Crimson Slab", "Double Crimson Slab") mcl_stairs.register_stair_and_slab_simple("crimson_hyphae_wood", "mcl_mushroom:crimson_hyphae_wood", "Crimson Stair", "Crimson Slab", "Double Crimson Slab", "woodlike")
minetest.register_abm({ minetest.register_abm({
label = "mcl_mushroom:crimson_fungus", label = "mcl_mushroom:crimson_fungus",
@ -436,11 +438,11 @@ minetest.register_abm({
action = function(pos) action = function(pos)
local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}) local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z})
if nodepos.name == "mcl_mushroom:crimson_nylium" or nodepos.name == "mcl_nether:netherrack" then if nodepos.name == "mcl_mushroom:crimson_nylium" or nodepos.name == "mcl_nether:netherrack" then
if pos.y < -28400 then if pos.y < -28400 then
generate_crimson_tree(pos) generate_crimson_tree(pos)
end end
end end
end end
}) })
minetest.register_abm({ minetest.register_abm({
@ -451,176 +453,204 @@ minetest.register_abm({
action = function(pos) action = function(pos)
local nodepos = minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}) local nodepos = minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z})
if nodepos.name == "air" then if nodepos.name == "air" then
minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_mushroom:crimson_nylium" }) minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_mushroom:crimson_nylium" })
local randomg = math.random(1, 400) local randomg = math.random(1, 400)
if randomg <= 10 then if randomg <= 10 then
minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:crimson_fungus" }) minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:crimson_fungus" })
elseif randomg > 10 and randomg <= 25 then elseif randomg > 10 and randomg <= 25 then
local pos1 = { x = pos.x, y = pos.y + 1, z = pos.z } local pos1 = { x = pos.x, y = pos.y + 1, z = pos.z }
generate_crimson_tree(pos1) generate_crimson_tree(pos1)
elseif randomg > 25 and randomg <= 30 then elseif randomg > 25 and randomg <= 30 then
minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:warped_fungus" }) minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:warped_fungus" })
elseif randomg > 30 and randomg <= 130 then elseif randomg > 30 and randomg <= 130 then
minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:crimson_roots" }) minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:crimson_roots" })
end end
else else
minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_nether:netherrack" }) minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_nether:netherrack" })
end end
end end
}) })
function generate_warped_tree(pos) function generate_warped_tree(pos)
local breakgrow = false local breakgrow = false
local breakgrow2 = false local breakgrow2 = false
-- Baumgenerator -- Tree generator
-- erste und zweite Etage -- first and second layer
for x = pos.x - 2,pos.x + 2 do for x = pos.x - 2,pos.x + 2 do
for y = pos.y + 3, pos.y + 4 do for y = pos.y + 3, pos.y + 4 do
for z = pos.z - 2, pos.z + 2 do for z = pos.z - 2, pos.z + 2 do
if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then breakgrow = true end if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then
end breakgrow = true
end
end end
end end
end
-- dritte und vierte Etage -- third and fourth layers
for x = pos.x - 1,pos.x + 1 do for x = pos.x - 1,pos.x + 1 do
for y = pos.y + 5, pos.y + 6 do for y = pos.y + 5, pos.y + 6 do
for z = pos.z - 1, pos.z + 1 do for z = pos.z - 1, pos.z + 1 do
if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then breakgrow = true end if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then
end breakgrow = true
end end
end end
end
end
-- fünfte Etage -- fifth layer
if not (minetest.get_node({x = pos.x, y = pos.y + 7, z = pos.z}).name == "air") then breakgrow = true end if not (minetest.get_node({x = pos.x, y = pos.y + 7, z = pos.z}).name == "air") then
breakgrow = true
end
-- Holz -- Wood
if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:warped_fungus") then breakgrow = true end if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:warped_fungus") then
for y = pos.y + 1, pos.y + 4 do breakgrow = true
if not (minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "air") then breakgrow = true end end
end for y = pos.y + 1, pos.y + 4 do
if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:warped_fungus") then breakgrow2 = true end if not (minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "air") then
if breakgrow == false then breakgrow = true
-- Warzen end
-- erste und zweite Etage end
for x = pos.x - 2,pos.x + 2 do if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:warped_fungus") then
for y = pos.y + 3, pos.y + 4 do breakgrow2 = true
for z = pos.z - 2, pos.z + 2 do end
minetest.set_node({x = x, y = y, z = z}, { name = "mcl_mushroom:warped_wart_block" }) if breakgrow == false then
end -- Warts
end -- first and second layer
end for x = pos.x - 2,pos.x + 2 do
for y = pos.y + 3, pos.y + 4 do
for z = pos.z - 2, pos.z + 2 do
minetest.set_node({x = x, y = y, z = z}, { name = "mcl_mushroom:warped_wart_block" })
end
end
end
-- dritte und vierte Etage -- third and fourth layers
for x = pos.x - 1,pos.x + 1 do for x = pos.x - 1,pos.x + 1 do
for y = pos.y + 5, pos.y + 6 do for y = pos.y + 5, pos.y + 6 do
for z = pos.z - 1, pos.z + 1 do for z = pos.z - 1, pos.z + 1 do
minetest.set_node({x = x, y = y, z = z}, { name = "mcl_mushroom:warped_wart_block" }) minetest.set_node({x = x, y = y, z = z}, { name = "mcl_mushroom:warped_wart_block" })
end end
end end
end end
-- fünfte Etage -- fifth layer
minetest.set_node({x = pos.x, y = pos.y + 7, z = pos.z}, { name = "mcl_mushroom:warped_wart_block" }) minetest.set_node({x = pos.x, y = pos.y + 7, z = pos.z}, { name = "mcl_mushroom:warped_wart_block" })
-- Pilzlich -- Fungal
local randomgenerate = math.random(1, 2) local randomgenerate = math.random(1, 2)
if randomgenerate == 1 then if randomgenerate == 1 then
local randomx = math.random(-2, 2) local randomx = math.random(-2, 2)
local randomz = math.random(-2, 2) local randomz = math.random(-2, 2)
minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" }) minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" })
end end
local randomgenerate = math.random(1, 8) local randomgenerate = math.random(1, 8)
if randomgenerate == 4 then if randomgenerate == 4 then
local randomx = math.random(-2, 2) local randomx = math.random(-2, 2)
local randomz = math.random(-2, 2) local randomz = math.random(-2, 2)
minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" }) minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" })
end end
-- Holz -- Wood
for y = pos.y, pos.y + 4 do for y = pos.y, pos.y + 4 do
minetest.set_node({x = pos.x, y = y, z = pos.z}, { name = "mcl_mushroom:warped_hyphae" }) minetest.set_node({x = pos.x, y = y, z = pos.z}, { name = "mcl_mushroom:warped_hyphae" })
--print("Placed at " .. x .. " " .. y .. " " .. z) --print("Placed at " .. x .. " " .. y .. " " .. z)
end end
else else
if breakgrow2 == false then minetest.set_node(pos,{ name = "mcl_mushroom:warped_fungus" }) end if breakgrow2 == false then
end minetest.set_node(pos,{ name = "mcl_mushroom:warped_fungus" })
end
end
end end
function generate_crimson_tree(pos) function generate_crimson_tree(pos)
local breakgrow = false local breakgrow = false
local breakgrow2 = false local breakgrow2 = false
-- Baumgenerator -- Tree generator
-- erste und zweite Etage -- first and second layer
for x = pos.x - 2,pos.x + 2 do for x = pos.x - 2,pos.x + 2 do
for y = pos.y + 3, pos.y + 4 do for y = pos.y + 3, pos.y + 4 do
for z = pos.z - 2, pos.z + 2 do for z = pos.z - 2, pos.z + 2 do
if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then breakgrow = true end if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then
end breakgrow = true
end
end end
end end
end
-- dritte und vierte Etage -- third and fourth layers
for x = pos.x - 1,pos.x + 1 do for x = pos.x - 1,pos.x + 1 do
for y = pos.y + 5, pos.y + 6 do for y = pos.y + 5, pos.y + 6 do
for z = pos.z - 1, pos.z + 1 do for z = pos.z - 1, pos.z + 1 do
if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then breakgrow = true end if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then
end breakgrow = true
end end
end end
end
end
-- fünfte Etage -- fifth layer
if not (minetest.get_node({x = pos.x, y = pos.y + 7, z = pos.z}).name == "air") then breakgrow = true end if not (minetest.get_node({x = pos.x, y = pos.y + 7, z = pos.z}).name == "air") then
breakgrow = true
end
-- Holz -- Wood
if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:crimson_fungus") then breakgrow = true end if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:crimson_fungus") then
for y = pos.y + 1, pos.y + 4 do breakgrow = true
if not (minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "air") then breakgrow = true end end
end for y = pos.y + 1, pos.y + 4 do
if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:crimson_fungus") then breakgrow2 = true end if not (minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "air") then
if breakgrow == false then breakgrow = true
-- Warzen end
-- erste und zweite Etage end
for x = pos.x - 2,pos.x + 2 do if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:crimson_fungus") then
for y = pos.y + 3, pos.y + 4 do breakgrow2 = true
for z = pos.z - 2, pos.z + 2 do end
minetest.set_node({x = x, y = y, z = z}, { name = "mcl_nether:nether_wart_block" }) if breakgrow == false then
end -- Warts
end -- first and second layer
end for x = pos.x - 2,pos.x + 2 do
for y = pos.y + 3, pos.y + 4 do
for z = pos.z - 2, pos.z + 2 do
minetest.set_node({x = x, y = y, z = z}, { name = "mcl_nether:nether_wart_block" })
end
end
end
-- dritte und vierte Etage -- third and fourth layers
for x = pos.x - 1,pos.x + 1 do for x = pos.x - 1,pos.x + 1 do
for y = pos.y + 5, pos.y + 6 do for y = pos.y + 5, pos.y + 6 do
for z = pos.z - 1, pos.z + 1 do for z = pos.z - 1, pos.z + 1 do
minetest.set_node({x = x, y = y, z = z}, { name = "mcl_nether:nether_wart_block" }) minetest.set_node({x = x, y = y, z = z}, { name = "mcl_nether:nether_wart_block" })
end end
end end
end end
-- fünfte Etage -- fifth layer
minetest.set_node({x = pos.x, y = pos.y + 7, z = pos.z}, { name = "mcl_nether:nether_wart_block" }) minetest.set_node({x = pos.x, y = pos.y + 7, z = pos.z}, { name = "mcl_nether:nether_wart_block" })
-- Pilzlich -- Fungal
local randomgenerate = math.random(1, 2) local randomgenerate = math.random(1, 2)
if randomgenerate == 1 then if randomgenerate == 1 then
local randomx = math.random(-2, 2) local randomx = math.random(-2, 2)
local randomz = math.random(-2, 2) local randomz = math.random(-2, 2)
minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" }) minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" })
end end
local randomgenerate = math.random(1, 8) local randomgenerate = math.random(1, 8)
if randomgenerate == 4 then if randomgenerate == 4 then
local randomx = math.random(-2, 2) local randomx = math.random(-2, 2)
local randomz = math.random(-2, 2) local randomz = math.random(-2, 2)
minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" }) minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" })
end end
-- Holz -- Wood
for y = pos.y, pos.y + 4 do for y = pos.y, pos.y + 4 do
minetest.set_node({x = pos.x, y = y, z = pos.z}, { name = "mcl_mushroom:crimson_hyphae" }) minetest.set_node({x = pos.x, y = y, z = pos.z}, { name = "mcl_mushroom:crimson_hyphae" })
--print("Placed at " .. x .. " " .. y .. " " .. z) --print("Placed at " .. x .. " " .. y .. " " .. z)
end end
else else
if breakgrow2 == false then minetest.set_node(pos,{ name = "mcl_mushroom:crimson_fungus" }) end if breakgrow2 == false then
end minetest.set_node(pos,{ name = "mcl_mushroom:crimson_fungus" })
end
end
end end
@ -662,45 +692,45 @@ minetest.register_decoration({
}) })
]] ]]
minetest.register_ore({ minetest.register_ore({
ore_type = "sheet", ore_type = "sheet",
ore = "mcl_mushroom:warped_checknode", ore = "mcl_mushroom:warped_checknode",
-- Note: Stone is included only for v6 mapgen support. Netherrack is not generated naturally -- Note: Stone is included only for v6 mapgen support. Netherrack is not generated naturally
-- in v6, but instead set with the on_generated function in mcl_mapgen_core. -- in v6, but instead set with the on_generated function in mcl_mapgen_core.
wherein = {"mcl_nether:netherrack", "mcl_core:stone"}, wherein = {"mcl_nether:netherrack", "mcl_core:stone"},
clust_scarcity = 14 * 14 * 14, clust_scarcity = 14 * 14 * 14,
clust_size = 10, clust_size = 10,
y_min = -29065, y_min = -29065,
y_max = -28940, y_max = -28940,
noise_threshold = 0.0, noise_threshold = 0.0,
noise_params = { noise_params = {
offset = 0.5, offset = 0.5,
scale = 0.1, scale = 0.1,
spread = {x = 8, y = 8, z = 8}, spread = {x = 8, y = 8, z = 8},
seed = 4996, seed = 4996,
octaves = 1, octaves = 1,
persist = 0.0 persist = 0.0
}, },
}) })
minetest.register_ore({ minetest.register_ore({
ore_type = "sheet", ore_type = "sheet",
ore = "mcl_mushroom:crimson_checknode", ore = "mcl_mushroom:crimson_checknode",
-- Note: Stone is included only for v6 mapgen support. Netherrack is not generated naturally -- Note: Stone is included only for v6 mapgen support. Netherrack is not generated naturally
-- in v6, but instead set with the on_generated function in mcl_mapgen_core. -- in v6, but instead set with the on_generated function in mcl_mapgen_core.
wherein = {"mcl_nether:netherrack", "mcl_core:stone"}, wherein = {"mcl_nether:netherrack", "mcl_core:stone"},
clust_scarcity = 10 * 10 * 10, clust_scarcity = 10 * 10 * 10,
clust_size = 10, clust_size = 10,
y_min = -29065, y_min = -29065,
y_max = -28940, y_max = -28940,
noise_threshold = 0.0, noise_threshold = 0.0,
noise_params = { noise_params = {
offset = 1, offset = 1,
scale = 0.5, scale = 0.5,
spread = {x = 12, y = 12, z = 12}, spread = {x = 12, y = 12, z = 12},
seed = 12948, seed = 12948,
octaves = 1, octaves = 1,
persist = 0.0 persist = 0.0
}, },
}) })

View File

@ -235,6 +235,7 @@ function mcl_portals.end_portal_teleport(pos, node)
end end
mcl_portals.end_teleport(obj, objpos) mcl_portals.end_teleport(obj, objpos)
awards.unlock(obj:get_player_name(), "mcl:enterEndPortal")
end end
end end