finally fixing the stupid folder thing
BIN
menu/background.png
Normal file
After Width: | Height: | Size: 1.0 MiB |
BIN
menu/header.png
Normal file
After Width: | Height: | Size: 960 KiB |
BIN
menu/icon.png
Normal file
After Width: | Height: | Size: 1.9 MiB |
5
minetest.conf
Normal file
@ -0,0 +1,5 @@
|
||||
movement_liquid_sink = 18
|
||||
movement_speed_jump = 5.6
|
||||
|
||||
remove_items = 86400
|
||||
enable_item_pickup = true
|
BIN
mobmodels/DM.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
mobmodels/DM.xcf
Normal file
BIN
mobmodels/DMech.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
mobmodels/DMech.xcf
Normal file
BIN
mobmodels/DungeonMaster.blend
Normal file
BIN
mobmodels/DungeonMaster.blend1
Normal file
BIN
mobmodels/DungeonMech.blend
Normal file
47
mods/beds/README.txt
Normal file
@ -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.
|
2
mods/beds/depends.txt
Normal file
@ -0,0 +1,2 @@
|
||||
default
|
||||
wool
|
237
mods/beds/init.lua
Normal file
@ -0,0 +1,237 @@
|
||||
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", "deco_wood_oak_planks.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,
|
||||
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
if not clicker:is_player() then
|
||||
return
|
||||
end
|
||||
local meta = minetest.env:get_meta(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 clicker:get_player_name() == meta:get_string("player") then
|
||||
if param2 == 0 then
|
||||
pos.x = pos.x-1
|
||||
elseif param2 == 1 then
|
||||
pos.z = pos.z+1
|
||||
elseif param2 == 2 then
|
||||
pos.x = pos.x+1
|
||||
elseif param2 == 3 then
|
||||
pos.z = pos.z-1
|
||||
end
|
||||
pos.y = pos.y-0.5
|
||||
clicker:set_physics_override(1, 1, 1)
|
||||
clicker:setpos(pos)
|
||||
meta:set_string("player", "")
|
||||
player_in_bed = player_in_bed-1
|
||||
elseif meta:get_string("player") == "" then
|
||||
clicker:set_physics_override(0, 0, 0, false, false)
|
||||
--pos.y = pos.y-0.75
|
||||
clicker:setpos(pos)
|
||||
if param2 == 0 then
|
||||
clicker:set_look_yaw(math.pi)
|
||||
elseif param2 == 1 then
|
||||
clicker:set_look_yaw(0.5*math.pi)
|
||||
elseif param2 == 2 then
|
||||
clicker:set_look_yaw(0)
|
||||
elseif param2 == 3 then
|
||||
clicker:set_look_yaw(1.5*math.pi)
|
||||
end
|
||||
|
||||
meta:set_string("player", clicker:get_player_name())
|
||||
player_in_bed = player_in_bed+1
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("beds:bed_top_"..colour, {
|
||||
drawtype = "nodebox",
|
||||
tiles = {"beds_bed_top_top_"..colour..".png", "deco_wood_oak_planks.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", },
|
||||
{"tools:stick", "", "tools:stick", }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "beds:bed_"..colour,
|
||||
recipe = {
|
||||
{"wool:white", "wool:"..colour, "wool:"..colour, },
|
||||
{"tools:stick", "", "tools: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")
|
||||
|
||||
beds_player_spawns = {}
|
||||
local file = io.open(minetest.get_worldpath().."/beds_player_spawns", "r")
|
||||
if file then
|
||||
beds_player_spawns = minetest.deserialize(file:read("*all"))
|
||||
file:close()
|
||||
end
|
||||
|
||||
local timer = 0
|
||||
local wait = false
|
||||
minetest.register_globalstep(function(dtime)
|
||||
if timer<2 then
|
||||
timer = timer+dtime
|
||||
return
|
||||
end
|
||||
timer = 0
|
||||
|
||||
local players = #minetest.get_connected_players()
|
||||
if players == player_in_bed and players ~= 0 then
|
||||
if minetest.env:get_timeofday() < 0.2 or minetest.env:get_timeofday() > 0.805 then
|
||||
if not wait then
|
||||
minetest.chat_send_all("Good night!!!")
|
||||
minetest.after(2, function()
|
||||
minetest.env:set_timeofday(0.23)
|
||||
wait = false
|
||||
end)
|
||||
wait = true
|
||||
for _,player in ipairs(minetest.get_connected_players()) do
|
||||
beds_player_spawns[player:get_player_name()] = player:getpos()
|
||||
end
|
||||
local file = io.open(minetest.get_worldpath().."/beds_player_spawns", "w")
|
||||
if file then
|
||||
file:write(minetest.serialize(beds_player_spawns))
|
||||
file:close()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_on_respawnplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
if beds_player_spawns[name] then
|
||||
player:setpos(beds_player_spawns[name])
|
||||
return true
|
||||
end
|
||||
end)
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "beds loaded")
|
||||
end
|
BIN
mods/beds/textures/beds_bed_side_black.png
Normal file
After Width: | Height: | Size: 477 B |
BIN
mods/beds/textures/beds_bed_side_blue.png
Normal file
After Width: | Height: | Size: 490 B |
BIN
mods/beds/textures/beds_bed_side_green.png
Normal file
After Width: | Height: | Size: 494 B |
BIN
mods/beds/textures/beds_bed_side_grey.png
Normal file
After Width: | Height: | Size: 485 B |
BIN
mods/beds/textures/beds_bed_side_orange.png
Normal file
After Width: | Height: | Size: 526 B |
BIN
mods/beds/textures/beds_bed_side_red.png
Normal file
After Width: | Height: | Size: 497 B |
BIN
mods/beds/textures/beds_bed_side_top_l_black.png
Normal file
After Width: | Height: | Size: 487 B |
BIN
mods/beds/textures/beds_bed_side_top_l_blue.png
Normal file
After Width: | Height: | Size: 483 B |
BIN
mods/beds/textures/beds_bed_side_top_l_green.png
Normal file
After Width: | Height: | Size: 477 B |
BIN
mods/beds/textures/beds_bed_side_top_l_grey.png
Normal file
After Width: | Height: | Size: 483 B |
BIN
mods/beds/textures/beds_bed_side_top_l_orange.png
Normal file
After Width: | Height: | Size: 507 B |
BIN
mods/beds/textures/beds_bed_side_top_l_red.png
Normal file
After Width: | Height: | Size: 498 B |
BIN
mods/beds/textures/beds_bed_side_top_l_violet.png
Normal file
After Width: | Height: | Size: 493 B |
BIN
mods/beds/textures/beds_bed_side_top_l_white.png
Normal file
After Width: | Height: | Size: 490 B |
BIN
mods/beds/textures/beds_bed_side_top_l_yellow.png
Normal file
After Width: | Height: | Size: 476 B |
BIN
mods/beds/textures/beds_bed_side_top_r_black.png
Normal file
After Width: | Height: | Size: 484 B |
BIN
mods/beds/textures/beds_bed_side_top_r_blue.png
Normal file
After Width: | Height: | Size: 487 B |
BIN
mods/beds/textures/beds_bed_side_top_r_green.png
Normal file
After Width: | Height: | Size: 488 B |
BIN
mods/beds/textures/beds_bed_side_top_r_grey.png
Normal file
After Width: | Height: | Size: 484 B |
BIN
mods/beds/textures/beds_bed_side_top_r_orange.png
Normal file
After Width: | Height: | Size: 509 B |
BIN
mods/beds/textures/beds_bed_side_top_r_red.png
Normal file
After Width: | Height: | Size: 505 B |
BIN
mods/beds/textures/beds_bed_side_top_r_violet.png
Normal file
After Width: | Height: | Size: 494 B |
BIN
mods/beds/textures/beds_bed_side_top_r_white.png
Normal file
After Width: | Height: | Size: 479 B |
BIN
mods/beds/textures/beds_bed_side_top_r_yellow.png
Normal file
After Width: | Height: | Size: 470 B |
BIN
mods/beds/textures/beds_bed_side_violet.png
Normal file
After Width: | Height: | Size: 505 B |
BIN
mods/beds/textures/beds_bed_side_white.png
Normal file
After Width: | Height: | Size: 479 B |
BIN
mods/beds/textures/beds_bed_side_yellow.png
Normal file
After Width: | Height: | Size: 468 B |
BIN
mods/beds/textures/beds_bed_top_bottom_black.png
Normal file
After Width: | Height: | Size: 328 B |
BIN
mods/beds/textures/beds_bed_top_bottom_blue.png
Normal file
After Width: | Height: | Size: 333 B |
BIN
mods/beds/textures/beds_bed_top_bottom_green.png
Normal file
After Width: | Height: | Size: 330 B |
BIN
mods/beds/textures/beds_bed_top_bottom_grey.png
Normal file
After Width: | Height: | Size: 319 B |
BIN
mods/beds/textures/beds_bed_top_bottom_orange.png
Normal file
After Width: | Height: | Size: 362 B |
BIN
mods/beds/textures/beds_bed_top_bottom_red.png
Normal file
After Width: | Height: | Size: 361 B |
BIN
mods/beds/textures/beds_bed_top_bottom_violet.png
Normal file
After Width: | Height: | Size: 351 B |
BIN
mods/beds/textures/beds_bed_top_bottom_white.png
Normal file
After Width: | Height: | Size: 331 B |
BIN
mods/beds/textures/beds_bed_top_bottom_yellow.png
Normal file
After Width: | Height: | Size: 302 B |
BIN
mods/beds/textures/beds_bed_top_front.png
Normal file
After Width: | Height: | Size: 442 B |
BIN
mods/beds/textures/beds_bed_top_top_black.png
Normal file
After Width: | Height: | Size: 455 B |
BIN
mods/beds/textures/beds_bed_top_top_blue.png
Normal file
After Width: | Height: | Size: 475 B |
BIN
mods/beds/textures/beds_bed_top_top_green.png
Normal file
After Width: | Height: | Size: 462 B |
BIN
mods/beds/textures/beds_bed_top_top_grey.png
Normal file
After Width: | Height: | Size: 455 B |
BIN
mods/beds/textures/beds_bed_top_top_orange.png
Normal file
After Width: | Height: | Size: 506 B |
BIN
mods/beds/textures/beds_bed_top_top_red.png
Normal file
After Width: | Height: | Size: 487 B |
BIN
mods/beds/textures/beds_bed_top_top_violet.png
Normal file
After Width: | Height: | Size: 497 B |
BIN
mods/beds/textures/beds_bed_top_top_white.png
Normal file
After Width: | Height: | Size: 457 B |
BIN
mods/beds/textures/beds_bed_top_top_yellow.png
Normal file
After Width: | Height: | Size: 449 B |
4
mods/bfoil/BFOil.txt
Normal file
@ -0,0 +1,4 @@
|
||||
1) Pools of oil that are rounded and somewhat sphere like (use ores:oil_source)
|
||||
2) Between ranges of depths: -256 <-> -4098 and -16392 <-> -31000
|
||||
3) Only spawn within stone, not to exposed air.
|
||||
4) Rare at -256 <-> -4098, 3x as common at the second layer.
|
1
mods/bfoil/README.txt
Normal file
@ -0,0 +1 @@
|
||||
Big F***ing Oil mod by paramat for Jordach
|
1
mods/bfoil/depends.txt
Normal file
@ -0,0 +1 @@
|
||||
default
|
93
mods/bfoil/init.lua
Normal file
@ -0,0 +1,93 @@
|
||||
-- Big F***ing Oil mod by paramat for Jordach
|
||||
|
||||
-- Parameters
|
||||
|
||||
local YMAXU = 256
|
||||
local YMINU = -4096
|
||||
local YMAXL = -16392
|
||||
local YMINL = -33000
|
||||
local RAD = 20 -- Average radius of oil sphere
|
||||
local NAMP = 0.33 -- Oily noise amplitude, controls reserve shape irregularity
|
||||
local TSTONE = -0.2 -- Oily stone threshold, controls width of stone shell
|
||||
local CHA = 1 / 5 ^ 3 -- Chance of reserve per chunk in upper layer
|
||||
-- 1 / n ^ 3 where n is average separation in chunks
|
||||
|
||||
-- 3D noise for reserve shape noise
|
||||
|
||||
local np_oil = {
|
||||
offset = 0,
|
||||
scale = 1,
|
||||
spread = {x=16, y=16, z=16},
|
||||
seed = 5900033,
|
||||
octaves = 2,
|
||||
persist = 0.5
|
||||
}
|
||||
|
||||
-- Stuff
|
||||
|
||||
bfoil = {}
|
||||
|
||||
-- On generated function
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp, seed)
|
||||
local y0 = minp.y
|
||||
local y1 = maxp.y
|
||||
if minp.y < YMINL or maxp.y > YMAXU
|
||||
or (minp.y < YMINU and maxp.y > YMAXL) then
|
||||
return
|
||||
end
|
||||
|
||||
if (minp.y >= YMINU and math.random() > CHA)
|
||||
or (maxp.y <= YMAXL and math.random() > CHA * 3) then -- 3 x more common in lower layer
|
||||
return
|
||||
end
|
||||
|
||||
local t1 = os.clock()
|
||||
local x0 = minp.x
|
||||
local x1 = maxp.x
|
||||
local z0 = minp.z
|
||||
local z1 = maxp.z
|
||||
print ("[bfoil] chunk ("..minp.x.." "..minp.y.." "..minp.z..")")
|
||||
local ccenx = math.floor((x0 + x1) / 2)
|
||||
local cceny = math.floor((y0 + y1) / 2)
|
||||
local ccenz = math.floor((z0 + z1) / 2)
|
||||
|
||||
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
|
||||
local area = VoxelArea:new{MinEdge=emin, MaxEdge=emax}
|
||||
local data = vm:get_data()
|
||||
|
||||
local c_oil = minetest.get_content_id("ores:oil_source")
|
||||
local c_stone = minetest.get_content_id("mapgen:stone")
|
||||
|
||||
local sidelen = x1 - x0 + 1
|
||||
local chulens = {x=sidelen, y=sidelen, z=sidelen}
|
||||
local minposxyz = {x=x0, y=y0, z=z0}
|
||||
|
||||
local nvals_oil = minetest.get_perlin_map(np_oil, chulens):get3dMap_flat(minposxyz)
|
||||
|
||||
local nixyz = 1
|
||||
for z = z0, z1 do
|
||||
for y = y0, y1 do
|
||||
local vi = area:index(x0, y, z)
|
||||
for x = x0, x1 do
|
||||
local n_oil = nvals_oil[nixyz]
|
||||
local nodrad = ((x - ccenx) ^ 2 + (y - cceny) ^ 2 + (z - ccenz) ^ 2) ^ 0.5
|
||||
local oily = (RAD - nodrad) / RAD + n_oil * NAMP -- oily = 1 at centre, = 0 at edge
|
||||
if oily >= 0 then
|
||||
data[vi] = c_oil
|
||||
elseif oily >= TSTONE then
|
||||
data[vi] = c_stone
|
||||
end
|
||||
nixyz = nixyz + 1
|
||||
vi = vi + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
vm:set_data(data)
|
||||
vm:set_lighting({day=0, night=0})
|
||||
vm:calc_lighting()
|
||||
vm:write_to_map(data)
|
||||
local chugent = math.ceil((os.clock() - t1) * 1000)
|
||||
print ("[bfoil] "..chugent.." ms")
|
||||
end)
|
14
mods/bfoil/license.txt
Normal file
@ -0,0 +1,14 @@
|
||||
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.
|
||||
|
17
mods/bones/README.txt
Normal file
@ -0,0 +1,17 @@
|
||||
Minetest 0.4 mod: bones
|
||||
=======================
|
||||
|
||||
License of source code:
|
||||
-----------------------
|
||||
Copyright (C) 2012 PilzAdam
|
||||
|
||||
WTFPL
|
||||
|
||||
License of media (textures and sounds)
|
||||
--------------------------------------
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
http://creativecommons.org/licenses/by-sa/3.0/
|
||||
|
||||
Authors of media files
|
||||
----------------------
|
||||
Bad_Command_
|
1
mods/bones/depends.txt
Normal file
@ -0,0 +1 @@
|
||||
default
|
131
mods/bones/init.lua
Normal file
@ -0,0 +1,131 @@
|
||||
-- Minetest 0.4 mod: bones
|
||||
-- See README.txt for licensing and other information.
|
||||
|
||||
local function is_owner(pos, name)
|
||||
local owner = minetest.get_meta(pos):get_string("owner")
|
||||
if owner == "" or owner == name then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
minetest.register_node("bones:bones", {
|
||||
description = "Bones",
|
||||
tiles = {
|
||||
"bones_top.png",
|
||||
"bones_bottom.png",
|
||||
"bones_side.png",
|
||||
"bones_side.png",
|
||||
"bones_rear.png",
|
||||
"bones_front.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = {dig_immediate=2},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}),
|
||||
|
||||
can_dig = function(pos, player)
|
||||
local inv = minetest.get_meta(pos):get_inventory()
|
||||
return is_owner(pos, player:get_player_name()) and inv:is_empty("main")
|
||||
end,
|
||||
|
||||
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
if is_owner(pos, player:get_player_name()) then
|
||||
return count
|
||||
end
|
||||
return 0
|
||||
end,
|
||||
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
return 0
|
||||
end,
|
||||
|
||||
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
if is_owner(pos, player:get_player_name()) then
|
||||
return stack:get_count()
|
||||
end
|
||||
return 0
|
||||
end,
|
||||
|
||||
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if meta:get_string("owner") ~= "" and meta:get_inventory():is_empty("main") then
|
||||
meta:set_string("infotext", meta:get_string("owner").."'s old bones")
|
||||
meta:set_string("formspec", "")
|
||||
meta:set_string("owner", "")
|
||||
end
|
||||
end,
|
||||
|
||||
on_timer = function(pos, elapsed)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local time = meta:get_int("time")+elapsed
|
||||
local publish = 1200
|
||||
if tonumber(minetest.setting_get("share_bones_time")) then
|
||||
publish = tonumber(minetest.setting_get("share_bones_time"))
|
||||
end
|
||||
if publish == 0 then
|
||||
return
|
||||
end
|
||||
if time >= publish then
|
||||
meta:set_string("infotext", meta:get_string("owner").."'s old bones")
|
||||
meta:set_string("owner", "")
|
||||
else
|
||||
return true
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_on_dieplayer(function(player)
|
||||
if minetest.setting_getbool("creative_mode") then
|
||||
return
|
||||
end
|
||||
|
||||
local pos = player:getpos()
|
||||
pos.x = math.floor(pos.x+0.5)
|
||||
pos.y = math.floor(pos.y+0.5)
|
||||
pos.z = math.floor(pos.z+0.5)
|
||||
local param2 = minetest.dir_to_facedir(player:get_look_dir())
|
||||
|
||||
local nn = minetest.get_node(pos).name
|
||||
if minetest.registered_nodes[nn].can_dig and
|
||||
not minetest.registered_nodes[nn].can_dig(pos, player) then
|
||||
local player_inv = player:get_inventory()
|
||||
|
||||
for i=1,player_inv:get_size("main") do
|
||||
player_inv:set_stack("main", i, nil)
|
||||
end
|
||||
for i=1,player_inv:get_size("craft") do
|
||||
player_inv:set_stack("craft", i, nil)
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
minetest.dig_node(pos)
|
||||
minetest.add_node(pos, {name="bones:bones", param2=param2})
|
||||
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local player_inv = player:get_inventory()
|
||||
inv:set_size("main", 8*4)
|
||||
|
||||
local empty_list = inv:get_list("main")
|
||||
inv:set_list("main", player_inv:get_list("main"))
|
||||
player_inv:set_list("main", empty_list)
|
||||
|
||||
for i=1,player_inv:get_size("craft") do
|
||||
inv:add_item("main", player_inv:get_stack("craft", i))
|
||||
player_inv:set_stack("craft", i, nil)
|
||||
end
|
||||
|
||||
meta:set_string("formspec", "size[8,9;]"..
|
||||
"list[current_name;main;0,0;8,4;]"..
|
||||
"list[current_player;main;0,5;8,4;]")
|
||||
meta:set_string("infotext", player:get_player_name().."'s fresh bones")
|
||||
meta:set_string("owner", player:get_player_name())
|
||||
meta:set_int("time", 0)
|
||||
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
timer:start(10)
|
||||
end)
|
BIN
mods/bones/textures/bones_bottom.png
Normal file
After Width: | Height: | Size: 284 B |
BIN
mods/bones/textures/bones_front.png
Normal file
After Width: | Height: | Size: 300 B |
BIN
mods/bones/textures/bones_rear.png
Normal file
After Width: | Height: | Size: 306 B |
BIN
mods/bones/textures/bones_side.png
Normal file
After Width: | Height: | Size: 289 B |
BIN
mods/bones/textures/bones_top.png
Normal file
After Width: | Height: | Size: 279 B |
26
mods/bucket/README.txt
Normal file
@ -0,0 +1,26 @@
|
||||
Minetest 0.4 mod: bucket
|
||||
=========================
|
||||
|
||||
License of source code:
|
||||
-----------------------
|
||||
Copyright (C) 2011-2012 Kahrl <kahrl@gmx.net>
|
||||
Copyright (C) 2011-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||
|
||||
This program 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 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
http://www.gnu.org/licenses/lgpl-2.1.html
|
||||
|
||||
License of media (textures and sounds)
|
||||
--------------------------------------
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
http://creativecommons.org/licenses/by-sa/3.0/
|
||||
|
||||
Authors of media files
|
||||
-----------------------
|
||||
Everything not listed in here:
|
||||
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||
|
||||
|
1
mods/bucket/depends.txt
Normal file
@ -0,0 +1 @@
|
||||
mapgen
|
199
mods/bucket/init.lua
Normal file
@ -0,0 +1,199 @@
|
||||
-- Minetest 0.4 mod: bucket
|
||||
-- See README.txt for licensing and other information.
|
||||
|
||||
local LIQUID_MAX = 8 --The number of water levels when liquid_finite is enabled
|
||||
|
||||
minetest.register_alias("bucket", "bucket:bucket_empty")
|
||||
minetest.register_alias("bucket_water", "bucket:bucket_water")
|
||||
minetest.register_alias("bucket_lava", "bucket:bucket_lava")
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'bucket:bucket_empty 1',
|
||||
recipe = {
|
||||
{'tools:steel_ingot', '', 'tools:steel_ingot'},
|
||||
{'', 'tools:steel_ingot', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'bucket:bucket_empty 1',
|
||||
recipe = {
|
||||
{'tools:tin_ingot', '', 'tools:tin_ingot'},
|
||||
{'', 'tools:tin_ingot', ''},
|
||||
}
|
||||
})
|
||||
|
||||
bucket = {}
|
||||
bucket.liquids = {}
|
||||
|
||||
local function check_protection(pos, name, text)
|
||||
if minetest.is_protected(pos, name) then
|
||||
minetest.log("action", (name ~= "" and name or "A mod")
|
||||
.. " tried to " .. text
|
||||
.. " at protected position "
|
||||
.. minetest.pos_to_string(pos)
|
||||
.. " with a bucket")
|
||||
minetest.record_protection_violation(pos, name)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- Register a new liquid
|
||||
-- source = name of the source node
|
||||
-- flowing = name of the flowing node
|
||||
-- itemname = name of the new bucket item (or nil if liquid is not takeable)
|
||||
-- inventory_image = texture of the new bucket item (ignored if itemname == nil)
|
||||
-- This function can be called from any mod (that depends on bucket).
|
||||
function bucket.register_liquid(source, flowing, itemname, inventory_image, name)
|
||||
bucket.liquids[source] = {
|
||||
source = source,
|
||||
flowing = flowing,
|
||||
itemname = itemname,
|
||||
}
|
||||
bucket.liquids[flowing] = bucket.liquids[source]
|
||||
|
||||
if itemname ~= nil then
|
||||
minetest.register_craftitem(itemname, {
|
||||
description = name,
|
||||
inventory_image = inventory_image,
|
||||
stack_max = 1,
|
||||
liquids_pointable = true,
|
||||
groups = {not_in_creative_inventory=1},
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
-- Must be pointing to node
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
end
|
||||
|
||||
local node = minetest.get_node_or_nil(pointed_thing.under)
|
||||
local ndef
|
||||
if node then
|
||||
ndef = minetest.registered_nodes[node.name]
|
||||
end
|
||||
-- Call on_rightclick if the pointed node defines it
|
||||
if ndef and ndef.on_rightclick and
|
||||
user and not user:get_player_control().sneak then
|
||||
return ndef.on_rightclick(
|
||||
pointed_thing.under,
|
||||
node, user,
|
||||
itemstack) or itemstack
|
||||
end
|
||||
|
||||
local place_liquid = function(pos, node, source, flowing, fullness)
|
||||
if check_protection(pos,
|
||||
user and user:get_player_name() or "",
|
||||
"place "..source) then
|
||||
return
|
||||
end
|
||||
if math.floor(fullness/128) == 1 or
|
||||
not minetest.setting_getbool("liquid_finite") then
|
||||
minetest.add_node(pos, {name=source,
|
||||
param2=fullness})
|
||||
return
|
||||
elseif node.name == flowing then
|
||||
fullness = fullness + node.param2
|
||||
elseif node.name == source then
|
||||
fullness = LIQUID_MAX
|
||||
end
|
||||
|
||||
if fullness >= LIQUID_MAX then
|
||||
minetest.add_node(pos, {name=source,
|
||||
param2=LIQUID_MAX})
|
||||
else
|
||||
minetest.add_node(pos, {name=flowing,
|
||||
param2=fullness})
|
||||
end
|
||||
end
|
||||
|
||||
-- Check if pointing to a buildable node
|
||||
local fullness = tonumber(itemstack:get_metadata())
|
||||
if not fullness then fullness = LIQUID_MAX end
|
||||
|
||||
if ndef and ndef.buildable_to then
|
||||
-- buildable; replace the node
|
||||
place_liquid(pointed_thing.under, node,
|
||||
source, flowing, fullness)
|
||||
else
|
||||
-- not buildable to; place the liquid above
|
||||
-- check if the node above can be replaced
|
||||
local node = minetest.get_node_or_nil(pointed_thing.above)
|
||||
if node and minetest.registered_nodes[node.name].buildable_to then
|
||||
place_liquid(pointed_thing.above,
|
||||
node, source,
|
||||
flowing, fullness)
|
||||
else
|
||||
-- do not remove the bucket with the liquid
|
||||
return
|
||||
end
|
||||
end
|
||||
return {name="bucket:bucket_empty"}
|
||||
end
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_craftitem("bucket:bucket_empty", {
|
||||
description = "Empty Bucket",
|
||||
inventory_image = "bucket.png",
|
||||
stack_max = 1,
|
||||
liquids_pointable = true,
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
-- Must be pointing to node
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
end
|
||||
-- Check if pointing to a liquid source
|
||||
node = minetest.get_node(pointed_thing.under)
|
||||
liquiddef = bucket.liquids[node.name]
|
||||
if liquiddef ~= nil and liquiddef.itemname ~= nil and
|
||||
(node.name == liquiddef.source or
|
||||
(node.name == liquiddef.flowing and
|
||||
minetest.setting_getbool("liquid_finite"))) then
|
||||
if check_protection(pointed_thing.under,
|
||||
user:get_player_name(),
|
||||
"take ".. node.name) then
|
||||
return
|
||||
end
|
||||
|
||||
minetest.add_node(pointed_thing.under, {name="air"})
|
||||
|
||||
if node.name == liquiddef.source then
|
||||
node.param2 = LIQUID_MAX
|
||||
end
|
||||
return ItemStack({name = liquiddef.itemname,
|
||||
metadata = tostring(node.param2)})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
bucket.register_liquid(
|
||||
"mapgen:water_source",
|
||||
"mapgen:water_flowing",
|
||||
"bucket:bucket_water",
|
||||
"bucket_water.png",
|
||||
"Water Bucket"
|
||||
)
|
||||
|
||||
bucket.register_liquid(
|
||||
"mapgen:lava_source",
|
||||
"mapgen:lava_flowing",
|
||||
"bucket:bucket_lava",
|
||||
"bucket_lava.png",
|
||||
"Lava Bucket"
|
||||
)
|
||||
|
||||
bucket.register_liquid(
|
||||
"ores:oil_source",
|
||||
"ores:oil_flowing",
|
||||
"bucket:oil",
|
||||
"bucket_oil.png",
|
||||
"Oil Bucket"
|
||||
)
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "bucket:bucket_lava",
|
||||
burntime = 60,
|
||||
replacements = {{"bucket:bucket_lava", "bucket:bucket_empty"}},
|
||||
})
|
BIN
mods/bucket/textures/bucket.png
Normal file
After Width: | Height: | Size: 278 B |
BIN
mods/bucket/textures/bucket_lava.png
Normal file
After Width: | Height: | Size: 287 B |
BIN
mods/bucket/textures/bucket_oil.png
Normal file
After Width: | Height: | Size: 354 B |
BIN
mods/bucket/textures/bucket_water.png
Normal file
After Width: | Height: | Size: 288 B |
2
mods/chatcomms/depends.txt
Normal file
@ -0,0 +1,2 @@
|
||||
irc_commands?
|
||||
irc?
|
43
mods/chatcomms/init.lua
Normal file
@ -0,0 +1,43 @@
|
||||
--init.lua
|
||||
|
||||
-- This file is part of BFD.
|
||||
|
||||
-- BFD is free software: you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation, either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
|
||||
-- BFD 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 may contact Jordach via the Minetest Forums PM service for help
|
||||
-- or ask on the forum topic for which this game is set on.
|
||||
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with BFD. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
minetest.register_chatcommand("skins", {
|
||||
description = "Instructions on getting your skin into the game",
|
||||
func = function(name)
|
||||
minetest.chat_send_player(name, "To install a skin, go to <insert domain>.com for a skin and then paste the website address to the chat, as a")
|
||||
minetest.chat_send_player(name, "server operator / admin will install it and will be availible at server restart, which is usually 10AM PDT.")
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("admin", {
|
||||
description = "Call an admin with a message attached", -- WARNING: ONLY OPERABLE WITH IRC MOD ENABLED.
|
||||
privs = {shout=true},
|
||||
params = "<message to admins>",
|
||||
func = function (name, param)
|
||||
if minetest.get_modpath("irc") ~= nil then
|
||||
mt_irc:say("Jordach", param)
|
||||
--mt_irc:say("VanessaE", param)
|
||||
else
|
||||
--minetest.chat_send_player(name, param)
|
||||
-- ^ testing line
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
1
mods/deco/depends.txt
Normal file
@ -0,0 +1 @@
|
||||
default
|
924
mods/deco/init.lua
Normal file
@ -0,0 +1,924 @@
|
||||
--deco.lua
|
||||
|
||||
-- This file is part of BFD.
|
||||
|
||||
-- BFD is free software: you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation, either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
|
||||
-- BFD 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 may contact Jordach via the Minetest Forums PM service for help
|
||||
-- or ask on the forum topic for which this game is set on.
|
||||
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with BFD. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
deco = {}
|
||||
|
||||
-- glass
|
||||
|
||||
minetest.register_node("deco:obsidian_glass", {
|
||||
description = "Obsidian Glass",
|
||||
drawtype = "glasslike",
|
||||
tiles = {"deco_obsidian_glass.png"},
|
||||
paramtype = "light",
|
||||
is_ground_content = false,
|
||||
sunlight_propagates = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
groups = {cracky=3,oddly_breakable_by_hand=3},
|
||||
})
|
||||
|
||||
minetest.register_node("deco:glass", {
|
||||
description = "Glass",
|
||||
drawtype = "glasslike",
|
||||
tiles = {"deco_glass.png"},
|
||||
paramtype = "light",
|
||||
is_ground_content = false,
|
||||
sunlight_propagates = true,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
groups = {cracky=3,oddly_breakable_by_hand=3},
|
||||
})
|
||||
|
||||
|
||||
-- wood planks
|
||||
|
||||
minetest.register_node("deco:oak_plank", {
|
||||
description = "Oak Planks",
|
||||
tiles = {"deco_wood_oak_planks.png"},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
groups = {oddly_breakable_by_hand=1, flammable=1, choppy=3, wood=1},
|
||||
})
|
||||
|
||||
minetest.register_node("deco:birch_plank", {
|
||||
description = "Birch Planks",
|
||||
tiles = {"deco_wood_birch_planks.png"},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
groups = {oddly_breakable_by_hand=1, flammable=1, choppy=3, wood=1},
|
||||
})
|
||||
|
||||
minetest.register_node("deco:cherry_plank", {
|
||||
description = "Cherry Planks",
|
||||
tiles = {"deco_wood_cherry_planks.png"},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
groups = {oddly_breakable_by_hand=1, flammable=1, choppy=3, wood=1},
|
||||
})
|
||||
|
||||
minetest.register_node("deco:evergreen_plank", {
|
||||
description = "Evergreen Planks",
|
||||
tiles = {"deco_wood_evergreen_planks.png"},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
groups = {oddly_breakable_by_hand=1, flammable=1, choppy=3, wood=1},
|
||||
})
|
||||
|
||||
-- plank crafting
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'deco:oak_plank 6',
|
||||
recipe = {
|
||||
{'mapgen:oak_log'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'deco:oak_plank 6',
|
||||
recipe = {
|
||||
{'mapgen:dead_oak_log'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'deco:cherry_plank 6',
|
||||
recipe = {
|
||||
{'mapgen:cherry_log'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'deco:birch_plank 6',
|
||||
recipe = {
|
||||
{'mapgen:birch_log'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'deco:evergreen_plank 6',
|
||||
recipe = {
|
||||
{'mapgen:evergreen_log'},
|
||||
}
|
||||
})
|
||||
|
||||
--chest crafts
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'deco:chest',
|
||||
recipe = {
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
{'group:wood', '', 'group:wood'},
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'deco:chest_locked',
|
||||
recipe = {
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
{'group:wood', 'tools:steel_ingot', 'group:wood'},
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
}
|
||||
})
|
||||
|
||||
--chests
|
||||
|
||||
default.chest_formspec =
|
||||
"size[8,9]"..
|
||||
"list[current_name;main;0,0;8,4;]"..
|
||||
"list[current_player;main;0,5;8,4;]"
|
||||
|
||||
function default.get_locked_chest_formspec(pos)
|
||||
local spos = pos.x .. "," .. pos.y .. "," ..pos.z
|
||||
local formspec =
|
||||
"size[8,9]"..
|
||||
"list[nodemeta:".. spos .. ";main;0,0;8,4;]"..
|
||||
"list[current_player;main;0,5;8,4;]"
|
||||
return formspec
|
||||
end
|
||||
|
||||
minetest.register_node("deco:chest", {
|
||||
description = "Chest",
|
||||
tiles = {"deco_chest_top.png", "deco_chest_top.png", "deco_chest_side.png",
|
||||
"deco_chest_side.png", "deco_chest_side.png", "deco_chest_front.png"},
|
||||
paramtype2 = "facedir",
|
||||
groups = {choppy=2,oddly_breakable_by_hand=2},
|
||||
legacy_facedir_simple = true,
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec",default.chest_formspec)
|
||||
meta:set_string("infotext", "Chest")
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8*4)
|
||||
end,
|
||||
after_place_node = function(pos, placer)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", placer:get_player_name() or "")
|
||||
meta:set_string("infotext", "Unlocked Chest (owned by "..
|
||||
meta:get_string("owner")..")")
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("main")
|
||||
end,
|
||||
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" moves stuff in chest at "..minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" moves stuff to chest at "..minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" takes stuff from chest at "..minetest.pos_to_string(pos))
|
||||
end,
|
||||
})
|
||||
|
||||
local function has_locked_chest_privilege(meta, player)
|
||||
if player:get_player_name() ~= meta:get_string("owner") then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
minetest.register_node("deco:chest_locked", {
|
||||
description = "Locked Chest",
|
||||
tiles = {"deco_chest_top.png", "deco_chest_top.png", "deco_chest_side.png",
|
||||
"deco_chest_side.png", "deco_chest_side.png", "deco_chest_lock.png"},
|
||||
paramtype2 = "facedir",
|
||||
groups = {choppy=2,oddly_breakable_by_hand=2},
|
||||
legacy_facedir_simple = true,
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
after_place_node = function(pos, placer)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", placer:get_player_name() or "")
|
||||
meta:set_string("infotext", "Locked Chest (owned by "..
|
||||
meta:get_string("owner")..")")
|
||||
end,
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("infotext", "Locked Chest")
|
||||
meta:set_string("owner", "")
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8*4)
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("main") and has_locked_chest_privilege(meta, player)
|
||||
end,
|
||||
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_locked_chest_privilege(meta, player) then
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" tried to access a locked chest belonging to "..
|
||||
meta:get_string("owner").." at "..
|
||||
minetest.pos_to_string(pos))
|
||||
return 0
|
||||
end
|
||||
return count
|
||||
end,
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_locked_chest_privilege(meta, player) then
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" tried to access a locked chest belonging to "..
|
||||
meta:get_string("owner").." at "..
|
||||
minetest.pos_to_string(pos))
|
||||
return 0
|
||||
end
|
||||
return stack:get_count()
|
||||
end,
|
||||
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_locked_chest_privilege(meta, player) then
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" tried to access a locked chest belonging to "..
|
||||
meta:get_string("owner").." at "..
|
||||
minetest.pos_to_string(pos))
|
||||
return 0
|
||||
end
|
||||
return stack:get_count()
|
||||
end,
|
||||
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" moves stuff in locked chest at "..minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" moves stuff to locked chest at "..minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" takes stuff from locked chest at "..minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if has_locked_chest_privilege(meta, clicker) then
|
||||
minetest.show_formspec(
|
||||
clicker:get_player_name(),
|
||||
"deco:chest_locked",
|
||||
default.get_locked_chest_formspec(pos)
|
||||
)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
--torches
|
||||
|
||||
minetest.register_node("deco:torch", {
|
||||
description = "Torch",
|
||||
drawtype = "torchlike",
|
||||
tiles = {
|
||||
{name="deco_torch_floor.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}},
|
||||
{name="deco_torch_ceiling.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}},
|
||||
{name="deco_torch.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}}
|
||||
},
|
||||
inventory_image = "deco_torch_wield.png",
|
||||
wield_image = "deco_torch_wield.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
walkable = false,
|
||||
light_source = 13,
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
wall_top = {-0.1, 0.5-0.6, -0.1, 0.1, 0.5, 0.1},
|
||||
wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1},
|
||||
wall_side = {-0.5, -0.3, -0.1, -0.5+0.3, 0.3, 0.1},
|
||||
},
|
||||
groups = {choppy=2,dig_immediate=3,flammable=1,attached_node=1,hot=2},
|
||||
legacy_wallmounted = true,
|
||||
sounds = default.node_sound_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'deco:torch 4',
|
||||
recipe = {
|
||||
{'ores:coal_lump'},
|
||||
{'tools:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'deco:torch 4',
|
||||
recipe = {
|
||||
{'ores:coal_fragment'},
|
||||
{'tools:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
--
|
||||
-- Furnace
|
||||
--
|
||||
|
||||
function default.get_furnace_active_formspec(pos, percent)
|
||||
local formspec =
|
||||
"size[8,9]"..
|
||||
"image[2,2;1,1;deco_furnace_fire_bg.png^[lowpart:"..
|
||||
(100-percent)..":deco_furnace_fire_fg.png]"..
|
||||
"list[current_name;fuel;2,3;1,1;]"..
|
||||
"list[current_name;src;2,1;1,1;]"..
|
||||
"list[current_name;dst;5,1;2,2;]"..
|
||||
"list[current_player;main;0,5;8,4;]"
|
||||
return formspec
|
||||
end
|
||||
|
||||
default.furnace_inactive_formspec =
|
||||
"size[8,9]"..
|
||||
"image[2,2;1,1;deco_furnace_fire_bg.png]"..
|
||||
"list[current_name;fuel;2,3;1,1;]"..
|
||||
"list[current_name;src;2,1;1,1;]"..
|
||||
"list[current_name;dst;5,1;2,2;]"..
|
||||
"list[current_player;main;0,5;8,4;]"
|
||||
|
||||
minetest.register_node("deco:furnace", {
|
||||
description = "Furnace",
|
||||
tiles = {"deco_furnace_top.png", "deco_furnace_bottom.png", "deco_furnace_side.png",
|
||||
"deco_furnace_side.png", "deco_furnace_side.png", "deco_furnace_front.png"},
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=3},
|
||||
legacy_facedir_simple = true,
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", default.furnace_inactive_formspec)
|
||||
meta:set_string("infotext", "Furnace")
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("fuel", 1)
|
||||
inv:set_size("src", 1)
|
||||
inv:set_size("dst", 4)
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
if not inv:is_empty("fuel") then
|
||||
return false
|
||||
elseif not inv:is_empty("dst") then
|
||||
return false
|
||||
elseif not inv:is_empty("src") then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end,
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
if listname == "fuel" then
|
||||
if minetest.get_craft_result({method="fuel",width=1,items={stack}}).time ~= 0 then
|
||||
if inv:is_empty("src") then
|
||||
meta:set_string("infotext","Furnace is empty")
|
||||
end
|
||||
return stack:get_count()
|
||||
else
|
||||
return 0
|
||||
end
|
||||
elseif listname == "src" then
|
||||
return stack:get_count()
|
||||
elseif listname == "dst" then
|
||||
return 0
|
||||
end
|
||||
end,
|
||||
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local stack = inv:get_stack(from_list, from_index)
|
||||
if to_list == "fuel" then
|
||||
if minetest.get_craft_result({method="fuel",width=1,items={stack}}).time ~= 0 then
|
||||
if inv:is_empty("src") then
|
||||
meta:set_string("infotext","Furnace is empty")
|
||||
end
|
||||
return count
|
||||
else
|
||||
return 0
|
||||
end
|
||||
elseif to_list == "src" then
|
||||
return count
|
||||
elseif to_list == "dst" then
|
||||
return 0
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("deco:furnace_active", {
|
||||
description = "Furnace",
|
||||
tiles = {
|
||||
"deco_furnace_top.png",
|
||||
"deco_furnace_bottom.png",
|
||||
"deco_furnace_side.png",
|
||||
"deco_furnace_side.png",
|
||||
"deco_furnace_side.png",
|
||||
{
|
||||
image = "deco_furnace_front_active.png",
|
||||
backface_culling = false,
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 1.5
|
||||
},
|
||||
}
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
light_source = 8,
|
||||
drop = "deco:furnace",
|
||||
--groups = {cracky=2, not_in_creative_inventory=1,hot=1},
|
||||
legacy_facedir_simple = true,
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", default.furnace_inactive_formspec)
|
||||
meta:set_string("infotext", "Furnace");
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("fuel", 1)
|
||||
inv:set_size("src", 1)
|
||||
inv:set_size("dst", 4)
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
if not inv:is_empty("fuel") then
|
||||
return false
|
||||
elseif not inv:is_empty("dst") then
|
||||
return false
|
||||
elseif not inv:is_empty("src") then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end,
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
if listname == "fuel" then
|
||||
if minetest.get_craft_result({method="fuel",width=1,items={stack}}).time ~= 0 then
|
||||
if inv:is_empty("src") then
|
||||
meta:set_string("infotext","Furnace is empty")
|
||||
end
|
||||
return stack:get_count()
|
||||
else
|
||||
return 0
|
||||
end
|
||||
elseif listname == "src" then
|
||||
return stack:get_count()
|
||||
elseif listname == "dst" then
|
||||
return 0
|
||||
end
|
||||
end,
|
||||
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local stack = inv:get_stack(from_list, from_index)
|
||||
if to_list == "fuel" then
|
||||
if minetest.get_craft_result({method="fuel",width=1,items={stack}}).time ~= 0 then
|
||||
if inv:is_empty("src") then
|
||||
meta:set_string("infotext","Furnace is empty")
|
||||
end
|
||||
return count
|
||||
else
|
||||
return 0
|
||||
end
|
||||
elseif to_list == "src" then
|
||||
return count
|
||||
elseif to_list == "dst" then
|
||||
return 0
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
local function swap_node(pos,name)
|
||||
local node = minetest.get_node(pos)
|
||||
if node.name == name then
|
||||
return
|
||||
end
|
||||
node.name = name
|
||||
minetest.swap_node(pos,node)
|
||||
end
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"deco:furnace","deco:furnace_active"},
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local meta = minetest.get_meta(pos)
|
||||
for i, name in ipairs({
|
||||
"fuel_totaltime",
|
||||
"fuel_time",
|
||||
"src_totaltime",
|
||||
"src_time"
|
||||
}) do
|
||||
if meta:get_string(name) == "" then
|
||||
meta:set_float(name, 0.0)
|
||||
end
|
||||
end
|
||||
|
||||
local inv = meta:get_inventory()
|
||||
|
||||
local srclist = inv:get_list("src")
|
||||
local cooked = nil
|
||||
local aftercooked
|
||||
|
||||
if srclist then
|
||||
cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
|
||||
end
|
||||
|
||||
local was_active = false
|
||||
|
||||
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
|
||||
was_active = true
|
||||
meta:set_float("fuel_time", meta:get_float("fuel_time") + 1)
|
||||
meta:set_float("src_time", meta:get_float("src_time") + 1)
|
||||
if cooked and cooked.item and meta:get_float("src_time") >= cooked.time then
|
||||
-- check if there's room for output in "dst" list
|
||||
if inv:room_for_item("dst",cooked.item) then
|
||||
-- Put result in "dst" list
|
||||
inv:add_item("dst", cooked.item)
|
||||
-- take stuff from "src" list
|
||||
inv:set_stack("src", 1, aftercooked.items[1])
|
||||
else
|
||||
--print("Could not insert '"..cooked.item:to_string().."'")
|
||||
end
|
||||
meta:set_string("src_time", 0)
|
||||
end
|
||||
end
|
||||
|
||||
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
|
||||
local percent = math.floor(meta:get_float("fuel_time") /
|
||||
meta:get_float("fuel_totaltime") * 100)
|
||||
meta:set_string("infotext","Furnace active: "..percent.."%")
|
||||
swap_node(pos,"deco:furnace_active")
|
||||
meta:set_string("formspec",default.get_furnace_active_formspec(pos, percent))
|
||||
return
|
||||
end
|
||||
|
||||
local fuel = nil
|
||||
local afterfuel
|
||||
local cooked = nil
|
||||
local fuellist = inv:get_list("fuel")
|
||||
local srclist = inv:get_list("src")
|
||||
|
||||
if srclist then
|
||||
cooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
|
||||
end
|
||||
if fuellist then
|
||||
fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
|
||||
end
|
||||
|
||||
if not fuel or fuel.time <= 0 then
|
||||
meta:set_string("infotext","Furnace out of fuel")
|
||||
swap_node(pos,"deco:furnace")
|
||||
meta:set_string("formspec", default.furnace_inactive_formspec)
|
||||
return
|
||||
end
|
||||
|
||||
if cooked.item:is_empty() then
|
||||
if was_active then
|
||||
meta:set_string("infotext","Furnace is empty")
|
||||
swap_node(pos,"deco:furnace")
|
||||
meta:set_string("formspec", default.furnace_inactive_formspec)
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
meta:set_string("fuel_totaltime", fuel.time)
|
||||
meta:set_string("fuel_time", 0)
|
||||
|
||||
inv:set_stack("fuel", 1, afterfuel.items[1])
|
||||
end,
|
||||
})
|
||||
|
||||
-- furnace crafting
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'deco:furnace',
|
||||
recipe = {
|
||||
{'group:stone', 'group:stone', 'group:stone'},
|
||||
{'group:stone', '', 'group:stone'},
|
||||
{'group:stone', 'group:stone', 'group:stone'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'deco:sign_wall 3',
|
||||
recipe = {
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
{'', 'tools:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
-- on a rail!
|
||||
|
||||
minetest.register_node("deco:rail", {
|
||||
description = "Rail",
|
||||
drawtype = "raillike",
|
||||
tiles = {"deco_rail.png", "deco_rail_curved.png", "deco_rail_t_junction.png", "deco_rail_crossing.png"},
|
||||
inventory_image = "deco_rail.png",
|
||||
wield_image = "deco_rail.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
is_ground_content = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
-- but how to specify the dimensions for curved and sideways rails?
|
||||
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
|
||||
},
|
||||
groups = {bendy=2,dig_immediate=2,attached_node=1},
|
||||
})
|
||||
|
||||
|
||||
--desk chair :3
|
||||
|
||||
minetest.register_node("deco:desk_chair", {
|
||||
description = "Desk Chair",
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
tiles = {"deco_wood_oak_planks.png"},
|
||||
paramtype2 = "facedir",
|
||||
groups = {choppy=3, oddly_breakable_by_hand=1},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.1, -0.5, -0.5, 0.1, -0.4, -0.1},
|
||||
{-0.1, -0.4, 0.1, -0.5, -0.5, -0.1},
|
||||
{0.1, -0.4, 0.1, -0.1, -0.5, 0.5},
|
||||
{-0.1, 0, 0.3, 0.1, 0.6, 0.4},
|
||||
{0.5, -0.5, 0.1, 0.1, -0.4, -0.1},
|
||||
{0.1, 0, -0.1, -0.1, -0.5, 0.1},
|
||||
{0.3, 0.1, 0.3, -0.3, 0, -0.2},
|
||||
{0.3, 0.4, 0.2, -0.3, 0.7, 0.3},
|
||||
},
|
||||
},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'deco:desk_chair',
|
||||
recipe = {
|
||||
{'', 'group:wood', ''},
|
||||
{'', 'group:wood', ''},
|
||||
{'tools:stick', 'tools:stick', 'tools:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
-- desk formspec stuff
|
||||
|
||||
default.desk_formspec =
|
||||
"size[8,9]"..
|
||||
"list[current_name;main;2,0;4,4;]"..
|
||||
"list[current_player;main;0,5;8,4;]"
|
||||
|
||||
--desks with micro amounts of storage :)
|
||||
|
||||
minetest.register_node("deco:desk_2", {
|
||||
description = "Desk",
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
tiles = {"deco_wood_oak_planks.png"},
|
||||
groups = {choppy=3, oddly_breakable_by_hand=1},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.3, -0.4, -0.4, -0.5, -0.5},
|
||||
{0.5, -0.3, -0.5, 0.4, -0.5, -0.4},
|
||||
{-0.5, -0.3, -0.5, 0.5, 0.3, 0.2},
|
||||
{0.5, 0.5, -0.5, -0.5, 0.3, 0.5},
|
||||
},
|
||||
},
|
||||
|
||||
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 == "deco:desk" ) 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,
|
||||
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, 0.5, -0.5, 0.5, -0.5, 1.5},
|
||||
}
|
||||
},
|
||||
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec",default.desk_formspec)
|
||||
meta:set_string("infotext", "Desk")
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8*4)
|
||||
end,
|
||||
after_place_node = function(pos, placer)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", placer:get_player_name() or "")
|
||||
meta:set_string("infotext", "Desk (owned by "..
|
||||
meta:get_string("owner")..")")
|
||||
local node = minetest.env:get_node(pos)
|
||||
local p = {x=pos.x, y=pos.y, z=pos.z}
|
||||
local param2 = node.param2
|
||||
node.name = "deco:desk"
|
||||
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,
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("main")
|
||||
end,
|
||||
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" moves stuff in desk at "..minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" moves stuff to desk at "..minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" takes stuff from desk at "..minetest.pos_to_string(pos))
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("deco:desk", {
|
||||
description = "Desk",
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {choppy=3, oddly_breakable_by_hand=1},
|
||||
tiles = {"deco_wood_oak_planks.png"},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.4, 0.3, 0.5, -0.5, -0.5, 0.4},
|
||||
{0.5, 0.3, 0.5, -0.5, 0.5, -0.5},
|
||||
{0.4, 0.3, 0.5, 0.5, -0.5, 0.4},
|
||||
},
|
||||
},
|
||||
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{0, 0, 0, 0, 0, 0},
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
--desk crafting
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'deco:desk_2',
|
||||
recipe = {
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
{'tools:stick', 'deco:chest', 'tools:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
--stone square
|
||||
|
||||
minetest.register_node("deco:stone_tile", {
|
||||
description = "Stone Tile",
|
||||
tiles = {"deco_stone_tile.png"},
|
||||
groups = {cracky=3, stone=1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'deco:stone_tile 4',
|
||||
recipe = {
|
||||
{'mapgen:cobble', 'mapgen:cobble'},
|
||||
{'mapgen:cobble', 'mapgen:cobble'},
|
||||
}
|
||||
})
|
||||
|
||||
-- stone brick
|
||||
|
||||
minetest.register_node("deco:stone_brick", {
|
||||
description = "Stone Brick",
|
||||
tiles = {"deco_stone_brick.png"},
|
||||
groups = {cracky=3, stone=1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'deco:stone_brick 4',
|
||||
recipe = {
|
||||
{'mapgen:stone', 'mapgen:stone'},
|
||||
{'mapgen:stone', 'mapgen:stone'},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
--
|
||||
-- Fuels
|
||||
--
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "ores:coal_lump",
|
||||
burntime = 60,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "bucket:bucket_lava",
|
||||
burntime = 120,
|
||||
replacements = {{"bucket:bucket_lava", "bucket:bucket_empty"}},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "bucket:oil",
|
||||
burntime = 360,
|
||||
replacements = {{"bucket:oil", "bucket:bucket_empty"}},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "group:leaves",
|
||||
burntime = 5,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "group:tree",
|
||||
burntime = 45,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "group:wood",
|
||||
burntime = 7,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "group:flower",
|
||||
burntime = 2,
|
||||
})
|
||||
|
||||
--
|
||||
-- Cooking Recipes
|
||||
--
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "deco:glass",
|
||||
recipe = "mapgen:sand",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
recipe = 'mapgen:cobble',
|
||||
output = 'mapgen:stone'
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
recipe = 'mapgen:crust_cobble',
|
||||
output = 'mapgen:crust_stone'
|
||||
})
|
BIN
mods/deco/textures/deco_brick.png
Normal file
After Width: | Height: | Size: 480 B |
BIN
mods/deco/textures/deco_chest_front.png
Normal file
After Width: | Height: | Size: 761 B |
BIN
mods/deco/textures/deco_chest_lock.png
Normal file
After Width: | Height: | Size: 864 B |
BIN
mods/deco/textures/deco_chest_side.png
Normal file
After Width: | Height: | Size: 709 B |
BIN
mods/deco/textures/deco_chest_top.png
Normal file
After Width: | Height: | Size: 627 B |
BIN
mods/deco/textures/deco_cobble.png
Normal file
After Width: | Height: | Size: 731 B |
BIN
mods/deco/textures/deco_fence.png
Normal file
After Width: | Height: | Size: 482 B |
BIN
mods/deco/textures/deco_furnace_bottom.png
Normal file
After Width: | Height: | Size: 604 B |
BIN
mods/deco/textures/deco_furnace_fire_bg.png
Normal file
After Width: | Height: | Size: 282 B |
BIN
mods/deco/textures/deco_furnace_fire_fg.png
Normal file
After Width: | Height: | Size: 803 B |
BIN
mods/deco/textures/deco_furnace_front.png
Normal file
After Width: | Height: | Size: 628 B |
BIN
mods/deco/textures/deco_furnace_front_active.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
mods/deco/textures/deco_furnace_side.png
Normal file
After Width: | Height: | Size: 604 B |
BIN
mods/deco/textures/deco_furnace_top.png
Normal file
After Width: | Height: | Size: 604 B |
BIN
mods/deco/textures/deco_glass.png
Normal file
After Width: | Height: | Size: 978 B |