Update game

This commit is contained in:
Maksim Gamarnik 2016-04-08 20:44:43 +03:00
parent 7a609102e1
commit 7d43313b62
32 changed files with 772 additions and 453 deletions

View File

@ -1,26 +1,30 @@
multicraft mod "Beds"
=======================
version: 1.1
License of source code: WTFPL
-----------------------------
author: BlockMen (2013)
original author: PilzAdam
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.
--USING the mod--
------------------
This mods implements Beds like known from Minecraft. You can use them to sleep at night to skip the time or to prevent attacks by evil mobs.
To sleep you have to "rightclick" on your bed. You can only sleep at night and get noticed when it is too early.
After dying the player will respawn at the last bed he has slept.
Minetest Game mod: beds
=======================
by BlockMen (c) 2014-2015
Version: 1.1.1
About
~~~~~
This mod adds a bed to Minetest which allows to skip the night. To sleep rightclick the bed, if playing
in singleplayer mode the night gets skipped imideatly. If playing on server you get shown how many other
players are in bed too. If all players are sleeping the night gets skipped aswell. Also the night skip can be forced
if more than 50% of the players are lying in bed and use this option.
Another feature is a controled respawning. If you have slept in bed (not just lying in it) your respawn point
is set to the beds location and you will respawn there after death.
You can disable the respawn at beds by setting "enable_bed_respawn = false" in minetest.conf
You can also disable the night skip feature by setting "enable_bed_night_skip = false" in minetest.conf or by using
the /set command ingame.
License of source code, textures: WTFPL
---------------------------------------
(c) Copyright BlockMen (2014-2015)
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.

157
files/beds/api.lua Normal file
View File

@ -0,0 +1,157 @@
local reverse = true
local function destruct_bed(pos, n)
local node = minetest.get_node(pos)
local other
if n == 2 then
local dir = minetest.facedir_to_dir(node.param2)
other = vector.subtract(pos, dir)
elseif n == 1 then
local dir = minetest.facedir_to_dir(node.param2)
other = vector.add(pos, dir)
end
if reverse then
reverse = not reverse
minetest.remove_node(other)
nodeupdate(other)
else
reverse = not reverse
end
end
function beds.register_bed(name, def)
minetest.register_node(name .. "_bottom", {
description = def.description,
inventory_image = def.inventory_image,
wield_image = def.wield_image,
drawtype = "nodebox",
tiles = def.tiles.bottom,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
stack_max = 1,
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 1},
sounds = default.node_sound_wood_defaults(),
node_box = {
type = "fixed",
fixed = def.nodebox.bottom,
},
selection_box = {
type = "fixed",
fixed = def.selectionbox,
},
on_place = function(itemstack, placer, pointed_thing)
local under = pointed_thing.under
local pos
if minetest.registered_items[minetest.get_node(under).name].buildable_to then
pos = under
else
pos = pointed_thing.above
end
if minetest.is_protected(pos, placer:get_player_name()) and
not minetest.check_player_privs(placer, "protection_bypass") then
minetest.record_protection_violation(pos, placer:get_player_name())
return itemstack
end
local def = minetest.registered_nodes[minetest.get_node(pos).name]
if not def or not def.buildable_to then
return itemstack
end
local dir = minetest.dir_to_facedir(placer:get_look_dir())
local botpos = vector.add(pos, minetest.facedir_to_dir(dir))
if minetest.is_protected(botpos, placer:get_player_name()) and
not minetest.check_player_privs(placer, "protection_bypass") then
minetest.record_protection_violation(botpos, placer:get_player_name())
return itemstack
end
local botdef = minetest.registered_nodes[minetest.get_node(botpos).name]
if not botdef or not botdef.buildable_to then
return itemstack
end
minetest.set_node(pos, {name = name .. "_bottom", param2 = dir})
minetest.set_node(botpos, {name = name .. "_top", param2 = dir})
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
end
return itemstack
end,
on_destruct = function(pos)
destruct_bed(pos, 1)
end,
on_rightclick = function(pos, node, clicker)
beds.on_rightclick(pos, clicker)
end,
on_rotate = function(pos, node, user, mode, new_param2)
local dir = minetest.facedir_to_dir(node.param2)
local p = vector.add(pos, dir)
local node2 = minetest.get_node_or_nil(p)
if not node2 or not minetest.get_item_group(node2.name, "bed") == 2 or
not node.param2 == node2.param2 then
return false
end
if minetest.is_protected(p, user:get_player_name()) then
minetest.record_protection_violation(p, user:get_player_name())
return false
end
if mode ~= screwdriver.ROTATE_FACE then
return false
end
local newp = vector.add(pos, minetest.facedir_to_dir(new_param2))
local node3 = minetest.get_node_or_nil(newp)
local def = node3 and minetest.registered_nodes[node3.name]
if not def or not def.buildable_to then
return false
end
if minetest.is_protected(newp, user:get_player_name()) then
minetest.record_protection_violation(newp, user:get_player_name())
return false
end
node.param2 = new_param2
-- do not remove_node here - it will trigger destroy_bed()
minetest.set_node(p, {name = "air"})
minetest.set_node(pos, node)
minetest.set_node(newp, {name = name .. "_top", param2 = new_param2})
return true
end,
})
minetest.register_node(name .. "_top", {
drawtype = "nodebox",
tiles = def.tiles.top,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
pointable = false,
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 2},
sounds = default.node_sound_wood_defaults(),
drop = name .. "_bottom",
node_box = {
type = "fixed",
fixed = def.nodebox.top,
},
on_destruct = function(pos)
destruct_bed(pos, 2)
end,
})
minetest.register_alias(name, name .. "_bottom")
minetest.register_craft({
output = name,
recipe = def.recipe
})
end

