Crafter support
Add Crafter support and weeding out dependencies in cloudlands
This commit is contained in:
parent
781835bef2
commit
0b8bcea729
268
cloudlands.lua
268
cloudlands.lua
@ -13,25 +13,27 @@ local BIOLUMINESCENCE = false or -- Allow giant trees variants which have
|
|||||||
minetest.get_modpath("ethereal") ~= nil or
|
minetest.get_modpath("ethereal") ~= nil or
|
||||||
minetest.get_modpath("glow") ~= nil or
|
minetest.get_modpath("glow") ~= nil or
|
||||||
minetest.get_modpath("nsspf") ~= nil or
|
minetest.get_modpath("nsspf") ~= nil or
|
||||||
|
minetest.get_modpath("nightscape") ~= nil or
|
||||||
minetest.get_modpath("moonflower") ~= nil -- a world using any of these mods is OK with bioluminescence
|
minetest.get_modpath("moonflower") ~= nil -- a world using any of these mods is OK with bioluminescence
|
||||||
local ENABLE_PORTALS = true -- Whether to allow players to build portals to islands. Portals require the Nether mod.
|
local ENABLE_PORTALS = true -- Whether to allow players to build portals to islands. Portals require the Nether mod.
|
||||||
local EDDYFIELD_SIZE = 1 -- size of the "eddy field-lines" that smaller islands follow
|
local EDDYFIELD_SIZE = 1 -- size of the "eddy field-lines" that smaller islands follow
|
||||||
local ISLANDS_SEED = 1000 -- You only need to change this if you want to try different island layouts without changing the map seed
|
local ISLANDS_SEED = 1000 -- You only need to change this if you want to try different island layouts without changing the map seed
|
||||||
|
|
||||||
-- Some lists of known node aliases (any nodes which can't be found won't be used).
|
-- Some lists of known node aliases (any nodes which can't be found won't be used).
|
||||||
local NODENAMES_STONE = {"mapgen_stone", "mcl_core:stone", "default:stone"}
|
local NODENAMES_STONE = {"mapgen_stone", "mcl_core:stone", "default:stone", "main:stone"}
|
||||||
local NODENAMES_WATER = {"mapgen_water_source", "mcl_core:water_source", "default:water_source"}
|
local NODENAMES_WATER = {"mapgen_water_source", "mcl_core:water_source", "default:water_source", "main:water"}
|
||||||
local NODENAMES_ICE = {"mapgen_ice", "mcl_core:ice", "pedology:ice_white", "default:ice"}
|
local NODENAMES_ICE = {"mapgen_ice", "mcl_core:ice", "pedology:ice_white", "default:ice", "main:ice"}
|
||||||
local NODENAMES_GRAVEL = {"mapgen_gravel", "mcl_core:gravel", "default:gravel"}
|
local NODENAMES_GRAVEL = {"mapgen_gravel", "mcl_core:gravel", "default:gravel", "main:gravel"}
|
||||||
local NODENAMES_GRASS = {"mapgen_dirt_with_grass", "mcl_core:dirt_with_grass", "default:dirt_with_grass"} -- currently only used with games that don't register biomes, e.g. Hades Revisted
|
local NODENAMES_GRASS = {"mapgen_dirt_with_grass", "mcl_core:dirt_with_grass", "default:dirt_with_grass", "main:grass"} -- currently only used with games that don't register biomes, e.g. Hades Revisted
|
||||||
local NODENAMES_DIRT = {"mapgen_dirt", "mcl_core:dirt", "default:dirt"} -- currently only used with games that don't register biomes, e.g. Hades Revisted
|
local NODENAMES_DIRT = {"mapgen_dirt", "mcl_core:dirt", "default:dirt", "main:dirt"} -- currently only used with games that don't register biomes, e.g. Hades Revisted
|
||||||
local NODENAMES_SILT = {"mapgen_silt", "default:silt", "aotearoa:silt", "darkage:silt", "mapgen_sand", "mcl_core:sand", "default:sand"} -- silt isn't a thing yet, but perhaps one day it will be. Use sand for the bottom of ponds in the meantime.
|
local NODENAMES_SILT = {"mapgen_silt", "default:silt", "aotearoa:silt", "darkage:silt", "mapgen_sand", "mcl_core:sand", "default:sand", "main:sand"} -- silt isn't a thing yet, but perhaps one day it will be. Use sand for the bottom of ponds in the meantime.
|
||||||
local NODENAMES_VINES = {"mcl_core:vine", "vines:side_end", "ethereal:vine"} -- ethereal vines don't grow, so only select that if there's nothing else.
|
local NODENAMES_VINES = {"mcl_core:vine", "vines:side_end", "ethereal:vine", "main:vine"} -- ethereal vines don't grow, so only select that if there's nothing else.
|
||||||
local NODENAMES_HANGINGVINE = {"vines:vine_end"}
|
local NODENAMES_HANGINGVINE = {"vines:vine_end"}
|
||||||
local NODENAMES_HANGINGROOT = {"vines:root_end"}
|
local NODENAMES_HANGINGROOT = {"vines:root_end"}
|
||||||
local NODENAMES_TREEWOOD = {"mcl_core:tree", "default:tree", "mapgen_tree"}
|
local NODENAMES_TREEWOOD = {"mcl_core:tree", "default:tree", "mapgen_tree", "main:tree"}
|
||||||
local NODENAMES_TREELEAVES = {"mcl_core:leaves", "default:leaves", "mapgen_leaves"}
|
local NODENAMES_TREELEAVES = {"mcl_core:leaves", "default:leaves", "mapgen_leaves", "main:leaves"}
|
||||||
local NODENAMES_FRAMEGLASS = {"xpanes:obsidian_pane_flat", "xpanes:pane_flat", "default:glass", "xpanes:pane_natural_flat", "mcl_core:glass"}
|
local NODENAMES_FRAMEGLASS = {"xpanes:obsidian_pane_flat", "xpanes:pane_flat", "default:glass", "xpanes:pane_natural_flat", "mcl_core:glass", "walls:window"}
|
||||||
|
local NODENAMES_WOOD = {"default:wood", "mcl_core:wood", "main:wood"}
|
||||||
|
|
||||||
local MODNAME = minetest.get_current_modname()
|
local MODNAME = minetest.get_current_modname()
|
||||||
local VINES_REQUIRED_HUMIDITY = 49
|
local VINES_REQUIRED_HUMIDITY = 49
|
||||||
@ -49,7 +51,7 @@ local DEBUG_SKYTREES = false -- dev logging
|
|||||||
-- notice problems requiring it.
|
-- notice problems requiring it.
|
||||||
local OVERDRAW = 0
|
local OVERDRAW = 0
|
||||||
|
|
||||||
local S = minetest.get_translator(minetest.get_current_modname())
|
local S = minetest.get_translator(MODNAME)
|
||||||
|
|
||||||
cloudlands = {} -- API functions can be accessed via this global:
|
cloudlands = {} -- API functions can be accessed via this global:
|
||||||
-- cloudlands.get_island_details(minp, maxp) -- returns an array of island-information-tables, y is ignored.
|
-- cloudlands.get_island_details(minp, maxp) -- returns an array of island-information-tables, y is ignored.
|
||||||
@ -172,7 +174,7 @@ local noise_surfaceMap
|
|||||||
local noise_skyReef
|
local noise_skyReef
|
||||||
|
|
||||||
local worldSeed
|
local worldSeed
|
||||||
local nodeId_ignore = minetest.CONTENT_IGNORE
|
local nodeId_ignore = minetest.CONTENT_IGNORE
|
||||||
local nodeId_air
|
local nodeId_air
|
||||||
local nodeId_stone
|
local nodeId_stone
|
||||||
local nodeId_grass
|
local nodeId_grass
|
||||||
@ -183,6 +185,7 @@ local nodeId_silt
|
|||||||
local nodeId_gravel
|
local nodeId_gravel
|
||||||
local nodeId_vine
|
local nodeId_vine
|
||||||
local nodeName_vine
|
local nodeName_vine
|
||||||
|
local nodeName_ignore = minetest.get_name_from_content_id(nodeId_ignore)
|
||||||
|
|
||||||
local REQUIRED_DENSITY = 0.4
|
local REQUIRED_DENSITY = 0.4
|
||||||
|
|
||||||
@ -242,7 +245,7 @@ if isMapgenV6 then
|
|||||||
end
|
end
|
||||||
|
|
||||||
local interop = {}
|
local interop = {}
|
||||||
-- returns the id of the first name in the list that resolves to a node id, or nodeId_ignore if not found
|
-- returns the id of the first nodename in the list that resolves to a node id, or nodeId_ignore if not found
|
||||||
interop.find_node_id = function (node_contender_names)
|
interop.find_node_id = function (node_contender_names)
|
||||||
local result = nodeId_ignore
|
local result = nodeId_ignore
|
||||||
for _,contenderName in ipairs(node_contender_names) do
|
for _,contenderName in ipairs(node_contender_names) do
|
||||||
@ -252,17 +255,37 @@ interop.find_node_id = function (node_contender_names)
|
|||||||
result = minetest.get_content_id(nonAliasName)
|
result = minetest.get_content_id(nonAliasName)
|
||||||
end
|
end
|
||||||
|
|
||||||
--if DEBUG then minetest.log("info", contenderName .. " returned " .. result) end
|
--if DEBUG then minetest.log("info", contenderName .. " returned " .. result .. " (" .. minetest.get_name_from_content_id(result) .. ")") end
|
||||||
if result ~= nodeId_ignore then return result end
|
if result ~= nodeId_ignore then return result end
|
||||||
end
|
end
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
-- returns the name of the first name in the list that resolves to a node id, or 'ignore' if not found
|
-- returns the name of the first nodename in the list that resolves to a node id, or 'ignore' if not found
|
||||||
interop.find_node_name = function (node_contender_names)
|
interop.find_node_name = function (node_contender_names)
|
||||||
return minetest.get_name_from_content_id(interop.find_node_id(node_contender_names))
|
return minetest.get_name_from_content_id(interop.find_node_id(node_contender_names))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
interop.get_first_element_in_table = function(tbl)
|
||||||
|
for k,v in pairs(tbl) do return v end
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns the top-texture name of the first nodename in the list that resolves to a node id, or nil if not found
|
||||||
|
interop.find_node_texture = function (node_contender_names)
|
||||||
|
local result = nil
|
||||||
|
local nodeName = minetest.get_name_from_content_id(interop.find_node_id(node_contender_names))
|
||||||
|
if nodeName ~= nil then
|
||||||
|
local node = minetest.registered_nodes[nodeName]
|
||||||
|
if node ~= nil then
|
||||||
|
result = node.tiles
|
||||||
|
if type(result) == "table" then result = result["name"] or interop.get_first_element_in_table(result) end -- incase it's not a string
|
||||||
|
if type(result) == "table" then result = result["name"] or interop.get_first_element_in_table(result) end -- incase multiple tile definitions
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
-- returns the node name of the clone node.
|
-- returns the node name of the clone node.
|
||||||
interop.register_clone = function(node_name, clone_name)
|
interop.register_clone = function(node_name, clone_name)
|
||||||
local node = minetest.registered_nodes[node_name]
|
local node = minetest.registered_nodes[node_name]
|
||||||
@ -317,6 +340,43 @@ interop.file_exists = function(filename)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- returns a written book item (technically an item stack), or nil if no books mod available
|
||||||
|
interop.write_book = function(title, author, text, description)
|
||||||
|
|
||||||
|
local stackName_writtenBook
|
||||||
|
if minetest.get_modpath("mcl_books") then
|
||||||
|
stackName_writtenBook = "mcl_books:written_book"
|
||||||
|
text = title .. "\n\n" .. text -- MineClone2 books doen't show a title (or author)
|
||||||
|
|
||||||
|
elseif minetest.get_modpath("book") ~= nil then
|
||||||
|
stackName_writtenBook = "book:book_written"
|
||||||
|
text = "\n\n" .. text -- Crafter books put the text immediately under the title
|
||||||
|
|
||||||
|
elseif minetest.get_modpath("default") ~= nil then
|
||||||
|
stackName_writtenBook = "default:book_written"
|
||||||
|
|
||||||
|
else
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local book_itemstack = ItemStack(stackName_writtenBook)
|
||||||
|
local book_data = {}
|
||||||
|
book_data.title = title
|
||||||
|
book_data.text = text
|
||||||
|
book_data.owner = author
|
||||||
|
book_data.author = author
|
||||||
|
book_data.description = description
|
||||||
|
book_data.page = 1
|
||||||
|
book_data.page_max = 1
|
||||||
|
book_data.generation = 0
|
||||||
|
book_data["book.book_title"] = title -- Crafter book title
|
||||||
|
book_data["book.book_text"] = text -- Crafter book text
|
||||||
|
|
||||||
|
book_itemstack:get_meta():from_table({fields = book_data})
|
||||||
|
|
||||||
|
return book_itemstack
|
||||||
|
end
|
||||||
|
|
||||||
--[[==============================
|
--[[==============================
|
||||||
Portals
|
Portals
|
||||||
==============================]]--
|
==============================]]--
|
||||||
@ -406,6 +466,7 @@ if ENABLE_PORTALS and minetest.get_modpath("nether") ~= nil and minetest.global_
|
|||||||
-- Ideally the Nether mod will provide a block obtainable by exploring the Nether which is
|
-- Ideally the Nether mod will provide a block obtainable by exploring the Nether which is
|
||||||
-- earmarked for mods like this one to use for portals, but until this happens I'll create
|
-- earmarked for mods like this one to use for portals, but until this happens I'll create
|
||||||
-- our own tempory placeholder "portalstone".
|
-- our own tempory placeholder "portalstone".
|
||||||
|
-- The Portals API is currently provided by nether, which depends on default, so we can assume default textures are available
|
||||||
local portalstone_end = "default_furnace_top.png^(default_ice.png^[opacity:120)^[multiply:#668" -- this gonna look bad with non-default texturepacks, hopefully Nether mod will provide a real block
|
local portalstone_end = "default_furnace_top.png^(default_ice.png^[opacity:120)^[multiply:#668" -- this gonna look bad with non-default texturepacks, hopefully Nether mod will provide a real block
|
||||||
local portalstone_side = "[combine:16x16:0,0=default_furnace_top.png:4,0=default_furnace_top.png:8,0=default_furnace_top.png:12,0=default_furnace_top.png:^(default_ice.png^[opacity:120)^[multiply:#668"
|
local portalstone_side = "[combine:16x16:0,0=default_furnace_top.png:4,0=default_furnace_top.png:8,0=default_furnace_top.png:12,0=default_furnace_top.png:^(default_ice.png^[opacity:120)^[multiply:#668"
|
||||||
minetest.register_node("cloudlands:ancient_portalstone", {
|
minetest.register_node("cloudlands:ancient_portalstone", {
|
||||||
@ -465,12 +526,12 @@ if ENABLE_PORTALS and minetest.get_modpath("nether") ~= nil and minetest.global_
|
|||||||
if (core.radius < 8 or PORTAL_RARITY == 0) then return false end -- avoid portals hanging off the side of small islands
|
if (core.radius < 8 or PORTAL_RARITY == 0) then return false end -- avoid portals hanging off the side of small islands
|
||||||
|
|
||||||
local fastHash = 3
|
local fastHash = 3
|
||||||
|
fastHash = (37 * fastHash) + 9354 -- to keep this probability distinct from reefs and atols
|
||||||
|
fastHash = (37 * fastHash) + ISLANDS_SEED
|
||||||
fastHash = (37 * fastHash) + core.x
|
fastHash = (37 * fastHash) + core.x
|
||||||
fastHash = (37 * fastHash) + core.z
|
fastHash = (37 * fastHash) + core.z
|
||||||
fastHash = (37 * fastHash) + math_floor(core.radius)
|
fastHash = (37 * fastHash) + math_floor(core.radius)
|
||||||
fastHash = (37 * fastHash) + math_floor(core.depth)
|
fastHash = (37 * fastHash) + math_floor(core.depth)
|
||||||
fastHash = (37 * fastHash) + ISLANDS_SEED
|
|
||||||
fastHash = (37 * fastHash) + 9354 -- to keep this probability distinct from reefs and atols
|
|
||||||
if (PORTAL_RARITY * 10000) < math_floor((math_abs(fastHash)) % 10000) then return false end
|
if (PORTAL_RARITY * 10000) < math_floor((math_abs(fastHash)) % 10000) then return false end
|
||||||
|
|
||||||
local portalPos = find_potential_portal_location_on_island(core)
|
local portalPos = find_potential_portal_location_on_island(core)
|
||||||
@ -557,7 +618,7 @@ if ENABLE_PORTALS and minetest.get_modpath("nether") ~= nil and minetest.global_
|
|||||||
-- back to find_surface_target_y.
|
-- back to find_surface_target_y.
|
||||||
|
|
||||||
-- Using -100000 for y to ensure the position is outside the cloudlands realm and so
|
-- Using -100000 for y to ensure the position is outside the cloudlands realm and so
|
||||||
-- find_nearest_working_portal() will only returns surface portals.
|
-- find_nearest_working_portal() will only returns ground portals.
|
||||||
-- a y_factor of 0 makes the search ignore the -100000 altitude of the portals (as
|
-- a y_factor of 0 makes the search ignore the -100000 altitude of the portals (as
|
||||||
-- long as they are outside the cloudlands realm)
|
-- long as they are outside the cloudlands realm)
|
||||||
local existing_portal_location, existing_portal_orientation =
|
local existing_portal_location, existing_portal_orientation =
|
||||||
@ -694,6 +755,11 @@ if not minetest.global_exists("SkyTrees") then -- If SkyTrees added into other m
|
|||||||
for key, value in pairs(trunkNode) do newTrunkNode[key] = value end
|
for key, value in pairs(trunkNode) do newTrunkNode[key] = value end
|
||||||
newTrunkNode.name = SkyTrees.MODNAME .. ":" .. nodesuffix
|
newTrunkNode.name = SkyTrees.MODNAME .. ":" .. nodesuffix
|
||||||
newTrunkNode.description = description
|
newTrunkNode.description = description
|
||||||
|
if newTrunkNode.paramtype2 == nil then newTrunkNode.paramtype2 = "facedir" end
|
||||||
|
if newTrunkNode.on_dig ~= nil and minetest.get_modpath("main") then
|
||||||
|
newTrunkNode.on_dig = nil -- Crafter has special trunk auto-digging logic that doesn't make sense for giant trees
|
||||||
|
end
|
||||||
|
|
||||||
if dropsTemplateWood then
|
if dropsTemplateWood then
|
||||||
newTrunkNode.drop = nodeName_templateWood
|
newTrunkNode.drop = nodeName_templateWood
|
||||||
if newTrunkNode.groups == nil then newTrunkNode.groups = {} end
|
if newTrunkNode.groups == nil then newTrunkNode.groups = {} end
|
||||||
@ -1169,7 +1235,7 @@ if not minetest.global_exists("SkyTrees") then -- If SkyTrees added into other m
|
|||||||
if rotation ~= 0 then schematicCoords = rotatePositon(schematicCoords, schematicInfo.size, rotation) end
|
if rotation ~= 0 then schematicCoords = rotatePositon(schematicCoords, schematicInfo.size, rotation) end
|
||||||
local nodePos = vector.add(treePos, schematicCoords)
|
local nodePos = vector.add(treePos, schematicCoords)
|
||||||
local nodeToConstruct = minetest.get_node(nodePos)
|
local nodeToConstruct = minetest.get_node(nodePos)
|
||||||
if nodeToConstruct.name == "air" or nodeToConstruct.name == "ignore" then
|
if nodeToConstruct.name == "air" or nodeToConstruct.name == nodeName_ignore then
|
||||||
--this is now normal - e.g. if vines are set to 'ignore' then the nodeToConstruct won't be there.
|
--this is now normal - e.g. if vines are set to 'ignore' then the nodeToConstruct won't be there.
|
||||||
--minetest.log("error", "nodesWithConstructor["..i.."] does not match schematic " .. schematicInfo.filename .. " at " .. nodePos.x..","..nodePos.y..","..nodePos.z.." rotation "..rotation)
|
--minetest.log("error", "nodesWithConstructor["..i.."] does not match schematic " .. schematicInfo.filename .. " at " .. nodePos.x..","..nodePos.y..","..nodePos.z.." rotation "..rotation)
|
||||||
else
|
else
|
||||||
@ -1917,36 +1983,33 @@ end
|
|||||||
-- We might not need this stand-in cobweb, but unless we go overboard on listing many
|
-- We might not need this stand-in cobweb, but unless we go overboard on listing many
|
||||||
-- optional dependencies we won't know whether there's a proper cobweb available to
|
-- optional dependencies we won't know whether there's a proper cobweb available to
|
||||||
-- use until after it's too late to register this one.
|
-- use until after it's too late to register this one.
|
||||||
if minetest.get_modpath("default") then
|
local nodeName_standinCobweb = MODNAME .. ":cobweb"
|
||||||
-- the crack texture is probably available
|
minetest.register_node(
|
||||||
local nodeName_standinCobweb = MODNAME .. ":cobweb"
|
nodeName_standinCobweb,
|
||||||
minetest.register_node(
|
{
|
||||||
nodeName_standinCobweb,
|
tiles = {
|
||||||
{
|
-- [Ab]Use the crack texture to avoid needing to include a cobweb texture
|
||||||
tiles = {
|
-- crack_anylength.png is required by the engine, so all games will have it.
|
||||||
-- [Ab]Use the crack texture to avoid needing to include a cobweb texture
|
"crack_anylength.png^[verticalframe:5:4^[brighten"
|
||||||
"crack_anylength.png^[verticalframe:5:4^[brighten"
|
},
|
||||||
},
|
description = S("Cobweb"),
|
||||||
description = S("Cobweb"),
|
groups = {snappy = 3, liquid = 3, flammable = 3, not_in_creative_inventory = 1},
|
||||||
groups = {snappy = 3, liquid = 3, flammable = 3, not_in_creative_inventory = 1},
|
drawtype = "plantlike",
|
||||||
drawtype = "plantlike",
|
walkable = false,
|
||||||
walkable = false,
|
liquid_viscosity = 8,
|
||||||
liquid_viscosity = 8,
|
liquidtype = "source",
|
||||||
liquidtype = "source",
|
liquid_alternative_flowing = nodeName_standinCobweb,
|
||||||
liquid_alternative_flowing = nodeName_standinCobweb,
|
liquid_alternative_source = nodeName_standinCobweb,
|
||||||
liquid_alternative_source = nodeName_standinCobweb,
|
liquid_renewable = false,
|
||||||
liquid_renewable = false,
|
liquid_range = 0,
|
||||||
liquid_range = 0,
|
sunlight_propagates = true,
|
||||||
sunlight_propagates = true,
|
paramtype = "light"
|
||||||
paramtype = "light"
|
}
|
||||||
}
|
)
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local nodeName_egg = "secret:fossilized_egg"
|
local nodeName_egg = "secret:fossilized_egg"
|
||||||
local eggTextureBaseName = "default_jungleleaves.png" -- called this in default/Voxelgarden/MineClone2
|
local eggTextureBaseName = interop.find_node_texture({"default:jungleleaves", "mcl_core:jungleleaves", "ethereal:frost_leaves", "main:leaves"})
|
||||||
if minetest.get_modpath("ethereal") ~= nil then eggTextureBaseName = "ethereal_frost_leaves.png" end -- called "ethereal_frost_leaves.png" in ethereal
|
|
||||||
|
|
||||||
-- [Ab]Use a leaf texture. Originally this was to avoid needing to include an egg texture (extra files) and
|
-- [Ab]Use a leaf texture. Originally this was to avoid needing to include an egg texture (extra files) and
|
||||||
-- exposing that the mod contains secrets, however both those reasons are obsolete and the mod could have textures
|
-- exposing that the mod contains secrets, however both those reasons are obsolete and the mod could have textures
|
||||||
@ -1956,13 +2019,24 @@ local eggTextureName = eggTextureBaseName.."^[colorize:#280040E0^[noalpha"
|
|||||||
-- Since "secret:fossilized_egg" doesn't use this mod's name for the prefix, we can't assume
|
-- Since "secret:fossilized_egg" doesn't use this mod's name for the prefix, we can't assume
|
||||||
-- another mod isn't also using/providing it
|
-- another mod isn't also using/providing it
|
||||||
if minetest.registered_nodes[nodeName_egg] == nil then
|
if minetest.registered_nodes[nodeName_egg] == nil then
|
||||||
|
|
||||||
|
local fossilSounds = nil
|
||||||
|
local nodeName_stone = interop.find_node_name(NODENAMES_STONE)
|
||||||
|
if nodeName_stone ~= nodeName_ignore then fossilSounds = minetest.registered_nodes[nodeName_stone].sounds end
|
||||||
|
|
||||||
minetest.register_node(
|
minetest.register_node(
|
||||||
":"..nodeName_egg,
|
":"..nodeName_egg,
|
||||||
{
|
{
|
||||||
tiles = { eggTextureName },
|
tiles = { eggTextureName },
|
||||||
description = S("Fossilized Egg"),
|
description = S("Fossilized Egg"),
|
||||||
groups = {oddly_breakable_by_hand = 3, handy = 1, not_in_creative_inventory = 1},
|
groups = {
|
||||||
|
oddly_breakable_by_hand = 3, -- MTG
|
||||||
|
handy = 1, -- MCL
|
||||||
|
stone = 1, -- Crafter needs to know the material in order to be breakable by hand
|
||||||
|
not_in_creative_inventory = 1
|
||||||
|
},
|
||||||
_mcl_hardness = 0.4,
|
_mcl_hardness = 0.4,
|
||||||
|
sounds = fossilSounds,
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
node_box = {
|
node_box = {
|
||||||
@ -1982,27 +2056,25 @@ end
|
|||||||
-- Allow the player to craft their egg into an egg in a display case
|
-- Allow the player to craft their egg into an egg in a display case
|
||||||
local nodeName_eggDisplay = nodeName_egg .. "_display"
|
local nodeName_eggDisplay = nodeName_egg .. "_display"
|
||||||
local nodeName_frameGlass = interop.find_node_name(NODENAMES_FRAMEGLASS)
|
local nodeName_frameGlass = interop.find_node_name(NODENAMES_FRAMEGLASS)
|
||||||
|
local woodTexture = interop.find_node_texture(NODENAMES_WOOD)
|
||||||
local frameTexture = nil
|
local frameTexture = nil
|
||||||
if minetest.get_modpath("default") ~= nil then
|
if woodTexture ~= nil then
|
||||||
--frameTexture = "default_obsidian_glass.png"
|
-- perhaps it's time for cloudlands to contain textures.
|
||||||
-- Oddly, I think the abomination made out of default_wood texture modifiers looks more suitable as
|
frameTexture = "([combine:16x16:0,0="..woodTexture.."\\^[colorize\\:black\\:170:1,1="..woodTexture.."\\^[colorize\\:#0F0\\:255\\^[resize\\:14x14^[makealpha:0,255,0)"
|
||||||
-- a display case than default_obsidian_glass.
|
|
||||||
frameTexture = "([combine:16x16:0,0=default_wood.png\\^[colorize\\:black\\:170:1,1=default_wood.png\\^[colorize\\:#0F0\\:255\\^[resize\\:14x14^[makealpha:0,255,0)"
|
|
||||||
elseif minetest.get_modpath("mcl_core") ~= nil then
|
|
||||||
-- I can't find a good frame texture in MineClone, perhaps it's time for cloudlands to contain textures.
|
|
||||||
-- frameTexture = "default_glass.png"
|
|
||||||
frameTexture = "([combine:16x16:0,0=default_wood.png\\^[colorize\\:black\\:170:1,1=default_wood.png\\^[colorize\\:#0F0\\:255\\^[resize\\:14x14^[makealpha:0,255,0)"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Since "secret:fossilized_egg_display" doesn't use this mod's name as the prefix, we shouldn't
|
-- Since "secret:fossilized_egg_display" doesn't use this mod's name as the prefix, we shouldn't
|
||||||
-- assume another mod isn't also using/providing it.
|
-- assume another mod isn't also using/providing it.
|
||||||
if frameTexture ~= nil and nodeName_frameGlass ~= "ignore" and minetest.registered_nodes[nodeName_eggDisplay] == nil then
|
if frameTexture ~= nil and nodeName_frameGlass ~= nodeName_ignore and minetest.registered_nodes[nodeName_eggDisplay] == nil then
|
||||||
minetest.register_node(
|
minetest.register_node(
|
||||||
":"..nodeName_eggDisplay,
|
":"..nodeName_eggDisplay,
|
||||||
{
|
{
|
||||||
tiles = { eggTextureName .. "^" .. frameTexture },
|
tiles = { eggTextureName .. "^" .. frameTexture },
|
||||||
description = S("Fossil Display"),
|
description = S("Fossil Display"),
|
||||||
groups = {oddly_breakable_by_hand = 3, not_in_creative_inventory = 1},
|
groups = {
|
||||||
|
oddly_breakable_by_hand = 3,
|
||||||
|
glass = 1, -- Crafter needs to know the material in order to be breakable by hand
|
||||||
|
not_in_creative_inventory = 1},
|
||||||
_mcl_hardness = 0.2,
|
_mcl_hardness = 0.2,
|
||||||
drop = "",
|
drop = "",
|
||||||
sounds = minetest.registered_nodes[nodeName_frameGlass].sounds,
|
sounds = minetest.registered_nodes[nodeName_frameGlass].sounds,
|
||||||
@ -2396,15 +2468,10 @@ local function addDetail_secrets(decoration_list, core, data, area, minp, maxp)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local stackName_writtenBook = "default:book_written"
|
local book_itemstack = interop.write_book(
|
||||||
if isMineCloneBookshelf then stackName_writtenBook = "mcl_books:written_book" end
|
S("Weddell Outpost, November 21"), -- title
|
||||||
|
S("Bert Shackleton"), -- owner/author
|
||||||
local book_itemstack = ItemStack(stackName_writtenBook)
|
S([[The aerostat is lost.
|
||||||
local book_data = {}
|
|
||||||
book_data.title = S("Weddell Outpost")
|
|
||||||
-- Instead of being a stand-alone line, the McNish line is tacked on the end of the
|
|
||||||
-- journey sentence because otherwise it gets truncated off by default:book_written
|
|
||||||
book_data.text = S([[The aerostat is lost.
|
|
||||||
|
|
||||||
However, salvage attempts throughout the night managed to
|
However, salvage attempts throughout the night managed to
|
||||||
save most provisions before it finally broke apart and fell.
|
save most provisions before it finally broke apart and fell.
|
||||||
@ -2419,29 +2486,23 @@ is becoming cause for concern.
|
|||||||
Quite a journey is now required, we cannot stay - nobody will
|
Quite a journey is now required, we cannot stay - nobody will
|
||||||
look for us here. McNish is attempting to strengthen the gliders.
|
look for us here. McNish is attempting to strengthen the gliders.
|
||||||
|
|
||||||
---====---
|
---====---]], groundDesc),
|
||||||
]], groundDesc)
|
S("Diary of Bert Shackleton") -- description
|
||||||
|
)
|
||||||
|
|
||||||
if isMineCloneBookshelf then book_data.text = book_data.title .. "\n\n" .. book_data.text end -- MineClone2 doesn't show the title
|
if book_itemstack ~= nil then
|
||||||
book_data.owner = S("Bert Shackleton")
|
if invBookshelf == nil then
|
||||||
book_data.author = book_data.owner
|
-- mineclone bookshelves are decorational like Minecraft, put the book in the chest instead
|
||||||
book_data.description = S("Diary of Bert Shackleton")
|
-- (also testing for nil invBookshelf because it can happen. Weird race condition??)
|
||||||
book_data.page = 1
|
if invChest ~= nil then invChest:add_item("main", book_itemstack) end
|
||||||
book_data.page_max = 1
|
else
|
||||||
book_data.generation = 0
|
-- add the book to the bookshelf and manually trigger update_bookshelf() so its
|
||||||
book_itemstack:get_meta():from_table({fields = book_data})
|
-- name will reflect the new contents.
|
||||||
|
invBookshelf:add_item("books", book_itemstack)
|
||||||
if invBookshelf == nil then
|
local dummyPlayer = {}
|
||||||
-- mineclone bookshelves are decorational like Minecraft, put the book in the chest instead
|
dummyPlayer.get_player_name = function() return "server" end
|
||||||
-- (also testing for nil invBookshelf because it can happen. Weird race condition??)
|
minetest.registered_nodes[nodeName_bookshelf].on_metadata_inventory_put(bookshelf_pos, "books", 1, book_itemstack, dummyPlayer)
|
||||||
if invChest ~= nil then invChest:add_item("main", book_itemstack) end
|
end
|
||||||
else
|
|
||||||
-- add the book to the bookshelf and manually trigger update_bookshelf() so its
|
|
||||||
-- name will reflect the new contents.
|
|
||||||
invBookshelf:add_item("books", book_itemstack)
|
|
||||||
local dummyPlayer = {}
|
|
||||||
dummyPlayer.get_player_name = function() return "server" end
|
|
||||||
minetest.registered_nodes[nodeName_bookshelf].on_metadata_inventory_put(bookshelf_pos, "books", 1, book_itemstack, dummyPlayer)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -2457,10 +2518,10 @@ look for us here. McNish is attempting to strengthen the gliders.
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
addIfFound({"mcl_tools:pick_iron", "default:pick_steel"}, 1)
|
addIfFound({"mcl_tools:pick_iron", "default:pick_steel", "main:ironpick"}, 1)
|
||||||
addIfFound({"binoculars:binoculars"}, 1)
|
addIfFound({"binoculars:binoculars"}, 1)
|
||||||
addIfFound({"mcl_core:wood", "default:wood"}, 10)
|
addIfFound(NODENAMES_WOOD, 10)
|
||||||
addIfFound({"mcl_torches:torch", "default:torch"}, 3)
|
addIfFound({"mcl_torches:torch", "default:torch", "torch:torch"}, 3)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -2470,26 +2531,25 @@ look for us here. McNish is attempting to strengthen the gliders.
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function init_secrets()
|
local function init_secrets()
|
||||||
nodeId_bed_top = interop.find_node_id({"beds:bed_top"})
|
nodeId_bed_top = interop.find_node_id({"beds:bed_top", "bed:bed_front"})
|
||||||
nodeId_bed_bottom = interop.find_node_id({"beds:bed_bottom"})
|
nodeId_bed_bottom = interop.find_node_id({"beds:bed_bottom", "bed:bed_back"})
|
||||||
nodeId_torch = interop.find_node_id({"mcl_torches:torch_wall", "default:torch_wall"})
|
nodeId_torch = interop.find_node_id({"mcl_torches:torch_wall", "default:torch_wall", "torch:wall"})
|
||||||
nodeId_chest = interop.find_node_id({"chest", "mcl_chests:chest", "default:chest"})
|
nodeId_chest = interop.find_node_id({"chest", "mcl_chests:chest", "default:chest", "utility:chest"})
|
||||||
nodeId_junk = interop.find_node_id({"xdecor:barrel", "cottages:barrel", "homedecor:copper_pans", "vessels:steel_bottle", "mcl_flowerpots:flower_pot"})
|
nodeId_junk = interop.find_node_id({"xdecor:barrel", "cottages:barrel", "homedecor:copper_pans", "vessels:steel_bottle", "mcl_flowerpots:flower_pot"})
|
||||||
nodeId_anvil = interop.find_node_id({"castle:anvil", "cottages:anvil", "mcl_anvils:anvil", "default:anvil" }) -- "default:anvil" isn't a thing, but perhaps one day.
|
nodeId_anvil = interop.find_node_id({"castle:anvil", "cottages:anvil", "mcl_anvils:anvil", "default:anvil", "main:anvil" }) -- "default:anvil" and "main:anvil" aren't a thing, but perhaps one day.
|
||||||
nodeId_workbench = interop.find_node_id({"homedecor:table", "xdecor:workbench", "mcl_crafting_table:crafting_table", "default:table", "random_buildings:bench"}) -- "default:table" isn't a thing, but perhaps one day.
|
nodeId_workbench = interop.find_node_id({"homedecor:table", "xdecor:workbench", "mcl_crafting_table:crafting_table", "default:table", "random_buildings:bench", "craftingtable:craftingtable"}) -- "default:table" isn't a thing, but perhaps one day.
|
||||||
nodeId_cobweb = interop.find_node_id({"mcl_core:cobweb", "xdecor:cobweb", "homedecor:cobweb_plantlike", "default:cobweb"})
|
nodeId_cobweb = interop.find_node_id({"mcl_core:cobweb", "xdecor:cobweb", "homedecor:cobweb_plantlike", "default:cobweb", "main:cobweb"})
|
||||||
|
|
||||||
local mineCloneBookshelfName = "mcl_books:bookshelf"
|
local mineCloneBookshelfName = "mcl_books:bookshelf"
|
||||||
nodeId_bookshelf = interop.find_node_id({mineCloneBookshelfName, "default:bookshelf"})
|
nodeId_bookshelf = interop.find_node_id({mineCloneBookshelfName, "default:bookshelf"})
|
||||||
nodeName_bookshelf = minetest.get_name_from_content_id(nodeId_bookshelf)
|
nodeName_bookshelf = minetest.get_name_from_content_id(nodeId_bookshelf)
|
||||||
isMineCloneBookshelf = nodeName_bookshelf == mineCloneBookshelfName
|
isMineCloneBookshelf = nodeName_bookshelf == mineCloneBookshelfName
|
||||||
|
|
||||||
local nodeName_standinCobweb = MODNAME .. ":cobweb"
|
|
||||||
if nodeId_cobweb ~= nodeId_ignore then
|
if nodeId_cobweb ~= nodeId_ignore then
|
||||||
-- This game has proper cobwebs, replace any cobwebs this mod may have generated
|
-- This game has proper cobwebs, replace any cobwebs this mod may have generated
|
||||||
-- previously (when a cobweb mod wasn't included) with the proper cobwebs.
|
-- previously (when a cobweb mod wasn't included) with the proper cobwebs.
|
||||||
minetest.register_alias(nodeName_standinCobweb, minetest.get_name_from_content_id(nodeId_cobweb))
|
minetest.register_alias(nodeName_standinCobweb, minetest.get_name_from_content_id(nodeId_cobweb))
|
||||||
else
|
elseif minetest.registered_nodes[nodeName_standinCobweb] ~= nil then
|
||||||
-- use a stand-in cobweb created by this mod
|
-- use a stand-in cobweb created by this mod
|
||||||
nodeId_cobweb = minetest.get_content_id(nodeName_standinCobweb)
|
nodeId_cobweb = minetest.get_content_id(nodeName_standinCobweb)
|
||||||
end
|
end
|
||||||
@ -2680,7 +2740,7 @@ local function renderCores(cores, minp, maxp, blockseed)
|
|||||||
local pondWallBuffer = core.type.pondWallBuffer
|
local pondWallBuffer = core.type.pondWallBuffer
|
||||||
local pondBottom = nodeId_filler
|
local pondBottom = nodeId_filler
|
||||||
local pondWater = nodeId_water
|
local pondWater = nodeId_water
|
||||||
if radius > 18 and core.depth > 15 and nodeId_silt ~= nodeId_ignore then
|
if radius > 18 and core.depth > 15 and nodeId_pondBottom ~= nodeId_ignore then
|
||||||
-- only give ponds a sandbed when islands are large enough for it not to stick out the side or bottom
|
-- only give ponds a sandbed when islands are large enough for it not to stick out the side or bottom
|
||||||
pondBottom = nodeId_pondBottom
|
pondBottom = nodeId_pondBottom
|
||||||
end
|
end
|
||||||
@ -2743,7 +2803,7 @@ local function renderCores(cores, minp, maxp, blockseed)
|
|||||||
end
|
end
|
||||||
for _,decoration in ipairs(decorations) do
|
for _,decoration in ipairs(decorations) do
|
||||||
local nodeAtPos = minetest.get_node(decoration.pos)
|
local nodeAtPos = minetest.get_node(decoration.pos)
|
||||||
if nodeAtPos.name == "air" or nodeAtPos.name == "ignore" then minetest.set_node(decoration.pos, decoration.node) end
|
if nodeAtPos.name == "air" or nodeAtPos.name == nodeName_ignore then minetest.set_node(decoration.pos, decoration.node) end
|
||||||
end
|
end
|
||||||
|
|
||||||
local dustingInProgress = false
|
local dustingInProgress = false
|
||||||
|
@ -23,11 +23,11 @@ Heart of the Tree=
|
|||||||
Leaves of a giant tree=
|
Leaves of a giant tree=
|
||||||
Sakura blossom=
|
Sakura blossom=
|
||||||
|
|
||||||
The aerostat is lost.@n@nHowever, salvage attempts throughout the night managed to@nsave most provisions before it finally broke apart and fell.@n@n ---@=@=@=@=---@n@nThis island is highly exposed and the weather did not treat@nthe tents well. We have enlarged a sheltered crag in the @1,@nbut it is laborous work and the condition of some of the party@nis becoming cause for concern.@n@nQuite a journey is now required, we cannot stay - nobody will@nlook for us here. McNish is attempting to strengthen the gliders.@n@n ---@=@=@=@=---@n=
|
The aerostat is lost.@n@nHowever, salvage attempts throughout the night managed to@nsave most provisions before it finally broke apart and fell.@n@n ---@=@=@=@=---@n@nThis island is highly exposed and the weather did not treat@nthe tents well. We have enlarged a sheltered crag in the @1,@nbut it is laborous work and the condition of some of the party@nis becoming cause for concern.@n@nQuite a journey is now required, we cannot stay - nobody will@nlook for us here. McNish is attempting to strengthen the gliders.@n@n ---@=@=@=@=---=
|
||||||
|
|
||||||
The only portal we managed to scavenge enough portalstone to build took us to a land of floating islands. There were hills and forests and even water up there, but the edges are a perilous drop — a depth of which we cannot even begin to plumb.=
|
The only portal we managed to scavenge enough portalstone to build took us to a land of floating islands. There were hills and forests and even water up there, but the edges are a perilous drop — a depth of which we cannot even begin to plumb.=
|
||||||
|
|
||||||
Weddell Outpost=
|
Weddell Outpost, November 21=
|
||||||
Wisteria blossom=
|
Wisteria blossom=
|
||||||
ice=
|
ice=
|
||||||
rock=
|
rock=
|
||||||
|
2
mod.conf
2
mod.conf
@ -1,5 +1,5 @@
|
|||||||
name = cloudlands
|
name = cloudlands
|
||||||
optional_depends = nether, vines, biomeinfo, schemlib, default, mcl_core, xpanes, ethereal
|
optional_depends = nether, vines, biomeinfo, schemlib, default, mcl_core, xpanes, ethereal, main
|
||||||
description = """
|
description = """
|
||||||
Hallelujah Mountains for Minetest
|
Hallelujah Mountains for Minetest
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user