develop #23
14 changed files with 83 additions and 36 deletions
|
@ -1,5 +1,7 @@
|
|||
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/integration-test/badge.svg)
|
||||
|
|
|
@ -41,7 +41,7 @@ minetest.register_craft({
|
|||
minetest.register_craft({
|
||||
output = 'building_blocks:fakegrass 2',
|
||||
recipe = {
|
||||
{'default:leaves'},
|
||||
{'group:leaves'},
|
||||
{"default:dirt"},
|
||||
}
|
||||
})
|
||||
|
@ -139,7 +139,7 @@ minetest.register_craft({
|
|||
minetest.register_craft({
|
||||
output = 'building_blocks:woodglass 1',
|
||||
recipe = {
|
||||
{"default:wood"},
|
||||
{"group:wood"},
|
||||
{"default:glass"},
|
||||
}
|
||||
})
|
||||
|
|
|
@ -76,7 +76,7 @@ homedecor.register("wall_shelf", {
|
|||
minetest.register_craft({
|
||||
output = "homedecor:table",
|
||||
recipe = {
|
||||
{ "default:wood","default:wood", "default:wood" },
|
||||
{ "group:wood","group:wood", "group:wood" },
|
||||
{ "group:stick", "", "group:stick" },
|
||||
},
|
||||
})
|
||||
|
|
|
@ -96,8 +96,8 @@ minetest.register_craft({
|
|||
output = "homedecor:desk",
|
||||
recipe = {
|
||||
{ "stairs:slab_wood", "stairs:slab_wood", "stairs:slab_wood" },
|
||||
{ "homedecor:drawer_small", "default:wood", "default:wood" },
|
||||
{ "homedecor:drawer_small", "", "default:wood" },
|
||||
{ "homedecor:drawer_small", "group:wood", "group:wood" },
|
||||
{ "homedecor:drawer_small", "", "group:wood" },
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -105,17 +105,17 @@ minetest.register_craft({
|
|||
output = "homedecor:desk",
|
||||
recipe = {
|
||||
{ "moreblocks:slab_wood", "moreblocks:slab_wood", "moreblocks:slab_wood" },
|
||||
{ "homedecor:drawer_small", "default:wood", "default:wood" },
|
||||
{ "homedecor:drawer_small", "", "default:wood" },
|
||||
{ "homedecor:drawer_small", "group:wood", "group:wood" },
|
||||
{ "homedecor:drawer_small", "", "group:wood" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:filing_cabinet",
|
||||
recipe = {
|
||||
{ "", "default:wood", "" },
|
||||
{ "default:wood", "homedecor:drawer_small", "default:wood" },
|
||||
{ "", "default:wood", "" },
|
||||
{ "", "group:wood", "" },
|
||||
{ "group:wood", "homedecor:drawer_small", "group:wood" },
|
||||
{ "", "group:wood", "" },
|
||||
},
|
||||
})
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ minetest.register_craft( {
|
|||
output = "homedecor:wardrobe",
|
||||
recipe = {
|
||||
{ "homedecor:drawer_small", "homedecor:kitchen_cabinet" },
|
||||
{ "homedecor:drawer_small", "default:wood" },
|
||||
{ "homedecor:drawer_small", "default:wood" }
|
||||
{ "homedecor:drawer_small", "group:wood" },
|
||||
{ "homedecor:drawer_small", "group:wood" }
|
||||
},
|
||||
})
|
||||
|
|
|
@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi")
|
|||
|
||||
mobs = {
|
||||
mod = "redo",
|
||||
version = "20201115",
|
||||
version = "20201130",
|
||||
intllib = S,
|
||||
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 spawn_protected = settings:get_bool("mobs_spawn_protected") ~= 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 show_health = settings:get_bool("mob_show_health") ~= false
|
||||
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())
|
||||
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
|
||||
v = v or 0
|
||||
v = v or 0.01
|
||||
|
||||
-- check if standing in liquid with max viscosity of 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)
|
||||
end
|
||||
|
||||
-- set velocity with hard limit of 10
|
||||
local vel = self.object:get_velocity()
|
||||
-- set velocity
|
||||
local vel = self.object:get_velocity() or 0
|
||||
|
||||
local new_vel = {
|
||||
x = (sin(yaw) * -v) + c_x,
|
||||
|
@ -3908,8 +3909,27 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light, inter
|
|||
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
|
||||
pos = can_spawn(pos, name)
|
||||
end
|
||||
|
||||
if pos then
|
||||
|
||||
|
|
|
@ -697,6 +697,9 @@ External Settings for "minetest.conf"
|
|||
function.
|
||||
'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_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
|
||||
to their minetest.conf file with a new value, the lower the value the more each
|
||||
|
|
|
@ -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)
|
||||
mob_active_limit (Mob Active Limit) float 0
|
||||
|
||||
# Enables area check when spawning mobs
|
||||
mob_area_spawn (Mob Area Spawn) bool false
|
||||
|
|
|
@ -42,6 +42,14 @@ for i in pairs(NoDe) do
|
|||
liquids_pointable = true,
|
||||
on_place = function(itemstack, placer, 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())
|
||||
if minetest.get_node(pt.above).name=="air" then
|
||||
minetest.swap_node(pt.above, {name="trunks:twig_"..math.random(1,4), param2=direction})
|
||||
|
|
3
mods/skinsdb/meta/character_1931.txt
Normal file
3
mods/skinsdb/meta/character_1931.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
Majo
|
||||
TMSB aka Dragoni or Dragon-ManioNM
|
||||
CC BY-SA 4.0
|
3
mods/skinsdb/meta/character_1932.txt
Normal file
3
mods/skinsdb/meta/character_1932.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
player1234's skin(dont use)
|
||||
player1234
|
||||
CC BY-NC-SA 3.0
|
BIN
mods/skinsdb/textures/character_1931.png
Normal file
BIN
mods/skinsdb/textures/character_1931.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
mods/skinsdb/textures/character_1932.png
Normal file
BIN
mods/skinsdb/textures/character_1932.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.8 KiB |
|
@ -166,14 +166,11 @@ minetest.register_on_placenode(
|
|||
return false
|
||||
end
|
||||
|
||||
if not string.find(itemstack:to_string(), "palette_index") then
|
||||
local param2
|
||||
local color = 0
|
||||
|
||||
if not string.find(itemstack:to_string(), "palette_index") then
|
||||
if def.palette == "unifieddyes_palette_extended.png"
|
||||
and def.paramtype2 == "color" then
|
||||
param2 = 240
|
||||
color = 240
|
||||
elseif def.palette == "unifieddyes_palette_colorwallmounted.png"
|
||||
and def.paramtype2 == "colorwallmounted" then
|
||||
param2 = newnode.param2 % 8
|
||||
|
@ -184,17 +181,21 @@ minetest.register_on_placenode(
|
|||
|
||||
if param2 then
|
||||
minetest.swap_node(pos, {name = newnode.name, param2 = param2})
|
||||
minetest.get_meta(pos):set_int("palette_index", color)
|
||||
end
|
||||
end
|
||||
|
||||
if def.palette ~= "" then
|
||||
minetest.get_meta(pos):set_int("palette_index", param2 or 240)
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
-- 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
|
||||
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)
|
||||
and (not creative or not inv:contains_item("main", item, true)) then
|
||||
inv:add_item("main", item)
|
||||
|
@ -214,20 +215,21 @@ function unifieddyes.on_dig(pos, node, digger)
|
|||
|
||||
local oldparam2 = minetest.get_node(pos).param2
|
||||
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
|
||||
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
|
||||
del_color = true
|
||||
fix_color = 0
|
||||
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
|
||||
|
||||
local inv = digger:get_inventory()
|
||||
|
||||
if del_color then
|
||||
move_item(node.name, pos, inv, digger)
|
||||
if fix_color then
|
||||
move_item(node.name, pos, inv, digger, fix_color)
|
||||
else
|
||||
return minetest.node_dig(pos, node, digger)
|
||||
end
|
||||
|
@ -273,11 +275,14 @@ end
|
|||
|
||||
-- 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)
|
||||
local paletteidx = unifieddyes.getpaletteidx(color, palette)
|
||||
local stack = ItemStack(item)
|
||||
stack:get_meta():set_int("palette_index", paletteidx)
|
||||
return stack:to_string(),paletteidx
|
||||
return unifieddyes.fix_bad_color_info(item, paletteidx), paletteidx
|
||||
end
|
||||
|
||||
-- these helper functions register all of the recipes needed to create colored
|
||||
|
|
Loading…
Reference in a new issue