This commit is contained in:
root 2020-12-02 17:45:37 +01:00
parent 4b63340257
commit ab042bbe9f
14 changed files with 83 additions and 36 deletions

View File

@ -1,5 +1,7 @@
Modpack - 3d Armor [0.4.13] Modpack - 3d Armor [0.4.13]
=========================== ===========================
![3d_armor screenshot](https://github.com/minetest-mods/3d_armor/blob/master/screenshot.png)
![](https://github.com/minetest-mods/3d_armor/workflows/luacheck/badge.svg) ![](https://github.com/minetest-mods/3d_armor/workflows/luacheck/badge.svg)
![](https://github.com/minetest-mods/3d_armor/workflows/integration-test/badge.svg) ![](https://github.com/minetest-mods/3d_armor/workflows/integration-test/badge.svg)

View File

@ -41,7 +41,7 @@ minetest.register_craft({
minetest.register_craft({ minetest.register_craft({
output = 'building_blocks:fakegrass 2', output = 'building_blocks:fakegrass 2',
recipe = { recipe = {
{'default:leaves'}, {'group:leaves'},
{"default:dirt"}, {"default:dirt"},
} }
}) })
@ -139,7 +139,7 @@ minetest.register_craft({
minetest.register_craft({ minetest.register_craft({
output = 'building_blocks:woodglass 1', output = 'building_blocks:woodglass 1',
recipe = { recipe = {
{"default:wood"}, {"group:wood"},
{"default:glass"}, {"default:glass"},
} }
}) })

View File

@ -76,7 +76,7 @@ homedecor.register("wall_shelf", {
minetest.register_craft({ minetest.register_craft({
output = "homedecor:table", output = "homedecor:table",
recipe = { recipe = {
{ "default:wood","default:wood", "default:wood" }, { "group:wood","group:wood", "group:wood" },
{ "group:stick", "", "group:stick" }, { "group:stick", "", "group:stick" },
}, },
}) })

View File

@ -96,8 +96,8 @@ minetest.register_craft({
output = "homedecor:desk", output = "homedecor:desk",
recipe = { recipe = {
{ "stairs:slab_wood", "stairs:slab_wood", "stairs:slab_wood" }, { "stairs:slab_wood", "stairs:slab_wood", "stairs:slab_wood" },
{ "homedecor:drawer_small", "default:wood", "default:wood" }, { "homedecor:drawer_small", "group:wood", "group:wood" },
{ "homedecor:drawer_small", "", "default:wood" }, { "homedecor:drawer_small", "", "group:wood" },
}, },
}) })
@ -105,17 +105,17 @@ minetest.register_craft({
output = "homedecor:desk", output = "homedecor:desk",
recipe = { recipe = {
{ "moreblocks:slab_wood", "moreblocks:slab_wood", "moreblocks:slab_wood" }, { "moreblocks:slab_wood", "moreblocks:slab_wood", "moreblocks:slab_wood" },
{ "homedecor:drawer_small", "default:wood", "default:wood" }, { "homedecor:drawer_small", "group:wood", "group:wood" },
{ "homedecor:drawer_small", "", "default:wood" }, { "homedecor:drawer_small", "", "group:wood" },
}, },
}) })
minetest.register_craft({ minetest.register_craft({
output = "homedecor:filing_cabinet", output = "homedecor:filing_cabinet",
recipe = { recipe = {
{ "", "default:wood", "" }, { "", "group:wood", "" },
{ "default:wood", "homedecor:drawer_small", "default:wood" }, { "group:wood", "homedecor:drawer_small", "group:wood" },
{ "", "default:wood", "" }, { "", "group:wood", "" },
}, },
}) })

View File

@ -189,7 +189,7 @@ minetest.register_craft( {
output = "homedecor:wardrobe", output = "homedecor:wardrobe",
recipe = { recipe = {
{ "homedecor:drawer_small", "homedecor:kitchen_cabinet" }, { "homedecor:drawer_small", "homedecor:kitchen_cabinet" },
{ "homedecor:drawer_small", "default:wood" }, { "homedecor:drawer_small", "group:wood" },
{ "homedecor:drawer_small", "default:wood" } { "homedecor:drawer_small", "group:wood" }
}, },
}) })

View File

@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi")
mobs = { mobs = {
mod = "redo", mod = "redo",
version = "20201115", version = "20201130",
intllib = S, intllib = S,
invis = minetest.global_exists("invisibility") and invisibility or {} invis = minetest.global_exists("invisibility") and invisibility or {}
} }
@ -58,6 +58,7 @@ local mobs_drop_items = settings:get_bool("mobs_drop_items") ~= false
local mobs_griefing = settings:get_bool("mobs_griefing") ~= false local mobs_griefing = settings:get_bool("mobs_griefing") ~= false
local spawn_protected = settings:get_bool("mobs_spawn_protected") ~= false local spawn_protected = settings:get_bool("mobs_spawn_protected") ~= false
local remove_far = settings:get_bool("remove_far_mobs") ~= false local remove_far = settings:get_bool("remove_far_mobs") ~= false
local mob_area_spawn = settings:get_bool("mob_area_spawn")
local difficulty = tonumber(settings:get("mob_difficulty")) or 1.0 local difficulty = tonumber(settings:get("mob_difficulty")) or 1.0
local show_health = settings:get_bool("mob_show_health") ~= false local show_health = settings:get_bool("mob_show_health") ~= false
local max_per_block = tonumber(settings:get("max_objects_per_block") or 99) local max_per_block = tonumber(settings:get("max_objects_per_block") or 99)
@ -276,10 +277,10 @@ function mob_class:set_velocity(v)
c_x, c_y = unpack(self:collision()) c_x, c_y = unpack(self:collision())
end end
local yaw = (self.object:get_yaw() or 0) + self.rotate local yaw = (self.object:get_yaw() or 0) + (self.rotate or 0)
-- nil check for velocity -- nil check for velocity
v = v or 0 v = v or 0.01
-- check if standing in liquid with max viscosity of 7 -- check if standing in liquid with max viscosity of 7
local visc = min(minetest.registered_nodes[self.standing_in].liquid_viscosity, 7) local visc = min(minetest.registered_nodes[self.standing_in].liquid_viscosity, 7)
@ -291,8 +292,8 @@ function mob_class:set_velocity(v)
v = v / (visc + 1) v = v / (visc + 1)
end end
-- set velocity with hard limit of 10 -- set velocity
local vel = self.object:get_velocity() local vel = self.object:get_velocity() or 0
local new_vel = { local new_vel = {
x = (sin(yaw) * -v) + c_x, x = (sin(yaw) * -v) + c_x,
@ -3908,8 +3909,27 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light, inter
end end
end end
-- should we check mob area for obstructions ?
if mob_area_spawn ~= true then
-- do we have enough height clearance to spawn mob?
local ent = minetest.registered_entities[name]
local height = max(1, math.ceil(
(ent.collisionbox[5] or 0.25) - (ent.collisionbox[2] or -0.25) - 1))
for n = 0, height do
local pos2 = {x = pos.x, y = pos.y + n, z = pos.z}
if minetest.registered_nodes[node_ok(pos2).name].walkable == true then
--print ("--- inside block", name, node_ok(pos2).name)
return
end
end
else
-- returns position if we have enough space to spawn mob -- returns position if we have enough space to spawn mob
pos = can_spawn(pos, name) pos = can_spawn(pos, name)
end
if pos then if pos then

View File

@ -697,6 +697,9 @@ External Settings for "minetest.conf"
function. function.
'mob_nospawn_range' Minimum range a mob can spawn near player (def: 12) 'mob_nospawn_range' Minimum range a mob can spawn near player (def: 12)
'mob_active_limit' Number of active mobs in game, 0 for unlimited 'mob_active_limit' Number of active mobs in game, 0 for unlimited
'mob_area_spawn' When true will check surrounding area the size of the
mob for obstructions before spawning, otherwise it
defaults to checking the height of the mob only.
Players can override the spawn chance for each mob registered by adding a line Players can override the spawn chance for each mob registered by adding a line
to their minetest.conf file with a new value, the lower the value the more each to their minetest.conf file with a new value, the lower the value the more each

View File

@ -33,3 +33,6 @@ mob_nospawn_range (Mob no-spawn range) float 12.0
# Sets maximum number of active mobs in game (0 for unlimited) # Sets maximum number of active mobs in game (0 for unlimited)
mob_active_limit (Mob Active Limit) float 0 mob_active_limit (Mob Active Limit) float 0
# Enables area check when spawning mobs
mob_area_spawn (Mob Area Spawn) bool false

View File

@ -42,6 +42,14 @@ for i in pairs(NoDe) do
liquids_pointable = true, liquids_pointable = true,
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
local pt = pointed_thing local pt = pointed_thing
if not placer then return end
local playername = placer:get_player_name()
if minetest.is_protected(pt.above, playername) then
minetest.record_protection_violation(pt.above, playername)
return
end
local direction = minetest.dir_to_facedir(placer:get_look_dir()) local direction = minetest.dir_to_facedir(placer:get_look_dir())
if minetest.get_node(pt.above).name=="air" then if minetest.get_node(pt.above).name=="air" then
minetest.swap_node(pt.above, {name="trunks:twig_"..math.random(1,4), param2=direction}) minetest.swap_node(pt.above, {name="trunks:twig_"..math.random(1,4), param2=direction})

View File

@ -0,0 +1,3 @@
Majo
TMSB aka Dragoni or Dragon-ManioNM
CC BY-SA 4.0

View File

@ -0,0 +1,3 @@
player1234's skin(dont use)
player1234
CC BY-NC-SA 3.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -166,14 +166,11 @@ minetest.register_on_placenode(
return false return false
end end
if not string.find(itemstack:to_string(), "palette_index") then
local param2 local param2
local color = 0 if not string.find(itemstack:to_string(), "palette_index") then
if def.palette == "unifieddyes_palette_extended.png" if def.palette == "unifieddyes_palette_extended.png"
and def.paramtype2 == "color" then and def.paramtype2 == "color" then
param2 = 240 param2 = 240
color = 240
elseif def.palette == "unifieddyes_palette_colorwallmounted.png" elseif def.palette == "unifieddyes_palette_colorwallmounted.png"
and def.paramtype2 == "colorwallmounted" then and def.paramtype2 == "colorwallmounted" then
param2 = newnode.param2 % 8 param2 = newnode.param2 % 8
@ -184,17 +181,21 @@ minetest.register_on_placenode(
if param2 then if param2 then
minetest.swap_node(pos, {name = newnode.name, param2 = param2}) minetest.swap_node(pos, {name = newnode.name, param2 = param2})
minetest.get_meta(pos):set_int("palette_index", color)
end end
end end
if def.palette ~= "" then
minetest.get_meta(pos):set_int("palette_index", param2 or 240)
end
end end
) )
-- The complementary function: strip-off the color if the node being dug is still white/neutral -- The complementary function: strip-off the color if the node being dug is still white/neutral
local function move_item(item, pos, inv, digger) local function move_item(item, pos, inv, digger, fix_color)
if not (digger and digger:is_player()) then return end if not (digger and digger:is_player()) then return end
local creative = creative_mode or minetest.check_player_privs(digger, "creative") local creative = creative_mode or minetest.check_player_privs(digger, "creative")
item = unifieddyes.fix_bad_color_info(item, fix_color)
if inv:room_for_item("main", item) if inv:room_for_item("main", item)
and (not creative or not inv:contains_item("main", item, true)) then and (not creative or not inv:contains_item("main", item, true)) then
inv:add_item("main", item) inv:add_item("main", item)
@ -214,20 +215,21 @@ function unifieddyes.on_dig(pos, node, digger)
local oldparam2 = minetest.get_node(pos).param2 local oldparam2 = minetest.get_node(pos).param2
local def = minetest.registered_items[node.name] local def = minetest.registered_items[node.name]
local del_color local fix_color
if def.paramtype2 == "color" and oldparam2 == 240 and def.palette == "unifieddyes_palette_extended.png" then if def.paramtype2 == "color" and oldparam2 == 240 and def.palette == "unifieddyes_palette_extended.png" then
del_color = true fix_color = 240
elseif def.paramtype2 == "color" and oldparam2 == 0 and def.palette == "unifieddyes_palette_extended.png" then
fix_color = 0
elseif def.paramtype2 == "colorwallmounted" and math.floor(oldparam2 / 8) == 0 and def.palette == "unifieddyes_palette_colorwallmounted.png" then elseif def.paramtype2 == "colorwallmounted" and math.floor(oldparam2 / 8) == 0 and def.palette == "unifieddyes_palette_colorwallmounted.png" then
del_color = true fix_color = 0
elseif def.paramtype2 == "colorfacedir" and math.floor(oldparam2 / 32) == 0 and string.find(def.palette, "unifieddyes_palette_") then elseif def.paramtype2 == "colorfacedir" and math.floor(oldparam2 / 32) == 0 and string.find(def.palette, "unifieddyes_palette_") then
del_color = true fix_color = 0
end end
local inv = digger:get_inventory() local inv = digger:get_inventory()
if fix_color then
if del_color then move_item(node.name, pos, inv, digger, fix_color)
move_item(node.name, pos, inv, digger)
else else
return minetest.node_dig(pos, node, digger) return minetest.node_dig(pos, node, digger)
end end
@ -273,11 +275,14 @@ end
-- This helper function creates a colored itemstack -- This helper function creates a colored itemstack
function unifieddyes.fix_bad_color_info(item, paletteidx)
local stack=minetest.itemstring_with_color(item, paletteidx)
return string.gsub(stack, "u0001color", "u0001palette_index")
end
function unifieddyes.make_colored_itemstack(item, palette, color) function unifieddyes.make_colored_itemstack(item, palette, color)
local paletteidx = unifieddyes.getpaletteidx(color, palette) local paletteidx = unifieddyes.getpaletteidx(color, palette)
local stack = ItemStack(item) return unifieddyes.fix_bad_color_info(item, paletteidx), paletteidx
stack:get_meta():set_int("palette_index", paletteidx)
return stack:to_string(),paletteidx
end end
-- these helper functions register all of the recipes needed to create colored -- these helper functions register all of the recipes needed to create colored