mirror of
https://codeberg.org/tenplus1/bakedclay.git
synced 2025-05-07 19:47:02 +02:00
change minetest. to core.
This commit is contained in:
parent
aa2c8f2e90
commit
b0d0135b5f
32
flowers.lua
32
flowers.lua
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
-- translation support
|
-- translation support
|
||||||
|
|
||||||
local S = minetest.get_translator("bakedclay")
|
local S = core.get_translator("bakedclay")
|
||||||
|
|
||||||
-- new flowers
|
-- new flowers
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ local function add_simple_flower(name, desc, box, f_groups)
|
|||||||
f_groups.flora = 1
|
f_groups.flora = 1
|
||||||
f_groups.attached_node = 1
|
f_groups.attached_node = 1
|
||||||
|
|
||||||
minetest.register_node("bakedclay:" .. name, {
|
core.register_node("bakedclay:" .. name, {
|
||||||
description = desc,
|
description = desc,
|
||||||
drawtype = "plantlike",
|
drawtype = "plantlike",
|
||||||
waving = 1,
|
waving = 1,
|
||||||
@ -53,7 +53,7 @@ end
|
|||||||
|
|
||||||
-- add new flowers to mapgen
|
-- add new flowers to mapgen
|
||||||
|
|
||||||
minetest.register_decoration({
|
core.register_decoration({
|
||||||
deco_type = "simple",
|
deco_type = "simple",
|
||||||
place_on = {"default:dirt_with_grass"},
|
place_on = {"default:dirt_with_grass"},
|
||||||
sidelen = 16,
|
sidelen = 16,
|
||||||
@ -65,12 +65,11 @@ minetest.register_decoration({
|
|||||||
octaves = 3,
|
octaves = 3,
|
||||||
persist = 0.6
|
persist = 0.6
|
||||||
},
|
},
|
||||||
y_min = 10,
|
y_min = 10, y_max = 90,
|
||||||
y_max = 90,
|
|
||||||
decoration = "bakedclay:delphinium"
|
decoration = "bakedclay:delphinium"
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_decoration({
|
core.register_decoration({
|
||||||
deco_type = "simple",
|
deco_type = "simple",
|
||||||
place_on = {"default:dirt_with_grass", "default:dirt_with_dry_grass"},
|
place_on = {"default:dirt_with_grass", "default:dirt_with_dry_grass"},
|
||||||
sidelen = 16,
|
sidelen = 16,
|
||||||
@ -82,12 +81,11 @@ minetest.register_decoration({
|
|||||||
octaves = 3,
|
octaves = 3,
|
||||||
persist = 0.6
|
persist = 0.6
|
||||||
},
|
},
|
||||||
y_min = 15,
|
y_min = 15, y_max = 90,
|
||||||
y_max = 90,
|
|
||||||
decoration = "bakedclay:thistle"
|
decoration = "bakedclay:thistle"
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_decoration({
|
core.register_decoration({
|
||||||
deco_type = "simple",
|
deco_type = "simple",
|
||||||
place_on = {"default:dirt_with_grass", "default:dirt_with_rainforest_litter"},
|
place_on = {"default:dirt_with_grass", "default:dirt_with_rainforest_litter"},
|
||||||
sidelen = 16,
|
sidelen = 16,
|
||||||
@ -99,14 +97,12 @@ minetest.register_decoration({
|
|||||||
octaves = 3,
|
octaves = 3,
|
||||||
persist = 0.6
|
persist = 0.6
|
||||||
},
|
},
|
||||||
y_min = 1,
|
y_min = 1, y_max = 90,
|
||||||
y_max = 90,
|
|
||||||
decoration = "bakedclay:lazarus",
|
decoration = "bakedclay:lazarus",
|
||||||
spawn_by = "default:jungletree",
|
spawn_by = "default:jungletree", num_spawn_by = 1
|
||||||
num_spawn_by = 1
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_decoration({
|
core.register_decoration({
|
||||||
deco_type = "simple",
|
deco_type = "simple",
|
||||||
place_on = {"default:dirt_with_grass", "default:sand"},
|
place_on = {"default:dirt_with_grass", "default:sand"},
|
||||||
sidelen = 16,
|
sidelen = 16,
|
||||||
@ -118,16 +114,14 @@ minetest.register_decoration({
|
|||||||
octaves = 3,
|
octaves = 3,
|
||||||
persist = 0.6
|
persist = 0.6
|
||||||
},
|
},
|
||||||
y_min = 1,
|
y_min = 1, y_max = 15,
|
||||||
y_max = 15,
|
|
||||||
decoration = "bakedclay:mannagrass",
|
decoration = "bakedclay:mannagrass",
|
||||||
spawn_by = "group:water",
|
spawn_by = "group:water", num_spawn_by = 1
|
||||||
num_spawn_by = 1
|
|
||||||
})
|
})
|
||||||
|
|
||||||
-- flowerpot mod support
|
-- flowerpot mod support
|
||||||
|
|
||||||
if minetest.get_modpath("flowerpot") then
|
if core.get_modpath("flowerpot") then
|
||||||
flowerpot.register_node("bakedclay:delphinium")
|
flowerpot.register_node("bakedclay:delphinium")
|
||||||
flowerpot.register_node("bakedclay:thistle")
|
flowerpot.register_node("bakedclay:thistle")
|
||||||
flowerpot.register_node("bakedclay:lazarus")
|
flowerpot.register_node("bakedclay:lazarus")
|
||||||
|
58
init.lua
58
init.lua
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
-- translation support
|
-- translation support
|
||||||
|
|
||||||
local S = minetest.get_translator("bakedclay")
|
local S = core.get_translator("bakedclay")
|
||||||
|
|
||||||
-- list of clay colours
|
-- list of clay colours
|
||||||
|
|
||||||
@ -26,11 +26,10 @@ local clay = {
|
|||||||
|
|
||||||
-- check mod support
|
-- check mod support
|
||||||
|
|
||||||
local techcnc_mod = minetest.get_modpath("technic_cnc")
|
local techcnc_mod = core.get_modpath("technic_cnc")
|
||||||
local stairs_mod = minetest.get_modpath("stairs")
|
local stairs_mod = core.get_modpath("stairs")
|
||||||
local stairsplus_mod = minetest.get_modpath("moreblocks")
|
local stairsplus_mod = core.get_modpath("moreblocks") and core.global_exists("stairsplus")
|
||||||
and minetest.global_exists("stairsplus")
|
local stairsplus_compat = core.settings:get_bool("stairsplus_clay_compatibility") ~= false
|
||||||
local stairsplus_compat = minetest.settings:get_bool("stairsplus_clay_compatibility") ~= false
|
|
||||||
|
|
||||||
-- scroll through colours
|
-- scroll through colours
|
||||||
|
|
||||||
@ -38,7 +37,7 @@ for _, clay in pairs(clay) do
|
|||||||
|
|
||||||
-- register node
|
-- register node
|
||||||
|
|
||||||
minetest.register_node("bakedclay:" .. clay[1], {
|
core.register_node("bakedclay:" .. clay[1], {
|
||||||
description = clay[2] .. " " .. S("Baked Clay"),
|
description = clay[2] .. " " .. S("Baked Clay"),
|
||||||
tiles = {"baked_clay_" .. clay[1] ..".png"},
|
tiles = {"baked_clay_" .. clay[1] ..".png"},
|
||||||
groups = {cracky = 3, bakedclay = 1},
|
groups = {cracky = 3, bakedclay = 1},
|
||||||
@ -50,7 +49,7 @@ for _, clay in pairs(clay) do
|
|||||||
|
|
||||||
if clay[1] ~= "natural" then
|
if clay[1] ~= "natural" then
|
||||||
|
|
||||||
minetest.register_craft({
|
core.register_craft({
|
||||||
output = "bakedclay:" .. clay[1] .. " 8",
|
output = "bakedclay:" .. clay[1] .. " 8",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"group:bakedclay", "group:bakedclay", "group:bakedclay"},
|
{"group:bakedclay", "group:bakedclay", "group:bakedclay"},
|
||||||
@ -77,10 +76,10 @@ for _, clay in pairs(clay) do
|
|||||||
stairsplus:register_alias_all("bakedclay", clay[1],
|
stairsplus:register_alias_all("bakedclay", clay[1],
|
||||||
"bakedclay", "baked_clay_" .. clay[1])
|
"bakedclay", "baked_clay_" .. clay[1])
|
||||||
|
|
||||||
minetest.register_alias("stairs:slab_bakedclay_".. clay[1],
|
core.register_alias("stairs:slab_bakedclay_".. clay[1],
|
||||||
"bakedclay:slab_baked_clay_" .. clay[1])
|
"bakedclay:slab_baked_clay_" .. clay[1])
|
||||||
|
|
||||||
minetest.register_alias("stairs:stair_bakedclay_".. clay[1],
|
core.register_alias("stairs:stair_bakedclay_".. clay[1],
|
||||||
"bakedclay:stair_baked_clay_" .. clay[1])
|
"bakedclay:stair_baked_clay_" .. clay[1])
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -110,7 +109,7 @@ for _, clay in pairs(clay) do
|
|||||||
|
|
||||||
if techcnc_mod then
|
if techcnc_mod then
|
||||||
|
|
||||||
minetest.register_on_mods_loaded(function()
|
core.register_on_mods_loaded(function()
|
||||||
|
|
||||||
technic_cnc.register_all("bakedclay:" .. clay[1],
|
technic_cnc.register_all("bakedclay:" .. clay[1],
|
||||||
{cracky = 3, not_in_creative_inventory = 1},
|
{cracky = 3, not_in_creative_inventory = 1},
|
||||||
@ -128,7 +127,7 @@ for _, clay in pairs(clay) do
|
|||||||
|
|
||||||
local texture = "baked_clay_terracotta_" .. clay[1] ..".png"
|
local texture = "baked_clay_terracotta_" .. clay[1] ..".png"
|
||||||
|
|
||||||
minetest.register_node("bakedclay:terracotta_" .. clay[1], {
|
core.register_node("bakedclay:terracotta_" .. clay[1], {
|
||||||
description = clay[2] .. " " .. S("Glazed Terracotta"),
|
description = clay[2] .. " " .. S("Glazed Terracotta"),
|
||||||
tiles = {
|
tiles = {
|
||||||
texture .. "",
|
texture .. "",
|
||||||
@ -142,10 +141,10 @@ for _, clay in pairs(clay) do
|
|||||||
groups = {cracky = 3, terracotta = 1},
|
groups = {cracky = 3, terracotta = 1},
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
on_place = minetest.rotate_node
|
on_place = core.rotate_node
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
core.register_craft({
|
||||||
type = "cooking",
|
type = "cooking",
|
||||||
output = "bakedclay:terracotta_" .. clay[1],
|
output = "bakedclay:terracotta_" .. clay[1],
|
||||||
recipe = "bakedclay:" .. clay[1]
|
recipe = "bakedclay:" .. clay[1]
|
||||||
@ -153,11 +152,11 @@ for _, clay in pairs(clay) do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_alias("bakedclay:terracotta_light_blue", "bakedclay:terracotta_cyan")
|
core.register_alias("bakedclay:terracotta_light_blue", "bakedclay:terracotta_cyan")
|
||||||
|
|
||||||
-- cook clay block into natural baked clay
|
-- cook clay block into natural baked clay
|
||||||
|
|
||||||
minetest.register_craft({
|
core.register_craft({
|
||||||
type = "cooking",
|
type = "cooking",
|
||||||
output = "bakedclay:natural",
|
output = "bakedclay:natural",
|
||||||
recipe = "default:clay"
|
recipe = "default:clay"
|
||||||
@ -165,26 +164,19 @@ minetest.register_craft({
|
|||||||
|
|
||||||
-- register a few extra dye colour options
|
-- register a few extra dye colour options
|
||||||
|
|
||||||
minetest.register_craft({
|
core.register_craft({ output = "dye:green 4", recipe = {{"default:cactus"}} })
|
||||||
output = "dye:green 4",
|
core.register_craft({ output = "dye:brown 4", recipe = {{"default:dry_shrub"}} })
|
||||||
recipe = {{"default:cactus"}}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "dye:brown 4",
|
|
||||||
recipe = {{"default:dry_shrub"}}
|
|
||||||
})
|
|
||||||
|
|
||||||
-- only add light grey recipe if unifieddye mod isnt present (conflict)
|
-- only add light grey recipe if unifieddye mod isnt present (conflict)
|
||||||
|
|
||||||
if not minetest.get_modpath("unifieddyes") then
|
if not core.get_modpath("unifieddyes") then
|
||||||
|
|
||||||
minetest.register_craft( {
|
core.register_craft( {
|
||||||
output = "dye:dark_grey 3",
|
output = "dye:dark_grey 3",
|
||||||
recipe = {{"dye:black", "dye:black", "dye:white"}}
|
recipe = {{"dye:black", "dye:black", "dye:white"}}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
core.register_craft( {
|
||||||
output = "dye:grey 3",
|
output = "dye:grey 3",
|
||||||
recipe = {{"dye:black", "dye:white", "dye:white"}}
|
recipe = {{"dye:black", "dye:white", "dye:white"}}
|
||||||
})
|
})
|
||||||
@ -192,7 +184,7 @@ end
|
|||||||
|
|
||||||
-- 2x2 red baked clay makes 16x clay brick
|
-- 2x2 red baked clay makes 16x clay brick
|
||||||
|
|
||||||
minetest.register_craft( {
|
core.register_craft( {
|
||||||
output = "default:clay_brick 16",
|
output = "default:clay_brick 16",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"bakedclay:red", "bakedclay:red"},
|
{"bakedclay:red", "bakedclay:red"},
|
||||||
@ -202,7 +194,7 @@ minetest.register_craft( {
|
|||||||
|
|
||||||
-- colored clay compatibility
|
-- colored clay compatibility
|
||||||
|
|
||||||
if minetest.settings:get_bool("colored_clay_compatibility") == true then
|
if core.settings:get_bool("colored_clay_compatibility") == true then
|
||||||
|
|
||||||
local cc = {
|
local cc = {
|
||||||
{"black", "black"},
|
{"black", "black"},
|
||||||
@ -229,7 +221,7 @@ if minetest.settings:get_bool("colored_clay_compatibility") == true then
|
|||||||
local nod1 = "colored_clay:" .. cc[n][1]
|
local nod1 = "colored_clay:" .. cc[n][1]
|
||||||
local nod2 = "bakedclay:" .. cc[n][2]
|
local nod2 = "bakedclay:" .. cc[n][2]
|
||||||
|
|
||||||
minetest.register_alias(nod1, nod2)
|
core.register_alias(nod1, nod2)
|
||||||
|
|
||||||
if stairsplus_mod then
|
if stairsplus_mod then
|
||||||
stairsplus:register_alias_all("colored_clay", cc[n][1], "bakedclay", cc[n][2])
|
stairsplus:register_alias_all("colored_clay", cc[n][1], "bakedclay", cc[n][2])
|
||||||
@ -239,7 +231,7 @@ end
|
|||||||
|
|
||||||
-- get mod path
|
-- get mod path
|
||||||
|
|
||||||
local path = minetest.get_modpath("bakedclay")
|
local path = core.get_modpath("bakedclay")
|
||||||
|
|
||||||
-- add new flowers
|
-- add new flowers
|
||||||
|
|
||||||
@ -247,7 +239,7 @@ dofile(path .. "/flowers.lua")
|
|||||||
|
|
||||||
-- add lucky blocks if mod present
|
-- add lucky blocks if mod present
|
||||||
|
|
||||||
if minetest.get_modpath("lucky_block") then
|
if core.get_modpath("lucky_block") then
|
||||||
dofile(path .. "/lucky_block.lua")
|
dofile(path .. "/lucky_block.lua")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user