plein de modifs sans commit :/

axinite
Axinite 2018-03-01 05:49:54 +00:00
parent 9cc3921b63
commit 4cf4b7313c
5 changed files with 92 additions and 25 deletions

8
crafts.lua Normal file
View File

@ -0,0 +1,8 @@
minetest.register_craft({
output = "axinite:nojump",
recipe = {
{"flowers:mushroom_red", "flowers:mushroom_red", "flowers:mushroom_red"},
{"flowers:mushroom_red", "", "flowers:mushroom_red"},
{"flowers:mushroom_red", "flowers:mushroom_red", "flowers:mushroom_red"}
}
})

View File

@ -1,25 +1,6 @@
local requartz = function(names)
for _,qname in ipairs(names) do
minetest.register_alias("nether:"..qname,"quartz:"..qname)
end
end
requartz({
"block",
"quartz_crystal",
"quartz_crystal_piece",
})
minetest.register_node("axinite:stone",{
tiles = {"default_stone.png"},
groups = {cracky = 3, stone = 1},
drop = 'default:cobble',
legacy_mineral = true,
sounds = default.node_sound_stone_defaults(),
})
minetest.register_alias("sporax_custom:stone","axinite:stone")
minetest.register_alias("inbox:inbox_empty","mailbox:mailbox")
--dofile(minetest.get_modpath("axinite".."/newplayer.lua"))
local path = minetest.get_modpath("axinite")
dofile(path.."/nodes.lua")
dofile(path.."/crafts.lua")
dofile(path.."/rollback_check.lua")
-- dofile(path.."/chatcommands.lua")
-- dofile(path.."/utilities.lua")

21
nodes.lua Normal file
View File

@ -0,0 +1,21 @@
-- No-jump block
minetest.register_node("axinite:nojump", {
description = "No Jump block",
drawtype = "normal",
tiles = {"nojump.png"},
groups = {
snappy = 3, cracky = 3, choppy = 3, oddly_breakable_by_hand = 3,
flammable = 2, disable_jump = 1, fall_damage_add_percent = -100
},
sounds = default.node_sound_dirt_defaults(),
})
--grief
minetest.register_node("axinite:stone",{
tiles = {"default_stone.png"},
groups = {cracky = 3, stone = 1},
drop = 'default:cobble',
legacy_mineral = true,
sounds = default.node_sound_stone_defaults(),
})

57
rollback_check.lua Normal file
View File

@ -0,0 +1,57 @@
minetest.register_chatcommand("check", {
params = "[<range>] [<seconds>] [limit]",
description = "Check who last touched a node or a node near it"
.. " within the time specified by <seconds>. Default: range = 0,"
.. " seconds = 86400 = 24h, limit = 5",
privs = {rollback_check=true},
func = function(name, param)
if not core.settings:get_bool("enable_rollback_recording") then
return false, "Rollback functions are disabled."
end
local range, seconds, limit =
param:match("(%d+) *(%d*) *(%d*)")
range = tonumber(range) or 0
seconds = tonumber(seconds) or 86400
limit = tonumber(limit) or 5
if limit > 100 then
return false, "That limit is too high!"
end
core.rollback_punch_callbacks[name] = function(pos, node, puncher)
local name = puncher:get_player_name()
core.chat_send_player(name, "Checking " .. core.pos_to_string(pos) .. "...")
local actions = core.rollback_get_node_actions(pos, range, seconds, limit)
if not actions then
core.chat_send_player(name, "Rollback functions are disabled")
return
end
local num_actions = #actions
if num_actions == 0 then
core.chat_send_player(name, "Nobody has touched"
.. " the specified location in "
.. seconds .. " seconds")
return
end
local time = os.time()
for i = num_actions, 1, -1 do
local action = actions[i]
core.chat_send_player(name,
("%s %s %s -> %s %d seconds ago.")
:format(
core.pos_to_string(action.pos),
action.actor,
action.oldnode.name,
action.newnode.name,
time - action.time))
end
end
return true, "Punch a node (range=" .. range .. ", seconds="
.. seconds .. "s, limit=" .. limit .. ")"
end,
})
minetest.register_privilege("rollback_check", {
description = "Can use the rollback check functionality",
give_to_singleplayer = false,
})

BIN
textures/nojump.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B