Moreblocks compatibility

Merged recipes.lua into items.lua
Added support for moreblocks' compressed dirt
This commit is contained in:
Joaquin Villalba 2020-12-22 11:26:30 -03:00 committed by GitHub
parent 86c0626956
commit 2ab701933d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 59 additions and 7 deletions

@ -203,8 +203,16 @@ minetest.register_abm({
local cooktime = minetest.get_item_group(inv:get_stack("fuel", 1):get_name(), "h2o") local cooktime = minetest.get_item_group(inv:get_stack("fuel", 1):get_name(), "h2o")
local cookable = true local cookable = true
if inv:get_stack("src", 1):get_name() ~= "claycrafter:compressed_dirt" then
cookable = false
if minetest.get_modpath("moreblocks") ~= nil then
if inv:get_stack("src", 1):get_name() ~= "moreblocks:dirt_compressed" then
cookable = false
end
else
if inv:get_stack("src", 1):get_name() ~= "claycrafter:compressed_dirt" then
cookable = false
end
end end
-- Check if we have enough fuel to burn -- Check if we have enough fuel to burn

@ -3,5 +3,4 @@ local modpath = minetest.get_modpath("claycrafter")
-- TODO: Investigate function to automatically get mod name. -- TODO: Investigate function to automatically get mod name.
dofile(modpath .. "/items.lua") dofile(modpath .. "/items.lua")
dofile(modpath .. "/recipes.lua")
dofile(modpath .. "/claycrafter.lua") dofile(modpath .. "/claycrafter.lua")

@ -1,9 +1,31 @@
minetest.register_node("claycrafter:compressed_dirt", { --compressed dirt
local moreblocks = minetest.get_modpath("moreblocks")
if moreblocks ~= nil then
minetest.register_alias("claycrafter:compressed_dirt","moreblocks:dirt_compressed")
else
minetest.register_craft({
output = "claycrafter:compressed_dirt",
recipe = {
{"default:dirt", "default:dirt", "default:dirt"},
{"default:dirt", "default:dirt", "default:dirt"},
{"default:dirt", "default:dirt", "default:dirt"}
}
})
minetest.register_node("claycrafter:compressed_dirt", {
description = "Compressed Dirt", description = "Compressed Dirt",
tiles = {"claycrafter_compressed_dirt.png"}, tiles = {"claycrafter_compressed_dirt.png"},
groups = {crumbly = 1, oddly_breakable_by_hand = 1, soil = 1, cracky =1} groups = {crumbly = 1, oddly_breakable_by_hand = 1, soil = 1, cracky =1},
}) sounds = default.node_sound_dirt_defaults(),
})
minetest.register_craft({
output = "default:dirt 9",
recipe = {{"claycrafter:compressed_dirt"}}
})
minetest.register_alias("moreblocks:dirt_compressed","claycrafter:compressed_dirt")
end
--nodes
minetest.register_node("claycrafter:glass_of_water", { minetest.register_node("claycrafter:glass_of_water", {
description = ("Glass of Water"), description = ("Glass of Water"),
drawtype = "plantlike", drawtype = "plantlike",
@ -19,3 +41,25 @@ minetest.register_node("claycrafter:glass_of_water", {
on_use = minetest.item_eat(0,"vessels:drinking_glass"), on_use = minetest.item_eat(0,"vessels:drinking_glass"),
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
}) })
--recipes
minetest.register_craft({
output = "claycrafter:glass_of_water 8",
recipe = {
{"vessels:drinking_glass", "vessels:drinking_glass", "vessels:drinking_glass"},
{"vessels:drinking_glass", "bucket:bucket_water", "vessels:drinking_glass"},
{"vessels:drinking_glass", "vessels:drinking_glass", "vessels:drinking_glass"}
},
replacements = {
{"bucket:bucket_water", "bucket:bucket_empty"},
}
})
minetest.register_craft({
output = "claycrafter:claycrafter",
recipe = {
{"group:wood", "default:steel_ingot", "group:wood"},
{"group:wood", "default:glass", "group:wood"},
{"default:stick", "bucket:bucket_water", "default:stick"}
}
})

@ -1,4 +1,5 @@
name = claycrafter name = claycrafter
description = This mod introduces the Claycrafter, which converts Compressed Dirt to Clay using Glasses of Water. description = This mod introduces the Claycrafter, which converts Compressed Dirt to Clay using Glasses of Water.
depends = vessels, default, bucket depends = vessels, default
optional_depends = moreblocks
author = Dragonop author = Dragonop