1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-25 02:00:37 +01:00

[default] Upate to upstream, move some edits out to [_misc]

This commit is contained in:
Dorian Wouters 2016-08-10 21:58:17 +02:00
parent 333c57bbeb
commit ab71609bad
No known key found for this signature in database
GPG Key ID: 6E9DA8063322434B
47 changed files with 511 additions and 163 deletions

View File

@ -58,6 +58,8 @@ VanessaE (WTFPL):
default_desert_sand.png
default_desert_stone.png
default_sand.png
default_mese_crystal.png
default_mese_crystal_fragment.png
Calinou (CC BY-SA):
default_brick.png
@ -99,7 +101,7 @@ Zeg9 (CC BY-SA 3.0):
default_gold_block.png
paramat (CC BY-SA 3.0):
wieldhand.png copied from character.png by Jordach (CC BY-SA 3.0)
wieldhand.png -- Copied from character.png by Jordach (CC BY-SA 3.0)
default_pinetree.png
default_pinetree_top.png
default_pinewood.png
@ -114,6 +116,10 @@ paramat (CC BY-SA 3.0):
default_obsidian_brick.png
default_stone_brick.png
default_desert_stone_brick.png
default_sandstone_block.png
default_obsidian_block.png
default_stone_block.png
default_desert_stone_block.png
default_river_water.png
default_river_water_source_animated.png
default_river_water_flowing_animated.png
@ -122,6 +128,8 @@ paramat (CC BY-SA 3.0):
default_dry_grass_*.png
default_grass.png
default_grass_side.png
default_snow_side.png
default_mese_block.png
brunob.santos (CC BY-SA 4.0):
default_desert_cobble.png
@ -184,6 +192,9 @@ Gambit (WTFPL):
asl97 (WTFPL):
default_ice.png
KevDoy (CC BY-SA 3.0)
heart.png
Glass breaking sounds (CC BY 3.0):
1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
2: http://www.freesound.org/people/Tomlija/sounds/97669/

View File

