Minor mod update
parent
57f067f8c1
commit
f96aecdef5
|
@ -12,7 +12,7 @@ Copyright (C) HybridDog (2015)
|
||||||
|
|
||||||
Copyright (C) theFox6 (2018)
|
Copyright (C) theFox6 (2018)
|
||||||
|
|
||||||
Copyright (C) MultiCraft Development Team (2019-2021)
|
Copyright (C) MultiCraft Development Team (2019-2020)
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
21
init.lua
21
init.lua
|
@ -47,6 +47,7 @@ end
|
||||||
|
|
||||||
-- Rain
|
-- Rain
|
||||||
weather.register("rain", {
|
weather.register("rain", {
|
||||||
|
desc = S("Rain"),
|
||||||
falling_speed = 5,
|
falling_speed = 5,
|
||||||
amount = 6,
|
amount = 6,
|
||||||
size = 20,
|
size = 20,
|
||||||
|
@ -57,6 +58,7 @@ weather.register("rain", {
|
||||||
|
|
||||||
-- Snow
|
-- Snow
|
||||||
weather.register("snow", {
|
weather.register("snow", {
|
||||||
|
desc = S("Snow"),
|
||||||
falling_speed = 2,
|
falling_speed = 2,
|
||||||
amount = 5,
|
amount = 5,
|
||||||
size = 35,
|
size = 35,
|
||||||
|
@ -82,9 +84,9 @@ function weather.set(weather_type, wind)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function weather_change()
|
local function weather_change(disable)
|
||||||
if weather.type == "none" then
|
if weather.type == "none" and not disable then
|
||||||
for id, _ in pairs(weather.registered) do
|
for id in pairs(weather.registered) do
|
||||||
if random(3) == 1 then
|
if random(3) == 1 then
|
||||||
weather.set(id, {
|
weather.set(id, {
|
||||||
x = random(0, 8),
|
x = random(0, 8),
|
||||||
|
@ -95,7 +97,7 @@ local function weather_change()
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
minetest.after(random(60, 300), weather_change)
|
minetest.after(random(60, 300), function() weather_change(true) end)
|
||||||
else
|
else
|
||||||
weather.set("none")
|
weather.set("none")
|
||||||
minetest.after(random(1800, 3600), weather_change)
|
minetest.after(random(1800, 3600), weather_change)
|
||||||
|
@ -234,13 +236,18 @@ minetest.register_chatcommand("weather", {
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
if param and (weather.registered[param] or param == "none") then
|
if param and (weather.registered[param] or param == "none") then
|
||||||
weather.set(param)
|
weather.set(param)
|
||||||
minetest.chat_send_player(name, S("Set weather type:") .. " " .. param)
|
if param == "none" then
|
||||||
|
minetest.chat_send_player(name, S("Set clear weather."))
|
||||||
|
else
|
||||||
|
local setw = weather.registered[param].desc or param:gsub("^%l", string.upper)
|
||||||
|
minetest.chat_send_player(name, S("Set weather type: @1.", setw))
|
||||||
|
end
|
||||||
else
|
else
|
||||||
local types = "none"
|
local types = "none"
|
||||||
for w, _ in pairs(weather.registered) do
|
for w in pairs(weather.registered) do
|
||||||
types = types .. ", " .. w
|
types = types .. ", " .. w
|
||||||
end
|
end
|
||||||
minetest.chat_send_player(name, S("Avalible weather types:") .. " " .. types)
|
minetest.chat_send_player(name, S("Avalible weather types: @1.", types))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
# textdomain: weather_lite
|
# textdomain: weather_lite
|
||||||
Setting the weather type=Установка тип погоды
|
Setting the weather type=Установка типа погоды
|
||||||
Set weather type:=Установлен тип погоды:
|
Set weather type: @1.=Установлен тип погоды: @1.
|
||||||
Avalible weather types:=Доступные типы погоды:
|
Avalible weather types: @1.=Доступные типы погоды: @1.
|
||||||
|
Set clear weather.=Установлена ясная погода.
|
||||||
|
Rain=Дождь
|
||||||
|
Snow=Снег
|
||||||
|
|
Loading…
Reference in New Issue