diff --git a/README.md b/README.md index 3f174c6..c6f1f87 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # claycrafter Minetest clay crafter mod. Adds a way to craft clay out of compressed dirt. -Dependencies: +Dependencies: Default Vessels Bucket @@ -10,24 +10,10 @@ moreblocks (optional) claycrafter.lua is derivated from furnace.lua (minetest_game) by PilzAdam and Amaz1. Edited by everamzah to work for this mod. -#####License for Code +#####License for Code -Copyright (C) 2016 Dragonop +Dragonop (LGPLv3) -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2.1 of the License, or -(at your option) any later version. +#####License for Media -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License along -with this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -#####License for Textures, Models and Sounds - -CC-BY-SA 3.0 UNPORTED. Created by Dragonop +Textures by Dragonop (CC-BY-SA 4.0) diff --git a/claycrafter.lua b/claycrafter.lua index 5943065..b2bebbe 100644 --- a/claycrafter.lua +++ b/claycrafter.lua @@ -233,7 +233,7 @@ minetest.register_abm({ end else -- Furnace ran out of fuel - if cookable then + if cookable and inv:room_for_item("dst", ItemStack({name = "default:clay", count = 4})) then -- We need to get new fuel local fueltime = minetest.get_item_group(inv:get_stack("fuel", 1):get_name(), "h2o") @@ -244,16 +244,13 @@ minetest.register_abm({ src_time = 0 else -- Take fuel from fuel list - - if inv:room_for_item("dst", ItemStack({name = "default:clay", count = 4})) - and inv:room_for_item("vessels", ItemStack({name = "vessels:drinking_glass"})) + if inv:room_for_item("vessels", ItemStack({name = "vessels:drinking_glass"})) then inv:remove_item("fuel", inv:get_stack("fuel", 1):get_name()) inv:add_item("vessels", {name = "vessels:drinking_glass"}) else swap_node(pos, "claycrafter:claycrafter_active") end - fuel_totaltime = fueltime fuel_time = 0 @@ -274,7 +271,7 @@ minetest.register_abm({ local item_percent = 0 if cookable then item_percent = math.floor(src_time / cooktime * 100) - item_state = "In use" + item_state = "Yes" else if srclist[1]:is_empty() then item_state = "Empty" diff --git a/depends.txt b/depends.txt deleted file mode 100644 index c5bcbcc..0000000 --- a/depends.txt +++ /dev/null @@ -1,4 +0,0 @@ -vessels -default -bucket -moreblocks? diff --git a/description.txt b/description.txt deleted file mode 100644 index c723f33..0000000 --- a/description.txt +++ /dev/null @@ -1 +0,0 @@ -Craft clay out of compressed dirt. diff --git a/items.lua b/items.lua index 8892d9b..3a3ab16 100644 --- a/items.lua +++ b/items.lua @@ -8,8 +8,18 @@ else }) end -minetest.register_craftitem("claycrafter:glass_of_water", { - description = "Glass of Water", - inventory_image = "claycrafter_glass_of_water.png", - groups = {h2o = 1, vessel = 1}, -- How much time to convert 1 compressed dirt to 4 clay +minetest.register_node("claycrafter:glass_of_water", { + description = ("Glass of Water"), + drawtype = "plantlike", + tiles = {"claycrafter_glass_of_water.png"}, + inventory_image = "claycrafter_glass_of_water_inv.png", + wield_image = "claycrafter_glass_of_water.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + sunlight_propagates = true, + selection_box = {type = "fixed",fixed = {-0.25, -0.5, -0.25, 0.25, 0, 0.25} }, + groups = {vessel = 1, dig_immediate = 3, attached_node = 1, h2o = 3}, -- How much time to convert 1 compressed dirt to 4 clay + on_use = minetest.item_eat(0,"vessels:drinking_glass"), + sounds = default.node_sound_glass_defaults(), }) diff --git a/mod.conf b/mod.conf index 5eb9725..3f98c9c 100644 --- a/mod.conf +++ b/mod.conf @@ -1 +1,5 @@ name = claycrafter +description = This mod introduces the Claycrafter, which converts Compressed Dirt to Clay using Glasses of Water. +depends = vessels, default, bucket +optional_depends = moreblocks +author = Dragonop diff --git a/recipes.lua b/recipes.lua index 8028eea..02c34a5 100644 --- a/recipes.lua +++ b/recipes.lua @@ -9,6 +9,11 @@ if not minetest.get_modpath("moreblocks") then }) end +minetest.register_craft({ + output = "default:dirt 9", + recipe = {{"claycrafter:compressed_dirt"}} +}) + minetest.register_craft({ output = "claycrafter:glass_of_water 8", recipe = { diff --git a/screenshot.png b/screenshot.png index b00d5ce..2171717 100644 Binary files a/screenshot.png and b/screenshot.png differ diff --git a/textures/claycrafter_glass_of_water.png b/textures/claycrafter_glass_of_water.png index f5f52c0..6e0768d 100644 Binary files a/textures/claycrafter_glass_of_water.png and b/textures/claycrafter_glass_of_water.png differ diff --git a/textures/claycrafter_glass_of_water_inv.png b/textures/claycrafter_glass_of_water_inv.png new file mode 100644 index 0000000..b9469dd Binary files /dev/null and b/textures/claycrafter_glass_of_water_inv.png differ