- Fix bed bed, boat, book, sapling, wood, minecart, rail, redstone, and boat placement
- Add sounds to redstone dust
- make redstone dust an attached node
+- Fixed treecaptitator not cutting down part of tree when lever is powering one of it's nodes
+- Added command for users with "server" privelage to control weather
---
if walkable then
local distance = vector.subtract(collision_point,pos).y-self.object:get_properties().collisionbox[2]+0.4
if distance >= -0.11 then
+ print("Jumping")
local vel = self.object:get_velocity()
self.jump_timer = 0.5
self.object:add_velocity(vector.new(vel.x,5,vel.z))
--- /dev/null
+minetest.register_chatcommand("weather", {
+ params = "<mobname>",
+ description = "Spawn a mob",
+ privs = {server = true},
+ func = function( name, weather)
+ if weather == "0" or weather == "clear" then
+ weather_type = 0
+ function_send_weather_type()
+ update_player_sky()
+ minetest.chat_send_all(name.." has set the weather to clear!")
+ elseif weather == "1" or weather == "snow" then
+ weather_type = 1
+ function_send_weather_type()
+ minetest.chat_send_all(name.." has set the weather to snow!")
+ update_player_sky()
+ elseif weather == "2" or weather == "rain" then
+ weather_type = 2
+ function_send_weather_type()
+ update_player_sky()
+ minetest.chat_send_all(name.." has set the weather to rain!")
+ elseif weather == "" then
+ minetest.chat_send_player(name, "Possible weather types are: 0,clear,1,snow,2,rain")
+ else
+ minetest.chat_send_player(name, '"'..weather..'"'.." is not a registered weather type!")
+ end
+ end,
+})
local weather_max = 2
-local weather_type = math.random(0,weather_max)
+weather_type = math.random(0,weather_max)
local weather_timer = 0
+local path = minetest.get_modpath(minetest.get_current_modname())
+dofile(path.."/commands.lua")
--this updates players skys since it cannot be done clientside
-local update_player_sky = function()
+update_player_sky = function()
for _,player in ipairs(minetest.get_connected_players()) do
if weather_type ~= 0 then
player:set_sky({
end
--this tells the client mod to update the weather type
-local function_send_weather_type = function()
+function_send_weather_type = function()
local channel = minetest.mod_channel_join("weather_type")
channel:send_all(tostring(weather_type))
channel:leave()