[minetestforfun_game] Update
parent
afd765477d
commit
fbc99a5af3
|
@ -50,4 +50,4 @@ Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||||
http://creativecommons.org/licenses/by-sa/3.0/
|
http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
|
|
||||||
License of menu/header.png
|
License of menu/header.png
|
||||||
Copyright (C) 2013 BlockMen CC BY-3.0
|
Copyright (C) 2015 paramat CC BY-SA 3.0
|
||||||
|
|
|
@ -163,7 +163,7 @@ on_rotate(pos, node, user, mode, new_param2)
|
||||||
Stairs API
|
Stairs API
|
||||||
----------
|
----------
|
||||||
The stairs API lets you register stairs and slabs and ensures that they are registered the same way as those
|
The stairs API lets you register stairs and slabs and ensures that they are registered the same way as those
|
||||||
delivered with minetest_game, to keep them compatible with other mods.
|
delivered with Minetest Game, to keep them compatible with other mods.
|
||||||
|
|
||||||
stairs.register_stair(subname, recipeitem, groups, images, description, sounds)
|
stairs.register_stair(subname, recipeitem, groups, images, description, sounds)
|
||||||
-> Registers a stair.
|
-> Registers a stair.
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 1.9 KiB |
|
@ -1,3 +1,4 @@
|
||||||
|
local pi = math.pi
|
||||||
local player_in_bed = 0
|
local player_in_bed = 0
|
||||||
local is_sp = minetest.is_singleplayer()
|
local is_sp = minetest.is_singleplayer()
|
||||||
local enable_respawn = minetest.setting_getbool("enable_bed_respawn")
|
local enable_respawn = minetest.setting_getbool("enable_bed_respawn")
|
||||||
|
@ -11,13 +12,13 @@ end
|
||||||
local function get_look_yaw(pos)
|
local function get_look_yaw(pos)
|
||||||
local n = minetest.get_node(pos)
|
local n = minetest.get_node(pos)
|
||||||
if n.param2 == 1 then
|
if n.param2 == 1 then
|
||||||
return 7.9, n.param2
|
return pi/2, n.param2
|
||||||
elseif n.param2 == 3 then
|
elseif n.param2 == 3 then
|
||||||
return 4.75, n.param2
|
return -pi/2, n.param2
|
||||||
elseif n.param2 == 0 then
|
elseif n.param2 == 0 then
|
||||||
return 3.15, n.param2
|
return pi, n.param2
|
||||||
else
|
else
|
||||||
return 6.28, n.param2
|
return 0, n.param2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,8 @@ local function book_on_use(itemstack, user, pointed_thing)
|
||||||
formspec = "size[8,8]"..default.gui_bg..
|
formspec = "size[8,8]"..default.gui_bg..
|
||||||
"label[0.5,0.5;by "..owner.."]"..
|
"label[0.5,0.5;by "..owner.."]"..
|
||||||
"label[0.5,0;"..minetest.formspec_escape(title).."]"..
|
"label[0.5,0;"..minetest.formspec_escape(title).."]"..
|
||||||
"textarea[0.5,1.5;7.5,7;;"..minetest.formspec_escape(text)..";]"
|
"tableoptions[background=#00000000;highlight=#00000000;border=false]"..
|
||||||
|
"table[0.5,1.5;7.5,7;;"..minetest.formspec_escape(text):gsub("\n", ",")..";1]"
|
||||||
end
|
end
|
||||||
minetest.show_formspec(user:get_player_name(), "default:book", formspec)
|
minetest.show_formspec(user:get_player_name(), "default:book", formspec)
|
||||||
end
|
end
|
||||||
|
|
|
@ -351,7 +351,12 @@ minetest.register_abm({
|
||||||
default.leafdecay_trunk_find_allow_accumulator - 1
|
default.leafdecay_trunk_find_allow_accumulator - 1
|
||||||
-- Assume ignore is a trunk, to make the thing
|
-- Assume ignore is a trunk, to make the thing
|
||||||
-- work at the border of the active area
|
-- work at the border of the active area
|
||||||
local p1 = minetest.find_node_near(p0, d, {"ignore", "group:tree"})
|
local p1
|
||||||
|
if n0.name == "moretrees:palm_leaves" then
|
||||||
|
p1 = minetest.find_node_near(p0, d, {"ignore", "moretrees:palm_trunk"})
|
||||||
|
else
|
||||||
|
p1 = minetest.find_node_near(p0, d, {"ignore", "group:tree"})
|
||||||
|
end
|
||||||
if p1 then
|
if p1 then
|
||||||
do_preserve = true
|
do_preserve = true
|
||||||
if default.leafdecay_enable_cache then
|
if default.leafdecay_enable_cache then
|
||||||
|
|
|
@ -669,9 +669,9 @@ function default.register_biomes()
|
||||||
minetest.register_biome({
|
minetest.register_biome({
|
||||||
name = "glacier_ocean",
|
name = "glacier_ocean",
|
||||||
node_dust = "default:snowblock",
|
node_dust = "default:snowblock",
|
||||||
node_top = "default:gravel",
|
node_top = "default:sand",
|
||||||
depth_top = 1,
|
depth_top = 1,
|
||||||
node_filler = "default:gravel",
|
node_filler = "default:sand",
|
||||||
depth_filler = 2,
|
depth_filler = 2,
|
||||||
--node_stone = "",
|
--node_stone = "",
|
||||||
--node_water_top = "",
|
--node_water_top = "",
|
||||||
|
@ -810,26 +810,8 @@ function default.register_biomes()
|
||||||
--depth_water_top = ,
|
--depth_water_top = ,
|
||||||
--node_water = "",
|
--node_water = "",
|
||||||
--node_river_water = "",
|
--node_river_water = "",
|
||||||
y_min = 9,
|
|
||||||
y_max = 31000,
|
|
||||||
heat_point = 45,
|
|
||||||
humidity_point = 75,
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_biome({
|
|
||||||
name = "coniferous_forest_dunes",
|
|
||||||
--node_dust = "",
|
|
||||||
node_top = "default:sand",
|
|
||||||
depth_top = 1,
|
|
||||||
node_filler = "default:sand",
|
|
||||||
depth_filler = 2,
|
|
||||||
--node_stone = "",
|
|
||||||
--node_water_top = "",
|
|
||||||
--depth_water_top = ,
|
|
||||||
--node_water = "",
|
|
||||||
--node_river_water = "",
|
|
||||||
y_min = 5,
|
y_min = 5,
|
||||||
y_max = 8,
|
y_max = 31000,
|
||||||
heat_point = 45,
|
heat_point = 45,
|
||||||
humidity_point = 75,
|
humidity_point = 75,
|
||||||
})
|
})
|
||||||
|
@ -1245,7 +1227,7 @@ local function register_grass_decoration(offset, scale, length)
|
||||||
persist = 0.6
|
persist = 0.6
|
||||||
},
|
},
|
||||||
biomes = {"stone_grassland", "sandstone_grassland",
|
biomes = {"stone_grassland", "sandstone_grassland",
|
||||||
"deciduous_forest", "coniferous_forest", "coniferous_forest_dunes"},
|
"deciduous_forest", "coniferous_forest"},
|
||||||
y_min = 1,
|
y_min = 1,
|
||||||
y_max = 31000,
|
y_max = 31000,
|
||||||
decoration = "default:grass_"..length,
|
decoration = "default:grass_"..length,
|
||||||
|
|
|
@ -16,6 +16,10 @@ local function can_grow(pos)
|
||||||
if is_soil == 0 then
|
if is_soil == 0 then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
local ll = minetest.get_node_light(pos)
|
||||||
|
if not ll or ll < 13 then -- Minimum light level for growth
|
||||||
|
return false -- matches grass, wheat and cotton
|
||||||
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -14,33 +14,42 @@ home.sethome = function(name)
|
||||||
p_status = "nether"
|
p_status = "nether"
|
||||||
end
|
end
|
||||||
|
|
||||||
home.homepos[p_status][name] = pos
|
local function assign_home()
|
||||||
minetest.chat_send_player(name, "Home set!")
|
home.homepos[p_status][name] = pos
|
||||||
local output = io.open(home.homes_file[p_status], "w")
|
minetest.chat_send_player(name, "Home set!")
|
||||||
output:write(minetest.serialize(home.homepos[p_status]))
|
local output = io.open(home.homes_file[p_status], "w")
|
||||||
io.close(output)
|
output:write(minetest.serialize(home.homepos[p_status]))
|
||||||
return true
|
io.close(output)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
action_timers.wrapper(name, "sethome", "sethome_" .. name, home.time, assign_home, {})
|
||||||
end
|
end
|
||||||
|
|
||||||
home.tohome = function(name)
|
home.tohome = function(name)
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
if player == nil then
|
if player == nil then
|
||||||
-- just a check to prevent the server crashing
|
-- just a check to prevent the server crashing
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
local p_status = "real"
|
local p_status = "real"
|
||||||
if player:getpos().y < -19600 then
|
if player:getpos().y < -19600 then
|
||||||
p_status = "nether"
|
p_status = "nether"
|
||||||
end
|
end
|
||||||
if home.homepos[p_status][name] then
|
if home.homepos[p_status][name] then
|
||||||
player:setpos(home.homepos[p_status][player:get_player_name()])
|
|
||||||
minetest.chat_send_player(name, "Teleported to home!")
|
local function go_to_home()
|
||||||
minetest.log("action","Player ".. name .." teleported to home. Next teleportation allowed in ".. home.time .." seconds.")
|
player:setpos(home.homepos[p_status][player:get_player_name()])
|
||||||
return true
|
minetest.chat_send_player(name, "Teleported to home!")
|
||||||
else
|
minetest.log("action","Player ".. name .." teleported to home. Next teleportation allowed in ".. home.time .." seconds.")
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
action_timers.wrapper(name, "home", "home_" .. name, home.time, go_to_home, {})
|
||||||
|
else
|
||||||
minetest.chat_send_player(name, "Set a home using /sethome")
|
minetest.chat_send_player(name, "Set a home using /sethome")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function loadhomes()
|
local function loadhomes()
|
||||||
|
|
Loading…
Reference in New Issue