1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-06-28 14:16:06 +02:00

Update minetestforfun_game, fix maptools

This commit is contained in:
LeMagnesium
2016-11-10 00:01:34 +01:00
parent 783cb0e3d9
commit d40a65244b
92 changed files with 3202 additions and 1803 deletions

View File

@ -1,62 +1,62 @@
Minetest Game mod: doors
========================
version: 2.0
See license.txt for license information.
License of source code:
-----------------------
Copyright (C) 2012 PilzAdam
modified by BlockMen (added sounds, glassdoors[glass, obsidian glass], trapdoor)
Steel trapdoor added by sofar.
Copyright (C) 2016 sofar@foo-projects.org
Re-implemented most of the door algorithms, added meshes, UV wrapped texture
Authors of source code
----------------------
Originally by PilzAdam (MIT)
Modified by BlockMen (MIT): Added sounds, glass doors (glass, obsidian glass) and trapdoor.
Modified by sofar (sofar@foo-projects.org) (MIT):
Added Steel trapdoor.
Re-implemented most of the door algorithms, added meshes, UV wrapped texture.
Added doors API to facilitate coding mods accessing and operating doors.
Added Fence Gate model, code, and sounds
Added Fence Gate model, code, and sounds.
This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2, as published by Sam Hocevar. See
http://sam.zoy.org/wtfpl/COPYING for more details.
Various Minetest developers and contributors (MIT)
License of textures
--------------------------------------
following Textures created by Fernando Zapata (CC BY-SA 3.0):
Authors of media (textures)
---------------------------
Following textures created by Fernando Zapata (CC BY-SA 3.0):
door_wood.png
door_wood_a.png
door_wood_a_r.png
door_wood_b.png
door_wood_b_r.png
following Textures created by BlockMen (WTFPL):
Following textures created by BlockMen (CC BY-SA 3.0):
door_trapdoor.png
door_obsidian_glass_side.png
following textures created by celeron55 (CC BY-SA 3.0):
Following textures created by celeron55 (CC BY-SA 3.0):
door_glass_a.png
door_glass_b.png
following Textures created by PenguinDad (CC BY-SA 4.0):
Following textures created by PenguinDad (CC BY-SA 4.0):
door_glass.png
door_obsidian_glass.png
following textures created by sofar (CC-BY-SA-3.0)
Following textures created by sofar (CC-BY-SA-3.0):
doors_trapdoor_steel.png
doors_trapdoor_steel_side.png
door_trapdoor_side.png
Obsidian door textures by red-001 based on textures by Pilzadam and BlockMen: WTFPL
Obsidian door textures by red-001 based on textures by Pilzadam and BlockMen (CC BY-SA 3.0):
door_obsidian_glass.png
Glass door textures by red-001 based on textures by celeron55: CC BY-SA 3.0
Glass door textures by red-001 based on textures by celeron55 (CC BY-SA 3.0):
door_glass.png
All other textures (created by PilzAdam): WTFPL
All other textures (created by PilzAdam) (CC BY-SA 3.0):
Door textures were converted to the new texture map by sofar, paramat and
red-001, under the same license as the originals.
Models:
--------------------------------------
Authors of media (models)
-------------------------
Door 3d models by sofar (CC-BY-SA-3.0)
- door_a.obj
- door_b.obj
@ -64,18 +64,21 @@ Fence gate models by sofar (CC-BY-SA-3.0)
- fencegate_open.obj
- fencegate_closed.obj
License of sounds
--------------------------------------
Authors of media (sounds)
-------------------------
Opening-Sound created by CGEffex (CC BY 3.0), modified by BlockMen
door_open.ogg
Closing-Sound created by bennstir (CC BY 3.0)
door_close.ogg
fencegate_open.ogg:
http://www.freesound.org/people/mhtaylor67/sounds/126041/ - CC0
http://www.freesound.org/people/mhtaylor67/sounds/126041/ - (CC0 1.0)
fencegate_close.ogg:
http://www.freesound.org/people/BarkersPinhead/sounds/274807/ - CC-BY-3.0
http://www.freesound.org/people/rivernile7/sounds/249573/ - CC-BY-3.0
Steel door sounds (open & close (CC-BY-3.0) by HazMatt
http://www.freesound.org/people/BarkersPinhead/sounds/274807/ - (CC-BY-3.0)
http://www.freesound.org/people/rivernile7/sounds/249573/ - (CC-BY-3.0)
Steel door sounds open & close (CC-BY-3.0) by HazMatt
- http://www.freesound.org/people/HazMattt/sounds/187283/
doors_steel_door_open.ogg
doors_steel_door_close.ogg
doors_glass_door_open.ogg, doors_glass_door_close.ogg:
https://www.freesound.org/people/SkeetMasterFunk69/sounds/235546/ (CC0 1.0)

View File

@ -0,0 +1,359 @@
local _doors = {}
_doors.registered_doors3 = {} --MFF doors3
-- door 3 nodes
function doors.register3(name, def)
if not name:find(":") then
name = "doors:" .. name
end
-- replace old doors of this type automatically
minetest.register_lbm({
name = ":doors:replace_" .. name:gsub(":", "_"),
nodenames = {name.."_b_1", name.."_b_2"},
action = function(pos, node)
local l = tonumber(node.name:sub(-1))
local meta = minetest.get_meta(pos)
local h = meta:get_int("right") + 1
local p2 = node.param2
local replace = {
{ { type = "a", state = 0 }, { type = "a", state = 3 } },
{ { type = "b", state = 1 }, { type = "b", state = 2 } }
}
local new = replace[l][h]
-- retain infotext and doors_owner fields
minetest.swap_node(pos, {name = name .. "_" .. new.type, param2 = p2})
meta:set_int("state", new.state)
-- properly place doors:hidden at the right spot
local p3 = p2
if new.state >= 2 then
p3 = (p3 + 3) % 4
end
if new.state % 2 == 1 then
if new.state >= 2 then
p3 = (p3 + 1) % 4
else
p3 = (p3 + 3) % 4
end
end
-- wipe meta on top node as it's unused
minetest.set_node({x = pos.x, y = pos.y + 1, z = pos.z},
{name = "doors:hidden", param2 = p3})
minetest.set_node({x = pos.x, y = pos.y + 2, z = pos.z},
{name = "doors:hidden", param2 = p3})
end
})
minetest.register_craftitem(":" .. name, {
description = def.description,
inventory_image = def.inventory_image,
on_place = function(itemstack, placer, pointed_thing)
local pos = nil
if not pointed_thing.type == "node" then
return itemstack
end
local node = minetest.get_node(pointed_thing.under)
local pdef = minetest.registered_nodes[node.name]
if pdef and pdef.on_rightclick then
return pdef.on_rightclick(pointed_thing.under,
node, placer, itemstack, pointed_thing)
end
if pdef and pdef.buildable_to then
pos = pointed_thing.under
else
pos = pointed_thing.above
node = minetest.get_node(pos)
pdef = minetest.registered_nodes[node.name]
if not pdef or not pdef.buildable_to then
return itemstack
end
end
local above = { x = pos.x, y = pos.y + 1, z = pos.z }
if not minetest.registered_nodes[minetest.get_node(above).name].buildable_to then
return itemstack
end
local above2 = { x = pos.x, y = pos.y + 2, z = pos.z }
if not minetest.registered_nodes[minetest.get_node(above2).name].buildable_to then
return itemstack
end
local pn = placer:get_player_name()
if minetest.is_protected(pos, pn) or minetest.is_protected(above, pn) or minetest.is_protected(above2, pn) then
return itemstack
end
local dir = minetest.dir_to_facedir(placer:get_look_dir())
local ref = {
{ x = -1, y = 0, z = 0 },
{ x = 0, y = 0, z = 1 },
{ x = 1, y = 0, z = 0 },
{ x = 0, y = 0, z = -1 },
}
local aside = {
x = pos.x + ref[dir + 1].x,
y = pos.y + ref[dir + 1].y,
z = pos.z + ref[dir + 1].z,
}
local state = 0
if minetest.get_item_group(minetest.get_node(aside).name, "door") == 1 then
state = state + 2
minetest.set_node(pos, {name = name .. "_b", param2 = dir})
else
minetest.set_node(pos, {name = name .. "_a", param2 = dir})
end
minetest.set_node(above, { name = "doors:hidden" })
minetest.set_node(above2, { name = "doors:hidden" })
local meta = minetest.get_meta(pos)
meta:set_int("state", state)
if def.protected then
local pn = placer:get_player_name()
meta:set_string("doors_owner", pn)
meta:set_string("infotext", "Owned by " .. pn)
end
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
end
on_place_node(pos, minetest.get_node(pos), placer, node, itemstack, pointed_thing)
return itemstack
end
})
local can_dig = function(pos, digger)
if not def.protected then
return true
end
if minetest.check_player_privs(digger:get_player_name(), {protection_bypass = true}) then
return true
end
local meta = minetest.get_meta(pos)
local name = ""
if digger then
name = digger:get_player_name()
end
return meta:get_string("doors_owner") == name
end
if not def.sounds then
def.sounds = default.node_sound_wood_defaults()
end
if not def.sound_open then
def.sound_open = "doors_door_open"
end
if not def.sound_close then
def.sound_close = "doors_door_close"
end
def.groups.not_in_creative_inventory = 1
def.groups.door = 1
def.drop = name
def.door = {
name = name,
sounds = { def.sound_close, def.sound_open },
}
def.on_rightclick = function(pos, node, clicker)
_doors.door_toggle(pos, clicker)
end
def.after_dig_node = function(pos, node, meta, digger)
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z})
minetest.remove_node({x = pos.x, y = pos.y + 2, z = pos.z})
nodeupdate({x = pos.x, y = pos.y + 2, z = pos.z})
end
def.can_dig = function(pos, player)
return can_dig(pos, player)
end
def.on_rotate = function(pos, node, user, mode, new_param2)
return false
end
if def.protected then
def.on_blast = function() end
else
def.on_blast = function(pos, intensity)
minetest.remove_node(pos)
-- hidden node doesn't get blasted away.
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z})
minetest.remove_node({x = pos.x, y = pos.y + 2, z = pos.z})
return {name}
end
end
def.on_destruct = function(pos)
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z})
minetest.remove_node({x = pos.x, y = pos.y + 2, z = pos.z})
end
minetest.register_node(":" .. name .. "_a", {
description = def.description,
visual = "mesh",
mesh = "door3_a.obj",
tiles = def.tiles,
drawtype = "mesh",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
walkable = true,
is_ground_content = false,
buildable_to = false,
drop = def.drop,
groups = def.groups,
sounds = def.sounds,
door = def.door,
on_rightclick = def.on_rightclick,
after_dig_node = def.after_dig_node,
can_dig = def.can_dig,
on_rotate = def.on_rotate,
on_blast = def.on_blast,
on_destruct = def.on_destruct,
selection_box = {
type = "fixed",
fixed = { -1/2,-1/2,-1/2,1/2,2.5,-6/16}
},
collision_box = {
type = "fixed",
fixed = { -1/2,-1/2,-1/2,1/2,2.5,-6/16}
},
})
minetest.register_node(":" .. name .. "_b", {
description = def.description,
visual = "mesh",
mesh = "door3_b.obj",
tiles = def.tiles,
drawtype = "mesh",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
walkable = true,
is_ground_content = false,
buildable_to = false,
drop = def.drop,
groups = def.groups,
sounds = def.sounds,
door = def.door,
on_rightclick = def.on_rightclick,
after_dig_node = def.after_dig_node,
can_dig = def.can_dig,
on_rotate = def.on_rotate,
on_blast = def.on_blast,
on_destruct = def.on_destruct,
selection_box = {
type = "fixed",
fixed = { -1/2,-1/2,-1/2,1/2,2.5,-6/16}
},
collision_box = {
type = "fixed",
fixed = { -1/2,-1/2,-1/2,1/2,2.5,-6/16}
},
})
if def.recipe then
minetest.register_craft({
output = name,
recipe = def.recipe,
})
end
_doors.registered_doors3[name .. "_a"] = true
_doors.registered_doors3[name .. "_b"] = true
end
doors.register3("door3_wood", {
tiles = {{ name = "doors_door3_wood.png", backface_culling = true }},
description = "Wooden Door 3 Nodes",
inventory_image = "doors3_item_wood.png",
groups = { snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2 },
recipe = {
{"", "", ""},
{"", "doors:door_wood", ""},
{"", "doors:door_wood", ""},
}
})
doors.register3("door3_steel", {
tiles = {{ name = "doors_door3_steel.png", backface_culling = true }},
description = "Steel Door 3 Nodes",
inventory_image = "doors3_item_steel.png",
protected = true,
groups = { snappy = 1, bendy = 2, cracky = 1, melty = 2, level = 2 },
sound_open = "doors_steel_door_open",
sound_close = "doors_steel_door_close",
recipe = {
{"", "", ""},
{"", "doors:door_steel", ""},
{"", "doors:door_steel", ""},
}
})
doors.register3("door3_glass", {
tiles = { "doors_door3_glass.png"},
description = "Glass Door 3 Nodes",
inventory_image = "doors3_item_glass.png",
groups = { snappy=1, cracky=1, oddly_breakable_by_hand=3 },
sounds = default.node_sound_glass_defaults(),
recipe = {
{"", "", ""},
{"", "doors:door_glass", ""},
{"", "doors:door_glass", ""},
}
})
doors.register3("door3_obsidian_glass", {
tiles = { "doors_door3_obsidian_glass.png" },
description = "Obsidian Glass Door 3 Nodes",
inventory_image = "doors3_item_obsidian_glass.png",
groups = { snappy=1, cracky=1, oddly_breakable_by_hand=3 },
sounds = default.node_sound_glass_defaults(),
recipe = {
{"", "", ""},
{"", "doors:door_obsidian_glass", ""},
{"", "doors:door_obsidian_glass", ""},
},
})
-- From BFD: Cherry planks doors
doors.register3("door3_cherry", {
tiles = { "doors_door3_cherry.png" },
description = "Cherry Door 3 Nodes",
inventory_image = "doors3_item_cherry.png",
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=2, door=1},
sounds = default.node_sound_wood_defaults(),
recipe = {
{"", "", ""},
{"", "doors:door_cherry", ""},
{"", "doors:door_cherry", ""},
},
})
-- doors prison MFF
doors.register3("door3_prison", {
tiles = { "doors_door3_prison.png" },
description = "Prison Door 3 Nodes",
inventory_image = "doors3_item_prison.png",
groups = {snappy=1,bendy=2,cracky=1,melty=2,level=2,door=1},
protected = true,
sounds = default.node_sound_stone_defaults(),
recipe = {
{"", "", ""},
{"", "doors:door_prison", ""},
{"", "doors:door_prison", ""},
}
})

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,164 @@
License of source code
----------------------
The MIT License (MIT)
Copyright (C) 2012-2016 PilzAdam
Copyright (C) 2014-2016 BlockMen
Copyright (C) 2015-2016 sofar (sofar@foo-projects.org)
Copyright (C) 2012-2016 Various Minetest developers and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
For more details:
https://opensource.org/licenses/MIT
Licenses of media (textures, models and sounds)
-----------------------------------------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
Copyright (C) 2011-2016 Fernando Zapata
Copyright (C) 2014-2016 celeron55
Copyright (C) 2012-2016 PilzAdam
Copyright (C) 2014-2016 BlockMen
Copyright (C) 2015-2016 sofar
Copyright (C) 2016 red-001
Copyright (C) 2016 paramat
You are free to:
Share — copy and redistribute the material in any medium or format.
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and
indicate if changes were made. You may do so in any reasonable manner, but not in any way
that suggests the licensor endorses you or your use.
ShareAlike — If you remix, transform, or build upon the material, you must distribute
your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures that
legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public
domain or where your use is permitted by an applicable exception or limitation.
No warranties are given. The license may not give you all of the permissions necessary
for your intended use. For example, other rights such as publicity, privacy, or moral
rights may limit how you use the material.
For more details:
http://creativecommons.org/licenses/by-sa/3.0/
-----------------------
Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
Copyright (C) 2014-2016 PenguinDad
You are free to:
Share — copy and redistribute the material in any medium or format.
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and
indicate if changes were made. You may do so in any reasonable manner, but not in any way
that suggests the licensor endorses you or your use.
ShareAlike — If you remix, transform, or build upon the material, you must distribute
your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures that
legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public
domain or where your use is permitted by an applicable exception or limitation.
No warranties are given. The license may not give you all of the permissions necessary
for your intended use. For example, other rights such as publicity, privacy, or moral
rights may limit how you use the material.
For more details:
http://creativecommons.org/licenses/by-sa/4.0/
-----------------------
Attribution 3.0 Unported (CC BY 3.0)
Copyright (C) 2014 CGEffex
Copyright (C) 2014 bennstir
Copyright (C) 2016 BarkersPinhead
Copyright (C) 2016 rivernile7
Copyright (C) 2016 HazMatt
You are free to:
Share — copy and redistribute the material in any medium or format.
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and
indicate if changes were made. You may do so in any reasonable manner, but not in any way
that suggests the licensor endorses you or your use.
No additional restrictions — You may not apply legal terms or technological measures that
legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public
domain or where your use is permitted by an applicable exception or limitation.
No warranties are given. The license may not give you all of the permissions necessary
for your intended use. For example, other rights such as publicity, privacy, or moral
rights may limit how you use the material.
For more details:
http://creativecommons.org/licenses/by/3.0/
-----------------------
CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
mhtaylor67
SkeetMasterFunk69
No Copyright
The person who associated a work with this deed has dedicated the work to the public
domain by waiving all of his or her rights to the work worldwide under copyright law,
including all related and neighboring rights, to the extent allowed by law.
You can copy, modify, distribute and perform the work, even for commercial purposes, all
without asking permission. See Other Information below.
Other Information
In no way are the patent or trademark rights of any person affected by CC0, nor are the
rights that other persons may have in the work or in how the work is used, such as
publicity or privacy rights.
Unless expressly stated otherwise, the person who associated a work with this deed makes
no warranties about the work, and disclaims liability for all uses of the work, to the
fullest extent permitted by applicable law.
When using or citing the work, you should not imply endorsement by the author or the
affirmer.
For more details:
https://creativecommons.org/publicdomain/zero/1.0/