diff --git a/README.md b/README.md index f75e4fd..6681aee 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,132 @@ -# minetest-balloon-blocks -A mod to add balloon-blocks that you can place on air. +# Balloonblocks + +A mod that adds balloon blocks which can be placed on air. + +![Crafting a red balloonblock](images/balloonblocks_ingame_all1.png) + +## Description + +Have you ever wanted to build a big house in the sky? + +But you can't because it would take ages to build up from the ground. + +Now you can! + +The balloonblocks can be placed on air, this means there is no more trouble getting a block up in the sky. + +When placing a balloonblock in the air it is always placed three blocks away. + +That means it is an efficient way to build a path in the sky (if you don't have fly). + +You can just jump onto one height above your current height or the same height. + +But, if you can fly, then you don't have to build up. + +You can just fly up and place a balloonblock! + +![Crafting a red balloonblock](images/balloonblocks_ingame_all2.png) + +Documentation todo list: + +* Add details to the change log section with version details. +* Contributing needs a reference to contributing guidlines. +* Add a brief intro to yourself under the Author heading. Make sure you get approval before pushing to github. +* Licensing needs a quick reference to the MIT license. + +![Crafting a red balloonblock](images/balloonblocks_ingame_ground.png) + +## Installing + +![Crafting a red balloonblock](images/balloonblocks_ingame_red.png) + +There are three ways to install the balloonblocks mod: + +### Minetest GUI Installation + +You can do it without closing the game. + +Click on the tab titled "Content". +* Then at the bottom click on "Browse online content" (it may take a while). +* After that search for "balloon". +* Find the one called "Balloonblocks". +* On the right of it there will be "install". +* Click on that. +* It will say "Downloding and installing Balloonblocks". + +You have now installed Balloonblocks. + +![Crafting a red balloonblock](images/balloonblocks_ingame_yellow.png) + +### Zip File Installation + +* Use the website [ContentDB](https://content.minetest.net/packages/?q=balloonblocks) +* Find the one titled Balloonblocks, then click on it. +* After that find a green button titled "Download" click on it. +* Then click ok on the box that comes up. +* Now open files. +* Next go to downloads and right click on it. +* Go to the top one and right click on it. +* Find "Extract to". +* Click on that and go to "Home". +* Then right click on an empty space and find "Show hidden files". +* Click on it, then find ".minetest". +* Double click on that. +* Then find "mods". +* If you don't have one alredy then make one, but it has to be "mods" exactly or it won't work. +* Then double click on it. +* Click "Select". +* Next take the same path as you did before (Home-.minetest-mods). +* And finaly rename it to minetest-balloon-blocks. + +You have now installed Balloonblocks + +![Crafting a red balloonblock](images/balloonblocks_ingame_green.png) + +### Git Installation + +* Use the website [ContentDB](https://content.minetest.net/packages/?q=balloonblocks). +* Find the one titled Balloonblocks. +* Then click on it. +* After that find "Source" it is near the bottom of the screenshot. +* Click on that. +* Then find "Clone or download". +* Click on it. +* Open a command line. +* Type in "cd .minetest". +* Then "cd mods". +* Then "git clone " but before you press enter right click on the screen. +* Find "Paste", click on it +* Now press enter +* It will say "Cloning into minetest-balloon-blocks" + +You have now installed Balloonblocks + +![Crafting a red balloonblock](images/balloonblocks_ingame_blue.png) + +## Crafting + +This is how to craft them and what they look like + +### Red + +![Crafting a red balloonblock](images/balloonblocks_crafting_red.png) + +### Yellow + +![Crafting a red balloonblock](images/balloonblocks_crafting_yellow.png) + +### Green + +![Crafting a red balloonblock](images/balloonblocks_crafting_green.png) + +### Blue + +![Crafting a red balloonblock](images/balloonblocks_crafting_blue.png) + +## Change Log + +## Contributing + +## Author + +## License diff --git a/images/balloonblocks_crafting_blue.png b/images/balloonblocks_crafting_blue.png new file mode 100644 index 0000000..53ab6e3 Binary files /dev/null and b/images/balloonblocks_crafting_blue.png differ diff --git a/images/balloonblocks_crafting_green.png b/images/balloonblocks_crafting_green.png new file mode 100644 index 0000000..7417098 Binary files /dev/null and b/images/balloonblocks_crafting_green.png differ diff --git a/images/balloonblocks_crafting_red.png b/images/balloonblocks_crafting_red.png new file mode 100644 index 0000000..2089428 Binary files /dev/null and b/images/balloonblocks_crafting_red.png differ diff --git a/images/balloonblocks_crafting_yellow.png b/images/balloonblocks_crafting_yellow.png new file mode 100644 index 0000000..ec67837 Binary files /dev/null and b/images/balloonblocks_crafting_yellow.png differ diff --git a/images/balloonblocks_ingame_all1.png b/images/balloonblocks_ingame_all1.png new file mode 100644 index 0000000..8593e4b Binary files /dev/null and b/images/balloonblocks_ingame_all1.png differ diff --git a/images/balloonblocks_ingame_all2.png b/images/balloonblocks_ingame_all2.png new file mode 100644 index 0000000..d1a7f3f Binary files /dev/null and b/images/balloonblocks_ingame_all2.png differ diff --git a/images/balloonblocks_ingame_blue.png b/images/balloonblocks_ingame_blue.png new file mode 100644 index 0000000..f86c98b Binary files /dev/null and b/images/balloonblocks_ingame_blue.png differ diff --git a/images/balloonblocks_ingame_green.png b/images/balloonblocks_ingame_green.png new file mode 100644 index 0000000..67ae393 Binary files /dev/null and b/images/balloonblocks_ingame_green.png differ diff --git a/images/balloonblocks_ingame_ground.png b/images/balloonblocks_ingame_ground.png new file mode 100644 index 0000000..91940df Binary files /dev/null and b/images/balloonblocks_ingame_ground.png differ diff --git a/images/balloonblocks_ingame_red.png b/images/balloonblocks_ingame_red.png new file mode 100644 index 0000000..94ff05e Binary files /dev/null and b/images/balloonblocks_ingame_red.png differ diff --git a/images/balloonblocks_ingame_yellow.png b/images/balloonblocks_ingame_yellow.png new file mode 100644 index 0000000..9d99bff Binary files /dev/null and b/images/balloonblocks_ingame_yellow.png differ diff --git a/init.lua b/init.lua index 9646979..613efd9 100644 --- a/init.lua +++ b/init.lua @@ -1,111 +1,107 @@ -minetest.register_node("balloons:rubber_red", { +local placeColour = function (colour) + return function(itemstack, user, pointed_thing) + local pos = user:getpos() + local dir = user:get_look_dir() + local i = 3 + local new_pos = { + x = pos.x + (dir.x * i), + y = pos.y + 1 + (dir.y * i), + z = pos.z + (dir.z * i), + } + local name = 'balloonblocks:'..colour + minetest.set_node(new_pos, {name=name}) + end +end + +local soundsConfig = function () + return { + footstep = {name = "balloonblocks_footstep", gain = 0.2}, + dig = {name = "balloonblocks_footstep", gain = 0.3}, + dug = {name = "balloonblocks_footstep", gain = 0.3}, + place = {name = "default_place_node_hard", gain = 1.0} + } +end + +local balloonState = { + placeRed = placeColour('red'), + placeYellow = placeColour('yellow'), + placeGreen = placeColour('green'), + placeBlue = placeColour('blue'), + sounds = soundsConfig() +} + +minetest.register_node("balloonblocks:red", { description = "Red balloon", - tiles = {"balloons_rubber_red.png"}, - groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + tiles = {"balloonblocks_red.png"}, + groups = {snappy=3}, paramtype = "light", sunlight_propagates = true, - on_secondary_use = function(itemstack, user, pointed_thing) - local pos = user:getpos() - local dir = user:get_look_dir() - local i = 3 - local new_pos = { - x = pos.x + (dir.x * i), - y = pos.y + 1 + (dir.y * i), - z = pos.z + (dir.z * i), - } - minetest.set_node(new_pos, {name='balloons:rubber_red'}) - end + on_secondary_use = balloonState.placeRed, + sounds = balloonState.sounds }) minetest.register_craft({ - output = 'balloons:rubber_red', + output = 'balloonblocks:red', recipe = { - {'default:wood', 'default:wood', ''}, - {'default:wood', 'default:wood', ''}, - {'', '', ''}, + {'group:leaves', 'group:leaves', 'group:leaves'}, + {'group:leaves', 'dye:red', 'group:leaves'}, + {'dye:red', 'group:leaves', 'dye:red'}, } }) -minetest.register_node("balloons:rubber_yellow", { +minetest.register_node("balloonblocks:yellow", { description = "Yellow balloon", - tiles = {"balloons_rubber_yellow.png"}, - groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + tiles = {"balloonblocks_yellow.png"}, + groups = {snappy=3} paramtype = "light", sunlight_propagates = true, - on_secondary_use = function(itemstack, user, pointed_thing) - local pos = user:getpos() - local dir = user:get_look_dir() - local i = 3 - local new_pos = { - x = pos.x + (dir.x * i), - y = pos.y + 1 + (dir.y * i), - z = pos.z + (dir.z * i), - } - minetest.set_node(new_pos, {name='balloons:rubber_yellow'}) - end + on_secondary_use = balloonState.placeYellow, + sounds = balloonState.sounds }) minetest.register_craft({ - output = 'balloons:rubber_yellow', + output = 'balloonblocks:yellow', recipe = { - {'default:wood', 'default:wood', ''}, - {'default:wood', 'default:wood', ''}, - {'', '', ''}, + {'group:leaves', 'group:leaves', 'group:leaves'}, + {'group:leaves', 'dye:yellow', 'group:leaves'}, + {'dye:yellow', 'group:leaves', 'dye:yellow'}, } }) -minetest.register_node("balloons:rubber_green", { +minetest.register_node("balloonblocks:green", { description = "Green balloon", - tiles = {"balloons_rubber_green.png"}, - groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + tiles = {"balloonblocks_green.png"}, + groups = {snappy=3} paramtype = "light", sunlight_propagates = true, - on_secondary_use = function(itemstack, user, pointed_thing) - local pos = user:getpos() - local dir = user:get_look_dir() - local i = 3 - local new_pos = { - x = pos.x + (dir.x * i), - y = pos.y + 1 + (dir.y * i), - z = pos.z + (dir.z * i), - } - minetest.set_node(new_pos, {name='balloons:rubber_green'}) - end + on_secondary_use = balloonState.placeGreen, + sounds = balloonState.sounds }) minetest.register_craft({ - output = 'balloons:rubber_green', + output = 'balloonblocks:green', recipe = { - {'default:wood', 'default:wood', ''}, - {'default:wood', 'default:wood', ''}, - {'', '', ''}, + {'group:leaves', 'group:leaves', 'group:leaves'}, + {'group:leaves', 'dye:green', 'group:leaves'}, + {'dye:green', 'group:leaves', 'dye:green'}, } }) -minetest.register_node("balloons:rubber_blue", { +minetest.register_node("balloonblocks:blue", { description = "Blue balloon", - tiles = {"balloons_rubber_blue.png"}, - groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + tiles = {"balloonblocks_blue.png"}, + groups = {snappy=3} paramtype = "light", sunlight_propagates = true, - on_secondary_use = function(itemstack, user, pointed_thing) - local pos = user:getpos() - local dir = user:get_look_dir() - local i = 3 - local new_pos = { - x = pos.x + (dir.x * i), - y = pos.y + 1 + (dir.y * i), - z = pos.z + (dir.z * i), - } - minetest.set_node(new_pos, {name='balloons:rubber_blue'}) - end + on_secondary_use = balloonState.placeBlue, + sounds = balloonState.sounds }) minetest.register_craft({ - output = 'balloons:rubber_blue', + output = 'balloonblocks:blue', recipe = { - {'default:wood', 'default:wood', ''}, - {'default:wood', 'default:wood', ''}, - {'', '', ''}, + {'group:leaves', 'group:leaves', 'group:leaves'}, + {'group:leaves', 'dye:blue', 'group:leaves'}, + {'dye:blue', 'group:leaves', 'dye:blue'}, } }) diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..5b5f689 --- /dev/null +++ b/mod.conf @@ -0,0 +1,4 @@ +name = balloonblocks +description = Adds balloon blocks that can be placed on air. +title = Balloon Blocks +author = TBSHEB \ No newline at end of file diff --git a/sounds/balloonblocks_footstep.ogg b/sounds/balloonblocks_footstep.ogg new file mode 100755 index 0000000..9a9465d Binary files /dev/null and b/sounds/balloonblocks_footstep.ogg differ diff --git a/textures/balloons_rubber_blue.png b/textures/balloonblocks_blue.png similarity index 100% rename from textures/balloons_rubber_blue.png rename to textures/balloonblocks_blue.png diff --git a/textures/balloons_rubber_green.png b/textures/balloonblocks_green.png similarity index 100% rename from textures/balloons_rubber_green.png rename to textures/balloonblocks_green.png diff --git a/textures/balloons_rubber_red.png b/textures/balloonblocks_red.png similarity index 100% rename from textures/balloons_rubber_red.png rename to textures/balloonblocks_red.png diff --git a/textures/balloons_rubber_yellow.png b/textures/balloonblocks_yellow.png similarity index 100% rename from textures/balloons_rubber_yellow.png rename to textures/balloonblocks_yellow.png