@ -958,6 +958,15 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = 'default:stone_block 9',
recipe = {
{'default:stone', 'default:stone', 'default:stone'},
{'default:stone', 'default:stone', 'default:stone'},
{'default:stone', 'default:stone', 'default:stone'},
}
})
minetest.register_craft({
output = 'default:desert_stonebrick 4',
recipe = {
@ -966,6 +975,15 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = 'default:desert_stone_block 9',
recipe = {
{'default:desert_stone', 'default:desert_stone', 'default:desert_stone'},
{'default:desert_stone', 'default:desert_stone', 'default:desert_stone'},
{'default:desert_stone', 'default:desert_stone', 'default:desert_stone'},
}
})
minetest.register_craft({
output = 'default:snowblock',
recipe = {

View File

@ -12,24 +12,34 @@ minetest.register_craftitem("default:paper", {
inventory_image = "default_paper.png",
})
local lpp = 14 -- Lines per book's page
local function book_on_use(itemstack, user)
local player_name = user:get_player_name()
local data = minetest.deserialize(itemstack:get_metadata())
local formspec, title, text, owner = "", "", "", player_name
local page, page_max, cpp = 1, 1, 650
local title, text, owner = "", "", player_name
local page, page_max, lines, string = 1, 1, {}, ""
if data then
title = data.title
text = data.text
owner = data.owner
for str in (text .. "\n"):gmatch("([^\n]*)[\n]") do
lines[#lines+1] = str
end
if data.page then
page = data.page
page_max = data.page_max
cpp = data.chars_per_page
for i = ((lpp * page) - lpp) + 1, lpp * page do
if not lines[i] then break end
string = string .. lines[i] .. "\n"
end
end
end
local formspec
if owner == player_name then
formspec = "size[8,8]" .. default.gui_bg ..
default.gui_bg_img ..
@ -45,8 +55,8 @@ local function book_on_use(itemstack, user)
"tablecolumns[color;text]" ..
"tableoptions[background=#00000000;highlight=#00000000;border=false]" ..
"table[0.4,0;7,0.5;title;#FFFF00," .. minetest.formspec_escape(title) .. "]" ..
"textarea[0.5,1.5;7.5,7;;" .. minetest.formspec_escape(text:sub(
(cpp * page) - cpp, cpp * page)) .. ";]" ..
"textarea[0.5,1.5;7.5,7;;" ..
minetest.formspec_escape(string ~= "" and string or text) .. ";]" ..
"button[2.4,7.6;0.8,0.8;book_prev;<]" ..
"label[3.2,7.7;Page " .. page .. " of " .. page_max .. "]" ..
"button[4.9,7.6;0.8,0.8;book_next;>]"
@ -77,10 +87,9 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
if not data then data = {} end
data.title = fields.title
data.text = fields.text
data.text_len = fields.text:len()
data.text_len = #data.text
data.page = 1
data.chars_per_page = 650
data.page_max = math.ceil(data.text_len / data.chars_per_page)
data.page_max = math.ceil((#data.text:gsub("[^\n]", "") + 1) / lpp)
data.owner = player:get_player_name()
local data_str = minetest.serialize(data)
@ -95,8 +104,6 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
stack:set_metadata(data_str)
end
player:set_wielded_item(stack)
elseif fields.book_next or fields.book_prev then
local data = minetest.deserialize(stack:get_metadata())
if not data.page then return end
@ -117,6 +124,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
stack:set_metadata(data_str)
book_on_use(stack, player)
end
player:set_wielded_item(stack)
end)
minetest.register_craftitem("default:book", {
@ -145,7 +154,6 @@ minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv
return
end
local copy = ItemStack("default:book_written")
local original
local index
for i = 1, player:get_inventory():get_size("craft") do

View File

@ -49,6 +49,18 @@ function default.node_sound_sand_defaults(table)
return table
end
function default.node_sound_gravel_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name = "default_gravel_footstep", gain = 0.5}
table.dug = table.dug or
{name = "default_gravel_footstep", gain = 1.0}
table.place = table.place or
{name = "default_place_node", gain = 1.0}
default.node_sound_defaults(table)
return table
end
function default.node_sound_wood_defaults(table)
table = table or {}
table.footstep = table.footstep or
@ -99,6 +111,7 @@ default.cool_lava = function(pos, node)
end
minetest.register_abm({
label = "Lava cooling",
nodenames = {"default:lava_source", "default:lava_flowing"},
neighbors = {"group:water"},
interval = 1,
@ -110,6 +123,21 @@ minetest.register_abm({
})
--
-- optimized helper to put all items in an inventory into a drops list
--
function default.get_inventory_drops(pos, inventory, drops)
local inv = minetest.get_meta(pos):get_inventory()
local n = #drops
for i = 1, inv:get_size(inventory) do
local stack = inv:get_stack(inventory, i)
if stack:get_count() > 0 then
drops[n+1] = stack:to_table()
n = n + 1
end
end
end
--
-- Papyrus and cactus growing
--
@ -163,6 +191,7 @@ function default.grow_papyrus(pos, node)
end
minetest.register_abm({
label = "Grow cactus",
nodenames = {"default:cactus"},
neighbors = {"group:sand", "default:dirt_with_dry_grass"}, --MFF
interval = 12,
@ -173,6 +202,7 @@ minetest.register_abm({
})
minetest.register_abm({
label = "Grow papyrus",
nodenames = {"default:papyrus"},
neighbors = {"default:dirt", "default:dirt_with_grass", "default:sand", "default:desert_sand"}, --MFF
interval = 14,
@ -277,6 +307,7 @@ default.after_place_leaves = function(pos, placer, itemstack, pointed_thing)
end
minetest.register_abm({
label = "Leaf decay",
nodenames = {"group:leafdecay"},
neighbors = {"air", "group:liquid"},
-- A low interval and a high inverse chance spreads the load
@ -358,49 +389,74 @@ minetest.register_abm({
})
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)
if newnode.name ~= "default:torch" or minetest.get_item_group(oldnode.name, "water") == 0 then
return
end
minetest.remove_node(pos, newnode)
minetest.set_node(pos, oldnode)
minetest.add_item(pos, "default:torch")
end)
--
-- Grass growing on well-lit dirt
-- Convert dirt to something that fits the environment
--
minetest.register_abm({
label = "Grass spread",
nodenames = {"default:dirt"},
neighbors = {"air"},
neighbors = {
"default:dirt_with_grass",
"default:dirt_with_dry_grass",
"default:dirt_with_snow",
"group:grass",
"group:dry_grass",
"default:snow",
},
interval = 6,
chance = 67,
catch_up = false,
action = function(pos, node)
-- Most likely case, half the time it's too dark for this.
local above = {x = pos.x, y = pos.y + 1, z = pos.z}
local name = minetest.get_node(above).name
local nodedef = minetest.registered_nodes[name]
if nodedef and (nodedef.sunlight_propagates or nodedef.paramtype == "light") and
nodedef.liquidtype == "none" and
pos.y >= 0 and
(minetest.get_node_light(above) or 0) >= 12 then
if name == "default:snow" or name == "default:snowblock" then
minetest.set_node(pos, {name = "default:dirt_with_snow"})
else
minetest.set_node(pos, {name = "default:dirt_with_grass"})
if (minetest.get_node_light(above) or 0) < 13 then
return
end
-- Look for likely neighbors.
local p2 = minetest.find_node_near(pos, 1, {"default:dirt_with_grass",
"default:dirt_with_dry_grass", "default:dirt_with_snow"})
if p2 then
-- But the node needs to be under air in this case.
local n2 = minetest.get_node(above)
if n2 and n2.name == "air" then
local n3 = minetest.get_node(p2)
minetest.set_node(pos, {name = n3.name})
return
end
end
-- Anything on top?
local n2 = minetest.get_node(above)
if not n2 then
return
end
local name = n2.name
-- Snow check is cheapest, so comes first.
if name == "default:snow" then
minetest.set_node(pos, {name = "default:dirt_with_snow"})
-- Most likely case first.
elseif minetest.get_item_group(name, "grass") ~= 0 then
minetest.set_node(pos, {name = "default:dirt_with_grass"})
elseif minetest.get_item_group(name, "dry_grass") ~= 0 then
minetest.set_node(pos, {name = "default:dirt_with_dry_grass"})
end
end
})
--
-- Grass and dry grass removed in darkness
--
minetest.register_abm({
nodenames = {"default:dirt_with_grass", "default:dirt_with_dry_grass"},
label = "Grass covered",
nodenames = {
"default:dirt_with_grass",
"default:dirt_with_dry_grass",
"default:dirt_with_snow",
},
interval = 8,
chance = 50,
catch_up = false,
@ -422,12 +478,59 @@ minetest.register_abm({
--
minetest.register_abm({
nodenames = {"default:cobble"},
label = "Moss growth",
nodenames = {"default:cobble", "stairs:slab_cobble", "stairs:stair_cobble"},
neighbors = {"group:water"},
interval = 16,
chance = 200,
catch_up = false,
action = function(pos, node)
minetest.set_node(pos, {name = "default:mossycobble"})
if node.name == "default:cobble" then
minetest.set_node(pos, {name = "default:mossycobble"})
elseif node.name == "stairs:slab_cobble" then
minetest.set_node(pos, {name = "stairs:slab_mossycobble", param2 = node.param2})
elseif node.name == "stairs:stair_cobble" then
minetest.set_node(pos, {name = "stairs:stair_mossycobble", param2 = node.param2})
end
end
})
--
-- Checks if specified volume intersects a protected volume
--
function default.intersects_protection(minp, maxp, player_name, interval)
-- 'interval' is the largest allowed interval for the 3D lattice of checks
-- Compute the optimal float step 'd' for each axis so that all corners and
-- borders are checked. 'd' will be smaller or equal to 'interval'.
-- Subtracting 1e-4 ensures that the max co-ordinate will be reached by the
-- for loop (which might otherwise not be the case due to rounding errors).
local d = {}
for _, c in pairs({"x", "y", "z"}) do
if maxp[c] > minp[c] then
d[c] = (maxp[c] - minp[c]) / math.ceil((maxp[c] - minp[c]) / interval) - 1e-4
elseif maxp[c] == minp[c] then
d[c] = 1 -- Any value larger than 0 to avoid division by zero
else -- maxp[c] < minp[c], print error and treat as protection intersected
minetest.log("error", "maxp < minp in 'default.intersects_protection()'")
return true
end
end
for zf = minp.z, maxp.z, d.z do
local z = math.floor(zf + 0.5)
for yf = minp.y, maxp.y, d.y do
local y = math.floor(yf + 0.5)
for xf = minp.x, maxp.x, d.x do
local x = math.floor(xf + 0.5)
if minetest.is_protected({x = x, y = y, z = z}, player_name) then
return true
end
end
end
end
return false
end

View File

@ -111,7 +111,6 @@ local function furnace_node_timer(pos, elapsed)
local inv = meta:get_inventory()
local srclist = inv:get_list("src")
local fuellist = inv:get_list("fuel")
local dstlist = inv:get_list("dst")
--
-- Cooking
@ -172,7 +171,7 @@ local function furnace_node_timer(pos, elapsed)
-- Update formspec, infotext and node
--
local formspec = inactive_formspec
local item_state = ""
local item_state
local item_percent = 0
if cookable then
item_percent = math.floor(src_time / cooked.time * 100)
@ -260,6 +259,15 @@ minetest.register_node("default:furnace", {
local timer = minetest.get_node_timer(pos)
timer:start(1.0)
end,
on_blast = function(pos)
local drops = {}
default.get_inventory_drops(pos, "src", drops)
default.get_inventory_drops(pos, "fuel", drops)
default.get_inventory_drops(pos, "dst", drops)
drops[#drops+1] = "default:furnace"
minetest.remove_node(pos)
return drops
end,
allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_move = allow_metadata_inventory_move,

View File

@ -1,8 +1,6 @@
-- Minetest 0.4 mod: default
-- See README.txt for licensing and other information.
default = {} -- Definitions made by this mod are usable by all mods.
-- The API documentation in here was moved into game_api.txt
-- Definitions made by this mod that other mods can use too
@ -38,7 +36,7 @@ default.gui_survival_form = "size[8,8.5]"..
-- Load files
dofile(minetest.get_modpath("default").."/functions.lua")
dofile(minetest.get_modpath("default").."/commands.lua")
dofile(minetest.get_modpath("default").."/trees.lua")
dofile(minetest.get_modpath("default").."/nodes.lua")
dofile(minetest.get_modpath("default").."/furnace.lua")
dofile(minetest.get_modpath("default").."/tools.lua")
@ -46,103 +44,5 @@ dofile(minetest.get_modpath("default").."/craftitems.lua")
dofile(minetest.get_modpath("default").."/crafting.lua")
dofile(minetest.get_modpath("default").."/mapgen.lua")
dofile(minetest.get_modpath("default").."/player.lua")
dofile(minetest.get_modpath("default").."/trees.lua")
dofile(minetest.get_modpath("default").."/aliases.lua")
dofile(minetest.get_modpath("default").."/legacy.lua")
-- Code below by Casimir.
local function count_items()
local i = 0
local number = 0
for name, item in pairs(minetest.registered_items) do
if (name and name ~= "") then
number = number + 1
end
i = i + 1
end
minetest.log("action", "There are " .. number .. " registered nodes, items and tools.")
end
local function player_join_sounds()
minetest.register_on_joinplayer(function()
minetest.sound_play("player_join", {gain = 0.75})
end)
end
local function player_leave_sounds()
minetest.register_on_leaveplayer(function()
minetest.sound_play("player_leave", {gain = 1})
end)
end
minetest.after(1, count_items)
minetest.after(5, player_join_sounds)
minetest.after(5, player_leave_sounds)
minetest.register_on_joinplayer(function(player)
player:set_physics_override({
sneak_glitch = false, -- Climable blocks are quite fast in Carbone.
})
end)
minetest.register_on_respawnplayer(function(player)
player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
local pos = player:getpos()
-- minetest.sound_play("player_join", {pos = pos, gain = 0.5})
end)
minetest.register_on_item_eat(function(hp_change, replace_with_item, itemstack, user, pointed_thing)
if user:get_hp() >= 20 then return end
local pos = user:getpos()
minetest.sound_play("health_gain", {pos = pos, gain = 0.4})
end)
minetest.log("action", "") -- Empty line.
minetest.log("action", "") -- Empty line.
if minetest.setting_getbool("creative_mode") then
minetest.log("action", "Creative mode is enabled.")
else
minetest.log("action", "Creative mode is disabled.")
end
if minetest.setting_getbool("enable_damage") then
minetest.log("action", "Damage is enabled.")
else
minetest.log("action", "Damage is disabled.")
end
if minetest.setting_getbool("enable_pvp") then
minetest.log("action", "PvP is enabled.")
else
minetest.log("action", "PvP is disabled.")
end
if not minetest.is_singleplayer() and minetest.setting_getbool("server_announce") then
minetest.log("action", "") -- Empty line.
minetest.log("action", "Server name: " .. minetest.setting_get("server_name") or "(none)")
minetest.log("action", "Server description: " .. minetest.setting_get("server_description") or "(none)")
minetest.log("action", "Server URL: " .. minetest.setting_get("server_address") or "(none)")
minetest.log("action", "MOTD: " .. minetest.setting_get("motd") or "(none)")
minetest.log("action", "Maximum users: " .. minetest.setting_get("max_users") or 15)
end
minetest.log("action", "") -- Empty line.
minetest.log("action", "") -- Empty line.
-- Reserved slot handling:
minetest.register_on_prejoinplayer(function(name, ip)
if #minetest.get_connected_players() >= (minetest.setting_get("max_users") - 2)
and not minetest.check_player_privs(name, {server = true}) then
return "Sorry, 2 slots are reserved for administrators."
end
end)
if minetest.setting_getbool("log_mods") then
-- Highlight the default mod in the mod loading logs:
minetest.log("action", "Carbone: * [default] loaded.")
end

View File

@ -42,14 +42,14 @@ minetest.register_alias("mapgen_stair_sandstonebrick", "stairs:stair_sandstonebr
-- Register ores
--
-- All mapgens except singlenode
-- Blob ore first to avoid other ores inside blobs
function default.register_ores()
-- Blob ores
-- These first to avoid other ores in blobs
-- Clay
-- This first to avoid clay in sand blobs
minetest.register_ore({
minetest.register_ore({
ore_type = "blob",
ore = "default:clay",
wherein = {"default:sand"},
@ -70,7 +70,7 @@ function default.register_ores()
-- Sand
minetest.register_ore({
minetest.register_ore({
ore_type = "blob",
ore = "default:sand",
wherein = {"default:stone", "default:sandstone",
@ -132,6 +132,8 @@ function default.register_ores()
},
})
-- Scatter ores
-- Coal
minetest.register_ore({
@ -225,6 +227,8 @@ function default.register_ores()
y_max = -64,
})
-- Copper
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_iron",
@ -260,6 +264,8 @@ function default.register_ores()
y_max = -256,
})
-- Gold
minetest.register_ore({
ore_type = "scatter",
ore = "default:mese",
@ -730,6 +736,8 @@ function default.register_biomes()
depth_water_top = 10,
--node_water = "",
node_river_water = "default:ice",
node_riverbed = "default:gravel",
depth_riverbed = 2,
y_min = -8,
y_max = 31000,
heat_point = 0,
@ -768,6 +776,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:gravel",
depth_riverbed = 2,
y_min = 2,
y_max = 31000,
heat_point = 15,
@ -786,6 +796,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:gravel",
depth_riverbed = 2,
y_min = -3,
y_max = 1,
heat_point = 15,
@ -804,6 +816,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:gravel",
depth_riverbed = 2,
y_min = -112,
y_max = -4,
heat_point = 15,
@ -823,6 +837,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = 2,
y_max = 31000,
heat_point = 15,
@ -841,6 +857,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = -112,
y_max = 1,
heat_point = 15,
@ -861,6 +879,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = 6,
y_max = 31000,
heat_point = 40,
@ -879,6 +899,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = 5,
y_max = 5,
heat_point = 40,
@ -897,6 +919,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = -112,
y_max = 4,
heat_point = 40,
@ -916,6 +940,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = 6,
y_max = 31000,
heat_point = 40,
@ -934,6 +960,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = 5,
y_max = 5,
heat_point = 40,
@ -952,6 +980,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = -112,
y_max = 4,
heat_point = 40,
@ -971,6 +1001,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = 6,
y_max = 31000,
heat_point = 60,
@ -989,6 +1021,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = 5,
y_max = 5,
heat_point = 60,
@ -1007,6 +1041,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = -112,
y_max = 4,
heat_point = 60,
@ -1026,6 +1062,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = 1,
y_max = 31000,
heat_point = 60,
@ -1044,6 +1082,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = -3,
y_max = 0,
heat_point = 60,
@ -1062,6 +1102,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = -112,
y_max = -4,
heat_point = 60,
@ -1082,6 +1124,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = 5,
y_max = 31000,
heat_point = 85,
@ -1100,6 +1144,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = -112,
y_max = 4,
heat_point = 85,
@ -1119,6 +1165,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = 1,
y_max = 31000,
heat_point = 85,
@ -1137,6 +1185,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = -3,
y_max = 0,
heat_point = 85,
@ -1155,6 +1205,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = -112,
y_max = -4,
heat_point = 85,
@ -1174,6 +1226,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = 1,
y_max = 31000,
heat_point = 85,
@ -1192,6 +1246,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = -3,
y_max = 0,
heat_point = 85,
@ -1210,6 +1266,8 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
node_riverbed = "default:sand",
depth_riverbed = 2,
y_min = -112,
y_max = -4,
heat_point = 85,

View File

@ -19,18 +19,22 @@ Stone
default:stone
default:cobble
default:stonebrick
default:stone_block
default:mossycobble
default:desert_stone
default:desert_cobble
default:desert_stonebrick
default:desert_stone_block
default:sandstone
default:sandstonebrick
default:sandstone_block
default:obsidian
default:obsidian_cooled
default:obsidianbrick
default:obsidian_block
Soft / Non-Stone
----------------
@ -247,12 +251,22 @@ minetest.register_node("default:cobble_cooled", {
minetest.register_node("default:stonebrick", {
description = "Stone Brick",
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"default_stone_brick.png"},
is_ground_content = false,
groups = {cracky = 2, stone = 1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:stone_block", {
description = "Stone Block",
tiles = {"default_stone_block.png"},
is_ground_content = false,
groups = {cracky = 2, stone = 1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:mossycobble", {
description = "Mossy Cobblestone",
tiles = {"default_mossycobble.png"},
@ -293,12 +307,22 @@ minetest.register_node("default:desert_cobble", {
minetest.register_node("default:desert_stonebrick", {
description = "Desert Stone Brick",
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"default_desert_stone_brick.png"},
is_ground_content = false,
groups = {cracky = 2, stone = 1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:desert_stone_block", {
description = "Desert Stone Block",
tiles = {"default_desert_stone_block.png"},
is_ground_content = false,
groups = {cracky = 2, stone = 1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:sandstone", {
description = "Sandstone",
@ -309,12 +333,22 @@ minetest.register_node("default:sandstone", {
minetest.register_node("default:sandstonebrick", {
description = "Sandstone Brick",
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"default_sandstone_brick.png"},
is_ground_content = false,
groups = {cracky = 2},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:sandstone_block", {
description = "Sandstone Block",
tiles = {"default_sandstone_block.png"},
is_ground_content = false,
groups = {cracky = 2},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:obsidian", {
description = "Obsidian",
@ -335,12 +369,22 @@ minetest.register_node("default:obsidian_cooled", {
minetest.register_node("default:obsidianbrick", {
description = "Obsidian Brick",
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"default_obsidian_brick.png"},
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
groups = {cracky = 1, level = 2},
})
minetest.register_node("default:obsidian_block", {
description = "Obsidian Block",
tiles = {"default_obsidian_block.png"},
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
groups = {cracky = 1, level = 2},
})
--
-- Soft / Non-Stone
--
@ -442,10 +486,7 @@ minetest.register_node("default:gravel", {
description = "Gravel",
tiles = {"default_gravel.png"},
groups = {crumbly = 2, falling_node = 1},
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_gravel_footstep", gain = 0.5},
dug = {name = "default_gravel_footstep", gain = 1.0},
}),
sounds = default.node_sound_gravel_defaults(),
drop = {
max_items = 1,
items = {
@ -487,6 +528,7 @@ minetest.register_node("default:snow", {
paramtype = "light",
buildable_to = true,
floodable = true,
walkable = false,
drawtype = "nodebox",
node_box = {
type = "fixed",
@ -546,6 +588,8 @@ minetest.register_node("default:tree", {
minetest.register_node("default:wood", {
description = "Wooden Planks",
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"default_wood.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
@ -562,6 +606,7 @@ minetest.register_node("default:sapling", {
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = default.grow_sapling,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
@ -569,6 +614,23 @@ minetest.register_node("default:sapling", {
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
attached_node = 1, sapling = 1},
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(2400,4800))
end,
on_place = function(itemstack, placer, pointed_thing)
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
"default:sapling",
-- minp, maxp to be checked, relative to sapling pos
-- minp_relative.y = 1 because sapling pos has been checked
{x = -2, y = 1, z = -2},
{x = 2, y = 6, z = 2},
-- maximum interval of interior volume check
4)
return itemstack
end,
})
minetest.register_node("default:leaves", {
@ -642,6 +704,8 @@ minetest.register_node("default:jungletree", {
minetest.register_node("default:junglewood", {
description = "Junglewood Planks",
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"default_junglewood.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
@ -680,6 +744,7 @@ minetest.register_node("default:junglesapling", {
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = default.grow_sapling,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
@ -687,6 +752,23 @@ minetest.register_node("default:junglesapling", {
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
attached_node = 1, sapling = 1},
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(2400,4800))
end,
on_place = function(itemstack, placer, pointed_thing)
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
"default:junglesapling",
-- minp, maxp to be checked, relative to sapling pos
-- minp_relative.y = 1 because sapling pos has been checked
{x = -2, y = 1, z = -2},
{x = 2, y = 15, z = 2},
-- maximum interval of interior volume check
4)
return itemstack
end,
})
@ -704,6 +786,8 @@ minetest.register_node("default:pine_tree", {
minetest.register_node("default:pine_wood", {
description = "Pine Wood Planks",
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"default_pine_wood.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
@ -741,6 +825,7 @@ minetest.register_node("default:pine_sapling", {
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = default.grow_sapling,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
@ -748,6 +833,23 @@ minetest.register_node("default:pine_sapling", {
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
attached_node = 1, sapling = 1},
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(2400,4800))
end,
on_place = function(itemstack, placer, pointed_thing)
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
"default:pine_sapling",
-- minp, maxp to be checked, relative to sapling pos
-- minp_relative.y = 1 because sapling pos has been checked
{x = -2, y = 1, z = -2},
{x = 2, y = 12, z = 2},
-- maximum interval of interior volume check
4)
return itemstack
end,
})
@ -765,6 +867,8 @@ minetest.register_node("default:acacia_tree", {
minetest.register_node("default:acacia_wood", {
description = "Acacia Wood Planks",
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"default_acacia_wood.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
@ -802,6 +906,7 @@ minetest.register_node("default:acacia_sapling", {
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = default.grow_sapling,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
@ -809,6 +914,23 @@ minetest.register_node("default:acacia_sapling", {
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
attached_node = 1, sapling = 1},
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(2400,4800))
end,
on_place = function(itemstack, placer, pointed_thing)
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
"default:acacia_sapling",
-- minp, maxp to be checked, relative to sapling pos
-- minp_relative.y = 1 because sapling pos has been checked
{x = -4, y = 1, z = -4},
{x = 4, y = 6, z = 4},
-- maximum interval of interior volume check
4)
return itemstack
end,
})
minetest.register_node("default:aspen_tree", {
@ -825,6 +947,8 @@ minetest.register_node("default:aspen_tree", {
minetest.register_node("default:aspen_wood", {
description = "Aspen Wood Planks",
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"default_aspen_wood.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
@ -863,11 +987,12 @@ minetest.register_node("default:aspen_sapling", {
sunlight_propagates = true,
walkable = false,
is_ground_content = true,
on_timer = default.grow_sapling,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
groups = {snappy = 3, flammable=2,
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
attached_node = 1, sapling = 1},
sounds = default.node_sound_leaves_defaults(),
})
@ -1005,7 +1130,7 @@ minetest.register_node("default:coalblock", {
minetest.register_node("default:stone_with_iron", {
description = "Iron Ore",
tiles = {"default_stone.png^default_mineral_iron.png"},
groups = {cracky = 3},
groups = {cracky = 2},
drop = {
items = {
{items = {"default:cobble"}},
@ -1029,7 +1154,7 @@ minetest.register_node("default:stone_with_copper", {
description = "Copper Ore",
tiles = {"default_stone.png^default_mineral_copper.png"},
is_ground_content = true,
groups = {cracky = 3},
groups = {cracky = 2},
drop = {
items = {
{items = {"default:cobble"}},
@ -1150,7 +1275,7 @@ minetest.register_node("default:silverblock", {
minetest.register_node("default:stone_with_mese", {
description = "Mese Ore",
tiles = {"default_stone.png^default_mineral_mese.png"},
groups = {cracky = 3},
groups = {cracky = 1},
drop = {
items = {
{items = {"default:cobble"}},
@ -1205,7 +1330,7 @@ minetest.register_alias("default:meze_block", "default:meze")
minetest.register_node("default:stone_with_gold", {
description = "Gold Ore",
tiles = {"default_stone.png^default_mineral_gold.png"},
groups = {cracky = 3},
groups = {cracky = 2},
drop = {
items = {
{items = {"default:cobble"}},
@ -1250,7 +1375,7 @@ minetest.register_node("default:mithrilblock", {
minetest.register_node("default:stone_with_diamond", {
description = "Diamond Ore",
tiles = {"default_stone.png^default_mineral_diamond.png"},
groups = {cracky = 3},
groups = {cracky = 1},
drop = {
items = {
{items = {"default:cobble"}},
@ -1360,7 +1485,7 @@ minetest.register_node("default:junglegrass", {
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy = 3, flammable = 2, flora = 1, attached_node = 1},
groups = {snappy = 3, flammable = 2, flora = 1, attached_node = 1, grass = 1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
@ -1381,7 +1506,7 @@ minetest.register_node("default:grass_1", {
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1},
groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1, grass = 1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
@ -1411,7 +1536,7 @@ for i = 2, 5 do
buildable_to = true,
drop = "default:grass_1",
groups = {snappy = 3, flammable = 3, flora = 1,
attached_node = 1, not_in_creative_inventory = 1},
attached_node = 1, not_in_creative_inventory = 1, grass = 1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
@ -1432,7 +1557,7 @@ minetest.register_node("default:dry_grass_1", {
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1},
groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1, dry_grass = 1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
@ -1461,7 +1586,7 @@ for i = 2, 5 do
walkable = false,
buildable_to = true,
groups = {snappy = 3, flammable = 3, flora = 1,
attached_node = 1, not_in_creative_inventory=1},
attached_node = 1, not_in_creative_inventory=1, dry_grass = 1},
drop = "default:dry_grass_1",
sounds = default.node_sound_leaves_defaults(),
selection_box = {
@ -2023,6 +2148,13 @@ minetest.register_node("default:chest", {
" takes " .. stack:get_name() ..
" from chest at " .. minetest.pos_to_string(pos))
end,
on_blast = function(pos)
local drops = {}
default.get_inventory_drops(pos, "main", drops)
drops[#drops+1] = "default:chest"
minetest.remove_node(pos)
return drops
end,
})
minetest.register_node("default:chest_locked", {
@ -2085,7 +2217,7 @@ minetest.register_node("default:chest_locked", {
" takes " .. stack:get_name() ..
" from locked chest at " .. minetest.pos_to_string(pos))
end,
on_rightclick = function(pos, node, clicker)
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local meta = minetest.get_meta(pos)
if has_locked_chest_privilege(meta, clicker) then
minetest.show_formspec(
@ -2094,6 +2226,7 @@ minetest.register_node("default:chest_locked", {
get_locked_chest_formspec(pos)
)
end
return itemstack
end,
on_blast = function() end,
})
@ -2113,7 +2246,9 @@ local bookshelf_formspec =
minetest.register_node("default:bookshelf", {
description = "Bookshelf",
tiles = {"default_wood.png", "default_wood.png", "default_bookshelf.png"},
tiles = {"default_wood.png", "default_wood.png", "default_wood.png",
"default_wood.png", "default_bookshelf.png", "default_bookshelf.png"},
paramtype2 = "facedir",
is_ground_content = false,
groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
sounds = default.node_sound_wood_defaults(),
@ -2146,6 +2281,13 @@ minetest.register_node("default:bookshelf", {
minetest.log("action", player:get_player_name() ..
" takes stuff from bookshelf at " .. minetest.pos_to_string(pos))
end,
on_blast = function(pos)
local drops = {}
default.get_inventory_drops(pos, "books", drops)
drops[#drops+1] = "default:bookshelf"
minetest.remove_node(pos)
return drops
end,
})
local function register_sign(material, desc, def)
@ -2388,6 +2530,8 @@ minetest.register_node("default:rail", {
minetest.register_node("default:brick", {
description = "Brick Block",
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"default_brick.png"},
is_ground_content = false,
groups = {cracky = 3},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 659 B

After

Width:  |  Height:  |  Size: 638 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 450 B

After

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 392 B

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 701 B

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 659 B

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 B

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 B

After

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 641 B

After

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 692 B

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 B

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 736 B

After

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 811 B

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 685 B

After

Width:  |  Height:  |  Size: 649 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 721 B

After

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 B

After

Width:  |  Height:  |  Size: 559 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 441 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 358 B

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 626 B

After

Width:  |  Height:  |  Size: 568 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 763 B

After

Width:  |  Height:  |  Size: 705 B

BIN
minetestforfun_game/mods/default/textures/gui_formbg.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
minetestforfun_game/mods/default/textures/gui_hotbar.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 B

After

Width:  |  Height:  |  Size: 68 B

View File

@ -0,0 +1,85 @@
-- Code below by Casimir.
minetest.after(1, function()
local i = 0
local number = 0
for name, item in pairs(minetest.registered_items) do
if (name and name ~= "") then
number = number + 1
end
i = i + 1
end
minetest.log("action", "There are " .. number .. " registered nodes, items and tools.")
end)
minetest.register_on_joinplayer(function(player)
minetest.sound_play("player_join", {gain = 0.75})
player:set_physics_override({
sneak_glitch = false, -- Climable blocks are quite fast in Carbone.
})
end)
minetest.register_on_leaveplayer(function(player)
minetest.sound_play("player_leave", {gain = 1})
end)
minetest.register_on_respawnplayer(function(player)
player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
local pos = player:getpos()
-- minetest.sound_play("player_join", {pos = pos, gain = 0.5})
end)
minetest.register_on_item_eat(function(hp_change, replace_with_item, itemstack, user, pointed_thing)
if user:get_hp() >= 20 then return end
local pos = user:getpos()
minetest.sound_play("health_gain", {pos = pos, gain = 0.4})
end)
minetest.log("action", "") -- Empty line.
minetest.log("action", "") -- Empty line.
if minetest.setting_getbool("creative_mode") then
minetest.log("action", "Creative mode is enabled.")
else
minetest.log("action", "Creative mode is disabled.")
end
if minetest.setting_getbool("enable_damage") then
minetest.log("action", "Damage is enabled.")
else
minetest.log("action", "Damage is disabled.")
end
if minetest.setting_getbool("enable_pvp") then
minetest.log("action", "PvP is enabled.")
else
minetest.log("action", "PvP is disabled.")
end
if not minetest.is_singleplayer() and minetest.setting_getbool("server_announce") then
minetest.log("action", "") -- Empty line.
minetest.log("action", "Server name: " .. minetest.setting_get("server_name") or "(none)")
minetest.log("action", "Server description: " .. minetest.setting_get("server_description") or "(none)")
minetest.log("action", "Server URL: " .. minetest.setting_get("server_address") or "(none)")
minetest.log("action", "MOTD: " .. minetest.setting_get("motd") or "(none)")
minetest.log("action", "Maximum users: " .. minetest.setting_get("max_users") or 15)
end
minetest.log("action", "") -- Empty line.
minetest.log("action", "") -- Empty line.
-- Reserved slot handling:
minetest.register_on_prejoinplayer(function(name, ip)
local admin_slots = minetest.setting_get('admin_slots') or 2
if #minetest.get_connected_players() >= (minetest.setting_get('max_users') - admin_slots)
and not minetest.check_player_privs(name, {server = true}) then
return "Sorry, " .. admin_slots .. " slots are reserved for administrators."
end
end)
if minetest.setting_getbool("log_mods") then
-- Highlight the default mod in the mod loading logs:
minetest.log("action", "Carbone: * [default] loaded.")
end

View File

@ -2,7 +2,7 @@ minetest.register_privilege("physics", {
description = "Allows player to set their gravity, jump height and movement speed"})
-- Infotool code by PilzAdam:
minetest.register_craftitem("default:infotool", {
minetest.register_craftitem(":default:infotool", {
description = "Infotool",
inventory_image = "default_infotool.png",
wield_image = "default_infotool.png^[transformR90",

View File

@ -0,0 +1,8 @@
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)
if newnode.name ~= "default:torch" or minetest.get_item_group(oldnode.name, "water") == 0 then
return
end
minetest.remove_node(pos, newnode)
minetest.set_node(pos, oldnode)
minetest.add_item(pos, "default:torch")
end)

View File

@ -4,6 +4,11 @@
local cwd = minetest.get_modpath("_misc")
-- Code extracted from edits done in the default mod
dofile(cwd.."/carbone_init.lua")
dofile(cwd.."/commands.lua")
dofile(cwd.."/forbid_underwater_torch.lua")
-- Give initial stuff
dofile(cwd.."/give_initial_stuff.lua")

View File

Before

Width:  |  Height:  |  Size: 125 B

After

Width:  |  Height:  |  Size: 125 B