mirror of
https://github.com/minetest-mods/jumping.git
synced 2025-06-29 22:50:58 +02:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
ca0cbcc333 |
1
depends.txt
Normal file
1
depends.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
default
|
1
description.txt
Normal file
1
description.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
adds trampolines, cushions, ...
|
56
init.lua
56
init.lua
@ -7,14 +7,14 @@ local trampolinebox = {
|
|||||||
{ 0.4, -0.5, -0.5, 0.5, -0.2, -0.4},
|
{ 0.4, -0.5, -0.5, 0.5, -0.2, -0.4},
|
||||||
{ 0.4, -0.5, 0.4, 0.5, -0.2, 0.5},
|
{ 0.4, -0.5, 0.4, 0.5, -0.2, 0.5},
|
||||||
{-0.5, -0.5, 0.4, -0.4, -0.2, 0.5},
|
{-0.5, -0.5, 0.4, -0.4, -0.2, 0.5},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local cushionbox = {
|
local cushionbox = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
{-0.5, -0.5, -0.5, 0.5, -0.3, 0.5},
|
{-0.5, -0.5, -0.5, 0.5, -0.3, 0.5},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local trampoline_punch = function(pos, node)
|
local trampoline_punch = function(pos, node)
|
||||||
@ -35,7 +35,6 @@ local power_decrease = function(pos, node)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or nil
|
|
||||||
for i = 1, 6 do
|
for i = 1, 6 do
|
||||||
minetest.register_node("jumping:trampoline"..i, {
|
minetest.register_node("jumping:trampoline"..i, {
|
||||||
description = "Trampoline",
|
description = "Trampoline",
|
||||||
@ -49,19 +48,17 @@ for i = 1, 6 do
|
|||||||
on_punch = trampoline_punch,
|
on_punch = trampoline_punch,
|
||||||
on_rightclick = power_decrease,
|
on_rightclick = power_decrease,
|
||||||
drop = "jumping:trampoline1",
|
drop = "jumping:trampoline1",
|
||||||
use_texture_alpha = use_texture_alpha,
|
|
||||||
tiles = {
|
tiles = {
|
||||||
"jumping_trampoline_top.png",
|
"jumping_trampoline_top.png",
|
||||||
"jumping_trampoline_bottom.png",
|
"jumping_trampoline_bottom.png",
|
||||||
"jumping_trampoline_sides.png^jumping_trampoline_sides_overlay"..i..".png"
|
"jumping_trampoline_sides.png^jumping_trampoline_sides_overlay"..i..".png"
|
||||||
},
|
},
|
||||||
is_ground_content = false,
|
|
||||||
groups = {
|
groups = {
|
||||||
dig_immediate = 2,
|
dig_immediate = 2,
|
||||||
bouncy = 20 + i * 20,
|
bouncy = 20 + i * 20,
|
||||||
fall_damage_add_percent = -70,
|
fall_damage_add_percent = -70,
|
||||||
not_in_creative_inventory = ( i > 1 and 1 or nil),
|
not_in_creative_inventory = ( i > 1 and 1 or nil),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -71,34 +68,29 @@ minetest.register_node("jumping:cushion", {
|
|||||||
node_box = cushionbox,
|
node_box = cushionbox,
|
||||||
selection_box = cushionbox,
|
selection_box = cushionbox,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
use_texture_alpha = use_texture_alpha,
|
|
||||||
tiles = {
|
tiles = {
|
||||||
"jumping_cushion_tb.png",
|
"jumping_cushion_tb.png",
|
||||||
"jumping_cushion_tb.png",
|
"jumping_cushion_tb.png",
|
||||||
"jumping_cushion_sides.png"
|
"jumping_cushion_sides.png"
|
||||||
},
|
},
|
||||||
is_ground_content = false,
|
|
||||||
groups = {dig_immediate=2, disable_jump=1, fall_damage_add_percent=-100},
|
groups = {dig_immediate=2, disable_jump=1, fall_damage_add_percent=-100},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- register recipes if the corresponding mods are present
|
minetest.register_craft({
|
||||||
if minetest.get_modpath("default") then
|
output = "jumping:trampoline1",
|
||||||
minetest.register_craft({
|
recipe = {
|
||||||
output = "jumping:trampoline1",
|
{"jumping:cushion", "jumping:cushion", "jumping:cushion"},
|
||||||
recipe = {
|
{"default:steel_ingot", "", "default:steel_ingot"}
|
||||||
{"jumping:cushion", "jumping:cushion", "jumping:cushion"},
|
}
|
||||||
{"default:steel_ingot", "", "default:steel_ingot"}
|
})
|
||||||
}
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
if minetest.get_modpath("farming") and minetest.get_modpath("wool") then
|
minetest.register_craft({
|
||||||
minetest.register_craft({
|
output = "jumping:cushion",
|
||||||
output = "jumping:cushion",
|
recipe = {
|
||||||
recipe = {
|
{"farming:cotton", "group:wool", "farming:cotton"},
|
||||||
{"farming:cotton", "group:wool", "farming:cotton"},
|
{"farming:cotton", "group:wool", "farming:cotton"},
|
||||||
{"farming:cotton", "group:wool", "farming:cotton"},
|
{"farming:cotton", "farming:cotton", "farming:cotton"}
|
||||||
{"farming:cotton", "farming:cotton", "farming:cotton"}
|
}
|
||||||
}
|
})
|
||||||
})
|
|
||||||
end
|
minetest.log("action", "[jumping] loaded.")
|
||||||
|
Reference in New Issue
Block a user