37
files/beds/beds.lua Normal file
View File

@ -0,0 +1,37 @@
beds.register_bed("beds:bed", {
description = "Bed",
inventory_image = "beds_bed.png",
wield_image = "beds_bed.png",
tiles = {
bottom = {
"beds_bed_top_bottom.png^[transformR90",
"default_wood.png",
"beds_bed_side_bottom_r.png",
"beds_bed_side_bottom_r.png^[transformfx",
"beds_transparent.png",
"beds_bed_side_bottom.png"
},
top = {
"beds_bed_top_top.png^[transformR90",
"default_wood.png",
"beds_bed_side_top_r.png",
"beds_bed_side_top_r.png^[transformfx",
"beds_bed_side_top.png",
"beds_transparent.png",
}
},
nodebox = {
bottom = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
top = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
},
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
recipe = {
{"group:wool", "group:wool", "group:wool"},
{"group:wood", "group:wood", "group:wood"}
},
})
-- Aliases for PilzAdam's beds mod
minetest.register_alias("beds:bed_bottom_red", "beds:bed_bottom")
minetest.register_alias("beds:bed_top_red", "beds:bed_top")

View File

@ -1,2 +1,2 @@
default
wool
wool

225
files/beds/functions.lua Normal file
View File

@ -0,0 +1,225 @@
local pi = math.pi
local player_in_bed = 0
local is_sp = minetest.is_singleplayer()
local enable_respawn = minetest.setting_getbool("enable_bed_respawn")
if enable_respawn == nil then
enable_respawn = true
end
-- Helper functions
local function get_look_yaw(pos)
local n = minetest.get_node(pos)
if n.param2 == 1 then
return pi / 2, n.param2
elseif n.param2 == 3 then
return -pi / 2, n.param2
elseif n.param2 == 0 then
return pi, n.param2
else
return 0, n.param2
end
end
local function is_night_skip_enabled()
local enable_night_skip = minetest.setting_getbool("enable_bed_night_skip")
if enable_night_skip == nil then
enable_night_skip = true
end
return enable_night_skip
end
local function check_in_beds(players)
local in_bed = beds.player
if not players then
players = minetest.get_connected_players()
end
for n, player in ipairs(players) do
local name = player:get_player_name()
if not in_bed[name] then
return false
end
end
return #players > 0
end
local function lay_down(player, pos, bed_pos, state, skip)
local name = player:get_player_name()
local hud_flags = player:hud_get_flags()
if not player or not name then
return
end
-- stand up
if state ~= nil and not state then
local p = beds.pos[name] or nil
if beds.player[name] ~= nil then
beds.player[name] = nil
player_in_bed = player_in_bed - 1
end
-- skip here to prevent sending player specific changes (used for leaving players)
if skip then
return
end
if p then
player:setpos(p)
end
-- physics, eye_offset, etc
player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
player:set_look_yaw(math.random(1, 180) / 100)
default.player_attached[name] = false
player:set_physics_override(1, 1, 1)
hud_flags.wielditem = true
default.player_set_animation(player, "stand" , 30)
-- lay down
else
beds.player[name] = 1
beds.pos[name] = pos
player_in_bed = player_in_bed + 1
-- physics, eye_offset, etc
player:set_eye_offset({x = 0, y = -13, z = 0}, {x = 0, y = 0, z = 0})
local yaw, param2 = get_look_yaw(bed_pos)
player:set_look_yaw(yaw)
local dir = minetest.facedir_to_dir(param2)
local p = {x = bed_pos.x + dir.x / 2, y = bed_pos.y, z = bed_pos.z + dir.z / 2}
player:set_physics_override(0, 0, 0)
player:setpos(p)
default.player_attached[name] = true
hud_flags.wielditem = false
default.player_set_animation(player, "lay" , 0)
end
player:hud_set_flags(hud_flags)
end
local function update_formspecs(finished)
local ges = #minetest.get_connected_players()
local form_n = ""
local is_majority = (ges / 2) < player_in_bed
if finished then
form_n = beds.formspec .. "label[2.7,11; Good morning.]"
else
form_n = beds.formspec .. "label[2.2,11;" .. tostring(player_in_bed) ..
" of " .. tostring(ges) .. " players are in bed]"
if is_majority and is_night_skip_enabled() then
form_n = form_n .. "button_exit[2,8;4,0.75;force;Force night skip]"
end
end
for name,_ in pairs(beds.player) do
minetest.show_formspec(name, "beds_form", form_n)
end
end
-- Public functions
function beds.kick_players()
for name, _ in pairs(beds.player) do
local player = minetest.get_player_by_name(name)
lay_down(player, nil, nil, false)
end
end
function beds.skip_night()
minetest.set_timeofday(0.23)
beds.set_spawns()
end
function beds.on_rightclick(pos, player)
local name = player:get_player_name()
local ppos = player:getpos()
local tod = minetest.get_timeofday()
if tod > 0.2 and tod < 0.805 then
if beds.player[name] then
lay_down(player, nil, nil, false)
end
minetest.chat_send_player(name, "You can only sleep at night.")
return
end
-- move to bed
if not beds.player[name] then
lay_down(player, ppos, pos)
else
lay_down(player, nil, nil, false)
end
if not is_sp then
update_formspecs(false)
end
-- skip the night and let all players stand up
if check_in_beds() then
minetest.after(2, function()
if not is_sp then
update_formspecs(is_night_skip_enabled())
end
if is_night_skip_enabled() then
beds.skip_night()
beds.kick_players()
end
end)
end
end
-- Callbacks
minetest.register_on_joinplayer(function(player)
beds.read_spawns()
end)
-- respawn player at bed if enabled and valid position is found
minetest.register_on_respawnplayer(function(player)
if not enable_respawn then
return false
end
local name = player:get_player_name()
local pos = beds.spawn[name] or nil
if pos then
player:setpos(pos)
return true
end
end)
minetest.register_on_leaveplayer(function(player)
local name = player:get_player_name()
lay_down(player, nil, nil, false, true)
beds.player[name] = nil
if check_in_beds() then
minetest.after(2, function()
update_formspecs(is_night_skip_enabled())
if is_night_skip_enabled() then
beds.skip_night()
beds.kick_players()
end
end)
end
end)
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname ~= "beds_form" then
return
end
if fields.quit or fields.leave then
lay_down(player, nil, nil, false)
update_formspecs(false)
end
if fields.force then
update_formspecs(is_night_skip_enabled())
if is_night_skip_enabled() then
beds.skip_night()
beds.kick_players()
end
end
end)

