added modified beds (sleep and spawn support removed, improved recipes)
|
@ -0,0 +1,47 @@
|
|||
===BEDS MOD for MINETEST-C55===
|
||||
by PilzAdam & thefamilygrog66
|
||||
|
||||
Introduction:
|
||||
This mods brings beds to Minetest. You can use them to sleep at night
|
||||
to prevent attacks by evil mobs.
|
||||
|
||||
How to install:
|
||||
Unzip the archive an place it in minetest-base-directory/mods/minetest/
|
||||
if you have a windows client or a linux run-in-place client. If you have
|
||||
a linux system-wide instalation place it in ~/.minetest/mods/minetest/.
|
||||
If you want to install this mod only in one world create the folder
|
||||
worldmods/ in your worlddirectory.
|
||||
For further information or help see:
|
||||
http://wiki.minetest.com/wiki/Installing_Mods
|
||||
|
||||
How to use the mod:
|
||||
Craft a bed like this:
|
||||
white wool white wool white wool
|
||||
stick stick
|
||||
After placing it anywhere you can go to sleep with a leftklick with your
|
||||
hand on the bed. If it is night a chatmessage wishs you "Good night" and
|
||||
you sleep until the next morning. To go outside the bed it is recommended
|
||||
to hit the bed again with a leftklick (it also works if you just go away
|
||||
but its not so safe).
|
||||
After dying the player will respawn at the last bed he has slept.
|
||||
|
||||
License:
|
||||
Sourcecode: WTFPL (see below)
|
||||
Graphics: WTFPL (see below)
|
||||
|
||||
See also:
|
||||
http://minetest.net/
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
|
@ -0,0 +1,2 @@
|
|||
default
|
||||
wool
|
|
@ -0,0 +1,139 @@
|
|||
-- local player_in_bed = 0
|
||||
|
||||
local beds_list = {
|
||||
{ "Red Bed", "red"},
|
||||
{ "Orange Bed", "orange"},
|
||||
{ "Yellow Bed", "yellow"},
|
||||
{ "Green Bed", "green"},
|
||||
{ "Blue Bed", "blue"},
|
||||
{ "Violet Bed", "violet"},
|
||||
{ "Black Bed", "black"},
|
||||
{ "Grey Bed", "grey"},
|
||||
{ "White Bed", "white"},
|
||||
}
|
||||
|
||||
for i in ipairs(beds_list) do
|
||||
local beddesc = beds_list[i][1]
|
||||
local colour = beds_list[i][2]
|
||||
|
||||
minetest.register_node("beds:bed_bottom_"..colour, {
|
||||
description = beddesc,
|
||||
drawtype = "nodebox",
|
||||
tiles = {"beds_bed_top_bottom_"..colour..".png", "default_wood.png", "beds_bed_side_"..colour..".png", "beds_bed_side_"..colour..".png", "beds_bed_side_"..colour..".png", "beds_bed_side_"..colour..".png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
stack_max = 1,
|
||||
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
-- bed
|
||||
{-0.5, 0.0, -0.5, 0.5, 0.3125, 0.5},
|
||||
|
||||
-- legs
|
||||
{-0.5, -0.5, -0.5, -0.4, 0.0, -0.4},
|
||||
{0.4, 0.0, -0.4, 0.5, -0.5, -0.5},
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.3125, 1.5},
|
||||
}
|
||||
},
|
||||
|
||||
after_place_node = function(pos, placer, itemstack)
|
||||
local node = minetest.env:get_node(pos)
|
||||
local p = {x=pos.x, y=pos.y, z=pos.z}
|
||||
local param2 = node.param2
|
||||
node.name = "beds:bed_top_"..colour
|
||||
if param2 == 0 then
|
||||
pos.z = pos.z+1
|
||||
elseif param2 == 1 then
|
||||
pos.x = pos.x+1
|
||||
elseif param2 == 2 then
|
||||
pos.z = pos.z-1
|
||||
elseif param2 == 3 then
|
||||
pos.x = pos.x-1
|
||||
end
|
||||
if minetest.registered_nodes[minetest.env:get_node(pos).name].buildable_to then
|
||||
minetest.env:set_node(pos, node)
|
||||
else
|
||||
minetest.env:remove_node(p)
|
||||
return true
|
||||
end
|
||||
end,
|
||||
|
||||
on_destruct = function(pos)
|
||||
local node = minetest.env:get_node(pos)
|
||||
local param2 = node.param2
|
||||
if param2 == 0 then
|
||||
pos.z = pos.z+1
|
||||
elseif param2 == 1 then
|
||||
pos.x = pos.x+1
|
||||
elseif param2 == 2 then
|
||||
pos.z = pos.z-1
|
||||
elseif param2 == 3 then
|
||||
pos.x = pos.x-1
|
||||
end
|
||||
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).name == "beds:bed_top_"..colour ) then
|
||||
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).param2 == param2 ) then
|
||||
minetest.env:remove_node(pos)
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("beds:bed_top_"..colour, {
|
||||
drawtype = "nodebox",
|
||||
tiles = {"beds_bed_top_top_"..colour..".png", "default_wood.png", "beds_bed_side_top_r_"..colour..".png", "beds_bed_side_top_l_"..colour..".png", "beds_bed_top_front.png", "beds_bed_side_"..colour..".png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
-- bed
|
||||
{-0.5, 0.0, -0.5, 0.5, 0.3125, 0.5},
|
||||
{-0.4375, 0.3125, 0.1, 0.4375, 0.4375, 0.5},
|
||||
|
||||
-- legs
|
||||
{-0.4, 0.0, 0.4, -0.5, -0.5, 0.5},
|
||||
{0.5, -0.5, 0.5, 0.4, 0.0, 0.4},
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{0, 0, 0, 0, 0, 0},
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_alias("beds:bed_"..colour, "beds:bed_bottom_"..colour)
|
||||
|
||||
-- minetest.register_craft({
|
||||
-- output = "beds:bed_"..colour,
|
||||
-- recipe = {
|
||||
-- {"wool:"..colour, "wool:"..colour, "wool:white", },
|
||||
-- {"default:stick", "", "default:stick", },
|
||||
-- {"", "", "", }
|
||||
-- }
|
||||
-- })
|
||||
|
||||
minetest.register_craft({
|
||||
output = "beds:bed_bottom_"..colour,
|
||||
recipe = {
|
||||
{"wool:white", "wool:"..colour, "wool:"..colour, },
|
||||
{"default:stick", "", "default:stick", }
|
||||
-- {"", "", "", }
|
||||
}
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
minetest.register_alias("beds:bed_bottom", "beds:bed_bottom_blue")
|
||||
minetest.register_alias("beds:bed_top", "beds:bed_top_blue")
|
||||
minetest.register_alias("beds:bed", "beds:bed_bottom_blue")
|
After Width: | Height: | Size: 477 B |
After Width: | Height: | Size: 490 B |
After Width: | Height: | Size: 494 B |
After Width: | Height: | Size: 485 B |
After Width: | Height: | Size: 526 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 487 B |
After Width: | Height: | Size: 483 B |
After Width: | Height: | Size: 477 B |
After Width: | Height: | Size: 483 B |
After Width: | Height: | Size: 507 B |
After Width: | Height: | Size: 498 B |
After Width: | Height: | Size: 493 B |
After Width: | Height: | Size: 490 B |
After Width: | Height: | Size: 476 B |
After Width: | Height: | Size: 484 B |
After Width: | Height: | Size: 487 B |
After Width: | Height: | Size: 488 B |
After Width: | Height: | Size: 484 B |
After Width: | Height: | Size: 509 B |
After Width: | Height: | Size: 505 B |
After Width: | Height: | Size: 494 B |
After Width: | Height: | Size: 479 B |
After Width: | Height: | Size: 470 B |
After Width: | Height: | Size: 505 B |
After Width: | Height: | Size: 479 B |
After Width: | Height: | Size: 468 B |
After Width: | Height: | Size: 328 B |
After Width: | Height: | Size: 333 B |
After Width: | Height: | Size: 330 B |
After Width: | Height: | Size: 319 B |
After Width: | Height: | Size: 362 B |
After Width: | Height: | Size: 361 B |
After Width: | Height: | Size: 351 B |
After Width: | Height: | Size: 331 B |
After Width: | Height: | Size: 302 B |
After Width: | Height: | Size: 442 B |
After Width: | Height: | Size: 455 B |
After Width: | Height: | Size: 475 B |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 455 B |
After Width: | Height: | Size: 506 B |
After Width: | Height: | Size: 487 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 457 B |
After Width: | Height: | Size: 449 B |