commit 59a9249db1f99a210be3fd2af027b90bab4c3a6e Author: David G Date: Thu Jan 30 09:51:25 2020 -0700 Initial commit. diff --git a/README.md b/README.md new file mode 100644 index 0000000..df2a450 --- /dev/null +++ b/README.md @@ -0,0 +1,48 @@ +Sleeping Mat [sleeping_mat] +------------------------- + +A simple sleeping mat made out of grass. + +By David G (kestral246) + +![Sleeping Mat Screenshot](screenshot.png "sleeping_mat") + +I was getting tired of having to go through the process of getting wool to make a bed, so I made a simpler to craft sleeping mat. + +Note that sleeping on this mat will overwrite an existing bed respawn point, which will then get reset after destroying—i.e. picking up the sleeping mat (as of Jan 26, 2020 commit to mtg). + + +How to craft +------------ +For crafting this sleeping mat, three grass nodes are required from three different types of grass—nine total grass nodes using any order (shapeless recipes). + +Supported types are: grass, dry\_grass, jungle\_grass, and marram\_grass). + +This means that players have to travel to several different biomes before they can build a sleeping mat. + + + +Prior art +--------- +After making this mod I discovered two alternatives. + +- Napiophelios's campfire mod includes a sleeping mat (really a sleeping bag), but it requires wool—just what I was trying to avoid. +- Duane's fun_tools mod includes a nest, but it's too easy to make—just four leaves or needles of the same type. + + +Licenses +-------- +Source code + +> The MIT License (MIT) + +Media (textures) + +> Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) + + + + + + + diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..f5fa285 --- /dev/null +++ b/init.lua @@ -0,0 +1,73 @@ +-- Sleeping Mat +-- by David G (kestral246@gmail.com) +-- 2020-01-29 + +beds.register_bed("sleeping_mat:mat", { + description = ("Grass Sleeping Mat"), + inventory_image = "sleeping_mat_roll.png", + wield_image = "sleeping_mat_roll.png", + tiles = { + bottom = { + "sleeping_mat_top1.png", + "sleeping_mat_top1_side.png", + }, + top = { + "sleeping_mat_top2.png", + "sleeping_mat_top2_side.png", + }, + }, + nodebox = { + bottom = { + {-1/2, -1/2, -1/2, 1/2, -7/16, 1/2} + }, + top = { + {-1/2, -1/2, -1/2, 1/2, -7/16, 1/2} + }, + }, + selectionbox = {-1/2, -1/2, -1/2, 1/2, -7/16, 3/2}, + recipe = { -- dummy recipe, subset of first shapeless recipe below + {"group:grass", "group:dry_grass", "default:junglegrass"}, + {"group:grass", "group:dry_grass", "default:junglegrass"}, + {"group:grass", "group:dry_grass", "default:junglegrass"}, + }, +}) + +minetest.register_craft({ -- without marram_grass + output = "sleeping_mat:mat", + type = "shapeless", + recipe = { + "group:grass", "group:grass", "group:grass", + "group:dry_grass", "group:dry_grass", "group:dry_grass", + "default:junglegrass", "default:junglegrass", "default:junglegrass" + }, +}) + +minetest.register_craft({ -- without junglegrass + output = "sleeping_mat:mat", + type = "shapeless", + recipe = { + "group:grass", "group:grass", "group:grass", + "group:dry_grass", "group:dry_grass", "group:dry_grass", + "default:marram_grass_1", "default:marram_grass_1", "default:marram_grass_1" + }, +}) + +minetest.register_craft({ -- without dry_grass + output = "sleeping_mat:mat", + type = "shapeless", + recipe = { + "group:grass", "group:grass", "group:grass", + "default:junglegrass", "default:junglegrass", "default:junglegrass", + "default:marram_grass_1", "default:marram_grass_1", "default:marram_grass_1" + }, +}) + +minetest.register_craft({ -- without grass + output = "sleeping_mat:mat", + type = "shapeless", + recipe = { + "group:dry_grass", "group:dry_grass", "group:dry_grass", + "default:junglegrass", "default:junglegrass", "default:junglegrass", + "default:marram_grass_1", "default:marram_grass_1", "default:marram_grass_1" + }, +}) diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..46fb624 --- /dev/null +++ b/mod.conf @@ -0,0 +1,3 @@ +name = sleeping_mat +description = Simple sleeping mat made out of grass. +depends = default, beds diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..afaaa39 Binary files /dev/null and b/screenshot.png differ diff --git a/textures/sleeping_mat_roll.png b/textures/sleeping_mat_roll.png new file mode 100644 index 0000000..4697da1 Binary files /dev/null and b/textures/sleeping_mat_roll.png differ diff --git a/textures/sleeping_mat_top1.png b/textures/sleeping_mat_top1.png new file mode 100644 index 0000000..6ebc9dd Binary files /dev/null and b/textures/sleeping_mat_top1.png differ diff --git a/textures/sleeping_mat_top1_side.png b/textures/sleeping_mat_top1_side.png new file mode 100644 index 0000000..971794e Binary files /dev/null and b/textures/sleeping_mat_top1_side.png differ diff --git a/textures/sleeping_mat_top2.png b/textures/sleeping_mat_top2.png new file mode 100644 index 0000000..1348579 Binary files /dev/null and b/textures/sleeping_mat_top2.png differ diff --git a/textures/sleeping_mat_top2_side.png b/textures/sleeping_mat_top2_side.png new file mode 100644 index 0000000..70e5dd3 Binary files /dev/null and b/textures/sleeping_mat_top2_side.png differ