Added features and fixed bug
19
README.md
|
@ -44,6 +44,12 @@ If you can fly, then you don't have to build to place a node. You can just fly u
|
|||
|
||||
![Balloonblocks in the game](images/balloonblocks_ingame_purple.png)
|
||||
|
||||
![Balloonblocks in the game](images/balloonblocks_ingame_pink.png)
|
||||
|
||||
![Balloonblocks in the game](images/balloonblocks_ingame_grey.png)
|
||||
|
||||
![Balloonblocks in the game](images/balloonblocks_ingame_brown.png)
|
||||
|
||||
![Crafting a red balloonblock](images/balloonblocks_crafting_red.png)
|
||||
|
||||
![Crafting a yellow balloonblock](images/balloonblocks_crafting_yellow.png)
|
||||
|
@ -60,6 +66,12 @@ If you can fly, then you don't have to build to place a node. You can just fly u
|
|||
|
||||
![Crafting a purple balloonblock](images/balloonblocks_crafting_purple.png)
|
||||
|
||||
![Crafting a pink balloonblock](images/balloonblocks_crafting_pink.png)
|
||||
|
||||
![Crafting a grey balloonblock](images/balloonblocks_crafting_grey.png)
|
||||
|
||||
![Crafting a brown balloonblock](images/balloonblocks_crafting_brown.png)
|
||||
|
||||
## Installing
|
||||
|
||||
There are three ways to [install](https://wiki.minetest.net/Installing_Mods) the balloonblocks mod:
|
||||
|
@ -97,8 +109,13 @@ You have now installed the balloonblocks mod, don't forget to enable it.
|
|||
|
||||
## Change Log
|
||||
|
||||
* 2020-06-18: v1.2.0
|
||||
* Added grey, pink, and brown balloonblocks
|
||||
* Added bounce attribute
|
||||
* Added more crafting recipes
|
||||
* Fixed block replacement bug
|
||||
* 2020-06-11: v1.1.0 - Added black, white, orange, and purple balloonblocks
|
||||
* 2020-06-09: v1.0.0 - Initial release
|
||||
* 2020-06-11: v1.1.0 - Added black, white, orange, and purple balloons
|
||||
|
||||
## License
|
||||
|
||||
|
|
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 238 KiB |
After Width: | Height: | Size: 161 KiB |
After Width: | Height: | Size: 165 KiB |
186
init.lua
|
@ -15,13 +15,19 @@ local placeColour = function (colour)
|
|||
y = pos.y + 1 + (dir.y * balloonPlaceDistanceFromPlayer),
|
||||
z = pos.z + (dir.z * balloonPlaceDistanceFromPlayer),
|
||||
}
|
||||
local name = 'balloonblocks:'..colour
|
||||
minetest.set_node(new_pos, {name=name})
|
||||
|
||||
local creative_enabled = (creative_mod and creative.is_enabled_for(user.get_player_name(user))) or creative_mode_cache
|
||||
if (not creative_enabled) then
|
||||
local stack = ItemStack(name)
|
||||
return ItemStack(name .. " " .. itemstack:get_count() - 1)
|
||||
local getPos = minetest.get_node(new_pos)
|
||||
if getPos.name == "air" or
|
||||
getPos.name == "default:water_source" or
|
||||
getPos.name == "default:water_flowing" or
|
||||
getPos.name == "default:river_water_source" or
|
||||
getPos.name == "default:river_water_flowing" then
|
||||
local name = 'balloonblocks:'..colour
|
||||
minetest.set_node(new_pos, {name=name})
|
||||
local creative_enabled = (creative_mod and creative.is_enabled_for(user.get_player_name(user))) or creative_mode_cache
|
||||
if (not creative_enabled) then
|
||||
local stack = ItemStack(name)
|
||||
return ItemStack(name .. " " .. itemstack:get_count() - 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -45,13 +51,16 @@ local balloonState = {
|
|||
placeWhite = placeColour('white'),
|
||||
placeOrange = placeColour('orange'),
|
||||
placePurple = placeColour('purple'),
|
||||
placeGrey = placeColour('grey'),
|
||||
placePink = placeColour('pink'),
|
||||
placeBrown = placeColour('brown'),
|
||||
sounds = soundsConfig()
|
||||
}
|
||||
|
||||
minetest.register_node("balloonblocks:red", {
|
||||
description = "Red balloon",
|
||||
tiles = {"balloonblocks_red.png"},
|
||||
groups = {snappy=3},
|
||||
groups = {snappy=3,fall_damage_add_percent = -99, bouncy=70},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
on_secondary_use = balloonState.placeRed,
|
||||
|
@ -70,7 +79,7 @@ minetest.register_craft({
|
|||
minetest.register_node("balloonblocks:yellow", {
|
||||
description = "Yellow balloon",
|
||||
tiles = {"balloonblocks_yellow.png"},
|
||||
groups = {snappy=3},
|
||||
groups = {snappy=3,fall_damage_add_percent = -99, bouncy=70},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
on_secondary_use = balloonState.placeYellow,
|
||||
|
@ -89,7 +98,7 @@ minetest.register_craft({
|
|||
minetest.register_node("balloonblocks:green", {
|
||||
description = "Green balloon",
|
||||
tiles = {"balloonblocks_green.png"},
|
||||
groups = {snappy=3},
|
||||
groups = {snappy=3,fall_damage_add_percent = -99, bouncy = 70},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
on_secondary_use = balloonState.placeGreen,
|
||||
|
@ -108,7 +117,7 @@ minetest.register_craft({
|
|||
minetest.register_node("balloonblocks:blue", {
|
||||
description = "Blue balloon",
|
||||
tiles = {"balloonblocks_blue.png"},
|
||||
groups = {snappy=3},
|
||||
groups = {snappy=3,fall_damage_add_percent = -99, bouncy = 70},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
on_secondary_use = balloonState.placeBlue,
|
||||
|
@ -127,7 +136,7 @@ minetest.register_craft({
|
|||
minetest.register_node("balloonblocks:black", {
|
||||
description = "Black balloon",
|
||||
tiles = {"balloonblocks_black.png"},
|
||||
groups = {snappy=3},
|
||||
groups = {snappy=3,fall_damage_add_percent = -99, bouncy = 70},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
on_secondary_use = balloonState.placeBlack,
|
||||
|
@ -146,7 +155,7 @@ minetest.register_craft({
|
|||
minetest.register_node("balloonblocks:white", {
|
||||
description = "White balloon",
|
||||
tiles = {"balloonblocks_white.png"},
|
||||
groups = {snappy=3},
|
||||
groups = {snappy=3,fall_damage_add_percent = -99, bouncy = 70},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
on_secondary_use = balloonState.placeWhite,
|
||||
|
@ -165,7 +174,7 @@ minetest.register_craft({
|
|||
minetest.register_node("balloonblocks:orange", {
|
||||
description = "Orange balloon",
|
||||
tiles = {"balloonblocks_orange.png"},
|
||||
groups = {snappy=3},
|
||||
groups = {snappy=3,fall_damage_add_percent = -99, bouncy = 70},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
on_secondary_use = balloonState.placeOrange,
|
||||
|
@ -184,7 +193,7 @@ minetest.register_craft({
|
|||
minetest.register_node("balloonblocks:purple", {
|
||||
description = "Purple balloon",
|
||||
tiles = {"balloonblocks_purple.png"},
|
||||
groups = {snappy=3},
|
||||
groups = {snappy=3,fall_damage_add_percent = -99, bouncy = 70},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
on_secondary_use = balloonState.placePurple,
|
||||
|
@ -198,4 +207,149 @@ minetest.register_craft({
|
|||
{'group:leaves', 'dye:violet', 'group:leaves'},
|
||||
{'dye:violet', 'group:leaves', 'dye:violet'},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_node("balloonblocks:grey", {
|
||||
description = "Grey balloon",
|
||||
tiles = {"balloonblocks_grey.png"},
|
||||
groups = {snappy=3,fall_damage_add_percent = -99, bouncy = 70},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
on_secondary_use = balloonState.placeGrey,
|
||||
sounds = balloonState.sounds
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'balloonblocks:grey',
|
||||
recipe = {
|
||||
{'group:leaves', 'group:leaves', 'group:leaves'},
|
||||
{'group:leaves', 'dye:grey', 'group:leaves'},
|
||||
{'dye:grey', 'group:leaves', 'dye:grey'},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("balloonblocks:pink", {
|
||||
description = "Pink balloon",
|
||||
tiles = {"balloonblocks_pink.png"},
|
||||
groups = {snappy=3,fall_damage_add_percent = -99, bouncy = 70},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
on_secondary_use = balloonState.placePink,
|
||||
sounds = balloonState.sounds
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'balloonblocks:pink',
|
||||
recipe = {
|
||||
{'group:leaves', 'group:leaves', 'group:leaves'},
|
||||
{'group:leaves', 'dye:magenta', 'group:leaves'},
|
||||
{'dye:magenta', 'group:leaves', 'dye:magenta'},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("balloonblocks:brown", {
|
||||
description = "Brown balloon",
|
||||
tiles = {"balloonblocks_brown.png"},
|
||||
groups = {snappy=3,fall_damage_add_percent = -99, bouncy = 70},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
on_secondary_use = balloonState.placeBrown,
|
||||
sounds = balloonState.sounds
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'balloonblocks:brown',
|
||||
recipe = {
|
||||
{'group:leaves', 'group:leaves', 'group:leaves'},
|
||||
{'group:leaves', 'dye:brown', 'group:leaves'},
|
||||
{'dye:brown', 'group:leaves', 'dye:brown'},
|
||||
}
|
||||
})
|
||||
-- Extra crafting --
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'balloonblocks:green',
|
||||
recipe = {
|
||||
{'balloonblocks:yellow', 'dye:blue'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'balloonblocks:green',
|
||||
recipe = {
|
||||
{'dye:yellow', 'balloonblocks:blue'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'balloonblocks:orange',
|
||||
recipe = {
|
||||
{'balloonblocks:yellow', 'dye:red'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'balloonblocks:orange',
|
||||
recipe = {
|
||||
{'dye:yellow', 'balloonblocks:red'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'balloonblocks:purple',
|
||||
recipe = {
|
||||
{'balloonblocks:red', 'dye:blue'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'balloonblocks:purple',
|
||||
recipe = {
|
||||
{'dye:red', 'balloonblocks:blue'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'balloonblocks:grey',
|
||||
recipe = {
|
||||
{'balloonblocks:white', 'dye:black'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'balloonblocks:grey',
|
||||
recipe = {
|
||||
{'dye:white', 'balloonblocks:black'},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'balloonblocks:pink',
|
||||
recipe = {
|
||||
{'balloonblocks:white', 'dye:red'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'balloonblocks:pink',
|
||||
recipe = {
|
||||
{'dye:white', 'balloonblocks:red'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'balloonblocks:brown',
|
||||
recipe = {
|
||||
{'balloonblocks:green', 'dye:red'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'balloonblocks:brown',
|
||||
recipe = {
|
||||
{'dye:green', 'balloonblocks:red'},
|
||||
}
|
||||
})
|
||||
|
|
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 9.3 KiB |
After Width: | Height: | Size: 17 KiB |