View File

@ -1,261 +1,17 @@
local player_in_bed = 0
local guy
local hand
local old_yaw = 0
local function get_dir(pos)
local btop = "beds:bed_top"
if minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z}).name == btop then
return 7.9
elseif minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z}).name == btop then
return 4.75
elseif minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}).name == btop then
return 3.15
elseif minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}).name == btop then
return 6.28
end
end
function plock(start, max, tick, player, yaw)
if start+tick < max then
player:set_look_pitch(-1.2)
player:set_look_yaw(yaw)
minetest.after(tick, plock, start+tick, max, tick, player, yaw)
else
player:set_look_pitch(0)
if old_yaw ~= 0 then minetest.after(0.1+tick, function() player:set_look_yaw(old_yaw) end) end
end
end
function exit(pos)
local npos = minetest.find_node_near(pos, 1, "beds:bed_bottom")
if npos ~= nil then pos = npos end
if minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z}).name == "air" then
return {x=pos.x+1,y=pos.y,z=pos.z}
elseif minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z}).name == "air" then
return {x=pos.x-1,y=pos.y,z=pos.z}
elseif minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}).name == "air" then
return {x=pos.x,y=pos.y,z=pos.z+1}
elseif minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}).name == "air" then
return {x=pos.x,y=pos.y,z=pos.z-1}
else
return {x=pos.x,y=pos.y,z=pos.z}
end
end
minetest.register_node("beds:bed_bottom", {
description = "Bed",
inventory_image = "beds_bed.png",
wield_image = "beds_bed.png",
wield_scale = {x=0.8,y=2.5,z=1.3},
drawtype = "nodebox",
tiles = {"beds_bed_top_bottom.png^[transformR90", "default_wood.png", "beds_bed_side_bottom_r.png", "beds_bed_side_bottom_r.png^[transformfx", "beds_bed_leer.png", "beds_bed_side_bottom.png"},
paramtype = "light",
paramtype2 = "facedir",
stack_max = 64,
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3, decorative = 1},
sounds = default.node_sound_wood_defaults(),
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
},
after_place_node = function(pos, placer, itemstack)
local node = minetest.get_node(pos)
local param2 = node.param2
local npos = {x=pos.x, y=pos.y, z=pos.z}
if param2 == 0 then
npos.z = npos.z+1
elseif param2 == 1 then
npos.x = npos.x+1
elseif param2 == 2 then
npos.z = npos.z-1
elseif param2 == 3 then
npos.x = npos.x-1
end
if minetest.registered_nodes[minetest.get_node(npos).name].buildable_to == true and minetest.get_node({x=npos.x, y=npos.y-1, z=npos.z}).name ~= "air" then
minetest.set_node(npos, {name="beds:bed_top", param2 = param2})
else
minetest.dig_node(pos)
return true
end
end,
on_destruct = function(pos)
pos = minetest.find_node_near(pos, 1, "beds:bed_top")
if pos ~= nil then minetest.remove_node(pos) end
end,
on_rightclick = function(pos, node, clicker, itemstack)
if not clicker:is_player() then
return
end
if minetest.get_timeofday() > 0.2 and minetest.get_timeofday() < 0.805 then
minetest.chat_send_all("You can only sleep at night")
return
else
clicker:set_physics_override(0,0,0)
old_yaw = clicker:get_look_yaw()
guy = clicker
clicker:set_look_yaw(get_dir(pos))
minetest.chat_send_all("Good night")
plock(0,2,0.1,clicker, get_dir(pos))
end
if not clicker:get_player_control().sneak then
local meta = minetest.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:setpos(pos)
meta:set_string("player", "")
player_in_bed = player_in_bed-1
elseif meta:get_string("player") == "" then
pos.y = pos.y-0.5
clicker:setpos(pos)
meta:set_string("player", clicker:get_player_name())
player_in_bed = player_in_bed+1
end
end
end
})
minetest.register_node("beds:bed_top", {
drawtype = "nodebox",
tiles = {"beds_bed_top_top.png^[transformR90", "beds_bed_leer.png", "beds_bed_side_top_r.png", "beds_bed_side_top_r.png^[transformfx", "beds_bed_side_top.png", "beds_bed_leer.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 = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
},
selection_box = {
type = "fixed",
fixed = {0, 0, 0, 0, 0, 0},
},
})
minetest.register_alias("beds:bed", "beds:bed_bottom")
minetest.register_craft({
output = "beds:bed",
recipe = {
{"group:wool", "group:wool", "group:wool", },
{"group:wood", "group:wood", "group:wood", }
}
})
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.get_timeofday() < 0.2 or minetest.get_timeofday() > 0.805 then
if not wait then
minetest.after(2, function()
minetest.set_timeofday(0.23)
wait = false
guy:set_physics_override(1,1,1)
guy:setpos(exit(guy:getpos()))
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)
minetest.register_abm({
nodenames = {"beds:bed_bottom"},
interval = 1,
chance = 1,
action = function(pos, node)
local meta = minetest.get_meta(pos)
if meta:get_string("player") ~= "" then
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
local player = minetest.get_player_by_name(meta:get_string("player"))
if player == nil then
meta:set_string("player", "")
player_in_bed = player_in_bed-1
return
end
local player_pos = player:getpos()
player_pos.x = math.floor(0.5+player_pos.x)
player_pos.y = math.floor(0.5+player_pos.y)
player_pos.z = math.floor(0.5+player_pos.z)
if pos.x ~= player_pos.x or pos.y ~= player_pos.y or pos.z ~= player_pos.z then
meta:set_string("player", "")
player_in_bed = player_in_bed-1
return
end
end
end
})
if minetest.setting_get("log_mods") then
minetest.log("action", "beds loaded")
end
beds = {}
beds.player = {}
beds.pos = {}
beds.spawn = {}
beds.formspec = "size[8,15;true]" ..
"bgcolor[#080808BB; true]" ..
"button_exit[2,12;4,0.75;leave;Leave Bed]"
local modpath = minetest.get_modpath("beds")
-- Load files
dofile(modpath .. "/functions.lua")
dofile(modpath .. "/api.lua")
dofile(modpath .. "/beds.lua")
dofile(modpath .. "/spawns.lua")

