From 931b5c11f32c5f972d937454efac56f92bde90fc Mon Sep 17 00:00:00 2001 From: MrIbby Date: Mon, 2 Nov 2015 19:03:49 -0800 Subject: [PATCH] Initial commit --- README.txt | 40 ++++++++++++++++++++++++++++ depends.txt | 2 ++ init.lua | 56 +++++++++++++++++++++++++++++++++++++++ textures/cake_bottom.png | Bin 0 -> 760 bytes textures/cake_inner.png | Bin 0 -> 559 bytes textures/cake_side.png | Bin 0 -> 559 bytes textures/cake_top.png | Bin 0 -> 760 bytes 7 files changed, 98 insertions(+) create mode 100644 README.txt create mode 100644 depends.txt create mode 100644 init.lua create mode 100644 textures/cake_bottom.png create mode 100644 textures/cake_inner.png create mode 100644 textures/cake_side.png create mode 100644 textures/cake_top.png 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 0000000000000000000000000000000000000000..fc99edbbc06af5500695b67f12f5c83ec2a746c9 GIT binary patch literal 760 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGf5&!@T5&_c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