develop #24

Merged
milan merged 4 commits from develop into master 2020-12-30 10:35:09 +01:00
6 changed files with 74 additions and 48 deletions
Showing only changes of commit 1ddd08b39f - Show all commits

View file

@ -1,13 +1,21 @@
# claycrafter
Minetest clay crafter mod. Adds a way to craft clay out of compressed dirt.
Minetest clay crafter mod.
Adds a way for players to obtain clay other than mining, out of a common material: dirt. It adds three new nodes:
Dependencies:
Claycrafter: Used to convert compressed dirt into clay.
Compressed dirt: Just 9 dirt, compressed, useful for saving storage space, too! (Not present if moreblocks is installed, use moreblocks:dirt_compressed instead)
Glass of water: Used as fuel for the Claycrafter. Placeable.
##### Dependencies:
Default
Vessels
Bucket
claycrafter.lua is derivated from furnace.lua (minetest_game) by PilzAdam and Amaz1.
Edited by everamzah to work for this mod.
##### Optional dependencies:
moreblocks
Special thanks to everamzah
##### License for Code

View file

@ -203,9 +203,17 @@ minetest.register_abm({
local cooktime = minetest.get_item_group(inv:get_stack("fuel", 1):get_name(), "h2o")
local cookable = true
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
-- Check if we have enough fuel to burn
if fuel_time < fuel_totaltime then

View file

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

View file

@ -1,9 +1,31 @@
--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",
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", {
description = ("Glass of Water"),
drawtype = "plantlike",
@ -19,3 +41,25 @@ minetest.register_node("claycrafter:glass_of_water", {
on_use = minetest.item_eat(0,"vessels:drinking_glass"),
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"}
}
})

View file

@ -1,4 +1,5 @@
name = claycrafter
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

View file

@ -1,34 +0,0 @@
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_craft({
output = "default:dirt 9",
recipe = {{"claycrafter:compressed_dirt"}}
})
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"}
}
})