commit 931b5c11f32c5f972d937454efac56f92bde90fc Author: MrIbby Date: Mon Nov 2 19:03:49 2015 -0800 Initial commit diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..54abfdc --- /dev/null +++ b/README.txt @@ -0,0 +1,40 @@ +Minetest 0.4 mod: cake +====================== + +License of source code: +----------------------- +The MIT License (MIT) + +Copyright (c) 2015 MrIbby + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +License of textures: +-------------------- +Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +http://creativecommons.org/licenses/by-sa/4.0/ + + +Authors of textures: +-------------------- +Derived from textures by rubenwardy (CC BY-SA): + cake_bottom.png + cake_inner.png + cake_side.png + cake_top.png diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..84893d5 --- /dev/null +++ b/depends.txt @@ -0,0 +1,2 @@ +bucket +farming diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..a3b8ecd --- /dev/null +++ b/init.lua @@ -0,0 +1,56 @@ +local sizes = {-0.4375, -0.3125, -0.1875, -0.0625, 0.0625, 0.1875, 0.3125} + +for i, size in ipairs(sizes) do + local slice = i - 1 + local name + local description + local drop + local tiles + local not_in_creative_inventory + + if slice == 0 then + name = "cake:cake" + description = "Cake" + drop = nil + tiles = {"cake_top.png", "cake_bottom.png", "cake_side.png"} + not_in_creative_inventory = 0 + else + name = "cake:cake_"..slice + description = "Cake (Slice "..slice..")" + drop = '' + tiles = {"cake_top.png", "cake_bottom.png", "cake_side.png", "cake_inner.png", "cake_side.png", "cake_side.png"} + not_in_creative_inventory = 1 + end + + minetest.register_node(name, { + description = description, + drop = drop, + drawtype = "nodebox", + tiles = tiles, + paramtype = "light", + is_ground_content = false, + groups = {crumbly=3,not_in_creative_inventory=not_in_creative_inventory}, + --sounds = sounds, + node_box = { + type = "fixed", + fixed = { + {size, -0.5, -0.4375, 0.4375, 0, 0.4375}, + } + }, + on_rightclick = function(pos, node, clicker) + clicker:set_hp(clicker:get_hp() + 1) + + if i < #sizes then + minetest.swap_node(pos, {name="cake:cake_"..i}) + else + minetest.remove_node(pos) + end + end, + }) +end + +minetest.register_craft({ + type = "shapeless", + output = "cake:cake", + recipe = {"farming:flour", "farming:flour", "group:water_bucket"} +}) diff --git a/textures/cake_bottom.png b/textures/cake_bottom.png new file mode 100644 index 0000000..fc99edb Binary files /dev/null and b/textures/cake_bottom.png differ diff --git a/textures/cake_inner.png b/textures/cake_inner.png new file mode 100644 index 0000000..144f986 Binary files /dev/null and b/textures/cake_inner.png differ diff --git a/textures/cake_side.png b/textures/cake_side.png new file mode 100644 index 0000000..144f986 Binary files /dev/null and b/textures/cake_side.png differ diff --git a/textures/cake_top.png b/textures/cake_top.png new file mode 100644 index 0000000..fc99edb Binary files /dev/null and b/textures/cake_top.png differ