61
files/beds/spawns.lua Normal file
View File

@ -0,0 +1,61 @@
local world_path = minetest.get_worldpath()
local org_file = world_path .. "/beds_spawns"
local file = world_path .. "/beds_spawns"
local bkwd = false
-- check for PA's beds mod spawns
local cf = io.open(world_path .. "/beds_player_spawns", "r")
if cf ~= nil then
io.close(cf)
file = world_path .. "/beds_player_spawns"
bkwd = true
end
function beds.read_spawns()
local spawns = beds.spawn
local input = io.open(file, "r")
if input and not bkwd then
repeat
local x = input:read("*n")
if x == nil then
break
end
local y = input:read("*n")
local z = input:read("*n")
local name = input:read("*l")
spawns[name:sub(2)] = {x = x, y = y, z = z}
until input:read(0) == nil
io.close(input)
elseif input and bkwd then
beds.spawn = minetest.deserialize(input:read("*all"))
input:close()
beds.save_spawns()
os.rename(file, file .. ".backup")
file = org_file
else
spawns = {}
end
end
function beds.save_spawns()
if not beds.spawn then
return
end
local output = io.open(org_file, "w")
for i, v in pairs(beds.spawn) do
output:write(v.x .. " " .. v.y .. " " .. v.z .. " " .. i .. "\n")
end
io.close(output)
end
function beds.set_spawns()
for name,_ in pairs(beds.player) do
local player = minetest.get_player_by_name(name)
local p = player:getpos()
-- but don't change spawn location if borrowing a bed
if not minetest.is_protected(p, name) then
beds.spawn[name] = p
end
end
beds.save_spawns()
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

