Remplissage du dépôt.
This commit is contained in:
parent
6c07b2ec4f
commit
811f29dbdf
64
aliases.lua
Executable file
64
aliases.lua
Executable file
@ -0,0 +1,64 @@
|
|||||||
|
local alias = minetest.register_alias
|
||||||
|
-- Remove duplicated items from the carbone subgame because of Moreores mod
|
||||||
|
-- Stone
|
||||||
|
alias("default:stone_with_tin", "default:stone")
|
||||||
|
alias("default:stone_with_silver", "default:stone")
|
||||||
|
-- Lump
|
||||||
|
alias("default:tin_lump", "default:stone")
|
||||||
|
alias("default:silver_lump", "default:stone")
|
||||||
|
-- Ingot
|
||||||
|
alias("default:tin_ingot", "default:stone")
|
||||||
|
alias("default:silver_ingot", "default:stone")
|
||||||
|
-- Block
|
||||||
|
alias("default:tinblock", "default:stone")
|
||||||
|
alias("default:silverblock", "default:stone")
|
||||||
|
-- Tools
|
||||||
|
alias("default:pick_silver", "default:stone")
|
||||||
|
alias("default:shovel_silver", "default:stone")
|
||||||
|
alias("default:axe_silver", "default:stone")
|
||||||
|
alias("default:sword_silver", "default:stone")
|
||||||
|
alias("default:knife_silver", "default:stone")
|
||||||
|
|
||||||
|
-- Remove torch from torches => remise des torches par défaut
|
||||||
|
alias("torches:floor", "default:torch")
|
||||||
|
alias("torches:wand", "default:torch")
|
||||||
|
|
||||||
|
-- Remove copper_rail from moreores => utilisation des rail_copper du mod carts
|
||||||
|
alias("moreores:copper_rail", "carts:rail_copper")
|
||||||
|
|
||||||
|
-- Old fishing mod to the new fishing mod
|
||||||
|
alias("fishing:fish_cooked", "fishing:fish")
|
||||||
|
alias("fishing:worm", "fishing:bait_worm")
|
||||||
|
|
||||||
|
-- Old itemframes mod to the new itemframes(v2) mod
|
||||||
|
alias("itemframes:pedestal", "itemframes:pedestal_cobble")
|
||||||
|
|
||||||
|
-- Remove "moreores:copper_rail" for "carts:copper_rail"
|
||||||
|
alias("moreores:copper_rail", "carts:rail_copper")
|
||||||
|
|
||||||
|
-- Remove "multitest:hayblock" because farming redo include it now
|
||||||
|
alias("multitest:hayblock", "farming:straw")
|
||||||
|
|
||||||
|
-- Remove "darkage:stair_straw", "darkage:straw", "darkage:straw_bale" and "darkage:adobe"
|
||||||
|
alias("darkage:stair_straw", "farming:straw")
|
||||||
|
alias("darkage:straw", "farming:straw")
|
||||||
|
alias("darkage:straw_bale", "farming:straw")
|
||||||
|
alias("darkage:adobe", "farming:straw")
|
||||||
|
|
||||||
|
-- Remove "wiki:wiki"
|
||||||
|
alias("wiki:wiki", "default:bookshelf")
|
||||||
|
|
||||||
|
-- Remove "building_blocks:knife"
|
||||||
|
alias("building_blocks:knife", "default:sword_steel")
|
||||||
|
|
||||||
|
-- Remove "xmas_tree" from snow mod
|
||||||
|
alias("snow:xmas_tree", "default:dirt")
|
||||||
|
|
||||||
|
-- remove "fake_fire:flint_and_steel" from homedecor_modpack mod
|
||||||
|
alias("fake_fire:flint_and_steel", "fire:flint_and_steel")
|
||||||
|
|
||||||
|
-- remove ongen pine saplings from moretrees
|
||||||
|
alias("moretrees:pine_sapling_ongen", "default:pine_sapling")
|
||||||
|
|
||||||
|
-- Remove bedrock mod
|
||||||
|
alias("bedrock:bedrock", "default:cobble")
|
31
bush_seeds.lua
Normal file
31
bush_seeds.lua
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
minetest.register_craftitem(":bushes:youngtree", {
|
||||||
|
description = "Young tree",
|
||||||
|
inventory_image = "bushes_youngtree.png",
|
||||||
|
on_place = function(stack, user, pointed_thing)
|
||||||
|
if pointed_thing.type ~= "node" then return end
|
||||||
|
local pos = pointed_thing.under
|
||||||
|
|
||||||
|
for y = 1, 4 do
|
||||||
|
local m = 0
|
||||||
|
if (y > 2) then m = 1 end
|
||||||
|
for z = 0, m do
|
||||||
|
if minetest.get_node({x = pos.x, y = pos.y+y, z = pos.z+z}).name ~= "air" or minetest.is_protected({x = pos.x, y = pos.y+y, z = pos.z+z}, user:get_player_name()) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
abstract_bushes.grow_youngtree_node2(pointed_thing.under, 4)
|
||||||
|
stack:set_count(stack:get_count() - 1)
|
||||||
|
return stack
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "bushes:youngtree",
|
||||||
|
recipe = {
|
||||||
|
{"bushes:BushLeaves1", "default:stick", "bushes:BushLeaves1"},
|
||||||
|
{"", "default:stick", ""},
|
||||||
|
{"", "default:stick", ""},
|
||||||
|
},
|
||||||
|
})
|
85
carbone_init.lua
Normal file
85
carbone_init.lua
Normal 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
|
61
chatcommands.lua
Executable file
61
chatcommands.lua
Executable file
@ -0,0 +1,61 @@
|
|||||||
|
--
|
||||||
|
-- Edited chat commands from core
|
||||||
|
--
|
||||||
|
|
||||||
|
-- /shutdown
|
||||||
|
-- /ban
|
||||||
|
-- /itemdb
|
||||||
|
|
||||||
|
minetest.register_chatcommand("shutdown", {
|
||||||
|
description = "shutdown server",
|
||||||
|
privs = {server=true},
|
||||||
|
func = function(name, param)
|
||||||
|
minetest.log("action", name .. " shuts down server")
|
||||||
|
minetest.request_shutdown()
|
||||||
|
minetest.chat_send_all(name .. " just shut down the server.")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_chatcommand("ban", {
|
||||||
|
params = "<name>",
|
||||||
|
description = "Ban IP of player",
|
||||||
|
privs = {ban=true},
|
||||||
|
func = function(name, param)
|
||||||
|
if param == "" then
|
||||||
|
return true, "Ban list: " .. minetest.get_ban_list()
|
||||||
|
end
|
||||||
|
if not minetest.get_player_by_name(param) then
|
||||||
|
return false, "This player is not online at the moment. Use a /future_ban instead."
|
||||||
|
end
|
||||||
|
if not minetest.ban_player(param) then
|
||||||
|
return false, "Failed to ban player."
|
||||||
|
end
|
||||||
|
local desc = minetest.get_ban_description(param)
|
||||||
|
minetest.log("action", name .. " bans " .. desc .. ".")
|
||||||
|
return true, "Banned " .. desc .. "."
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_chatcommand("itemdb", {
|
||||||
|
params = "",
|
||||||
|
description = "Give itemstring of wielded item",
|
||||||
|
privs = {},
|
||||||
|
func = function(name)
|
||||||
|
local player = minetest.get_player_by_name(name)
|
||||||
|
if not player then return false end
|
||||||
|
local item = player:get_wielded_item()
|
||||||
|
|
||||||
|
if item:get_name() == "" then
|
||||||
|
minetest.chat_send_player(name,"You're handling nothing.")
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
if not minetest.registered_items[item:get_name()] then
|
||||||
|
minetest.chat_send_player(name,"You are handling an unknown item (known before as " .. item:get_name() ..").")
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
minetest.chat_send_player(name,"You are handling a " .. minetest.registered_items[item:get_name()].description .. " also known as " .. item:get_name() .. ".")
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
})
|
190
commands.lua
Executable file
190
commands.lua
Executable file
@ -0,0 +1,190 @@
|
|||||||
|
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", {
|
||||||
|
description = "Infotool",
|
||||||
|
inventory_image = "default_infotool.png",
|
||||||
|
wield_image = "default_infotool.png^[transformR90",
|
||||||
|
groups = {not_in_creative_inventory = 1},
|
||||||
|
on_use = function(_, user, pt)
|
||||||
|
if pt.type ~= "node" then return end
|
||||||
|
local nn = minetest.get_node(pt.under).name
|
||||||
|
if minetest.registered_items[nn] == nil or minetest.registered_items[nn].tiles == nil or type(minetest.registered_items[nn].tiles[1]) ~= "string" then return end
|
||||||
|
local def = minetest.registered_nodes[nn]
|
||||||
|
if not def then return end
|
||||||
|
|
||||||
|
local textures = def.tiles
|
||||||
|
local description = def.description
|
||||||
|
if not textures then
|
||||||
|
textures = {"(no texture)"}
|
||||||
|
end
|
||||||
|
if not description then
|
||||||
|
description = {"(no description)"}
|
||||||
|
end
|
||||||
|
for i = 1,6 do
|
||||||
|
if not textures[i] then
|
||||||
|
textures[i] = textures[i-1]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local dir = vector.subtract(pt.above, pt.under)
|
||||||
|
local index
|
||||||
|
-- This doesn't work for facedir or other drawtypes yet.
|
||||||
|
if dir.y == 1 then
|
||||||
|
index = 1
|
||||||
|
elseif dir.y == -1 then
|
||||||
|
index = 2
|
||||||
|
else
|
||||||
|
if dir.x == 1 then
|
||||||
|
index = 3
|
||||||
|
elseif dir.x == -1 then
|
||||||
|
index = 4
|
||||||
|
else
|
||||||
|
if dir.z == 1 then
|
||||||
|
index = 5
|
||||||
|
else
|
||||||
|
index = 6
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
minetest.chat_send_player(user:get_player_name(), description .. ": " .. nn .. " (" .. textures[index] .. ")")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_chatcommand("info", {
|
||||||
|
description = "Gives an Infotool, click to receive information on the pointed node",
|
||||||
|
func = function(name)
|
||||||
|
local receiverref = minetest.get_player_by_name(name)
|
||||||
|
receiverref:get_inventory():add_item("main", "default:infotool")
|
||||||
|
minetest.chat_send_player(name, "\"default:infotool\" added to inventory.")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_chatcommand("clearinventory", {
|
||||||
|
params = "<inventory>",
|
||||||
|
description = "Clears an entire inventory, \"main\" if unspecified, \"craft\" is another possible choice",
|
||||||
|
func = function(name, param)
|
||||||
|
local player = minetest.get_player_by_name(name)
|
||||||
|
local player_inv = player:get_inventory()
|
||||||
|
if not player then
|
||||||
|
minetest.log("error", "Unable to clear inventory, no player.")
|
||||||
|
return false, "Unable to clear inventory, no player."
|
||||||
|
end
|
||||||
|
if param == "" then
|
||||||
|
player_inv:set_list("main", {})
|
||||||
|
return true, "Inventory \"main\" cleared."
|
||||||
|
else
|
||||||
|
player_inv:set_list(param, {})
|
||||||
|
return true, "Inventory \"" .. param .. "\" cleared."
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- The following commands /whoami, /suicide, /speed, /gravity and /jump by Wuzzy:
|
||||||
|
minetest.register_chatcommand("whoami", {
|
||||||
|
params = "",
|
||||||
|
description = "Tells your name",
|
||||||
|
privs = {},
|
||||||
|
func = function(name)
|
||||||
|
minetest.chat_send_player(name, "Your name is: " .. name)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_chatcommand("ip", {
|
||||||
|
params = "",
|
||||||
|
description = "Shows your IP address",
|
||||||
|
privs = {},
|
||||||
|
func = function(name)
|
||||||
|
minetest.chat_send_player(name, "Your IP address is: "..minetest.get_player_ip(name))
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_chatcommand("suicide", {
|
||||||
|
params = "",
|
||||||
|
description = "Kills yourself",
|
||||||
|
func = function(name, param)
|
||||||
|
local player = minetest.get_player_by_name(name)
|
||||||
|
if not player then return end
|
||||||
|
player:set_hp(0)
|
||||||
|
if minetest.setting_getbool("enable_damage") == false then
|
||||||
|
minetest.chat_send_player(name, "[X] Damage is disabled on this server.")
|
||||||
|
else
|
||||||
|
minetest.chat_send_player(name, "[X] You suicided.")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_chatcommand("speed", {
|
||||||
|
params = "[speed]",
|
||||||
|
description = "Sets your movement speed (defaults to 1).",
|
||||||
|
privs = {physics = true},
|
||||||
|
func = function(name, speed)
|
||||||
|
local player = minetest.get_player_by_name(name)
|
||||||
|
if not player then return end
|
||||||
|
if speed == "" then speed = 1 end
|
||||||
|
if type(tonumber(speed)) ~= "number"
|
||||||
|
or tonumber(speed) < 0
|
||||||
|
or tonumber(speed) > 10 then
|
||||||
|
minetest.chat_send_player(name, "[~] Speed must be between 0.0 and 10.0.")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
player:set_physics_override(tonumber(speed), nil, nil)
|
||||||
|
minetest.chat_send_player(name, "[~] Speed set to " .. tonumber(speed) * 100 .. " %.")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_chatcommand("gravity", {
|
||||||
|
params = "[gravity]",
|
||||||
|
description = "Sets your gravity (defaults to 1).",
|
||||||
|
privs = {physics = true},
|
||||||
|
func = function(name, gravity)
|
||||||
|
local player = minetest.get_player_by_name(name)
|
||||||
|
if not player then return end
|
||||||
|
if gravity == "" then gravity = 1 end
|
||||||
|
if type(tonumber(gravity)) ~= "number"
|
||||||
|
or tonumber(gravity) < -10
|
||||||
|
or tonumber(gravity) > 10 then
|
||||||
|
minetest.chat_send_player(name, "[~] Gravity must be between -10.0 and 10.0.")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
player:set_physics_override(nil, nil, tonumber(gravity))
|
||||||
|
minetest.chat_send_player(name, "[~] Gravity set to " .. tonumber(gravity) * 100 .. " %.")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_chatcommand("jump", {
|
||||||
|
params = "[height]",
|
||||||
|
description = "Sets your jump height (defaults to 1)",
|
||||||
|
privs = {physics = true},
|
||||||
|
func = function(name, jump)
|
||||||
|
local player = minetest.get_player_by_name(name)
|
||||||
|
if not player then return end
|
||||||
|
if jump == "" then jump = 1 end
|
||||||
|
if type(tonumber(jump)) ~= "number"
|
||||||
|
or tonumber(jump) < 0
|
||||||
|
or tonumber(jump) > 10 then
|
||||||
|
minetest.chat_send_player(name, "[~] Jump height must be between 0.0 and 10.0.")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
player:set_physics_override(nil, tonumber(jump), nil)
|
||||||
|
minetest.chat_send_player(name, "[~] Jump height set to " .. tonumber(jump) * 100 .. " %.")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_chatcommand("hotbar", {
|
||||||
|
params = "[size]",
|
||||||
|
description = "Sets the size of your hotbar",
|
||||||
|
func = function(name, slots)
|
||||||
|
if slots == "" then slots = 16 end
|
||||||
|
if type(tonumber(slots)) ~= "number" or tonumber(slots) < 1 or tonumber(slots) > 23 then
|
||||||
|
minetest.chat_send_player(name, "[_] Hotbar size must be between 1 and 23.")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local player = minetest.get_player_by_name(name)
|
||||||
|
player:hud_set_hotbar_itemcount(tonumber(slots))
|
||||||
|
minetest.chat_send_player(name, "[_] Hotbar size set to " .. tonumber(slots) .. ".")
|
||||||
|
end,
|
||||||
|
})
|
10
craft_obsidian.lua
Executable file
10
craft_obsidian.lua
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
-- Craft obsidian
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "default:obsidian",
|
||||||
|
recipe = {
|
||||||
|
{"bucket:bucket_lava"},
|
||||||
|
},
|
||||||
|
replacements = {
|
||||||
|
{"bucket:bucket_lava", "bucket:bucket_empty"}
|
||||||
|
},
|
||||||
|
})
|
4
depends.txt
Executable file
4
depends.txt
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
interact
|
||||||
|
moretrees?
|
||||||
|
nether?
|
||||||
|
bushes?
|
8
forbid_underwater_torch.lua
Normal file
8
forbid_underwater_torch.lua
Normal 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)
|
343
furnace_locked.lua
Executable file
343
furnace_locked.lua
Executable file
@ -0,0 +1,343 @@
|
|||||||
|
|
||||||
|
--
|
||||||
|
-- Formspecs
|
||||||
|
--
|
||||||
|
|
||||||
|
local function active_formspec(fuel_percent, item_percent)
|
||||||
|
local formspec =
|
||||||
|
"size[8,8.5]"..
|
||||||
|
default.gui_bg..
|
||||||
|
default.gui_bg_img..
|
||||||
|
default.gui_slots..
|
||||||
|
"list[current_name;src;2.75,0.5;1,1;]"..
|
||||||
|
"list[current_name;fuel;2.75,2.5;1,1;]"..
|
||||||
|
"image[2.75,1.5;1,1;default_furnace_fire_bg.png^[lowpart:"..
|
||||||
|
(100-fuel_percent)..":default_furnace_fire_fg.png]"..
|
||||||
|
"image[3.75,1.5;1,1;gui_furnace_arrow_bg.png^[lowpart:"..
|
||||||
|
(item_percent)..":gui_furnace_arrow_fg.png^[transformR270]"..
|
||||||
|
"list[current_name;dst;4.75,0.96;2,2;]"..
|
||||||
|
"list[current_player;main;0,4.25;8,1;]"..
|
||||||
|
"list[current_player;main;0,5.5;8,3;8]"..
|
||||||
|
"listring[current_name;dst]"..
|
||||||
|
"listring[current_player;main]"..
|
||||||
|
"listring[current_name;src]"..
|
||||||
|
"listring[current_player;main]"..
|
||||||
|
default.get_hotbar_bg(0, 4.25)
|
||||||
|
return formspec
|
||||||
|
end
|
||||||
|
|
||||||
|
local inactive_formspec =
|
||||||
|
"size[8,8.5]"..
|
||||||
|
default.gui_bg..
|
||||||
|
default.gui_bg_img..
|
||||||
|
default.gui_slots..
|
||||||
|
"list[current_name;src;2.75,0.5;1,1;]"..
|
||||||
|
"list[current_name;fuel;2.75,2.5;1,1;]"..
|
||||||
|
"image[2.75,1.5;1,1;default_furnace_fire_bg.png]"..
|
||||||
|
"image[3.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
|
||||||
|
"list[current_name;dst;4.75,0.96;2,2;]"..
|
||||||
|
"list[current_player;main;0,4.25;8,1;]"..
|
||||||
|
"list[current_player;main;0,5.5;8,3;8]"..
|
||||||
|
"listring[current_name;dst]"..
|
||||||
|
"listring[current_player;main]"..
|
||||||
|
"listring[current_name;src]"..
|
||||||
|
"listring[current_player;main]"..
|
||||||
|
default.get_hotbar_bg(0, 4.25)
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Node callback functions that are the same for active and inactive furnace
|
||||||
|
--
|
||||||
|
local function has_locked_furnace_privilege(meta, player)
|
||||||
|
if player:get_player_name() ~= meta:get_string("owner") and player:get_player_name() ~= minetest.setting_get("name") then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local function can_dig(pos, player)
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
local inv = meta:get_inventory()
|
||||||
|
return has_locked_furnace_privilege(meta, player) and inv:is_empty("fuel") and inv:is_empty("dst") and inv:is_empty("src")
|
||||||
|
end
|
||||||
|
|
||||||
|
local function allow_metadata_inventory_put(pos, listname, index, stack, player)
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
if not has_locked_furnace_privilege(meta, player) then
|
||||||
|
minetest.log("action", player:get_player_name()..
|
||||||
|
" tried to access a locked furnace belonging to "..
|
||||||
|
meta:get_string("owner").." at "..
|
||||||
|
minetest.pos_to_string(pos) .. ".")
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
|
||||||
|
local inv = meta:get_inventory()
|
||||||
|
if listname == "fuel" then
|
||||||
|
if minetest.get_craft_result({method="fuel", width=1, items={stack}}).time ~= 0 then
|
||||||
|
if inv:is_empty("src") then
|
||||||
|
meta:set_string("infotext", "Furnace is empty")
|
||||||
|
end
|
||||||
|
return stack:get_count()
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
elseif listname == "src" then
|
||||||
|
return stack:get_count()
|
||||||
|
elseif listname == "dst" then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
local inv = meta:get_inventory()
|
||||||
|
local stack = inv:get_stack(from_list, from_index)
|
||||||
|
return allow_metadata_inventory_put(pos, to_list, to_index, stack, player)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function allow_metadata_inventory_take(pos, listname, index, stack, player)
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
if not has_locked_furnace_privilege(meta, player) then
|
||||||
|
minetest.log("action", player:get_player_name()..
|
||||||
|
" tried to access a locked furnace belonging to "..
|
||||||
|
meta:get_string("owner").." at "..
|
||||||
|
minetest.pos_to_string(pos) .. ".")
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
return stack:get_count()
|
||||||
|
end
|
||||||
|
|
||||||
|
local function swap_node(pos, name)
|
||||||
|
local node = minetest.get_node(pos)
|
||||||
|
if node.name == name then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
node.name = name
|
||||||
|
minetest.swap_node(pos, node)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function furnace_node_timer(pos, elapsed)
|
||||||
|
--
|
||||||
|
-- Inizialize metadata
|
||||||
|
--
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
local fuel_time = meta:get_float("fuel_time") or 0
|
||||||
|
local src_time = meta:get_float("src_time") or 0
|
||||||
|
local fuel_totaltime = meta:get_float("fuel_totaltime") or 0
|
||||||
|
|
||||||
|
local inv = meta:get_inventory()
|
||||||
|
local srclist = inv:get_list("src")
|
||||||
|
local fuellist = inv:get_list("fuel")
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Cooking
|
||||||
|
--
|
||||||
|
|
||||||
|
-- Check if we have cookable content
|
||||||
|
local cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
|
||||||
|
local cookable = true
|
||||||
|
|
||||||
|
if cooked.time == 0 then
|
||||||
|
cookable = false
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Check if we have enough fuel to burn
|
||||||
|
if fuel_time < fuel_totaltime then
|
||||||
|
-- The furnace is currently active and has enough fuel
|
||||||
|
fuel_time = fuel_time + 1
|
||||||
|
|
||||||
|
-- If there is a cookable item then check if it is ready yet
|
||||||
|
if cookable then
|
||||||
|
src_time = src_time + 1
|
||||||
|
if src_time >= cooked.time then
|
||||||
|
-- Place result in dst list if possible
|
||||||
|
if inv:room_for_item("dst", cooked.item) then
|
||||||
|
inv:add_item("dst", cooked.item)
|
||||||
|
inv:set_stack("src", 1, aftercooked.items[1])
|
||||||
|
src_time = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
-- Furnace ran out of fuel
|
||||||
|
if cookable then
|
||||||
|
-- We need to get new fuel
|
||||||
|
local fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
|
||||||
|
|
||||||
|
if fuel.time == 0 then
|
||||||
|
-- No valid fuel in fuel list
|
||||||
|
fuel_totaltime = 0
|
||||||
|
fuel_time = 0
|
||||||
|
src_time = 0
|
||||||
|
else
|
||||||
|
-- Take fuel from fuel list
|
||||||
|
inv:set_stack("fuel", 1, afterfuel.items[1])
|
||||||
|
|
||||||
|
fuel_totaltime = fuel.time
|
||||||
|
fuel_time = 0
|
||||||
|
end
|
||||||
|
else
|
||||||
|
-- We don't need to get new fuel since there is no cookable item
|
||||||
|
fuel_totaltime = 0
|
||||||
|
fuel_time = 0
|
||||||
|
src_time = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Update formspec, infotext and node
|
||||||
|
--
|
||||||
|
local formspec = inactive_formspec
|
||||||
|
local item_state
|
||||||
|
local item_percent = 0
|
||||||
|
if cookable then
|
||||||
|
item_percent = math.floor(src_time / cooked.time * 100)
|
||||||
|
item_state = item_percent .. "%"
|
||||||
|
else
|
||||||
|
if srclist[1]:is_empty() then
|
||||||
|
item_state = "Empty"
|
||||||
|
else
|
||||||
|
item_state = "Not cookable"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local fuel_state = "Empty"
|
||||||
|
local active = "inactive "
|
||||||
|
local result = false
|
||||||
|
|
||||||
|
if fuel_time <= fuel_totaltime and fuel_totaltime ~= 0 then
|
||||||
|
active = "active "
|
||||||
|
local fuel_percent = math.floor(fuel_time / fuel_totaltime * 100)
|
||||||
|
fuel_state = fuel_percent .. "%"
|
||||||
|
formspec = active_formspec(fuel_percent, item_percent)
|
||||||
|
swap_node(pos, "default:furnace_locked_active")
|
||||||
|
-- make sure timer restarts automatically
|
||||||
|
result = true
|
||||||
|
else
|
||||||
|
if not fuellist[1]:is_empty() then
|
||||||
|
fuel_state = "0%"
|
||||||
|
end
|
||||||
|
swap_node(pos, "default:furnace_locked")
|
||||||
|
-- stop timer on the inactive furnace
|
||||||
|
local timer = minetest.get_node_timer(pos)
|
||||||
|
timer:stop()
|
||||||
|
end
|
||||||
|
|
||||||
|
local infotext = "Locked Furnace " .. active .."(Item: " .. item_state .. "; Fuel: " .. fuel_state .. ")\n(owned by "..meta:get_string("owner") .. ")"
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Set meta values
|
||||||
|
--
|
||||||
|
meta:set_float("fuel_totaltime", fuel_totaltime)
|
||||||
|
meta:set_float("fuel_time", fuel_time)
|
||||||
|
meta:set_float("src_time", src_time)
|
||||||
|
meta:set_string("formspec", formspec)
|
||||||
|
meta:set_string("infotext", infotext)
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Node definitions
|
||||||
|
--
|
||||||
|
|
||||||
|
minetest.register_node(":default:furnace_locked", {
|
||||||
|
description = "Locked Furnace",
|
||||||
|
tiles = {
|
||||||
|
"default_furnace_top.png", "default_furnace_bottom.png",
|
||||||
|
"default_furnace_side.png", "default_furnace_side.png",
|
||||||
|
"default_furnace_side.png", "default_furnace_locked_front.png"
|
||||||
|
},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
groups = {cracky=2},
|
||||||
|
legacy_facedir_simple = true,
|
||||||
|
is_ground_content = false,
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
can_dig = can_dig,
|
||||||
|
|
||||||
|
on_timer = furnace_node_timer,
|
||||||
|
after_place_node = function(pos, placer)
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
meta:set_string("owner", placer:get_player_name())
|
||||||
|
meta:set_string("infotext", "Locked Furnace (owned by " .. placer:get_player_name() .. ")")
|
||||||
|
end,
|
||||||
|
on_construct = function(pos)
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
meta:set_string("formspec", inactive_formspec)
|
||||||
|
local inv = meta:get_inventory()
|
||||||
|
inv:set_size('src', 1)
|
||||||
|
inv:set_size('fuel', 1)
|
||||||
|
inv:set_size('dst', 4)
|
||||||
|
end,
|
||||||
|
|
||||||
|
on_metadata_inventory_move = function(pos)
|
||||||
|
local timer = minetest.get_node_timer(pos)
|
||||||
|
timer:start(1.0)
|
||||||
|
end,
|
||||||
|
on_metadata_inventory_put = function(pos)
|
||||||
|
-- start timer function, it will sort out whether furnace can burn or not.
|
||||||
|
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_locked"
|
||||||
|
minetest.remove_node(pos)
|
||||||
|
return drops
|
||||||
|
end,
|
||||||
|
|
||||||
|
allow_metadata_inventory_put = allow_metadata_inventory_put,
|
||||||
|
allow_metadata_inventory_move = allow_metadata_inventory_move,
|
||||||
|
allow_metadata_inventory_take = allow_metadata_inventory_take,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":default:furnace_locked_active", {
|
||||||
|
description = "Locked Furnace",
|
||||||
|
tiles = {
|
||||||
|
"default_furnace_top.png", "default_furnace_bottom.png",
|
||||||
|
"default_furnace_side.png", "default_furnace_side.png",
|
||||||
|
"default_furnace_side.png",
|
||||||
|
{
|
||||||
|
image = "default_furnace_locked_front_active.png",
|
||||||
|
backface_culling = false,
|
||||||
|
animation = {
|
||||||
|
type = "vertical_frames",
|
||||||
|
aspect_w = 16,
|
||||||
|
aspect_h = 16,
|
||||||
|
length = 1.5
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
light_source = 8,
|
||||||
|
drop = "default:furnace_locked",
|
||||||
|
groups = {cracky=2, not_in_creative_inventory=1},
|
||||||
|
legacy_facedir_simple = true,
|
||||||
|
is_ground_content = false,
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
on_timer = furnace_node_timer,
|
||||||
|
|
||||||
|
can_dig = can_dig,
|
||||||
|
|
||||||
|
allow_metadata_inventory_put = allow_metadata_inventory_put,
|
||||||
|
allow_metadata_inventory_move = allow_metadata_inventory_move,
|
||||||
|
allow_metadata_inventory_take = allow_metadata_inventory_take,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "default:furnace_locked",
|
||||||
|
recipe = {
|
||||||
|
{"group:stone", "group:stone", "group:stone"},
|
||||||
|
{"group:stone", "group:ingot", "group:stone"},
|
||||||
|
{"group:stone", "group:stone", "group:stone"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "shapeless",
|
||||||
|
output = "default:furnace_locked",
|
||||||
|
recipe = {"default:furnace", "group:ingot"},
|
||||||
|
})
|
10
give_initial_stuff.lua
Executable file
10
give_initial_stuff.lua
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
minetest.register_on_newplayer(function(player)
|
||||||
|
print("Un nouveau joueur vient de nous rejoindre !")
|
||||||
|
if minetest.setting_getbool("give_initial_stuff") then
|
||||||
|
print("Equipement de depart transmis")
|
||||||
|
player:get_inventory():add_item("main", "default:axe_wood")
|
||||||
|
player:get_inventory():add_item("main", "default:torch 10")
|
||||||
|
player:get_inventory():add_item("main", "default:sapling 2")
|
||||||
|
player:get_inventory():add_item("main", "default:apple 5")
|
||||||
|
end
|
||||||
|
end)
|
48
init.lua
Executable file
48
init.lua
Executable file
@ -0,0 +1,48 @@
|
|||||||
|
---------------------
|
||||||
|
-- Server Misc Mod --
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
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")
|
||||||
|
|
||||||
|
-- Chat Commands
|
||||||
|
dofile(cwd.."/chatcommands.lua")
|
||||||
|
|
||||||
|
-- No Interact Messages
|
||||||
|
dofile(cwd.."/nointeract_messages.lua")
|
||||||
|
|
||||||
|
-- irc
|
||||||
|
dofile(cwd.."/irc.lua")
|
||||||
|
-- No Shout Messages
|
||||||
|
dofile(cwd.."/noshout_messages.lua")
|
||||||
|
|
||||||
|
-- Aliases
|
||||||
|
dofile(cwd.."/aliases.lua")
|
||||||
|
|
||||||
|
-- Craft Obsidian
|
||||||
|
dofile(cwd.."/craft_obsidian.lua")
|
||||||
|
|
||||||
|
-- UnCraft Woll
|
||||||
|
dofile(cwd.."/uncraft_woll.lua")
|
||||||
|
|
||||||
|
-- List players
|
||||||
|
dofile(cwd.."/list_players.lua")
|
||||||
|
|
||||||
|
-- Desert Sand/Sand swap
|
||||||
|
dofile(cwd.."/sand_swapping.lua")
|
||||||
|
|
||||||
|
-- Sapling craft recipes
|
||||||
|
dofile(cwd.."/sapling_crafts.lua")
|
||||||
|
|
||||||
|
-- Bush seeds
|
||||||
|
dofile(cwd.."/bush_seeds.lua")
|
||||||
|
|
||||||
|
--Locked furnace
|
||||||
|
dofile(cwd.."/furnace_locked.lua")
|
84
irc.lua
Executable file
84
irc.lua
Executable file
@ -0,0 +1,84 @@
|
|||||||
|
# Based on https://github.com/ChaosWormz/mt_terms_of_use
|
||||||
|
|
||||||
|
local IRC = [[
|
||||||
|
-~= Regles du salon de chat IRC #minetestforfun@irc.inchra.net =~-
|
||||||
|
(Ces regles ont ete etablies le 1er Novembre 2014 par les operateurs du canal Mg et MinetestForFun)
|
||||||
|
|
||||||
|
1) Il ne sera tolere aucune transgressions aux regles du reseau InchraNet, sous peine de la sanction prevue par les administrateurs du reseau.
|
||||||
|
2) Il ne sera tolere aucune forme de violation des lois en vigueur dans les pays de residence des participants, ainsi que ceux des hebergeurs des serveurs.
|
||||||
|
3) Il ne sera tolere aucune sorte d'insulte, de provocation gratuite, d'incitation a la haine, au meurtre, au suicide, ou toute autre forme d'atteinte au respect mutuel des utilisateurs de l'IRC.
|
||||||
|
4) Il ne sera tolere aucune forme de flood ainsi que de spam. Rappelez-vous qu'il est preferable d'utiliser un site de televersion de texte (aussi nomme "pastebin"), tel que "pastebin.ubuntu.com" a chaque fois que vous desirez transmettre du code ou un long texte.
|
||||||
|
Le flood est l'action de saturer le chat de messages repetitifs, inutiles, y compris les join/part, grossiers, sans aucun rapport avec la conversation et au detriment des participants
|
||||||
|
Le spam est l'action de faire de la publicite pour quelque chose que ce soit sans l'accord d'un ayant droit ou d'un operateur de canal.
|
||||||
|
5) Il ne sera tolere aucun pseudonyme a caractere sexuel, haineux, contenant des termes ou propos indesirables sur le salon.
|
||||||
|
6) Il ne sera tolere aucune forme d'harcelement moral ou a caractere sexuel, y compris par messages prives.
|
||||||
|
7) Il ne sera tolere aucun type de discrimination contre quelque participant que ce soit, ni aucune forme d'insulte envers les operateurs, semi-operateurs et administrateurs d'InchraNet.
|
||||||
|
|
||||||
|
Voici les sanctions prevues pour les infractions aux regles ci-dessus.
|
||||||
|
|
||||||
|
- Infraction niveau DIRT :
|
||||||
|
Manque de respect envers autrui : Devoice une journee
|
||||||
|
Provocation envers autrui : Devoice une journee
|
||||||
|
Insultes envers autrui : Kick + Devoice une journee
|
||||||
|
|
||||||
|
- Infraction niveau STONE :
|
||||||
|
- Recidivide d'infraction niveau dirt : Kick + Ban 1/2 journee
|
||||||
|
- Flood, Discrimination : Kick + Devoice deux heures
|
||||||
|
- Spam : Kick + Devoice 1 jour + Ban 1/2 journee
|
||||||
|
|
||||||
|
- Infraction niveau MESE :
|
||||||
|
- Recidive d'infraction niveau stone : Kick + Ban 4 jours + devoice 5 jours
|
||||||
|
- Diffusion de contenu a caractere sexuel : Kick + Ban 1 semaine + devoice 5 jours
|
||||||
|
- Irrespect envers l'equipe du canal : Kick + Ban 10 jours + devoice 8 jours
|
||||||
|
|
||||||
|
- Infraction niveau OBSIDIAN :
|
||||||
|
- Recidive d'infraction niveau mese : Kick + Ban 1 mois + devoice 2 semaines
|
||||||
|
- Violation des lois en vigueur : Kick + Ban definitif + Gline si accord des IrcOP d'InchraNet
|
||||||
|
- Violation des regles d'InchraNet : Kick + Ban definitif + Gline ou sanction defnie par l'equipe d'InchraNet
|
||||||
|
|
||||||
|
|
||||||
|
Autres regles de bienseances :
|
||||||
|
- Ne demandez pas a faire partie des operateurs/semi-operateurs du canal.
|
||||||
|
- Attention, l'abus de query et msg est dangereux pour la sante.
|
||||||
|
- Inutile de faire etalage de votre vie privee si c'est hors contexte ou si personne n'est interesse par celle ci.
|
||||||
|
- Nous ne sanctionnons bien evidemment pas le hors-sujet, toutefois, s'il est evitable ca ne peut qu’être toujours un plus !
|
||||||
|
- Le respect d'autrui est important a nos yeux.
|
||||||
|
- En cas de probleme, n'hesitez pas a contacter le staff.
|
||||||
|
]]
|
||||||
|
|
||||||
|
local function make_formspec()
|
||||||
|
local size = { "size[12,10;]" }
|
||||||
|
table.insert(size, "background[-0.22,-0.25;13,11;irc_background.jpg]")
|
||||||
|
table.insert(size, "textarea[.50,1;12,10;TOS;Voici les regles, cliquez sur Accepter si vous etes d'accord avec;"..minetest.formspec_escape(IRC).."]")
|
||||||
|
table.insert(size, "button_exit[6,9.9;1.5,0.5;accept;J'accepte]")
|
||||||
|
table.insert(size, "button[7.5,9.9;1.5,0.5;decline;Je refuse]")
|
||||||
|
return table.concat(size)
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
|
if formname ~= "irc" then return end
|
||||||
|
local name = player:get_player_name()
|
||||||
|
if fields.accept then
|
||||||
|
minetest.chat_send_player(name, "Merci d'avoir accepte les regles, vous etes maintenant capable de parler.")
|
||||||
|
minetest.chat_send_player(name, "Pour plus d'informations tapez /news")
|
||||||
|
local privs = minetest.get_player_privs(name)
|
||||||
|
privs.shout = true
|
||||||
|
minetest.set_player_privs(name, privs)
|
||||||
|
--end
|
||||||
|
return
|
||||||
|
elseif fields.decline then
|
||||||
|
minetest.kick_player(name, "Aurevoir ! Vous devez accepter les regles de l'irc pour jouer sur le serveur (revennez si vous changez d'avis).")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
minetest.register_chatcommand("irc",{
|
||||||
|
params = "",
|
||||||
|
description = "Montre les regles de l'irc",
|
||||||
|
func = function (name,params)
|
||||||
|
local player = minetest.get_player_by_name(name)
|
||||||
|
minetest.after(1, function()
|
||||||
|
minetest.show_formspec(name, "irc", make_formspec())
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
})
|
84
irc_accents.lua
Executable file
84
irc_accents.lua
Executable file
@ -0,0 +1,84 @@
|
|||||||
|
# Based on https://github.com/ChaosWormz/mt_terms_of_use
|
||||||
|
|
||||||
|
local IRC = [[
|
||||||
|
-~= Règles du salon de chat IRC #minetestforfun@irc.inchra.net =~-
|
||||||
|
(Ces règles ont été établies le 1er Novembre 2014 par les opérateurs du canal Mg et MinetestForFun)
|
||||||
|
|
||||||
|
1) Il ne sera toléré aucune transgressions aux règles du réseau InchraNet, sous peine de la sanction prévue par les administrateurs du réseau.
|
||||||
|
2) Il ne sera toléré aucune forme de violation des lois en vigueur dans les pays de résidence des participants, ainsi que ceux des hébergeurs des serveurs.
|
||||||
|
3) Il ne sera toléré aucune sorte d'insulte, de provocation gratuite, d'incitation à la haine, au meurtre, au suicide, ou toute autre forme d'atteinte au respect mutuel des utilisateurs de l'IRC.
|
||||||
|
4) Il ne sera toléré aucune forme de flood ainsi que de spam. Rappelez-vous qu'il est préférable d'utiliser un site de téléversion de texte (aussi nommé "pastebin"), tel que "pastebin.ubuntu.com" à chaque fois que vous désirez transmettre du code ou un long texte.
|
||||||
|
Le flood est l'action de saturer le chat de messages répétitifs, inutiles, y compris les join/part, grossiers, sans aucun rapport avec la conversation et au détriment des participants
|
||||||
|
Le spam est l'action de faire de la publicité pour quelque chose que ce soit sans l'accord d'un ayant droit ou d'un opérateur de canal.
|
||||||
|
5) Il ne sera toléré aucun pseudonyme à caractère sexuel, haineux, contenant des termes ou propos indésirables sur le salon.
|
||||||
|
6) Il ne sera toléré aucune forme d'harcèlement moral ou à caractère sexuel, y compris par messages privés.
|
||||||
|
7) Il ne sera toléré aucun type de discrimination contre quelque participant que ce soit, ni aucune forme d'insulte envers les opérateurs, semi-opérateurs et administrateurs d'InchraNet.
|
||||||
|
|
||||||
|
Voici les sanctions prévues pour les infractions aux règles ci-dessus.
|
||||||
|
|
||||||
|
- Infraction niveau DIRT :
|
||||||
|
Manque de respect envers autrui : Devoice une journée
|
||||||
|
Provocation envers autrui : Devoice une journée
|
||||||
|
Insultes envers autrui : Kick + Devoice une journée
|
||||||
|
|
||||||
|
- Infraction niveau STONE :
|
||||||
|
- Récidivide d'infraction niveau dirt : Kick + Ban 1/2 journée
|
||||||
|
- Flood, Discrimination : Kick + Devoice deux heures
|
||||||
|
- Spam : Kick + Devoice 1 jour + Ban 1/2 journée
|
||||||
|
|
||||||
|
- Infraction niveau MESE :
|
||||||
|
- Récidive d'infraction niveau stone : Kick + Ban 4 jours + devoice 5 jours
|
||||||
|
- Diffusion de contenu à caractère sexuel : Kick + Ban 1 semaine + devoice 5 jours
|
||||||
|
- Irrespect envers l'équipe du canal : Kick + Ban 10 jours + devoice 8 jours
|
||||||
|
|
||||||
|
- Infraction niveau OBSIDIAN :
|
||||||
|
- Récidive d'infraction niveau mese : Kick + Ban 1 mois + devoice 2 semaines
|
||||||
|
- Violation des lois en vigueur : Kick + Ban définitif + Gline si accord des IrcOP d'InchraNet
|
||||||
|
- Violation des règles d'InchraNet : Kick + Ban définitif + Gline ou sanction défnie par l'équipe d'InchraNet
|
||||||
|
|
||||||
|
|
||||||
|
Autres règles de bienséances :
|
||||||
|
- Ne demandez pas à faire partie des opérateurs/semi-opérateurs du canal.
|
||||||
|
- Attention, l'abus de query et msg est dangereux pour la santé.
|
||||||
|
- Inutile de faire étalage de votre vie privée si c'est hors contexte ou si personne n'est intéressé par celle ci.
|
||||||
|
- Nous ne sanctionnons bien évidemment pas le hors-sujet, toutefois, s'il est évitable ça ne peut qu’être toujours un plus !
|
||||||
|
- Le respect d'autrui est important à nos yeux.
|
||||||
|
- En cas de problème, n'hésitez pas à contacter le staff.
|
||||||
|
]]
|
||||||
|
|
||||||
|
local function make_formspec()
|
||||||
|
local size = { "size[10,8]" }
|
||||||
|
table.insert(size, "textarea[0.5,0.5;9.5,8;TOS;Voici les regles, cliquez sur Accepter si vous etes d'accord avec;"..minetest.formspec_escape(IRC).."]")
|
||||||
|
table.insert(size, "button_exit[6,7.4;1.5,0.5;accept;J'accepte]")
|
||||||
|
table.insert(size, "button[7.5,7.4;1.5,0.5;decline;Je refuse]")
|
||||||
|
return table.concat(size)
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
|
if formname ~= "irc" then return end
|
||||||
|
local name = player:get_player_name()
|
||||||
|
if fields.accept then
|
||||||
|
minetest.chat_send_player(name, "Merci d'avoir accepte les regles, vous etes maintenant capable de parler.")
|
||||||
|
minetest.chat_send_player(name, "Pour plus d'informations tapez /news")
|
||||||
|
local privs = minetest.get_player_privs(name)
|
||||||
|
privs.shout = true
|
||||||
|
minetest.set_player_privs(name, privs)
|
||||||
|
--end
|
||||||
|
return
|
||||||
|
elseif fields.decline then
|
||||||
|
minetest.kick_player(name, "Aurevoir ! Vous devez accepter les règles de l'irc pour jouer sur le serveur (revennez si vous changez d'avis).")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
minetest.register_chatcommand("irc",{
|
||||||
|
params = "",
|
||||||
|
description = "Montre les regles de l'irc",
|
||||||
|
privs = {spawn=true},
|
||||||
|
func = function (name,params)
|
||||||
|
local player = minetest.get_player_by_name(name)
|
||||||
|
minetest.after(1, function()
|
||||||
|
minetest.show_formspec(name, "irc", make_formspec())
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
})
|
20
list_players.lua
Executable file
20
list_players.lua
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
-- list_players
|
||||||
|
-- Extracted from MT_essentials, by IndriAppolo
|
||||||
|
--
|
||||||
|
|
||||||
|
minetest.register_chatcommand("list_players", {
|
||||||
|
params = "",
|
||||||
|
description = "List currentky connected players",
|
||||||
|
func = function(name,param)
|
||||||
|
local list
|
||||||
|
for i,player in ipairs(minetest.get_connected_players()) do
|
||||||
|
local lname = player:get_player_name()
|
||||||
|
if not list then list = lname.." "
|
||||||
|
else list = list..lname.." " end
|
||||||
|
end
|
||||||
|
minetest.chat_send_player(name,"-- "..table.getn(minetest.get_connected_players()).." player(s) connected --\n"..list)
|
||||||
|
return true
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_chatcommand("players", core.chatcommands["list_players"])
|
31
nointeract_messages.lua
Executable file
31
nointeract_messages.lua
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
local players = {}
|
||||||
|
|
||||||
|
local function tick(name)
|
||||||
|
if players[name] == nil then return end
|
||||||
|
if not minetest.get_player_by_name(name) or minetest.check_player_privs(name, {interact=true}) == true then
|
||||||
|
players[name] = nil
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if minetest.check_player_privs(name, {shout=true}) then
|
||||||
|
minetest.chat_send_player(name, "Hey " .. name .. " ! Pour pouvoir construire et intéragir sur ce serveur, tu dois lire les règles du serveur et les accepter. Tape /rules.")
|
||||||
|
minetest.chat_send_player(name, "Hey " .. name .. " ! To build and interact on this server, you have to read the rules of our server and agree them. Type /rules.")
|
||||||
|
end
|
||||||
|
minetest.after(20, tick, name)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
local name = player:get_player_name()
|
||||||
|
if not minetest.check_player_privs(name, {interact=true}) and players[name] == nil then
|
||||||
|
minetest.after(7, tick, name)
|
||||||
|
players[name] = true
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_on_leaveplayer(function(player)
|
||||||
|
local name = player:get_player_name()
|
||||||
|
if not name then return end
|
||||||
|
players[name] = nil
|
||||||
|
end)
|
30
noshout_messages.lua
Executable file
30
noshout_messages.lua
Executable file
@ -0,0 +1,30 @@
|
|||||||
|
|
||||||
|
local players = {}
|
||||||
|
|
||||||
|
local function tick(name)
|
||||||
|
if players[name] == nil then return end
|
||||||
|
if not minetest.get_player_by_name(name) or minetest.check_player_privs(name, {shout=true}) == true then
|
||||||
|
players[name] = nil
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.chat_send_player(name, "Hey " .. name .. " ! Pour pouvoir communiquer avec les autres joueurs sur ce serveur, tu dois lire les règles de l'irc et les accepter. Tape /irc.")
|
||||||
|
minetest.chat_send_player(name, "Hey " .. name .. " ! To speak to other people on this server, you have to read the rules of our irc channel and agree them. Type /irc.")
|
||||||
|
minetest.after(20, tick, name)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
local name = player:get_player_name()
|
||||||
|
if minetest.check_player_privs(name, {shout=false}) and players[name] == nil then
|
||||||
|
minetest.after(5, tick, name)
|
||||||
|
players[name] = true
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_on_leaveplayer(function(player)
|
||||||
|
local name = player:get_player_name()
|
||||||
|
if not name then return end
|
||||||
|
players[name] = nil
|
||||||
|
end)
|
13
sand_swapping.lua
Normal file
13
sand_swapping.lua
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
-- Swap sands
|
||||||
|
|
||||||
|
-- desert -> normal
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "default:sand",
|
||||||
|
recipe = {{"default:desert_sand"}}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- normal -> desert
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "default:desert_sand",
|
||||||
|
recipe = {{"default:sand"}}
|
||||||
|
})
|
84
sapling_crafts.lua
Normal file
84
sapling_crafts.lua
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
-- Crafts for saplings
|
||||||
|
-- From Skyblock by Cornernote
|
||||||
|
--
|
||||||
|
|
||||||
|
-- sapling from leaves and sticks
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'default:sapling',
|
||||||
|
recipe = {
|
||||||
|
{'default:leaves', 'default:leaves', 'default:leaves'},
|
||||||
|
{'default:leaves', 'default:leaves', 'default:leaves'},
|
||||||
|
{'', 'default:stick', ''},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- junglesapling from jungleleaves and sticks
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'default:junglesapling',
|
||||||
|
recipe = {
|
||||||
|
{'default:jungleleaves', 'default:jungleleaves', 'default:jungleleaves'},
|
||||||
|
{'default:jungleleaves', 'default:jungleleaves', 'default:jungleleaves'},
|
||||||
|
{'', 'default:stick', ''},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- pine_sapling from pine_needles and sticks
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'default:pine_sapling',
|
||||||
|
recipe = {
|
||||||
|
{'default:pine_needles', 'default:pine_needles', 'default:pine_needles'},
|
||||||
|
{'default:pine_needles', 'default:pine_needles', 'default:pine_needles'},
|
||||||
|
{'', 'default:stick', ''},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Aspen tree
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "default:aspen_sapling",
|
||||||
|
recipe = {
|
||||||
|
{"default:aspen_leaves", "default:aspen_leaves", "default:aspen_leaves"},
|
||||||
|
{"default:aspen_leaves", "default:aspen_leaves", "default:aspen_leaves"},
|
||||||
|
{"", "default:stick", ""},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Cherry trees
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "default:cherry_sapling",
|
||||||
|
recipe = {
|
||||||
|
{"default:cherry_blossom_leaves", "default:cherry_blossom_leaves", "default:cherry_blossom_leaves"},
|
||||||
|
{"default:cherry_blossom_leaves", "default:cherry_blossom_leaves", "default:cherry_blossom_leaves"},
|
||||||
|
{"", "default:stick", ""},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- With nether
|
||||||
|
if minetest.get_modpath("nether") then
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "nether:tree_sapling",
|
||||||
|
recipe = {
|
||||||
|
{"nether:leaves", "nether:leaves", "nether:leaves"},
|
||||||
|
{"nether:leaves", "nether:leaves", "nether:leaves"},
|
||||||
|
{"", "default:stick", ""},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- With moretrees
|
||||||
|
if minetest.get_modpath("moretrees") then
|
||||||
|
for _, tdef in pairs(moretrees.treelist) do
|
||||||
|
local treename = tdef[1]
|
||||||
|
if treename ~= "jungletree" then
|
||||||
|
local leaves = "moretrees:" .. treename .. "_leaves"
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "moretrees:" .. treename .. "_sapling",
|
||||||
|
recipe = {
|
||||||
|
{leaves, leaves, leaves},
|
||||||
|
{leaves, leaves, leaves},
|
||||||
|
{"", "default:stick", ""},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
BIN
sounds/player_join.ogg
Executable file
BIN
sounds/player_join.ogg
Executable file
Binary file not shown.
BIN
sounds/player_leave.ogg
Executable file
BIN
sounds/player_leave.ogg
Executable file
Binary file not shown.
BIN
textures/bushes_youngtree.png
Normal file
BIN
textures/bushes_youngtree.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 146 B |
BIN
textures/default_furnace_locked_front.png
Executable file
BIN
textures/default_furnace_locked_front.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 632 B |
BIN
textures/default_furnace_locked_front_active.png
Executable file
BIN
textures/default_furnace_locked_front_active.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
BIN
textures/default_infotool.png
Executable file
BIN
textures/default_infotool.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 125 B |
BIN
textures/irc_background.jpg
Executable file
BIN
textures/irc_background.jpg
Executable file
Binary file not shown.
After Width: | Height: | Size: 110 KiB |
119
uncraft_woll.lua
Executable file
119
uncraft_woll.lua
Executable file
@ -0,0 +1,119 @@
|
|||||||
|
-- récupéré les "cotton" des "wool" faite (récupère 3 aulieu de 4 et perte du colorant)
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "farming:cotton 4",
|
||||||
|
recipe = {
|
||||||
|
{"wool:black"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "farming:cotton 4",
|
||||||
|
recipe = {
|
||||||
|
{"wool:white"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "farming:cotton 4",
|
||||||
|
recipe = {
|
||||||
|
{"wool:grey"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "farming:cotton 4",
|
||||||
|
recipe = {
|
||||||
|
{"wool:dark_grey"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "farming:cotton 4",
|
||||||
|
recipe = {
|
||||||
|
{"wool:blue"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "farming:cotton 4",
|
||||||
|
recipe = {
|
||||||
|
{"wool:brown"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "farming:cotton 4",
|
||||||
|
recipe = {
|
||||||
|
{"wool:cyan"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "farming:cotton 4",
|
||||||
|
recipe = {
|
||||||
|
{"wool:green"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "farming:cotton 4",
|
||||||
|
recipe = {
|
||||||
|
{"wool:dark_green"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "farming:cotton 4",
|
||||||
|
recipe = {
|
||||||
|
{"wool:dark_grey"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "farming:cotton 4",
|
||||||
|
recipe = {
|
||||||
|
{"wool:dark_grey"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "farming:cotton 4",
|
||||||
|
recipe = {
|
||||||
|
{"wool:magenta"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "farming:cotton 4",
|
||||||
|
recipe = {
|
||||||
|
{"wool:orange"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "farming:cotton 4",
|
||||||
|
recipe = {
|
||||||
|
{"wool:pink"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "farming:cotton 4",
|
||||||
|
recipe = {
|
||||||
|
{"wool:red"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "farming:cotton 4",
|
||||||
|
recipe = {
|
||||||
|
{"wool:violet"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "farming:cotton 4",
|
||||||
|
recipe = {
|
||||||
|
{"wool:yellow"},
|
||||||
|
},
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user