mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-08 03:20:21 +01:00
Merge branch 'crabman77-global_vars_and_debug'
This commit is contained in:
commit
af00f61cbc
|
@ -5,7 +5,7 @@ minetest.register_globalstep(function(dtime)
|
|||
TIMER = 0
|
||||
for _,player in ipairs(minetest.get_connected_players()) do
|
||||
local name = player:get_player_name()
|
||||
if not minetest.check_player_privs(name, {interact=shout}) then
|
||||
if not minetest.check_player_privs(name, {shout=true}) then
|
||||
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.")
|
||||
end
|
||||
|
|
|
@ -236,15 +236,15 @@ local is_daytime = function()
|
|||
end
|
||||
|
||||
local nodes_in_range = function(pos, search_distance, node_name)
|
||||
minp = {x=pos.x-search_distance,y=pos.y-search_distance, z=pos.z-search_distance}
|
||||
maxp = {x=pos.x+search_distance,y=pos.y+search_distance, z=pos.z+search_distance}
|
||||
nodes = minetest.find_nodes_in_area(minp, maxp, node_name)
|
||||
local minp = {x=pos.x-search_distance,y=pos.y-search_distance, z=pos.z-search_distance}
|
||||
local maxp = {x=pos.x+search_distance,y=pos.y+search_distance, z=pos.z+search_distance}
|
||||
local nodes = minetest.find_nodes_in_area(minp, maxp, node_name)
|
||||
--minetest.chat_send_all("Found (" .. node_name .. ": " .. #nodes .. ")")
|
||||
return #nodes
|
||||
end
|
||||
|
||||
local nodes_in_coords = function(minp, maxp, node_name)
|
||||
nodes = minetest.find_nodes_in_area(minp, maxp, node_name)
|
||||
local nodes = minetest.find_nodes_in_area(minp, maxp, node_name)
|
||||
--minetest.chat_send_all("Found (" .. node_name .. ": " .. #nodes .. ")")
|
||||
return #nodes
|
||||
end
|
||||
|
@ -394,11 +394,11 @@ local get_ambience = function(player)
|
|||
-- minetest.chat_send_all("n3uf:" ..node_3_under_feet)
|
||||
--
|
||||
local air_or_ignore = {air=true,ignore=true}
|
||||
minp = {x=pos.x-3,y=pos.y-4, z=pos.z-3}
|
||||
maxp = {x=pos.x+3,y=pos.y-1, z=pos.z+3}
|
||||
local minp = {x=pos.x-3,y=pos.y-4, z=pos.z-3}
|
||||
local maxp = {x=pos.x+3,y=pos.y-1, z=pos.z+3}
|
||||
local air_under_player = nodes_in_coords(minp, maxp, "air")
|
||||
local ignore_under_player = nodes_in_coords(minp, maxp, "ignore")
|
||||
air_plus_ignore_under = air_under_player + ignore_under_player
|
||||
local air_plus_ignore_under = air_under_player + ignore_under_player
|
||||
-- minetest.chat_send_all("airUnder:" ..air_under_player)
|
||||
-- minetest.chat_send_all("ignoreUnder:" ..ignore_under_player)
|
||||
-- minetest.chat_send_all("a+i:" ..air_plus_ignore_under)
|
||||
|
@ -448,7 +448,7 @@ local get_ambience = function(player)
|
|||
end
|
||||
|
||||
|
||||
desert_in_range = (nodes_in_range(pos, 6, "default:desert_sand")+nodes_in_range(pos, 6, "default:desert_stone"))
|
||||
local desert_in_range = (nodes_in_range(pos, 6, "default:desert_sand")+nodes_in_range(pos, 6, "default:desert_stone"))
|
||||
--minetest.chat_send_all("desertcount: " .. desert_in_range .. ",".. pos.y )
|
||||
if desert_in_range >250 then
|
||||
if music then
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
function spawn_falling_node(p, node, owners)
|
||||
obj = minetest.add_entity(p, "__builtin:falling_node")
|
||||
local obj = minetest.add_entity(p, "__builtin:falling_node")
|
||||
obj:get_luaentity():set_node(node)
|
||||
obj:get_luaentity():set_owner(owners)
|
||||
end
|
||||
|
@ -52,10 +52,10 @@ end
|
|||
--
|
||||
|
||||
function nodeupdate_single(p, delay)
|
||||
n = minetest.get_node(p)
|
||||
local n = minetest.get_node(p)
|
||||
if minetest.get_item_group(n.name, "falling_node") ~= 0 then
|
||||
p_bottom = {x=p.x, y=p.y-1, z=p.z}
|
||||
n_bottom = minetest.get_node(p_bottom)
|
||||
local p_bottom = {x=p.x, y=p.y-1, z=p.z}
|
||||
local n_bottom = minetest.get_node(p_bottom)
|
||||
-- Note: walkable is in the node definition, not in item groups
|
||||
if minetest.registered_nodes[n_bottom.name] and
|
||||
(minetest.get_item_group(n.name, "float") == 0 or
|
||||
|
|
|
@ -29,7 +29,7 @@ minetest.register_entity(":__builtin:falling_node", {
|
|||
item_texture = minetest.registered_items[itemname].inventory_image
|
||||
item_type = minetest.registered_items[itemname].type
|
||||
end
|
||||
prop = {
|
||||
local prop = {
|
||||
is_visible = true,
|
||||
textures = {node.name},
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ minetest.register_entity(":__builtin:item", {
|
|||
item_texture = minetest.registered_items[itemname].inventory_image
|
||||
item_type = minetest.registered_items[itemname].type
|
||||
end
|
||||
prop = {
|
||||
local prop = {
|
||||
is_visible = true,
|
||||
visual = "sprite",
|
||||
textures = {"unknown_item.png"}
|
||||
|
|
|
@ -26,6 +26,12 @@ minetest.register_chatcommand("future_ban", {
|
|||
minetest.chat_send_player(name, "Future ban list: " .. dump(future_ban_list))
|
||||
return
|
||||
end
|
||||
for _,n in ipairs(future_ban_list) do
|
||||
if n == param then
|
||||
minetest.chat_send_player(name, param .. " is already in future ban list.")
|
||||
return
|
||||
end
|
||||
end
|
||||
if not minetest.get_player_by_name(param) then
|
||||
table.insert(future_ban_list, param)
|
||||
minetest.chat_send_player(name, param .. " to future ban list added.")
|
||||
|
@ -35,8 +41,8 @@ minetest.register_chatcommand("future_ban", {
|
|||
end
|
||||
if not minetest.ban_player(param) then
|
||||
table.insert(future_ban_list, param)
|
||||
minetest.chat_send_player(name, desc .. " to future ban list added.")
|
||||
minetest.log("action", name .. " added " .. desc .. " to future ban list.")
|
||||
minetest.chat_send_player(name, param .. " to future ban list added.")
|
||||
minetest.log("action", name .. " added " .. param .. " to future ban list.")
|
||||
save_file()
|
||||
else
|
||||
local desc = minetest.get_ban_description(param)
|
||||
|
|
|
@ -19,8 +19,8 @@ function hp_bar:on_step(dtime)
|
|||
self.object:remove()
|
||||
return
|
||||
end
|
||||
hp = wielder:get_hp()
|
||||
breath = wielder:get_breath()
|
||||
local hp = wielder:get_hp()
|
||||
local breath = wielder:get_breath()
|
||||
self.object:set_properties({textures = {"health_" .. tostring(hp) .. ".png^breath_" .. tostring(breath) .. ".png"}})
|
||||
end
|
||||
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
minetest.register_globalstep(function(dtime)
|
||||
local players = minetest.get_connected_players()
|
||||
for i,player in ipairs(players) do
|
||||
target = lavatemple.mapgen_data.pos;
|
||||
local target = lavatemple.mapgen_data.pos;
|
||||
if not target then return end
|
||||
pos = player:getpos()
|
||||
dir = player:get_look_yaw()
|
||||
local pos = player:getpos()
|
||||
local dir = player:get_look_yaw()
|
||||
local angle_north = math.deg(math.atan2(target.x - pos.x, target.z - pos.z))
|
||||
if angle_north < 0 then angle_north = angle_north + 360 end
|
||||
angle_dir = 90 - math.deg(dir)
|
||||
local angle_dir = 90 - math.deg(dir)
|
||||
local angle_relative = (angle_north - angle_dir) % 360
|
||||
local compass_image = math.floor((angle_relative/30) + 0.5)%12
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user