View File

@ -148,10 +148,10 @@ end
function boat.on_step(self, dtime)
-- after 10 seconds remove boat and drop as item if not boarded
-- after 30 seconds remove boat and drop as item if not boarded
self.count = self.count + dtime
if self.count > 10 then
if self.count > 30 then
minetest.add_item(self.object:getpos(), "boats:boat")
self.object:remove()
return

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 B

After

Width:  |  Height:  |  Size: 460 B

View File

@ -8,7 +8,6 @@ local item_spawn = function(pos, node)
end
minetest.register_node("bonusbox:chest", {
description = "Item Chest",
tiles = {
"chest_top.png",
"chest_bottom.png",
@ -34,7 +33,6 @@ minetest.register_node("bonusbox:chest", {
})
minetest.register_node("bonusbox:chest_open", {
description = "Item Chest",
tiles = {
"chest_open_top.png",
"chest_open_bottom.png",
@ -45,6 +43,7 @@ minetest.register_node("bonusbox:chest_open", {
},
drawtype = "nodebox",
paramtype = "light",
drop = "",
node_box = {
type = "fixed",
fixed = {
@ -55,12 +54,11 @@ minetest.register_node("bonusbox:chest_open", {
{-0.484478, 0.206242, 0.242552, 0.484478, 0.5, 0.5}, -- NodeBox5
}
},
groups = {oddly_breakable_by_hand=5, not_in_creative_inventory=1},
groups = {choppy = 2, not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("bonusbox:chest_cap", {
description = "Chest Open",
tiles = {
"chest_open_top.png",
"chest_open_bottom.png",
@ -71,6 +69,7 @@ minetest.register_node("bonusbox:chest_cap", {
},
drawtype = "nodebox",
paramtype = "light",
drop = "",
node_box = {
type = "fixed",
fixed = {
@ -78,6 +77,6 @@ minetest.register_node("bonusbox:chest_cap", {
{-0.485183, -0.5, 0.249501, 0.485183, -0.144871, 0.5}, -- NodeBox2
}
},
groups = {oddly_breakable_by_hand=5, not_in_creative_inventory=1},
groups = {attached_node = 1, not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(),
})

View File

@ -1 +1 @@
default
default

View File

@ -3,48 +3,55 @@ local crea = minetest.setting_getbool("creative_mode")
local drop = function(pos, itemstack)
-- is remove_items enabled?
if remi == true then
return
end
local obj = core.add_item(pos,
itemstack:take_item(itemstack:get_count()))
local obj = core.add_item(pos, itemstack:take_item(itemstack:get_count()))
if obj then
-- drop stack random distances from player
obj:setvelocity({
x = math.random(-1, 1),
x = math.random(-10, 10) / 9,
y = 5,
z = math.random(-1, 1)
z = math.random(-10, 10) / 9,
})
end
end
minetest.register_on_dieplayer(function(player)
-- are we in creative?
if crea then
return
end
local pos = player:getpos()
-- display death coordinates
minetest.chat_send_player(player:get_player_name(),
'last known coords were '
.. minetest.pos_to_string(vector.round(pos)))
local player_inv = player:get_inventory()
-- drop inventory items
for i = 1, player_inv:get_size("main") do
drop(pos, player_inv:get_stack("main", i))
player_inv:set_stack("main", i, nil)
end
-- drop crafting grid items
for i = 1, player_inv:get_size("craft") do
drop(pos, player_inv:get_stack("craft", i))
player_inv:set_stack("craft", i, nil)
end
end)
end)
--print ("[MOD] Drop on Die loaded")

View File

@ -1,9 +1,5 @@
Fire Redo 0.2
by TenPlus1
Based on Minetest 0.4 mod: fire with changes by HybridDog
=========================================================
Minetest Game mod: fire (redo with changes by TenPlus1)
=======================================================
License of source code:
-----------------------
@ -18,7 +14,7 @@ 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)
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by-sa/3.0/
Authors of media files
@ -34,3 +30,7 @@ fire_large.ogg sampled from:
fire_basic_flame_animated.png:
Muadtralk
fire_flint_steel.png
Gambit (WTFPL)

View File

@ -1,8 +1,4 @@
-- minetest/fire/init.lua (HybridDog pull request changes)
-- Tweaked by TenPlus1 to add chest drops, also removed sounds which are now
-- handled by Ambience mod.
-- minetest/fire/init.lua
-- Global namespace for functions
@ -11,7 +7,56 @@ fire.mod = "redo"
-- Register flame nodes
local flamedef = {
minetest.register_node("fire:basic_flame", {
drawtype = "plantlike", --"firelike",
tiles = {
{
name = "fire_basic_flame_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1
},
},
},
inventory_image = "fire_basic_flame.png",
paramtype = "light",
light_source = 14,
walkable = false,
buildable_to = true,
sunlight_propagates = true,
damage_per_second = 4,
groups = {igniter = 2, dig_immediate = 3},
drop = "",
on_timer = function(pos)
local f = minetest.find_node_near(pos, 1, {"group:flammable"})
if not f then
minetest.swap_node(pos, {name = "air"})
return
end
-- restart timer
return true
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(30, 60))
-- minetest.after(0, fire.on_flame_add_at, pos)
end,
-- on_destruct = function(pos)
-- minetest.after(0, fire.on_flame_remove_at, pos)
-- end,
on_blast = function()
end, -- unaffected by explosions
})
minetest.register_node("fire:permanent_flame", {
description = "Permanent Flame",
drawtype = "firelike",
tiles = {
@ -36,14 +81,138 @@ local flamedef = {
drop = "",
on_blast = function()
end, -- unaffected by explosions
}
minetest.register_node("fire:permanent_flame", table.copy(flamedef))
end,
})
flamedef.description = "Basic Flame"
flamedef.drawtype = "plantlike" -- quick draw for basic flame, fancy for permanent
minetest.register_tool("fire:flint_and_steel", {
description = "Flint and Steel",
inventory_image = "fire_flint_steel.png",
minetest.register_node("fire:basic_flame", flamedef)
on_use = function(itemstack, user, pointed_thing)
local player_name = user:get_player_name()
local pt = pointed_thing
if pt.type == "node"
and minetest.get_node(pt.above).name == "air" then
itemstack:add_wear(1000)
local node_under = minetest.get_node(pt.under).name
if minetest.get_item_group(node_under, "flammable") >= 1 then
if not minetest.is_protected(pt.above, player_name) then
minetest.set_node(pt.above, {name = "fire:basic_flame"})
else
minetest.chat_send_player(player_name, "This area is protected")
end
end
end
if not minetest.setting_getbool("creative_mode") then
return itemstack
end
end
})
minetest.register_craft({
output = "fire:flint_and_steel",
recipe = {
{"default:flint", "default:steel_ingot"}
}
})
-- Get sound area of position
fire.D = 6 -- size of sound areas
function fire.get_area_p0p1(pos)
local p0 = {
x = math.floor(pos.x / fire.D) * fire.D,
y = math.floor(pos.y / fire.D) * fire.D,
z = math.floor(pos.z / fire.D) * fire.D,
}
local p1 = {
x = p0.x + fire.D - 1,
y = p0.y + fire.D - 1,
z = p0.z + fire.D - 1
}
return p0, p1
end
-- Fire sounds table
-- key: position hash of low corner of area
-- value: {handle=sound handle, name=sound name}
fire.sounds = {}
-- Update fire sounds in sound area of position
function fire.update_sounds_around(pos)
local p0, p1 = fire.get_area_p0p1(pos)
local cp = {x = (p0.x + p1.x) / 2, y = (p0.y + p1.y) / 2, z = (p0.z + p1.z) / 2}
local flames_p = minetest.find_nodes_in_area(p0, p1, {"fire:basic_flame"})
--print("number of flames at "..minetest.pos_to_string(p0).."/"
-- ..minetest.pos_to_string(p1)..": "..#flames_p)
local should_have_sound = (#flames_p > 0)
local wanted_sound = nil
if #flames_p >= 9 then
wanted_sound = {name = "fire_large", gain = 0.7}
elseif #flames_p > 0 then
wanted_sound = {name = "fire_small", gain = 0.9}
end
local p0_hash = minetest.hash_node_position(p0)
local sound = fire.sounds[p0_hash]
if not sound then
if should_have_sound then
fire.sounds[p0_hash] = {
handle = minetest.sound_play(wanted_sound,
{pos = cp, max_hear_distance = 16, loop = true}),
name = wanted_sound.name,
}
end
else
if not wanted_sound then
minetest.sound_stop(sound.handle)
fire.sounds[p0_hash] = nil
elseif sound.name ~= wanted_sound.name then
minetest.sound_stop(sound.handle)
fire.sounds[p0_hash] = {
handle = minetest.sound_play(wanted_sound,
{pos = cp, max_hear_distance = 16, loop = true}),
name = wanted_sound.name,
}
end
end
end
-- Update fire sounds on flame node construct or destruct
function fire.on_flame_add_at(pos)
fire.update_sounds_around(pos)
end
function fire.on_flame_remove_at(pos)
fire.update_sounds_around(pos)
end
-- Return positions for flames around a burning node
@ -68,8 +237,7 @@ minetest.register_abm({
interval = 3,
chance = 1,
catch_up = false,
action = function(p0)
-- fire node holds no metadata so quickly swap out for air
action = function(p0, node, _, _)
minetest.swap_node(p0, {name = "air"})
minetest.sound_play("fire_extinguish_flame",
{pos = p0, max_hear_distance = 16, gain = 0.25})
@ -88,10 +256,9 @@ if minetest.setting_getbool("disable_fire") then
interval = 7,
chance = 1,
catch_up = false,
action = function(p0)
-- fire node holds no metadata so quickly swap out for air
action = function(p0, node, _, _)
minetest.swap_node(p0, {name = "air"})
end
end,
})
else
@ -102,16 +269,15 @@ else
nodenames = {"group:flammable"},
neighbors = {"group:igniter"},
interval = 7,
chance = 16,
chance = 12,
catch_up = false,
action = function(p0)
action = function(p0, node, _, _)
-- If there is water or stuff like that around node, don't ignite
if fire.flame_should_extinguish(p0) then
return
end
local p = fire.find_pos_for_flame_around(p0)
if p then
-- air node holds no metadata so quickly swap out for fire
minetest.swap_node(p, {name = "fire:basic_flame"})
end
end,
@ -122,38 +288,23 @@ else
minetest.register_abm({
nodenames = {"fire:basic_flame"},
interval = 5,
chance = 16,
chance = 6,
catch_up = false,
action = function(p0)
action = function(p0, node, _, _)
-- If there are no flammable nodes around flame, remove flame
if not minetest.find_node_near(p0, 1, {"group:flammable"}) then
-- fire node holds no metadata so quickly swap out for air
minetest.swap_node(p0, {name = "air"})
return
end
if math.random(1, 4) ~= 1 then
return
end
-- remove flammable nodes around flame
local p = minetest.find_node_near(p0, 1, {"group:flammable"})
if not p then
return
end
local node = minetest.get_node(p)
local on_burn = minetest.registered_nodes[node.name].on_burn
if on_burn then
if type(on_burn) == "string" then
node.name = on_burn
minetest.set_node(p, node)
if p and math.random(1, 4) == 1 then
-- remove flammable nodes around flame
local node = minetest.get_node(p)
local def = minetest.registered_nodes[node.name]
if def.on_burn then
def.on_burn(p)
else
minetest.remove_node(p)
nodeupdate(p)
return
end
if on_burn(p, node) ~= false then
return
end
end
minetest.remove_node(p)
nodeupdate(p)
end,
})

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

View File

@ -24,6 +24,7 @@ minetest.register_alias("flowers:flower_dandelion_yellow", "flowers:dandelion_ye
minetest.register_alias("flowers:flower_orchid", "flowers:orchid")
minetest.register_alias("flowers:flower_allium", "flowers:allium")
minetest.register_alias("flowers:flower_dandelion_white", "flowers:dandelion_white")
minetest.register_alias("flowers:dandelion_white", "flowers:oxeye_daisy")
-- Flower registration
@ -31,7 +32,6 @@ minetest.register_alias("flowers:flower_dandelion_white", "flowers:dandelion_whi
local function add_simple_flower(name, desc, box, f_groups)
-- Common flowers' groups
f_groups.snappy = 3
f_groups.flammable = 2
f_groups.flower = 1
f_groups.flora = 1
f_groups.attached_node = 1
@ -63,7 +63,7 @@ flowers.datas = {
{"dandelion_yellow", "Yellow Dandelion", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_yellow = 1}},
{"orchid", "Blue Orchid", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_blue = 1}},
{"allium", "Allium", {-0.5, -0.5, -0.5, 0.5, -0.2, 0.5}, {color_violet = 1}},
{"dandelion_white", "White dandelion", {-0.5, -0.5, -0.5, 0.5, -0.2, 0.5}, {color_white = 1}}
{"oxeye_daisy", "Oxeye Daisy", {-0.5, -0.5, -0.5, 0.5, -0.2, 0.5}, {color_white = 1}}
}
for _,item in pairs(flowers.datas) do
@ -134,7 +134,7 @@ minetest.register_node("flowers:mushroom_red", {
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy = 3, flammable = 3, attached_node = 1},
groups = {snappy = 3, attached_node = 1},
sounds = default.node_sound_leaves_defaults(),
on_use = minetest.item_eat(-5),
selection_box = {
@ -153,7 +153,7 @@ minetest.register_node("flowers:mushroom_brown", {
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy = 3, flammable = 3, attached_node = 1},
groups = {snappy = 3, attached_node = 1},
sounds = default.node_sound_leaves_defaults(),
on_use = minetest.item_eat(1),
selection_box = {

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

View File

@ -229,6 +229,7 @@ if minetest.get_modpath("ethereal") then
register_food("ethereal:seaweed", 1)
register_food("ethereal:yellowleaves", 1, "", nil, 1)
register_food("ethereal:sashimi", 4)
register_food("ethereal:orange", 2)
end
if minetest.get_modpath("farming") and farming.mod == "redo" then
@ -260,6 +261,7 @@ if minetest.get_modpath("farming") and farming.mod == "redo" then
register_food("farming:rhubarb", 1)
register_food("farming:rhubarb_pie", 6)
register_food("farming:beans", 1)
register_food("farming:grapes", 1)
end
if minetest.get_modpath("kpgmobs") ~= nil then
@ -312,3 +314,9 @@ if minetest.get_modpath("pizza") ~= nil then
register_food("pizza:pizza", 30, "", nil, 30)
register_food("pizza:pizzaslice", 5, "", nil, 5)
end
if minetest.get_modpath("wine") ~= nil then
register_food("wine:glass_wine", 2)
register_food("wine:glass_beer", 2)
register_food("wine:glass_mead", 2)
end

View File

@ -1,8 +1,8 @@
--basic settings
item_drop_settings = {} --settings table
item_drop_settings.age = 1 --how old an item has to be before collecting
item_drop_settings.radius_magnet = 2.5 --radius of item magnet
item_drop_settings.radius_collect = 0.2 --radius of collection
item_drop_settings.radius_magnet = 2.0 --radius of item magnet
item_drop_settings.radius_collect = 0.3 --radius of collection
item_drop_settings.player_collect_height = 1.0 --added to their pos y value
item_drop_settings.collection_safety = true --do this to prevent items from flying away on laggy servers
@ -25,7 +25,7 @@ minetest.register_globalstep(function(dtime)
minetest.sound_play("item_drop_pickup", {
pos = pos,
max_hear_distance = 100,
gain = 0.5,
gain = 0.1,
})
object:get_luaentity().itemstring = ""
object:remove()
@ -59,8 +59,6 @@ minetest.register_globalstep(function(dtime)
vec.z = pos2.z + (vec.z/3)
object:moveto(vec)
object:get_luaentity().physical_state = false
object:get_luaentity().object:set_properties({
physical = false
@ -87,7 +85,7 @@ minetest.register_globalstep(function(dtime)
minetest.sound_play("item_drop_pickup", {
pos = pos,
max_hear_distance = 100,
gain = 0.5,
gain = 0.1,
})
end
object:get_luaentity().itemstring = ""

View File

@ -1,63 +0,0 @@
Light mod
===========
By MoNTE48, for MultiCraft
Source license: CC-BY-NC-SA
Notice: Only and MultiCraft Project is entitled to unlimited use (including commercial purposes) of the code.
License
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
1. Definitions
"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
"Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership.
"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections;
to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";
to Distribute and Publicly Perform the Work including as incorporated in Collections; and,
to Distribute and Publicly Perform Adaptations.
The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Section 4(d).
4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(c), as requested.
You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and, (iv) consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
For the avoidance of doubt:
Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and,
Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(c).
Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. Termination
This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
8. Miscellaneous
Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.

View File

@ -1,21 +0,0 @@
--
-- LightCorrect mod
-- By MoNTE48
-- License: CC-BY-NC-SA
--
lightcorrect = {}
minetest.register_globalstep(
function(dtime)
local light = (minetest.get_timeofday()*2)
if light < 0.4 then
for _,player in ipairs(minetest.get_connected_players()) do
player:override_day_night_ratio((light)+0.2)
end
else
for _,player in ipairs(minetest.get_connected_players()) do
player:override_day_night_ratio(nil)
end
end
end
)