1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-03-31 17:50:41 +02:00

Updated 3d_armor and removed whitespaces

- Solves #218
This commit is contained in:
LeMagnesium 2015-08-16 11:04:11 +02:00
parent 0faa14e2d5
commit e74f3f4aa6
8 changed files with 35 additions and 21 deletions

View File

@ -53,7 +53,7 @@ function default.register_ores()
-- Clay -- Clay
minetest.register_ore({ minetest.register_ore({
ore_type = "blob", ore_type = "blob",
ore = "default:clay", ore = "default:clay",
wherein = {"default:sand"}, wherein = {"default:sand"},
@ -74,7 +74,7 @@ function default.register_ores()
-- Sand -- Sand
minetest.register_ore({ minetest.register_ore({
ore_type = "blob", ore_type = "blob",
ore = "default:sand", ore = "default:sand",
wherein = {"default:stone"}, wherein = {"default:stone"},

View File

@ -68,13 +68,11 @@ end
-- override hot nodes so they do not hurt player anywhere but mod -- override hot nodes so they do not hurt player anywhere but mod
if ARMOR_FIRE_PROTECT == true then if ARMOR_FIRE_PROTECT == true then
minetest.after(2, function() for _, row in ipairs(ARMOR_FIRE_NODES) do
for _, row in ipairs(ARMOR_FIRE_NODES) do if minetest.registered_nodes[row[1]] then
if minetest.registered_nodes[row[1]] then minetest.override_item(row[1], {damage_per_second = 0})
minetest.override_item(row[1], {damage_per_second = 0})
end
end end
end) end
end end
local time = 0 local time = 0
@ -90,7 +88,7 @@ armor = {
.."list[current_player;craftpreview;7,2;1,1;]", .."list[current_player;craftpreview;7,2;1,1;]",
textures = {}, textures = {},
default_skin = "character", default_skin = "character",
version = "0.4.3", version = "0.4.4",
} }
if minetest.get_modpath("inventory_plus") then if minetest.get_modpath("inventory_plus") then
@ -254,13 +252,13 @@ armor.set_player_armor = function(self, player)
self:update_player_visuals(player) self:update_player_visuals(player)
end end
armor.update_armor = function(self, player, dtime) armor.update_armor = function(self, player)
local name, player_inv, armor_inv, pos = armor:get_valid_player(player, "[update_armor]") local name, player_inv, armor_inv, pos = armor:get_valid_player(player, "[update_armor]")
if not name then if not name then
return return
end end
local hp = player:get_hp() or 0 local hp = player:get_hp() or 0
if ARMOR_FIRE_PROTECT == true and dtime then if ARMOR_FIRE_PROTECT == true then
pos.y = pos.y + 1.4 -- head level pos.y = pos.y + 1.4 -- head level
local node_head = minetest.get_node(pos).name local node_head = minetest.get_node(pos).name
pos.y = pos.y - 1.2 -- feet level pos.y = pos.y - 1.2 -- feet level
@ -270,7 +268,7 @@ armor.update_armor = function(self, player, dtime)
-- check for fire protection, if not enough then get hurt -- check for fire protection, if not enough then get hurt
if row[1] == node_head or row[1] == node_feet then if row[1] == node_head or row[1] == node_feet then
if hp > 0 and armor.def[name].fire < row[2] then if hp > 0 and armor.def[name].fire < row[2] then
hp = hp - row[3] * dtime hp = hp - row[3] * ARMOR_UPDATE_TIME
player:set_hp(hp) player:set_hp(hp)
break break
end end
@ -634,7 +632,7 @@ minetest.register_globalstep(function(dtime)
time = time + dtime time = time + dtime
if time > ARMOR_UPDATE_TIME then if time > ARMOR_UPDATE_TIME then
for _,player in ipairs(minetest.get_connected_players()) do for _,player in ipairs(minetest.get_connected_players()) do
armor:update_armor(player, time) armor:update_armor(player)
end end
time = 0 time = 0
end end

View File

@ -1,3 +1,6 @@
default default
inventory_plus? inventory_plus?
unified_inventory? unified_inventory?
fire?
ethereal?
bakedclay?

View File

@ -251,3 +251,4 @@ for k, v in pairs(ARMOR_MATERIALS) do
}, },
}) })
end end

View File

@ -33,10 +33,18 @@ depends: 3d_armor
Makes hand wielded items visible to other players. Makes hand wielded items visible to other players.
[mod] Shields [shields] [mod] Shields [shields]
------------------------------------- -----------------------
depends: 3d_armor depends: 3d_armor
Originally a part of 3d_armor, shields have been re-included as an optional extra. Originally a part of 3d_armor, shields have been re-included as an optional extra.
If you do not want shields then simply remove the shields folder from the modpack. If you do not want shields then simply remove the shields folder from the modpack.
[mod] Technic Armor [technic_armor]
-----------------------------------
depends: 3d_armor
Adds tin, silver and technic materials to 3d_armor.
Requires technic mod to be installed for craft registration.

View File

@ -132,3 +132,4 @@ end
minetest.after(0, function() minetest.after(0, function()
table.insert(armor.elements, "shield") table.insert(armor.elements, "shield")
end) end)

View File

@ -1,3 +1,6 @@
[mod] Technic Armor [technic_armor]
===================================
Adds tin, silver and technic materials to 3d_armor. Adds tin, silver and technic materials to 3d_armor.
Requires technic mod to be installed for craft registration. Requires technic mod to be installed for craft registration.

View File

@ -127,7 +127,7 @@ end
function biome_lib:register_generate_plant(biomedef, nodes_or_function_or_model) function biome_lib:register_generate_plant(biomedef, nodes_or_function_or_model)
-- if calling code passes an undefined node for a surface or -- if calling code passes an undefined node for a surface or
-- as a node to be spawned, don't register an action for it. -- as a node to be spawned, don't register an action for it.
if type(nodes_or_function_or_model) == "string" if type(nodes_or_function_or_model) == "string"
@ -142,7 +142,7 @@ function biome_lib:register_generate_plant(biomedef, nodes_or_function_or_model)
biome_lib:dbg("Warning: Registered function call using deprecated string method: "..dump(nodes_or_function_or_model)) biome_lib:dbg("Warning: Registered function call using deprecated string method: "..dump(nodes_or_function_or_model))
end end
if biomedef.check_air == false then if biomedef.check_air == false then
biome_lib:dbg("Register no-air-check mapgen hook: "..dump(nodes_or_function_or_model)) biome_lib:dbg("Register no-air-check mapgen hook: "..dump(nodes_or_function_or_model))
biome_lib.actionslist_no_aircheck[#biome_lib.actionslist_no_aircheck + 1] = { biomedef, nodes_or_function_or_model } biome_lib.actionslist_no_aircheck[#biome_lib.actionslist_no_aircheck + 1] = { biomedef, nodes_or_function_or_model }
local s = biomedef.surface local s = biomedef.surface
@ -218,7 +218,7 @@ function biome_lib:populate_surfaces(biome, nodes_or_function_or_model, snodes,
else else
if string.find(biome_surfaces_string, "group:") then if string.find(biome_surfaces_string, "group:") then
for j = 1, #biome.surface do for j = 1, #biome.surface do
if string.find(biome.surface[j], "^group:") if string.find(biome.surface[j], "^group:")
and minetest.get_item_group(dest_node.name, biome.surface[j]) then and minetest.get_item_group(dest_node.name, biome.surface[j]) then
surface_ok = true surface_ok = true
break break
@ -497,13 +497,13 @@ function biome_lib:spawn_on_surfaces(sd,sp,sr,sc,ss,sa)
chance = biome.spawn_chance, chance = biome.spawn_chance,
neighbors = biome.neighbors, neighbors = biome.neighbors,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
local p_top = { x = pos.x, y = pos.y + 1, z = pos.z } local p_top = { x = pos.x, y = pos.y + 1, z = pos.z }
local n_top = minetest.get_node(p_top) local n_top = minetest.get_node(p_top)
local perlin_fertile_area = minetest.get_perlin(biome.seed_diff, perlin_octaves, perlin_persistence, perlin_scale) local perlin_fertile_area = minetest.get_perlin(biome.seed_diff, perlin_octaves, perlin_persistence, perlin_scale)
local noise1 = perlin_fertile_area:get2d({x=p_top.x, y=p_top.z}) local noise1 = perlin_fertile_area:get2d({x=p_top.x, y=p_top.z})
local noise2 = biome_lib.perlin_temperature:get2d({x=p_top.x, y=p_top.z}) local noise2 = biome_lib.perlin_temperature:get2d({x=p_top.x, y=p_top.z})
local noise3 = biome_lib.perlin_humidity:get2d({x=p_top.x+150, y=p_top.z+50}) local noise3 = biome_lib.perlin_humidity:get2d({x=p_top.x+150, y=p_top.z+50})
if noise1 > biome.plantlife_limit if noise1 > biome.plantlife_limit
and noise2 <= biome.temp_min and noise2 <= biome.temp_min
and noise2 >= biome.temp_max and noise2 >= biome.temp_max
and noise3 <= biome.humidity_min and noise3 <= biome.humidity_min
@ -546,7 +546,7 @@ function biome_lib:spawn_on_surfaces(sd,sp,sr,sc,ss,sa)
elseif biome.spawn_on_side then elseif biome.spawn_on_side then
local onside = biome_lib:find_open_side(pos) local onside = biome_lib:find_open_side(pos)
if onside then if onside then
minetest.set_node(onside.newpos, { name = plant_to_spawn, param2 = onside.facedir }) minetest.set_node(onside.newpos, { name = plant_to_spawn, param2 = onside.facedir })
end end
elseif biome.spawn_on_bottom then elseif biome.spawn_on_bottom then
@ -652,7 +652,7 @@ function biome_lib:find_adjacent_wall(pos, verticals, randomflag)
local verts = dump(verticals) local verts = dump(verticals)
if randomflag then if randomflag then
local walltab = {} local walltab = {}
if string.find(verts, minetest.get_node({ x=pos.x-1, y=pos.y, z=pos.z }).name) then walltab[#walltab + 1] = 3 end if string.find(verts, minetest.get_node({ x=pos.x-1, y=pos.y, z=pos.z }).name) then walltab[#walltab + 1] = 3 end
if string.find(verts, minetest.get_node({ x=pos.x+1, y=pos.y, z=pos.z }).name) then walltab[#walltab + 1] = 2 end if string.find(verts, minetest.get_node({ x=pos.x+1, y=pos.y, z=pos.z }).name) then walltab[#walltab + 1] = 2 end
if string.find(verts, minetest.get_node({ x=pos.x , y=pos.y, z=pos.z-1 }).name) then walltab[#walltab + 1] = 5 end if string.find(verts, minetest.get_node({ x=pos.x , y=pos.y, z=pos.z-1 }).name) then walltab[#walltab + 1] = 5 end