added all the other mods i could find
|
@ -0,0 +1,723 @@
|
|||
-- BobBlocks mod by RabbiBob
|
||||
-- State Changes
|
||||
|
||||
local update_bobblock = function (pos, node)
|
||||
local nodename=""
|
||||
local param2=""
|
||||
--Switch Block State
|
||||
if
|
||||
-- Start Blocks
|
||||
node.name == 'bobblocks:redblock_off' then nodename = 'bobblocks:redblock'
|
||||
elseif node.name == 'bobblocks:redblock' then nodename = 'bobblocks:redblock_off'
|
||||
elseif node.name == 'bobblocks:orangeblock_off' then nodename = 'bobblocks:orangeblock'
|
||||
elseif node.name == 'bobblocks:orangeblock' then nodename = 'bobblocks:orangeblock_off'
|
||||
elseif node.name == 'bobblocks:yellowblock_off' then nodename = 'bobblocks:yellowblock'
|
||||
elseif node.name == 'bobblocks:yellowblock' then nodename = 'bobblocks:yellowblock_off'
|
||||
elseif node.name == 'bobblocks:greenblock_off' then nodename = 'bobblocks:greenblock'
|
||||
elseif node.name == 'bobblocks:greenblock' then nodename = 'bobblocks:greenblock_off'
|
||||
elseif node.name == 'bobblocks:blueblock_off' then nodename = 'bobblocks:blueblock'
|
||||
elseif node.name == 'bobblocks:blueblock' then nodename = 'bobblocks:blueblock_off'
|
||||
elseif node.name == 'bobblocks:indigoblock_off' then nodename = 'bobblocks:indigoblock'
|
||||
elseif node.name == 'bobblocks:indigoblock' then nodename = 'bobblocks:indigoblock_off'
|
||||
elseif node.name == 'bobblocks:violetblock_off' then nodename = 'bobblocks:violetblock'
|
||||
elseif node.name == 'bobblocks:violetblock' then nodename = 'bobblocks:violetblock_off'
|
||||
elseif node.name == 'bobblocks:whiteblock_off' then nodename = 'bobblocks:whiteblock'
|
||||
elseif node.name == 'bobblocks:whiteblock' then nodename = 'bobblocks:whiteblock_off'
|
||||
-- Start Poles
|
||||
elseif node.name == 'bobblocks:redpole_off' then nodename = 'bobblocks:redpole'
|
||||
elseif node.name == 'bobblocks:redpole' then nodename = 'bobblocks:redpole_off'
|
||||
elseif node.name == 'bobblocks:orangepole_off' then nodename = 'bobblocks:orangepole'
|
||||
elseif node.name == 'bobblocks:orangepole' then nodename = 'bobblocks:orangepole_off'
|
||||
elseif node.name == 'bobblocks:yellowpole_off' then nodename = 'bobblocks:yellowpole'
|
||||
elseif node.name == 'bobblocks:yellowpole' then nodename = 'bobblocks:yellowpole_off'
|
||||
elseif node.name == 'bobblocks:greenpole_off' then nodename = 'bobblocks:greenpole'
|
||||
elseif node.name == 'bobblocks:greenpole' then nodename = 'bobblocks:greenpole_off'
|
||||
elseif node.name == 'bobblocks:bluepole_off' then nodename = 'bobblocks:bluepole'
|
||||
elseif node.name == 'bobblocks:bluepole' then nodename = 'bobblocks:bluepole_off'
|
||||
elseif node.name == 'bobblocks:indigopole_off' then nodename = 'bobblocks:indigopole'
|
||||
elseif node.name == 'bobblocks:indigopole' then nodename = 'bobblocks:indigopole_off'
|
||||
elseif node.name == 'bobblocks:violetpole_off' then nodename = 'bobblocks:violetpole'
|
||||
elseif node.name == 'bobblocks:violetpole' then nodename = 'bobblocks:violetpole_off'
|
||||
elseif node.name == 'bobblocks:whitepole_off' then nodename = 'bobblocks:whitepole'
|
||||
elseif node.name == 'bobblocks:whitepole' then nodename = 'bobblocks:whitepole_off'
|
||||
end
|
||||
minetest.env:add_node(pos, {name = nodename})
|
||||
minetest.sound_play("bobblocks_glassblock",
|
||||
{pos = pos, gain = 1.0, max_hear_distance = 32,})
|
||||
end
|
||||
|
||||
|
||||
-- Punch Blocks
|
||||
local on_bobblock_punched = function (pos, node, puncher)
|
||||
if
|
||||
-- Start Blocks
|
||||
node.name == 'bobblocks:redblock_off' or node.name == 'bobblocks:redblock' or
|
||||
node.name == 'bobblocks:orangeblock_off' or node.name == 'bobblocks:orangeblock' or
|
||||
node.name == 'bobblocks:yellowblock_off' or node.name == 'bobblocks:yellowblock' or
|
||||
node.name == 'bobblocks:greenblock_off' or node.name == 'bobblocks:greenblock' or
|
||||
node.name == 'bobblocks:blueblock_off' or node.name == 'bobblocks:blueblock' or
|
||||
node.name == 'bobblocks:indigoblock_off' or node.name == 'bobblocks:indigoblock' or
|
||||
node.name == 'bobblocks:violetblock_off' or node.name == 'bobblocks:violetblock' or
|
||||
node.name == 'bobblocks:whiteblock_off' or node.name == 'bobblocks:whiteblock' or
|
||||
--Start Poles
|
||||
node.name == 'bobblocks:redpole_off' or node.name == 'bobblocks:redpole' or
|
||||
node.name == 'bobblocks:orangepole_off' or node.name == 'bobblocks:orangepole' or
|
||||
node.name == 'bobblocks:yellowpole_off' or node.name == 'bobblocks:yellowpole' or
|
||||
node.name == 'bobblocks:greenpole_off' or node.name == 'bobblocks:greenpole' or
|
||||
node.name == 'bobblocks:bluepole_off' or node.name == 'bobblocks:bluepole' or
|
||||
node.name == 'bobblocks:indigopole_off' or node.name == 'bobblocks:indigopole' or
|
||||
node.name == 'bobblocks:violetpole_off' or node.name == 'bobblocks:violetpole' or
|
||||
node.name == 'bobblocks:whitepole_off' or node.name == 'bobblocks:whitepole'
|
||||
then
|
||||
update_bobblock(pos, node)
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_on_punchnode(on_bobblock_punched)
|
||||
|
||||
-- Nodes
|
||||
-- Misc Node
|
||||
|
||||
minetest.register_node("bobblocks:btm", {
|
||||
description = "Bobs TransMorgifier v5",
|
||||
tiles = {"bobblocks_btm_sides.png", "bobblocks_btm_sides.png", "bobblocks_btm_sides.png",
|
||||
"bobblocks_btm_sides.png", "bobblocks_btm_sides.png", "bobblocks_btm.png"},
|
||||
inventory_image = "bobblocks_btm.png",
|
||||
paramtype2 = "facedir",
|
||||
material = minetest.digprop_dirtlike(1.0),
|
||||
legacy_facedir_simple = true,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
})
|
||||
|
||||
|
||||
-- Start Block Nodes
|
||||
minetest.register_node("bobblocks:redblock", {
|
||||
description = "Red Block",
|
||||
drawtype = "glasslike",
|
||||
tiles = {"bobblocks_redblock.png"},
|
||||
inventory_image = minetest.inventorycube("bobblocks_redblock.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-0,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:redblock_off", {
|
||||
description = "Red Block",
|
||||
tiles = {"bobblocks_redblock.png"},
|
||||
is_ground_content = true,
|
||||
alpha = WATER_ALPHA,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
drop = 'bobblocks:redblock',
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:orangeblock", {
|
||||
description = "Orange Block",
|
||||
drawtype = "glasslike",
|
||||
tiles = {"bobblocks_orangeblock.png"},
|
||||
inventory_image = minetest.inventorycube("bobblocks_orangeblock.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-0,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:orangeblock_off", {
|
||||
description = "Orange Block",
|
||||
tiles = {"bobblocks_orangeblock.png"},
|
||||
is_ground_content = true,
|
||||
alpha = WATER_ALPHA,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
drop = 'bobblocks:orangeblock',
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("bobblocks:yellowblock", {
|
||||
description = "Yellow Block",
|
||||
drawtype = "glasslike",
|
||||
tiles = {"bobblocks_yellowblock.png"},
|
||||
inventory_image = minetest.inventorycube("bobblocks_yellowblock.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-0,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:yellowblock_off", {
|
||||
description = "yellow Block",
|
||||
tiles = {"bobblocks_yellowblock.png"},
|
||||
is_ground_content = true,
|
||||
alpha = WATER_ALPHA,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
drop = 'bobblocks:yellowblock',
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:greenblock", {
|
||||
description = "Green Block",
|
||||
drawtype = "glasslike",
|
||||
tiles = {"bobblocks_greenblock.png"},
|
||||
inventory_image = minetest.inventorycube("bobblocks_greenblock.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-0,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:greenblock_off", {
|
||||
description = "green Block",
|
||||
tiles = {"bobblocks_greenblock.png"},
|
||||
is_ground_content = true,
|
||||
alpha = WATER_ALPHA,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
drop = 'bobblocks:greenblock',
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:blueblock", {
|
||||
description = "Blue Block",
|
||||
drawtype = "glasslike",
|
||||
tiles = {"bobblocks_blueblock.png"},
|
||||
inventory_image = minetest.inventorycube("bobblocks_blueblock.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-0,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:blueblock_off", {
|
||||
description = "Blue Block",
|
||||
tiles = {"bobblocks_blueblock.png"},
|
||||
is_ground_content = true,
|
||||
alpha = WATER_ALPHA,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
drop = 'bobblocks:blueblock',
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:indigoblock", {
|
||||
description = "Indigo Block",
|
||||
drawtype = "glasslike",
|
||||
tiles = {"bobblocks_indigoblock.png"},
|
||||
inventory_image = minetest.inventorycube("bobblocks_indigoblock.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-0,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:indigoblock_off", {
|
||||
description = "indigo Block",
|
||||
tiles = {"bobblocks_indigoblock.png"},
|
||||
is_ground_content = true,
|
||||
alpha = WATER_ALPHA,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
drop = 'bobblocks:indigoblock',
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:violetblock", {
|
||||
description = "Violet Block",
|
||||
drawtype = "glasslike",
|
||||
tiles = {"bobblocks_violetblock.png"},
|
||||
inventory_image = minetest.inventorycube("bobblocks_violetblock.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-0,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:violetblock_off", {
|
||||
description = "violet Block",
|
||||
tiles = {"bobblocks_violetblock.png"},
|
||||
is_ground_content = true,
|
||||
alpha = WATER_ALPHA,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
drop = 'bobblocks:violetblock',
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:whiteblock", {
|
||||
description = "White Block",
|
||||
drawtype = "glasslike",
|
||||
tiles = {"bobblocks_whiteblock.png"},
|
||||
inventory_image = minetest.inventorycube("bobblocks_whiteblock.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-0,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:whiteblock_off", {
|
||||
description = "white Block",
|
||||
tiles = {"bobblocks_whiteblock.png"},
|
||||
is_ground_content = true,
|
||||
alpha = WATER_ALPHA,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
drop = 'bobblocks:whiteblock',
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:greyblock", {
|
||||
description = "Grey Block",
|
||||
drawtype = "glasslike",
|
||||
tiles = {"bobblocks_greyblock.png"},
|
||||
inventory_image = minetest.inventorycube("bobblocks_greyblock.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
})
|
||||
|
||||
-- Block Poles
|
||||
minetest.register_node("bobblocks:redpole", {
|
||||
description = "Red Pole",
|
||||
drawtype = "fencelike",
|
||||
tiles = {"bobblocks_redblock.png"},
|
||||
inventory_image = ("bobblocks_invredpole.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-0,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:redpole_off", {
|
||||
description = "Red Pole",
|
||||
drawtype = "fencelike",
|
||||
tiles = {"bobblocks_redblock.png"},
|
||||
inventory_image = ("bobblocks_invredpole.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-10,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
drop = 'bobblocks:redpole',
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:orangepole", {
|
||||
description = "Orange Pole",
|
||||
drawtype = "fencelike",
|
||||
tiles = {"bobblocks_orangeblock.png"},
|
||||
inventory_image = ("bobblocks_invorangepole.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-0,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:orangepole_off", {
|
||||
description = "Orange Pole",
|
||||
drawtype = "fencelike",
|
||||
tiles = {"bobblocks_orangeblock.png"},
|
||||
inventory_image = ("bobblocks_invorangepole.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-10,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
drop = 'bobblocks:orangepole',
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:yellowpole", {
|
||||
description = "Yellow Pole",
|
||||
drawtype = "fencelike",
|
||||
tiles = {"bobblocks_yellowblock.png"},
|
||||
inventory_image = ("bobblocks_invyellowpole.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-0,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:yellowpole_off", {
|
||||
description = "Yellow Pole",
|
||||
drawtype = "fencelike",
|
||||
tiles = {"bobblocks_yellowblock.png"},
|
||||
inventory_image = ("bobblocks_invyellowpole.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-10,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
drop = 'bobblocks:yellowpole',
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:greenpole", {
|
||||
description = "Green Pole",
|
||||
drawtype = "fencelike",
|
||||
tiles = {"bobblocks_greenblock.png"},
|
||||
inventory_image = ("bobblocks_invgreenpole.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-0,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:greenpole_off", {
|
||||
description = "Green Pole",
|
||||
drawtype = "fencelike",
|
||||
tiles = {"bobblocks_greenblock.png"},
|
||||
inventory_image = ("bobblocks_invgreenpole.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-10,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
drop = 'bobblocks:greenpole',
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:bluepole", {
|
||||
description = "Blue Pole",
|
||||
drawtype = "fencelike",
|
||||
tiles = {"bobblocks_blueblock.png"},
|
||||
inventory_image = ("bobblocks_invbluepole.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-0,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:bluepole_off", {
|
||||
description = "Blue Pole",
|
||||
drawtype = "fencelike",
|
||||
tiles = {"bobblocks_blueblock.png"},
|
||||
inventory_image = ("bobblocks_invbluepole.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-10,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
drop = 'bobblocks:bluepole',
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:indigopole", {
|
||||
description = "Indigo Pole",
|
||||
drawtype = "fencelike",
|
||||
tiles = {"bobblocks_indigoblock.png"},
|
||||
inventory_image = ("bobblocks_invindigopole.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-0,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:indigopole_off", {
|
||||
description = "Indigo Pole",
|
||||
drawtype = "fencelike",
|
||||
tiles = {"bobblocks_indigoblock.png"},
|
||||
inventory_image = ("bobblocks_invindigopole.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-10,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
drop = 'bobblocks:indigopole',
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:violetpole", {
|
||||
description = "Violet Pole",
|
||||
drawtype = "fencelike",
|
||||
tiles = {"bobblocks_violetblock.png"},
|
||||
inventory_image = ("bobblocks_invvioletpole.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-0,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:violetpole_off", {
|
||||
description = "Violet Pole",
|
||||
drawtype = "fencelike",
|
||||
tiles = {"bobblocks_violetblock.png"},
|
||||
inventory_image = ("bobblocks_invvioletpole.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-10,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
drop = 'bobblocks:violetpole',
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:whitepole", {
|
||||
description = "White Pole",
|
||||
drawtype = "fencelike",
|
||||
tiles = {"bobblocks_whiteblock.png"},
|
||||
inventory_image = ("bobblocks_invwhitepole.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-0,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:whitepole_off", {
|
||||
description = "White Pole",
|
||||
drawtype = "fencelike",
|
||||
tiles = {"bobblocks_whiteblock.png"},
|
||||
inventory_image = ("bobblocks_invwhitepole.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-10,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
drop = 'bobblocks:whitepole',
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:greypole", {
|
||||
description = "Grey Pole",
|
||||
drawtype = "fencelike",
|
||||
tiles = {"bobblocks_greyblock.png"},
|
||||
inventory_image = ("bobblocks_invgreypole.png"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
--light_source = LIGHT_MAX-0,
|
||||
})
|
||||
|
||||
|
||||
|
||||
-- Crafts
|
||||
-- BTM
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "bobblocks:btm" 1',
|
||||
recipe = {
|
||||
{'node "default:glass" 1', 'node "default:torch" 1', 'node "default:leaves" 1',
|
||||
'node "default:mese" 1','node "default:rat" 1'},
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "bobblocks:greyblock" 2',
|
||||
recipe = {
|
||||
{'node "default:glass" 1', 'node "default:torch" 1', 'node "default:cobble" 1'},
|
||||
},
|
||||
})
|
||||
|
||||
-- Red / Yellow / Blue / White
|
||||
-- Red / Yellow -> Orange
|
||||
-- Red / Blue -> Violet
|
||||
-- Blue / Yellow -> Green
|
||||
-- Red / Yellow / White -> Indigo
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "bobblocks:redblock" 2',
|
||||
recipe = {
|
||||
{'node "default:glass" 1', 'node "default:torch" 1', 'node "default:brick" 1'},
|
||||
},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "bobblocks:yellowblock" 2',
|
||||
recipe = {
|
||||
{'node "default:glass" 1', 'node "default:torch" 1', 'node "default:sand" 1'},
|
||||
},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "bobblocks:blueblock" 2',
|
||||
recipe = {
|
||||
{'node "default:glass" 1', 'node "default:torch" 1', 'node "default:gravel" 1'},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "bobblocks:whiteblock" 2',
|
||||
recipe = {
|
||||
{'node "default:glass" 1', 'node "default:torch" 1', 'node "default:dirt" 1'},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "bobblocks:orangeblock" 2',
|
||||
recipe = {
|
||||
{'node "bobblocks:redblock" 1', 'node "bobblocks:yellowblock" 1'},
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "bobblocks:violetblock" 2',
|
||||
recipe = {
|
||||
{'node "bobblocks:redblock" 1', 'node "bobblocks:blueblock" 1'},
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "bobblocks:greenblock" 2',
|
||||
recipe = {
|
||||
{'node "bobblocks:blueblock" 1', 'node "bobblocks:yellowblock" 1'},
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "bobblocks:indigoblock" 3',
|
||||
recipe = {
|
||||
{'node "bobblocks:redblock" 1', 'node "bobblocks:blueblock" 1', 'node "bobblocks:whiteblock" 1'},
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
-- Poles
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "bobblocks:redpole" 1',
|
||||
recipe = {
|
||||
{'node "bobblocks:redblock" 1', 'node "default:stick" 1'},
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "bobblocks:yellowpole" 1',
|
||||
recipe = {
|
||||
{'node "bobblocks:yellowblock" 1', 'node "default:stick" 1'},
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "bobblocks:bluepole" 1',
|
||||
recipe = {
|
||||
{'node "bobblocks:blueblock" 1', 'node "default:stick" 1'},
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "bobblocks:whitepole" 1',
|
||||
recipe = {
|
||||
{'node "bobblocks:whiteblock" 1', 'node "default:stick" 1'},
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "bobblocks:orangepole" 1',
|
||||
recipe = {
|
||||
{'node "bobblocks:orangeblock" 1', 'node "default:stick" 1'},
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "bobblocks:violetpole" 1',
|
||||
recipe = {
|
||||
{'node "bobblocks:violetblock" 1', 'node "default:stick" 1'},
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "bobblocks:greenpole" 1',
|
||||
recipe = {
|
||||
{'node "bobblocks:greenblock" 1', 'node "default:stick" 1'},
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "bobblocks:indigopole" 1',
|
||||
recipe = {
|
||||
{'node "bobblocks:indigoblock" 1', 'node "default:stick" 1'},
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "bobblocks:greypole" 1',
|
||||
recipe = {
|
||||
{'node "bobblocks:greyblock" 1', 'node "default:stick" 1'},
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
-- MESECON
|
||||
-- Add jeija to bobblocks\default.txt and paste the below in at the bottom of bobblocks\blocks.lua
|
||||
|
||||
mesecon:register_on_signal_on(function (pos, node)
|
||||
if
|
||||
node.name == 'bobblocks:redblock_off' or
|
||||
node.name == 'bobblocks:orangeblock_off' or
|
||||
node.name == 'bobblocks:yellowblock_off' or
|
||||
node.name == 'bobblocks:greenblock_off' or
|
||||
node.name == 'bobblocks:blueblock_off' or
|
||||
node.name == 'bobblocks:indigoblock_off' or
|
||||
node.name == 'bobblocks:violetblock_off' or
|
||||
node.name == 'bobblocks:whiteblock_off' or
|
||||
node.name == 'bobblocks:redpole_off' or
|
||||
node.name == 'bobblocks:orangepole_off' or
|
||||
node.name == 'bobblocks:yellowpole_off' or
|
||||
node.name == 'bobblocks:greenpole_off' or
|
||||
node.name == 'bobblocks:bluepole_off' or
|
||||
node.name == 'bobblocks:indigopole_off' or
|
||||
node.name == 'bobblocks:violetpole_off' or
|
||||
node.name == 'bobblocks:whitepole_off'
|
||||
then
|
||||
update_bobblock (pos, node, state)
|
||||
end
|
||||
end)
|
||||
|
||||
mesecon:register_on_signal_off(function (pos, node)
|
||||
if
|
||||
node.name == 'bobblocks:redblock' or
|
||||
node.name == 'bobblocks:orangeblock' or
|
||||
node.name == 'bobblocks:yellowblock' or
|
||||
node.name == 'bobblocks:greenblock' or
|
||||
node.name == 'bobblocks:blueblock' or
|
||||
node.name == 'bobblocks:indigoblock' or
|
||||
node.name == 'bobblocks:violetblock' or
|
||||
node.name == 'bobblocks:whiteblock' or
|
||||
node.name == 'bobblocks:redpole' or
|
||||
node.name == 'bobblocks:orangepole' or
|
||||
node.name == 'bobblocks:yellowpole' or
|
||||
node.name == 'bobblocks:greenpole' or
|
||||
node.name == 'bobblocks:bluepole' or
|
||||
node.name == 'bobblocks:indigopole' or
|
||||
node.name == 'bobblocks:violetpole' or
|
||||
node.name == 'bobblocks:whitepole'
|
||||
then
|
||||
update_bobblock (pos, node, state)
|
||||
end
|
||||
end)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
default
|
||||
mesecons
|
|
@ -0,0 +1,87 @@
|
|||
local is_healthpack = function(node)
|
||||
if node.name == 'bobblocks:health_off' or node.name == 'health_on' then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local update_healthpack = function (pos, node)
|
||||
local nodename=""
|
||||
local param2=""
|
||||
--Switch HealthPack State
|
||||
if node.name == 'bobblocks:health_off' then
|
||||
nodename = 'bobblocks:health_on'
|
||||
elseif node.name == 'bobblocks:health_on' then
|
||||
nodename = 'bobblocks:health_off'
|
||||
end
|
||||
minetest.env:add_node(pos, {name = nodename})
|
||||
end
|
||||
|
||||
local toggle_healthpack = function (pos, node)
|
||||
if not is_healthgate(node) then return end
|
||||
update_healthpack (pos, node, state)
|
||||
end
|
||||
|
||||
local on_healthpack_punched = function (pos, node, puncher)
|
||||
if node.name == 'bobblocks:health_off' or node.name == 'bobblocks:health_on' then
|
||||
update_healthpack(pos, node)
|
||||
end
|
||||
end
|
||||
|
||||
-- Healing Node
|
||||
|
||||
minetest.register_node("bobblocks:health_off", {
|
||||
description = "Health Pack 1",
|
||||
tiles = {"bobblocks_health_off.png"},
|
||||
inventory_image = "bobblocks_health_off.png",
|
||||
paramtype2 = "facedir",
|
||||
legacy_facedir_simple = true,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
is_ground_content = true,
|
||||
walkable = false,
|
||||
climbable = false,
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:health_on", {
|
||||
description = "Health Pack 1",
|
||||
tiles = {"bobblocks_health_on.png"},
|
||||
paramtype2 = "facedir",
|
||||
legacy_facedir_simple = true,
|
||||
light_source = LIGHT_MAX-0,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
is_ground_content = true,
|
||||
walkable = false,
|
||||
climbable = false,
|
||||
drop = "bobblocks:health_off",
|
||||
})
|
||||
|
||||
|
||||
minetest.register_abm(
|
||||
{nodenames = {"bobblocks:health_on"},
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
||||
for k, obj in pairs(objs) do
|
||||
minetest.sound_play("bobblocks_health",
|
||||
{pos = pos, gain = 1.0, max_hear_distance = 32,})
|
||||
obj:set_hp(obj:get_hp()+10) -- give 10HP
|
||||
minetest.env:remove_node(pos) -- remove the node after use
|
||||
end
|
||||
end,
|
||||
|
||||
})
|
||||
|
||||
--- Health
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "bobblocks:health_off" 1',
|
||||
recipe = {
|
||||
{'node "default:dirt" 1', 'node "default:paper" 1', 'node "default:apple" 2'},
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_on_punchnode(on_healthpack_punched)
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
dofile(minetest.get_modpath("bobblocks") .. "/blocks.lua")
|
||||
dofile(minetest.get_modpath("bobblocks") .. "/health.lua")
|
||||
dofile(minetest.get_modpath("bobblocks") .. "/trap.lua")
|
||||
|
||||
print("[BobBlocks By minetest@rabbibob.com] Version 0.0.6 loaded!")
|
|
@ -0,0 +1,51 @@
|
|||
-- BobBlocks v0.0.6
|
||||
-- (Minetest 0.4 mod Compatible 20120408)
|
||||
-- http://c55.me/minetest/forum/viewtopic.php?id=1274
|
||||
------------------------------------------------------------------
|
||||
------------------------------------------------------------------
|
||||
-- Requirements: Jeija or Mesecons --
|
||||
-- c55.me/minetest/forum/viewtopic.php?id=628 --
|
||||
-- You must edit depends.txt and add either jeija or --
|
||||
-- mesecons depending on whether or not you're using --
|
||||
-- jejia v.05 or mesecons pulled from GitHub --
|
||||
------------------------------------------------------------------
|
||||
------------------------------------------------------------------
|
||||
-- Colored Lit Blocks
|
||||
---- Default state = Solid lit block
|
||||
---- Secondary state (punch) = transparent unlit block
|
||||
---- Mesecons activation
|
||||
-- Colored Lit Poles
|
||||
---- Default state = Solid lit block
|
||||
---- Secondary state (punch) = unlit block
|
||||
---- Mesecons activation
|
||||
-- Health Kit
|
||||
---- Default state = health kit inactive
|
||||
---- Secondary state (punch) = health kit active +10HP when walked through
|
||||
-- Trap
|
||||
---- Default Grass (walkable off)
|
||||
---- Spike Minor (1HP per hit)
|
||||
------ Spikes can be 'set' and activated when walked over
|
||||
---- Spike Major (100HP per hit)
|
||||
------ Spikes can be 'set' and activated when walked over
|
||||
|
||||
# Attribution
|
||||
# Unless otherwise noted, all graphics & sounds
|
||||
# created by Rabbi Bob
|
||||
# Licensed under the GPLv2/later
|
||||
|
||||
# [GRAPHICS]
|
||||
# minor & major spikes by Death Dealer
|
||||
# License: WTFPL
|
||||
# http://minetest.net/forum/viewtopic.php?id=1582
|
||||
|
||||
# [SOUNDS]
|
||||
# bobblocks_glass
|
||||
# Author: Ch0cchi
|
||||
# http://www.freesound.org/people/Ch0cchi/sounds/15285/
|
||||
# Edited by rabbibob
|
||||
# bobblocks_trap_fall & bobblocks_trap_fall_major
|
||||
# Author: Rock Savage
|
||||
# http://www.freesound.org/people/Rock%20Savage/sounds/65924/#
|
||||
# Edited by rabbibob
|
||||
# bobblocks_health
|
||||
# http://hamsterrepublic.com/ohrrpgce/Free_Sound_Effects.html
|
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
|
@ -0,0 +1,183 @@
|
|||
-- State Changes
|
||||
|
||||
local update_bobtrap = function (pos, node)
|
||||
local nodename=""
|
||||
local param2=""
|
||||
--Switch Trap State
|
||||
if
|
||||
-- Swap Traps
|
||||
node.name == 'bobblocks:trap_spike' then nodename = 'bobblocks:trap_spike_set'
|
||||
elseif node.name == 'bobblocks:trap_spike_set' then nodename = 'bobblocks:trap_spike'
|
||||
elseif node.name == 'bobblocks:trap_spike_major' then nodename = 'bobblocks:trap_spike_major_set'
|
||||
elseif node.name == 'bobblocks:trap_spike_major_set' then nodename = 'bobblocks:trap_spike_major'
|
||||
end
|
||||
minetest.env:add_node(pos, {name = nodename})
|
||||
end
|
||||
|
||||
-- Punch Traps
|
||||
local on_bobtrap_punched = function (pos, node, puncher)
|
||||
if
|
||||
-- Start Traps
|
||||
node.name == 'bobblocks:trap_spike' or node.name == 'bobblocks:trap_spike_set' or
|
||||
node.name == 'bobblocks:trap_spike_major' or node.name == 'bobblocks:trap_spike_major_set'
|
||||
then
|
||||
update_bobtrap(pos, node)
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_on_punchnode(on_bobtrap_punched)
|
||||
|
||||
|
||||
--ABM (Spring The Traps)
|
||||
|
||||
minetest.register_abm(
|
||||
{nodenames = {"bobblocks:trap_spike_set"},
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
||||
for k, obj in pairs(objs) do
|
||||
|
||||
update_bobtrap(pos, node)
|
||||
end
|
||||
end,
|
||||
|
||||
})
|
||||
|
||||
minetest.register_abm(
|
||||
{nodenames = {"bobblocks:trap_spike_major_set"},
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
||||
for k, obj in pairs(objs) do
|
||||
|
||||
update_bobtrap(pos, node)
|
||||
end
|
||||
end,
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
-- Nodes
|
||||
minetest.register_node("bobblocks:trap_grass", {
|
||||
description = "Trap Grass",
|
||||
tiles = {"default_grass.png"},
|
||||
paramtype2 = "facedir",
|
||||
legacy_facedir_simple = true,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
is_ground_content = false,
|
||||
walkable = false,
|
||||
climbable = false,
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:trap_spike", {
|
||||
description = "Trap Spike Minor",
|
||||
drawtype = "plantlike",
|
||||
visual_scale = 1,
|
||||
tiles = {"bobblocks_minorspike.png"},
|
||||
inventory_image = ("bobblocks_minorspike.png"),
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
groups = {cracky=3,melty=3},
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:trap_spike_set", {
|
||||
description = "Trap Spike Minor",
|
||||
drawtype = "raillike",
|
||||
visual_scale = 1,
|
||||
tiles = {"bobblocks_trap_set.png"},
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
groups = {cracky=3,melty=3},
|
||||
drop = 'bobblocks:trap_spike',
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("bobblocks:trap_spike_major", {
|
||||
description = "Trap Spike Minor",
|
||||
drawtype = "plantlike",
|
||||
visual_scale = 1,
|
||||
tiles = {"bobblocks_majorspike.png"},
|
||||
inventory_image = ("bobblocks_majorspike.png"),
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
groups = {cracky=2,melty=2},
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:trap_spike_major_set", {
|
||||
description = "Trap Spike Major",
|
||||
drawtype = "raillike",
|
||||
visual_scale = 1,
|
||||
tiles = {"bobblocks_trap_set.png"},
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
groups = {cracky=3,melty=3},
|
||||
drop = 'bobblocks:trap_spike',
|
||||
})
|
||||
|
||||
|
||||
-- Crafting
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'bobblocks:trap_spike',
|
||||
recipe = {
|
||||
{'', '', ''},
|
||||
{'', 'default:cobble', ''},
|
||||
{'default:cobble', 'default:apple', 'default:cobble'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'bobblocks:trap_spike_major',
|
||||
recipe = {
|
||||
{'', 'default:cobble', ''},
|
||||
{'', 'default:apple', ''},
|
||||
{'default:cobble', 'default:apple', 'default:cobble'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'bobblocks:trap_grass',
|
||||
recipe = {
|
||||
{'', '', ''},
|
||||
{'', 'default:dirt', ''},
|
||||
{'', 'default:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
-- ABM
|
||||
minetest.register_abm(
|
||||
{nodenames = {"bobblocks:trap_spike"},
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
||||
for k, obj in pairs(objs) do
|
||||
obj:set_hp(obj:get_hp()-1)
|
||||
minetest.sound_play("bobblocks_trap_fall",
|
||||
{pos = pos, gain = 1.0, max_hear_distance = 3,})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_abm(
|
||||
{nodenames = {"bobblocks:trap_spike_major"},
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
||||
for k, obj in pairs(objs) do
|
||||
obj:set_hp(obj:get_hp()-100)
|
||||
minetest.sound_play("bobblocks_trap_fall",
|
||||
{pos = pos, gain = 1.0, max_hear_distance = 3,})
|
||||
end
|
||||
end,
|
||||
|
||||
})
|
|
@ -0,0 +1,201 @@
|
|||
---
|
||||
--Bones
|
||||
--Copyright (C) 2012 Bad_Command
|
||||
--
|
||||
--This library is free software; you can redistribute it and/or
|
||||
--modify it under the terms of the GNU Lesser General Public
|
||||
--License as published by the Free Software Foundation; either
|
||||
--version 2.1 of the License, or (at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public
|
||||
--License along with this library; if not, write to the Free Software
|
||||
--Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
----
|
||||
|
||||
bones.replaceable_node_types = {
|
||||
"default:lava_source",
|
||||
"default:lava_flowing",
|
||||
"default:water_source",
|
||||
"default:water_flowing",
|
||||
"air"
|
||||
}
|
||||
|
||||
bones.inventory_take = function(pos, listname, index, count, player)
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
if not bones.privilege(meta, player) then
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" tried to access bones belonging to "..
|
||||
meta:get_string("owner").." at "..
|
||||
minetest.pos_to_string(pos))
|
||||
return
|
||||
end
|
||||
local fresh = meta:get_int("fresh") or 1
|
||||
if fresh > 0 then
|
||||
fresh = "fresh"
|
||||
else
|
||||
fresh = "old"
|
||||
end
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" picks from "..meta:get_string("owner").."'s "..fresh.." bones at "..minetest.pos_to_string(pos))
|
||||
return minetest.node_metadata_inventory_take_allow_all(
|
||||
pos, listname, index, count, player)
|
||||
end
|
||||
|
||||
bones.privilege=function(meta, player)
|
||||
local name = player:get_player_name()
|
||||
local privs = minetest.get_player_privs(name)
|
||||
if not privs["interact"] then
|
||||
return false
|
||||
end
|
||||
local fresh = meta:get_int("fresh") or 0
|
||||
if fresh > 0 and name ~= meta:get_string("owner") and not privs["server"] then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
bones.action=function(pos, node, active_object_count, active_object_count_wider)
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
local fresh = meta:get_int("fresh") or 0
|
||||
local bonetime = meta:get_float("bonetime") or 0
|
||||
if fresh > 0 and worldtime_get() - bonetime > bones.age_after then
|
||||
local name = meta:get_string("owner") or ""
|
||||
meta:set_string("infotext", name .. "'s old bones")
|
||||
meta:set_int("fresh", -1)
|
||||
end
|
||||
end
|
||||
|
||||
bones.create = function(player, pos)
|
||||
local name = player:get_player_name()
|
||||
minetest.env:set_node(pos, {name="bones:bones", param1=0, param2=0})
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
meta:set_string("formspec",
|
||||
"invsize[8,9;]"..
|
||||
"list[current_name;main;0,0;8,4;]"..
|
||||
"list[current_player;main;0,5;8,4;]")
|
||||
meta:set_string("infotext", name .. "'s fresh bones")
|
||||
meta:set_string("owner", name)
|
||||
meta:set_float("bonetime", worldtime_get())
|
||||
meta:set_int("fresh", 1)
|
||||
|
||||
-- test to see if node was created
|
||||
local node = minetest.env:get_node_or_nil(pos)
|
||||
if node == nil or node.name ~= "bones:bones" then
|
||||
minetest.log("error", 'Bones: Failed to create bones node for '..name)
|
||||
return false
|
||||
end
|
||||
|
||||
local bones_inv = meta:get_inventory()
|
||||
bones_inv:set_size("main", 8*4)
|
||||
local player_inv = player:get_inventory()
|
||||
if ( player_inv == nil ) then
|
||||
minetest.log("error", 'Bones: Unable to get player '..name..' inventory')
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
for i=1,32 do
|
||||
local stack = player_inv:get_stack("main", i)
|
||||
if stack ~= nil and not stack:is_empty() then
|
||||
bones_inv:set_stack("main", i, stack:to_table())
|
||||
player_inv:set_stack("main", i, nil)
|
||||
end
|
||||
end
|
||||
for i=1,9 do
|
||||
local stack = player_inv:get_stack("craft", i)
|
||||
if stack ~= nil and not stack:is_empty() then
|
||||
local leftover = bones_inv:add_item("main", stack)
|
||||
if leftover ~= nil and not leftover:is_empty() then
|
||||
minetest.env:add_item({
|
||||
x=pos.x,
|
||||
y=pos.y + 1.1,
|
||||
z=pos.z}, leftover)
|
||||
end
|
||||
player_inv:set_stack("craft", i, nil)
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
bones.settle_type = function(nodename)
|
||||
for i=1,#bones.replaceable_node_types do
|
||||
if nodename == bones.replaceable_node_types[i] then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
bones.settle_bones = function(pos)
|
||||
local nextpos = pos;
|
||||
local node
|
||||
|
||||
-- find ground beneath player
|
||||
repeat
|
||||
pos = nextpos
|
||||
nextpos = {x=pos.x, y=pos.y-1, z=pos.z}
|
||||
node = minetest.env:get_node_or_nil(nextpos)
|
||||
until node == nil or not bones.settle_type(node.name)
|
||||
|
||||
node = minetest.env:get_node_or_nil(pos)
|
||||
|
||||
-- if the player is inside rock or something
|
||||
if node == nil or not bones.settle_type(node.name) then
|
||||
-- find nearby empty node
|
||||
pos = minetest.env:find_node_near(pos, 3, bones.replaceable_node_types)
|
||||
end
|
||||
|
||||
-- if nothing nearby is empty
|
||||
if pos == nil then
|
||||
return nil
|
||||
end
|
||||
|
||||
return pos;--{x=math.floor(pos.x*10)/10, y=math.floor(pos.y*10)/10, z=math.floor(pos.z*10)/10}
|
||||
end
|
||||
|
||||
bones.pos_to_string = function(pos)
|
||||
return math.floor(pos.x + 0.5) .. "," .. math.floor(pos.y+0.5) .. "," .. math.floor(pos.z+0.5)
|
||||
end
|
||||
|
||||
bones.on_dieplayer = function(player)
|
||||
if player == nil then
|
||||
minetest.log("error", 'Unknown player died (player = nil)')
|
||||
return
|
||||
end
|
||||
|
||||
local name = player:get_player_name()
|
||||
local privs = minetest.get_player_privs(name)
|
||||
local inv = player:get_inventory()
|
||||
|
||||
if not privs["interact"] or (inv:is_empty("main") and inv:is_empty("craft")) then
|
||||
return
|
||||
end
|
||||
|
||||
local playerpos = player:getpos()
|
||||
playerpos = {
|
||||
x=math.floor(playerpos.x+0.5),
|
||||
y=math.floor(playerpos.y+0.5),
|
||||
z=math.floor(playerpos.z+0.5)
|
||||
}
|
||||
local bonepos = bones.settle_bones(playerpos);
|
||||
if bonepos == nil then
|
||||
minetest.log("action", player:get_player_name().." dies at "..minetest.pos_to_string(playerpos)..' without dropping gear.')
|
||||
minetest.chat_send_player(name, 'Bones: There was no room to drop your bones. You get to keep your gear.')
|
||||
return
|
||||
else
|
||||
if bones.create(player, bonepos) then
|
||||
minetest.log("action", player:get_player_name().." dies at "..minetest.pos_to_string(playerpos)..', gear dropped at '..minetest.pos_to_string(bonepos))
|
||||
minetest.chat_send_player(name,
|
||||
'Bones: Your bones were left at '..bones.pos_to_string(bonepos)..
|
||||
'. Go there to find your gear. Bones stay fresh for '..
|
||||
(math.floor(bones.age_after/360+0.5)/10)..'hrs.')
|
||||
else
|
||||
minetest.chat_send_player(name, 'Bones: Lucky you! You get to respawn with your bones.')
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
--Bones Configuration File
|
||||
--Copyright (C) 2012 Bad_Command
|
||||
--
|
||||
--This library is free software; you can redistribute it and/or
|
||||
--modify it under the terms of the GNU Lesser General Public
|
||||
--License as published by the Free Software Foundation; either
|
||||
--version 2.1 of the License, or (at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public
|
||||
--License along with this library; if not, write to the Free Software
|
||||
--Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
----
|
||||
|
||||
-- Config option: Bones become 'old' after this interval, in seconds.
|
||||
-- Default: 2 hours (there are 3600 seconds in an hour.)
|
||||
bones.age_after = 2 * 3600
|
||||
|
|
@ -0,0 +1 @@
|
|||
worldtime
|
|
@ -0,0 +1,64 @@
|
|||
---
|
||||
--Bones 1.01
|
||||
--Copyright (C) 2012 Bad_Command
|
||||
--
|
||||
--This library is free software; you can redistribute it and/or
|
||||
--modify it under the terms of the GNU Lesser General Public
|
||||
--License as published by the Free Software Foundation; either
|
||||
--version 2.1 of the License, or (at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public
|
||||
--License along with this library; if not, write to the Free Software
|
||||
--Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
----
|
||||
|
||||
bones = {}
|
||||
bones.version = 1.01
|
||||
|
||||
-- config.lua contains configuration parameters
|
||||
dofile(minetest.get_modpath("bones").."/config.lua")
|
||||
-- bones.lua contains the code
|
||||
dofile(minetest.get_modpath("bones").."/bones.lua")
|
||||
|
||||
minetest.register_node("bones:bones", {
|
||||
description = "Old Bones",
|
||||
tiles ={"bones_top.png", "bones_bottom.png", "bones_side.png",
|
||||
"bones_side.png", "bones_rear.png", "bones_front.png"},
|
||||
paramtype2 = "facedir",
|
||||
groups = {crumbly=2},
|
||||
paramtype = "light",
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.45},
|
||||
}),
|
||||
after_place_node = function(pos, placer)
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
meta:set_string("owner", "")
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.env:get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv == nil or inv:is_empty("main")
|
||||
end,
|
||||
on_metadata_inventory_move = function(pos, from_list, from_index,
|
||||
to_list, to_index, count, player)
|
||||
end,
|
||||
on_metadata_inventory_offer = function(pos, listname, index, stack, player)
|
||||
return stack
|
||||
end,
|
||||
on_metadata_inventory_take = bones.inventory_take,
|
||||
})
|
||||
|
||||
minetest.register_abm(
|
||||
{nodenames = {"bones:bones"},
|
||||
interval = 10.0,
|
||||
chance = 1,
|
||||
action = bones.action
|
||||
})
|
||||
|
||||
minetest.register_on_dieplayer(bones.on_dieplayer)
|
||||
|
|
@ -0,0 +1,502 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
After Width: | Height: | Size: 382 B |
After Width: | Height: | Size: 441 B |
After Width: | Height: | Size: 437 B |
After Width: | Height: | Size: 412 B |
After Width: | Height: | Size: 410 B |
|
@ -0,0 +1,72 @@
|
|||
|
||||
-- ***********************************************************************************
|
||||
-- go **************************************************
|
||||
-- ***********************************************************************************
|
||||
local write_gofile = function()
|
||||
local output = '' -- WRITE CHANGES TO FILE
|
||||
for name, coords in pairs(GONETWORK) do output = output..name..':'..coords.x..','..coords.y..','..coords.z..';' end
|
||||
local f = io.open(minetest.get_worldpath()..'/bookmarks.go', "w")
|
||||
f:write(output)
|
||||
io.close(f)
|
||||
end
|
||||
|
||||
|
||||
GONETWORK = {}
|
||||
local gonfile = io.open(minetest.get_worldpath()..'/bookmarks.go', "r")
|
||||
if gonfile then
|
||||
local contents = gonfile:read()
|
||||
io.close(gonfile)
|
||||
if contents ~= nil then
|
||||
local entries = contents:split(";")
|
||||
for i,entry in pairs(entries) do
|
||||
local goname, coords = unpack(entry:split(":"))
|
||||
local p = {}
|
||||
p.x, p.y, p.z = string.match(coords, "^([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)$")
|
||||
if p.x and p.y and p.z then
|
||||
GONETWORK[goname] = {x = tonumber(p.x),y= tonumber(p.y),z = tonumber(p.z)}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
minetest.register_chatcommand("setgo", {
|
||||
params = "<name>",
|
||||
description = "set /go destination",
|
||||
privs = {server=true},
|
||||
func = function(name, param)
|
||||
local target = minetest.env:get_player_by_name(name)
|
||||
if target then
|
||||
GONETWORK[param] = target:getpos()
|
||||
write_gofile()
|
||||
minetest.chat_send_player(name, "/go "..param.." set")
|
||||
return
|
||||
end
|
||||
end,
|
||||
})
|
||||
minetest.register_chatcommand("go", {
|
||||
params = "<goname>",
|
||||
description = "go to destination",
|
||||
func = function(name, param)
|
||||
if GONETWORK[param] == nil then minetest.chat_send_player(name, "no such destination") return end
|
||||
teleportee = minetest.env:get_player_by_name(name)
|
||||
teleportee:setpos(GONETWORK[param])
|
||||
end,
|
||||
})
|
||||
minetest.register_chatcommand("delgo", {
|
||||
params = "<name>",
|
||||
description = "delete /go destination",
|
||||
privs = {server=true},
|
||||
func = function(name, param)
|
||||
if GONETWORK[param] then
|
||||
GONETWORK[param] = nil
|
||||
write_gofile()
|
||||
end
|
||||
end,
|
||||
})
|
||||
minetest.register_chatcommand("listgo", {
|
||||
params = "<goname>",
|
||||
description = "list all go destinations",
|
||||
func = function(name, param)
|
||||
for go, coords in pairs(GONETWORK) do minetest.chat_send_player(name, "/go "..go.. ' at '..coords.x..','..coords.y..','..coords.z) end
|
||||
end,
|
||||
})
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
default
|
||||
|
|
@ -0,0 +1,169 @@
|
|||
local craftitem_place_item = function(item, player, pos)
|
||||
minetest.env:add_item(pos, 'CraftItem "' .. item .. '" 1')
|
||||
return true
|
||||
end
|
||||
|
||||
local craftitem_drink = function(hp_change)
|
||||
return function(item, user, pointed_thing)
|
||||
user:set_hp(user:get_hp() + hp_change)
|
||||
user:add_to_inventory_later('CraftItem "bottle:bottle_empty" 1')
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'CraftItem "bottle:bottle_empty" 3',
|
||||
recipe = {
|
||||
{'NodeItem "default:glass"', '', 'NodeItem "default:glass"'},
|
||||
{'', 'NodeItem "default:glass"', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("bottle:bottle_empty", {
|
||||
image = "bottle_empty.png",
|
||||
liquids_pointable = true,
|
||||
on_place_on_ground = craftitem_place_item,
|
||||
on_use = function(item, player, pointed_thing)
|
||||
if pointed_thing.type == "node" then
|
||||
n = minetest.env:get_node(pointed_thing.under)
|
||||
if n.name == "default:water_source" or n.name == "default:water_flowing" then
|
||||
player:add_to_inventory_later('CraftItem "bottle:bottle_water" 1')
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("bottle:bottle_water", {
|
||||
image = "bottle_water.png",
|
||||
on_place_on_ground = craftitem_place_item,
|
||||
on_use = craftitem_drink(0),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'CraftItem "bottle:bottle_applejuice" 1',
|
||||
recipe = {
|
||||
{'CraftItem "default:apple"'},
|
||||
{'CraftItem "default:apple"'},
|
||||
{'CraftItem "bottle:bottle_water"'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("bottle:bottle_caoh2", {
|
||||
image = "bottle_CaOH2.png",
|
||||
on_place_on_ground = craftitem_place_item,
|
||||
on_use = craftitem_drink(-2),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'CraftItem "bottle:bottle_caoh2" 1',
|
||||
recipe = {
|
||||
{'CraftItem "moreores:calcium_oxide"'},
|
||||
{'CraftItem "moreores:calcium_oxide"'},
|
||||
{'CraftItem "bottle:bottle_water"'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("bottle:bottle_hcn", {
|
||||
image = "bottle_HCN.png",
|
||||
on_place_on_ground = craftitem_place_item,
|
||||
on_use = craftitem_drink(-3),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'CraftItem "bottle:bottle_hcn" 1',
|
||||
recipe = {
|
||||
{'node "default:junglegrass"'},
|
||||
{'node "default:junglegrass"'},
|
||||
{'CraftItem "bottle:bottle_water"'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("bottle:bottle_cacn2", {
|
||||
image = "bottle_CaCN2.png",
|
||||
on_place_on_ground = craftitem_place_item,
|
||||
on_use = craftitem_drink(-999),
|
||||
})
|
||||
--===
|
||||
minetest.register_craft({
|
||||
output = 'CraftItem "bottle:bottle_cacn2" 2',
|
||||
recipe = {
|
||||
{'craft "bottle:bottle_caoh2" 1'},
|
||||
{'craft "bottle:bottle_hcn" 1'},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'CraftItem "bottle:bottle_cacn2" 2',
|
||||
recipe = {
|
||||
{'craft "bottle:bottle_hcn" 1'},
|
||||
{'craft "bottle:bottle_caoh2" 1'},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'CraftItem "bottle:bottle_cacn2" 2',
|
||||
recipe = {
|
||||
{'craft "bottle:bottle_hcn" 1','craft "bottle:bottle_caoh2" 1'},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'CraftItem "bottle:bottle_cacn2" 2',
|
||||
recipe = {
|
||||
{'craft "bottle:bottle_caoh2" 1','craft "bottle:bottle_hcn" 1'},
|
||||
}
|
||||
})
|
||||
--===
|
||||
minetest.register_craftitem("bottle:bottle_applejuice", {
|
||||
image = "bottle_applejuice.png",
|
||||
on_place_on_ground = craftitem_place_item,
|
||||
on_use = craftitem_drink(4),
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'CraftItem "bottle:bottle_watermelonjuice" 1',
|
||||
recipe = {
|
||||
{'CraftItem "watermelon:watermelon_slice"'},
|
||||
{'CraftItem "watermelon:watermelon_slice"'},
|
||||
{'CraftItem "bottle:bottle_water"'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("bottle:bottle_watermelonjuice", {
|
||||
image = "bottle_watermelonjuice.png",
|
||||
on_place_on_ground = craftitem_place_item,
|
||||
on_use = craftitem_drink(5),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'CraftItem "bottle:bottle_cactusjuice" 1',
|
||||
recipe = {
|
||||
{'NodeItem "default:cactus"'},
|
||||
{'NodeItem "default:cactus"'},
|
||||
{'CraftItem "bottle:bottle_water"'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("bottle:bottle_cactusjuice", {
|
||||
image = "bottle_cactusjuice.png",
|
||||
on_place_on_ground = craftitem_place_item,
|
||||
on_use = craftitem_drink(3),
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'CraftItem "bottle:bottle_dirtywater" 1',
|
||||
recipe = {
|
||||
{'NodeItem "default:dirt"'},
|
||||
{'NodeItem "default:dirt"'},
|
||||
{'CraftItem "bottle:bottle_water"'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("bottle:bottle_dirtywater", {
|
||||
image = "bottle_dirtywater.png",
|
||||
on_place_on_ground = craftitem_place_item,
|
||||
on_use = craftitem_drink(-1),
|
||||
})
|
||||
|
||||
print("[Bottle] Loaded!")
|
After Width: | Height: | Size: 668 B |
After Width: | Height: | Size: 639 B |
After Width: | Height: | Size: 388 B |
After Width: | Height: | Size: 443 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 362 B |
After Width: | Height: | Size: 241 B |
After Width: | Height: | Size: 396 B |
After Width: | Height: | Size: 417 B |
|
@ -0,0 +1,108 @@
|
|||
minetest.register_node("brick:kaktusbrick",{
|
||||
tiles = {"brick_kaktusbrick.png"},
|
||||
material = minetest.digprop_constanttime(1),
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = '"brick:kaktusbrick" 5',
|
||||
recipe = {
|
||||
{'default:cactus', 'default:cactus', ''},
|
||||
{'default:cactus', 'default:cactus', ''},
|
||||
{'', '', ''},
|
||||
}
|
||||
})
|
||||
minetest.register_node("brick:treebrick",{
|
||||
tiles = {"brick_treebrick.png"},
|
||||
material = minetest.digprop_constanttime(1),
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = '"brick:treebrick" 5',
|
||||
recipe = {
|
||||
{'default:tree', 'default:tree', ''},
|
||||
{'default:tree', 'default:tree', ''},
|
||||
{'', '', ''},
|
||||
}
|
||||
})
|
||||
minetest.register_node("brick:leavesbrick",{
|
||||
tiles = {"brick_leavesbrick.png"},
|
||||
material = minetest.digprop_constanttime(1),
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = '"brick:leavesbrick" 5',
|
||||
recipe = {
|
||||
{'default:leaves', 'default:leaves', ''},
|
||||
{'default:leaves', 'default:leaves', ''},
|
||||
{'', '', ''},
|
||||
}
|
||||
})
|
||||
minetest.register_node("brick:cobblebrick",{
|
||||
tiles = {"brick_cobblebrick.png"},
|
||||
material = minetest.digprop_constanttime(1),
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = '"brick:cobblebrick" 5',
|
||||
recipe = {
|
||||
{'default:cobble', 'default:cobble', ''},
|
||||
{'default:cobble', 'default:cobble', ''},
|
||||
{'', '', ''},
|
||||
}
|
||||
})
|
||||
minetest.register_node("brick:sandbrick",{
|
||||
tiles = {"brick_sandbrick.png"},
|
||||
material = minetest.digprop_constanttime(1),
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = '"brick:sandbrick" 5',
|
||||
recipe = {
|
||||
{'default:sandstone', 'default:sandstone', ''},
|
||||
{'default:sandstone', 'default:sandstone', ''},
|
||||
{'', '', ''},
|
||||
}
|
||||
})
|
||||
minetest.register_node("brick:applebrick",{
|
||||
tiles = {"brick_applebrick.png"},
|
||||
material = minetest.digprop_constanttime(1),
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = '"brick:applebrick" 5',
|
||||
recipe = {
|
||||
{'default:apple', 'default:apple', ''},
|
||||
{'default:apple', 'default:apple', ''},
|
||||
{'', '', ''},
|
||||
}
|
||||
})
|
||||
minetest.register_node("brick:dirtbrick",{
|
||||
tiles = {"brick_dirtbrick.png"},
|
||||
material = minetest.digprop_constanttime(1),
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = '"brick:dirtbrick" 5',
|
||||
recipe = {
|
||||
{'default:dirt', 'default:dirt', ''},
|
||||
{'default:dirt', 'default:dirt', ''},
|
||||
{'', '', ''},
|
||||
}
|
||||
})
|
||||
minetest.register_node("brick:waterbrick",{
|
||||
tiles = {"brick_waterbrick.png"},
|
||||
material = minetest.digprop_constanttime(1),
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = '"brick:waterbrick" 5',
|
||||
recipe = {
|
||||
{'bucket:bucket_water', 'bucket:bucket_water', ''},
|
||||
{'bucket:bucket_water', 'bucket:bucket_water', ''},
|
||||
{'', '', ''},
|
||||
}
|
||||
})
|
||||
minetest.register_node("brick:coalbrick",{
|
||||
tiles = {"brick_coalbrick.png"},
|
||||
material = minetest.digprop_constanttime(1),
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = '"brick:coalbrick" 5',
|
||||
recipe = {
|
||||
{'default:coal_lump', 'default:coal_lump', ''},
|
||||
{'default:coal_lump', 'default:coal_lump', ''},
|
||||
{'', '', ''},
|
||||
}
|
||||
})
|
After Width: | Height: | Size: 335 B |
After Width: | Height: | Size: 325 B |
After Width: | Height: | Size: 361 B |
After Width: | Height: | Size: 364 B |
After Width: | Height: | Size: 360 B |
After Width: | Height: | Size: 361 B |
After Width: | Height: | Size: 356 B |
After Width: | Height: | Size: 366 B |
After Width: | Height: | Size: 360 B |
|
@ -0,0 +1 @@
|
|||
default
|
|
@ -0,0 +1,422 @@
|
|||
minetest.register_node("building_blocks:Adobe", {
|
||||
tiles = {"building_blocks_Adobe.png"},
|
||||
inventory_image = "building_blocks_Adobe.png",
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
minetest.register_node("building_blocks:Roofing", {
|
||||
tiles = {"building_blocks_Roofing.png"},
|
||||
inventory_image = "building_blocks_Roofing.png",
|
||||
is_ground_content = true,
|
||||
groups = {snappy=3},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'building_blocks:terrycloth_towel 2',
|
||||
recipe = {
|
||||
{"flowers:cotton", "flowers:cotton", "flowers:cotton"},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'building_blocks:Tarmac_spread 4',
|
||||
recipe = {
|
||||
{"building_blocks:Tar", "building_blocks:Tar", "building_blocks:Tar"},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'building_blocks:gravel_spread 4',
|
||||
recipe = {
|
||||
{"default:gravel", "default:gravel", "default:gravel"},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'building_blocks:brobble_spread 4',
|
||||
recipe = {
|
||||
{"default:brick", "default:cobble", "default:brick"},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'building_blocks:Fireplace 1',
|
||||
recipe = {
|
||||
{"default:steel_ingot", "building_blocks:faggot", "default:steel_ingot"},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'building_blocks:Adobe 3',
|
||||
recipe = {
|
||||
{"default:sand"},
|
||||
{"default:clay"},
|
||||
{"default:stick"},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'building_blocks:Roofing 10',
|
||||
recipe = {
|
||||
{"building_blocks:Adobe", "building_blocks:Adobe"},
|
||||
{"building_blocks:Adobe", "building_blocks:Adobe"},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'building_blocks:grate 1',
|
||||
recipe = {
|
||||
{"default:steel_ingot"},
|
||||
{"default:glass"},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'building_blocks:woodglass 1',
|
||||
recipe = {
|
||||
{"default:wood"},
|
||||
{"default:glass"},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'building_blocks:hardwood 1',
|
||||
recipe = {
|
||||
{"default:wood", "default:wood"},
|
||||
{"default:wood", "default:wood"},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'building_blocks:faggot 1',
|
||||
recipe = {
|
||||
{'craft "default:stick"', 'craft "default:stick"'},
|
||||
{'craft "default:stick"', 'craft "default:stick"'},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'building_blocks:fakegrass 2',
|
||||
recipe = {
|
||||
{'default:leaves'},
|
||||
{"default:dirt"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "building_blocks:smoothglass",
|
||||
recipe = "default:glass"
|
||||
})
|
||||
minetest.register_node("building_blocks:smoothglass", {
|
||||
drawtype = "glasslike",
|
||||
tiles = {"building_blocks_sglass.png"},
|
||||
inventory_image = "building_blocks_sglass.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
minetest.register_node("building_blocks:grate", {
|
||||
drawtype = "glasslike",
|
||||
tiles = {"building_blocks_grate.png"},
|
||||
inventory_image = "building_blocks_grate.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
groups = {cracky=1},
|
||||
})
|
||||
minetest.register_node("building_blocks:Fireplace", {
|
||||
drawtype = "stonelike",
|
||||
tiles = {"building_blocks_cast_iron.png","building_blocks_cast_iron.png","building_blocks_cast_iron.png","building_blocks_cast_iron_fireplace.png"},
|
||||
inventory_image = "building_blocks_cast_iron.png","building_blocks_cast_iron.png","building_blocks_cast_iron.png","building_blocks_cast_iron_fireplace.png",
|
||||
paramtype = "facedir_simple",
|
||||
light_source = LIGHT_MAX,
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
groups = {cracky=2},
|
||||
})
|
||||
minetest.register_node("building_blocks:woodglass", {
|
||||
drawtype = "glasslike",
|
||||
tiles = {"building_blocks_wglass.png"},
|
||||
inventory_image = "building_blocks_wglass.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
minetest.register_node("building_blocks:terrycloth_towel", {
|
||||
drawtype = "raillike",
|
||||
tiles = {"building_blocks_towel.png"},
|
||||
inventory_image = "building_blocks_towel.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
--fixed = <default>
|
||||
},
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3},
|
||||
})
|
||||
minetest.register_node("building_blocks:Tarmac_spread", {
|
||||
drawtype = "raillike",
|
||||
tiles = {"tar.png"},
|
||||
inventory_image = "tar.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
--fixed = <default>
|
||||
},
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3},
|
||||
})
|
||||
minetest.register_node("building_blocks:brobble_spread", {
|
||||
drawtype = "raillike",
|
||||
tiles = {"building_blocks_brobble.png"},
|
||||
inventory_image = "building_blocks_brobble.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
--fixed = <default>
|
||||
},
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3},
|
||||
})
|
||||
minetest.register_node("building_blocks:gravel_spread", {
|
||||
drawtype = "raillike",
|
||||
tiles = {"default_gravel.png"},
|
||||
inventory_image = "default_gravel.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
--fixed = <default>
|
||||
},
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
groups = {cracky=2},
|
||||
})
|
||||
minetest.register_node("building_blocks:hardwood", {
|
||||
tiles = {"building_blocks_hardwood.png"},
|
||||
inventory_image = "building_blocks_hardwood.png",
|
||||
is_ground_content = true,
|
||||
groups = {choppy=1,flammable=1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
stairs = {}
|
||||
|
||||
-- Node will be called stairs:stair_<subname>
|
||||
function stairs.register_stair(subname, recipeitem, groups, images, description)
|
||||
minetest.register_node("building_blocks:stair_" .. subname, {
|
||||
description = description,
|
||||
drawtype = "nodebox",
|
||||
tiles = images,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = true,
|
||||
groups = groups,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
||||
{-0.5, 0, 0, 0.5, 0.5, 0.5},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'building_blocks:stair_' .. subname .. ' 4',
|
||||
recipe = {
|
||||
{recipeitem, "", ""},
|
||||
{recipeitem, recipeitem, ""},
|
||||
{recipeitem, recipeitem, recipeitem},
|
||||
},
|
||||
})
|
||||
|
||||
-- Flipped recipe for the silly minecrafters
|
||||
minetest.register_craft({
|
||||
output = 'building_blocks:stair_' .. subname .. ' 4',
|
||||
recipe = {
|
||||
{"", "", recipeitem},
|
||||
{"", recipeitem, recipeitem},
|
||||
{recipeitem, recipeitem, recipeitem},
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
-- Node will be called stairs:slab_<subname>
|
||||
function stairs.register_slab(subname, recipeitem, groups, images, description)
|
||||
minetest.register_node("building_blocks:slab_" .. subname, {
|
||||
description = description,
|
||||
drawtype = "nodebox",
|
||||
tiles = images,
|
||||
paramtype = "light",
|
||||
is_ground_content = true,
|
||||
groups = groups,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
||||
},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if pointed_thing.type ~= "node" then
|
||||
return itemstack
|
||||
end
|
||||
|
||||
-- If it's being placed on an another similar one, replace it with
|
||||
-- a full block
|
||||
local slabpos = nil
|
||||
local slabnode = nil
|
||||
local p0 = pointed_thing.under
|
||||
local p1 = pointed_thing.above
|
||||
local n0 = minetest.env:get_node(p0)
|
||||
local n1 = minetest.env:get_node(p1)
|
||||
if n0.name == "building_blocks:slab_" .. subname then
|
||||
slabpos = p0
|
||||
slabnode = n0
|
||||
elseif n1.name == "building_blocks:slab_" .. subname then
|
||||
slabpos = p1
|
||||
slabnode = n1
|
||||
end
|
||||
if slabpos then
|
||||
-- Remove the slab at slabpos
|
||||
minetest.env:remove_node(slabpos)
|
||||
-- Make a fake stack of a single item and try to place it
|
||||
local fakestack = ItemStack(recipeitem)
|
||||
pointed_thing.above = slabpos
|
||||
fakestack = minetest.item_place(fakestack, placer, pointed_thing)
|
||||
-- If the item was taken from the fake stack, decrement original
|
||||
if not fakestack or fakestack:is_empty() then
|
||||
itemstack:take_item(1)
|
||||
-- Else put old node back
|
||||
else
|
||||
minetest.env:set_node(slabpos, slabnode)
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
-- Otherwise place regularly
|
||||
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'building_blocks:slab_' .. subname .. ' 3',
|
||||
recipe = {
|
||||
{recipeitem, recipeitem, recipeitem},
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
-- Nodes will be called stairs:{stair,slab}_<subname>
|
||||
function stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab)
|
||||
stairs.register_stair(subname, recipeitem, groups, images, desc_stair)
|
||||
stairs.register_slab(subname, recipeitem, groups, images, desc_slab)
|
||||
end
|
||||
stairs.register_stair_and_slab("marble","building_blocks:Marble",
|
||||
{cracky=3},
|
||||
{"marble.png"},
|
||||
"Marble stair",
|
||||
"Marble slab")
|
||||
stairs.register_stair_and_slab("hardwood","building_blocks:hardwood",
|
||||
{snappy=1,choppy=1,flammable=1},
|
||||
{"building_blocks_hardwood.png"},
|
||||
"Hardwood stair",
|
||||
"Hardwood slab")
|
||||
stairs.register_stair_and_slab("fakegrass","building_blocks:fakegrass",
|
||||
{crumbly=3},
|
||||
{"default_grass.png"},
|
||||
"Grass stair",
|
||||
"Grass slab")
|
||||
stairs.register_stair_and_slab("tar","building_blocks:Tar",
|
||||
{crumbly=1},
|
||||
{"tar.png"},
|
||||
"Tar stair",
|
||||
"Tar slab")
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "building_blocks:hardwood",
|
||||
burntime = 28,
|
||||
})
|
||||
minetest.register_node("building_blocks:fakegrass", {
|
||||
tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
|
||||
inventory_image = "default_grass.png",
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
}),
|
||||
})
|
||||
minetest.register_craftitem("building_blocks:faggot", {
|
||||
image = "building_blocks_faggot.png",
|
||||
on_place_on_ground = minetest.craftitem_place_item,
|
||||
})
|
||||
|
||||
--Tar
|
||||
minetest.register_craft({
|
||||
output = 'building_blocks:knife 1',
|
||||
recipe = {
|
||||
{"building_blocks:Tar"},
|
||||
{"Stick"},
|
||||
}
|
||||
})
|
||||
minetest.register_alias("tar", "building_blocks:Tar")
|
||||
minetest.register_alias("fakegrass", "building_blocks:fakegrass")
|
||||
minetest.register_alias("tar_knife", "building_blocks:knife")
|
||||
minetest.register_alias("adobe", "building_blocks:Adobe")
|
||||
minetest.register_alias("building_blocks_roofing", "building_blocks:Roofing")
|
||||
minetest.register_alias("hardwood", "building_blocks:hardwood")
|
||||
minetest.register_alias("faggot", "building_blocks:faggot")
|
||||
minetest.register_alias("marble", "building_blocks:Marble")
|
||||
minetest.register_node("building_blocks:Tar", {
|
||||
description = "Tar",
|
||||
tiles = {"tar.png"},
|
||||
inventory_image = "tar.png",
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
minetest.register_node("building_blocks:Marble", {
|
||||
tiles = {"marble.png"},
|
||||
inventory_image = "marble.png",
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "building_blocks:faggot",
|
||||
burntime = 5,
|
||||
})
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "building_blocks:Tar",
|
||||
burntime = 40,
|
||||
})
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "building_blocks:Tar",
|
||||
recipe = "default:gravel",
|
||||
})
|
||||
minetest.register_tool("building_blocks:knife", {
|
||||
description = "Tar Knife",
|
||||
inventory_image = "knife.png",
|
||||
tool_capabilities = {
|
||||
max_drop_level=0,
|
||||
groupcaps={
|
||||
choppy={times={[2]=7.50, [3]=2.80}, maxwear=0.01, maxlevel=.1},
|
||||
fleshy={times={[2]=5.50, [3]=2.80}, maxwear=0.01, maxlevel=.1}
|
||||
}
|
||||
},
|
||||
})
|
||||
minetest.add_to_creative_inventory('building_blocks:Tar 0')
|
||||
minetest.add_to_creative_inventory('building_blocks:hardwood 0')
|
||||
minetest.register_craft({
|
||||
output = "building_blocks:Marble 9",
|
||||
recipe = {
|
||||
{"default:clay", "building_blocks:Tar", "default:clay"},
|
||||
{"building_blocks:Tar","default:clay", "building_blocks:Tar"},
|
||||
{"default:clay", "building_blocks:Tar","default:clay"},
|
||||
}
|
||||
})
|
||||
|
After Width: | Height: | Size: 325 B |
After Width: | Height: | Size: 407 B |
After Width: | Height: | Size: 508 B |
After Width: | Height: | Size: 225 B |
After Width: | Height: | Size: 316 B |
After Width: | Height: | Size: 358 B |
After Width: | Height: | Size: 304 B |
After Width: | Height: | Size: 302 B |
After Width: | Height: | Size: 365 B |
After Width: | Height: | Size: 285 B |
After Width: | Height: | Size: 540 B |
After Width: | Height: | Size: 515 B |
After Width: | Height: | Size: 177 B |
After Width: | Height: | Size: 612 B |
After Width: | Height: | Size: 409 B |
|
@ -0,0 +1,81 @@
|
|||
-- Basket
|
||||
minetest.register_node("bushes:basket_empty", {
|
||||
description = "Basket",
|
||||
tiles = {
|
||||
"bushes_basket_empty_top.png",
|
||||
"bushes_basket_bottom.png",
|
||||
"bushes_basket_side.png"
|
||||
},
|
||||
groups = { dig_immediate = 3 },
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'bushes:basket_empty',
|
||||
recipe = {
|
||||
{ 'default:stick', 'default:stick', 'default:stick' },
|
||||
{ '', 'default:stick', '' },
|
||||
},
|
||||
})
|
||||
|
||||
-- Sugar
|
||||
minetest.register_craftitem("bushes:sugar", {
|
||||
description = "Sugar",
|
||||
inventory_image = "bushes_sugar.png",
|
||||
on_use = minetest.item_eat(1),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'bushes:sugar 1',
|
||||
recipe = {
|
||||
{ 'default:papyrus', 'default:papyrus' },
|
||||
},
|
||||
})
|
||||
|
||||
-- Raw pie
|
||||
minetest.register_craftitem("bushes:berry_pie_raw", {
|
||||
description = "Raw berry pie",
|
||||
inventory_image = "bushes_berry_pie_raw.png",
|
||||
on_use = minetest.item_eat(3),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'bushes:berry_pie_raw 1',
|
||||
recipe = {
|
||||
{ 'bushes:sugar', 'default:junglegrass', 'bushes:sugar' },
|
||||
{ 'bushes:strawberry', 'bushes:strawberry', 'bushes:strawberry' },
|
||||
},
|
||||
})
|
||||
|
||||
-- Cooked pie
|
||||
minetest.register_craftitem("bushes:berry_pie_cooked", {
|
||||
description = "Cooked berry pie",
|
||||
inventory_image = "bushes_berry_pie_cooked.png",
|
||||
on_use = minetest.item_eat(4),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'cooking',
|
||||
output = 'bushes:berry_pie_cooked',
|
||||
recipe = 'bushes:berry_pie_raw',
|
||||
cooktime = 30,
|
||||
})
|
||||
|
||||
-- Basket with pies
|
||||
minetest.register_node("bushes:basket_pies", {
|
||||
description = "Basket with pies",
|
||||
tiles = {
|
||||
"bushes_basket_full_top.png",
|
||||
"bushes_basket_bottom.png",
|
||||
"bushes_basket_side.png"
|
||||
},
|
||||
on_use = minetest.item_eat(15),
|
||||
groups = { dig_immediate = 3 },
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'bushes:basket_pies 1',
|
||||
recipe = {
|
||||
{ 'bushes:berry_pie_cooked', 'bushes:berry_pie_cooked', 'bushes:berry_pie_cooked' },
|
||||
{ '', 'bushes:basket_empty', '' },
|
||||
},
|
||||
})
|
|
@ -0,0 +1,2 @@
|
|||
default
|
||||
flowers
|
|
@ -0,0 +1,53 @@
|
|||
local BUSHES = {
|
||||
"strawberry",
|
||||
}
|
||||
|
||||
local BUSHES_DESCRIPTIONS = {
|
||||
"Strawberry",
|
||||
}
|
||||
|
||||
-- Grow junglegrass
|
||||
grow_blocks_on_surfaces(3600, {
|
||||
"default:junglegrass",
|
||||
}, {
|
||||
{ name = "default:dirt_with_grass", chance = 3, spacing = 10 },
|
||||
})
|
||||
|
||||
for i, bush_name in ipairs(BUSHES) do
|
||||
minetest.register_node("bushes:" .. bush_name .. "_bush", {
|
||||
description = BUSHES_DESCRIPTIONS[i] .. " bush",
|
||||
drawtype = "plantlike",
|
||||
visual_scale = 1.3,
|
||||
tiles = { "bushes_" .. bush_name .. "_bush.png" },
|
||||
inventory_image = "bushes_" .. bush_name .. "_bush.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
drop = 'bushes:' .. bush_name .. ' 4',
|
||||
groups = { snappy = 3 },
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craftitem("bushes:" .. bush_name, {
|
||||
description = BUSHES_DESCRIPTIONS[i],
|
||||
inventory_image = "bushes_" .. bush_name .. ".png",
|
||||
stack_max = 99,
|
||||
on_use = minetest.item_eat(1),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'bushes:' .. bush_name .. '_bush',
|
||||
recipe = {
|
||||
{ 'bushes:' .. bush_name, 'bushes:' .. bush_name, 'bushes:' .. bush_name },
|
||||
{ 'bushes:' .. bush_name, 'bushes:' .. bush_name, 'bushes:' .. bush_name },
|
||||
}
|
||||
})
|
||||
|
||||
grow_blocks_on_surfaces(3600, {
|
||||
"bushes:" .. bush_name .. "_bush",
|
||||
}, {
|
||||
{ name = "default:dirt_with_grass", chance = 2, spacing = 15 },
|
||||
})
|
||||
end
|
||||
|
||||
dofile(minetest.get_modpath('bushes') .. '/cooking.lua')
|
After Width: | Height: | Size: 283 B |
After Width: | Height: | Size: 285 B |
After Width: | Height: | Size: 633 B |
After Width: | Height: | Size: 320 B |
After Width: | Height: | Size: 918 B |
After Width: | Height: | Size: 918 B |
After Width: | Height: | Size: 824 B |
After Width: | Height: | Size: 7.1 KiB |
After Width: | Height: | Size: 4.3 KiB |
|
@ -0,0 +1 @@
|
|||
default
|