Small update mainmenu. Cleanup and fixes

master
MoNTE48 2019-06-25 01:00:18 +02:00
parent aa4c3bf5ea
commit a78bb6cbd6
37 changed files with 119 additions and 165 deletions

View File

@ -514,6 +514,9 @@ function core.item_drop(itemstack, dropper, pos)
local dropper_is_player = dropper and dropper:is_player()
local p = table.copy(pos)
local cnt = itemstack:get_count()
if not core.is_valid_pos(p) then
return
end
if dropper_is_player then
p.y = p.y + 1.2
if dropper:get_player_control().sneak then

View File

@ -162,7 +162,7 @@ end
-- Checks if specified volume intersects a protected volume
-- Backport from Minetest 5.0
function core.intersects_protection(minp, maxp, player_name, interval)
function core.is_area_protected(minp, maxp, player_name, interval)
-- 'interval' is the largest allowed interval for the 3D lattice of checks.
-- Compute the optimal float step 'd' for each axis so that all corners and
@ -175,14 +175,18 @@ function core.intersects_protection(minp, maxp, player_name, interval)
local d = {}
for _, c in pairs({"x", "y", "z"}) do
if minp[c] > maxp[c] then
-- Repair positions: 'minp' > 'maxp'
local tmp = maxp[c]
maxp[c] = minp[c]
minp[c] = tmp
end
if maxp[c] > minp[c] then
d[c] = (maxp[c] - minp[c]) /
math.ceil((maxp[c] - minp[c]) / interval) - 1e-4
elseif maxp[c] == minp[c] then
else
d[c] = 1 -- Any value larger than 0 to avoid division by zero
else -- maxp[c] < minp[c], print error and treat as protection intersected
core.log("error", "maxp < minp in 'minetest.intersects_protection()'")
return true
end
end
@ -192,13 +196,13 @@ function core.intersects_protection(minp, maxp, player_name, interval)
local y = math.floor(yf + 0.5)
for xf = minp.x, maxp.x, d.x do
local x = math.floor(xf + 0.5)
if core.is_protected({x = x, y = y, z = z}, player_name) then
return true
local pos = {x = x, y = y, z = z}
if core.is_protected(pos, player_name) then
return pos
end
end
end
end
return false
end

View File

@ -21,7 +21,7 @@ local breath_bar_definition =
hud_elem_type = "statbar",
position = {x = 0.5, y = 1},
alignment = {x = -1, y = -1},
offset = {x = 10, y = -134},
offset = {x = 8, y = -134},
size = {x = 24, y = 24},
text = "bubble.png",
number = 20,

View File

@ -35,7 +35,7 @@ common_update_cached_supp_proto()
--------------------------------------------------------------------------------
local function render_client_count(n)
if n > 99 then return '99+'
if n > 999 then return '999'
elseif n >= 0 then return tostring(n)
else return '?' end
end
@ -54,14 +54,16 @@ end
function image_column(tooltip, flagname)
return "image,tooltip=" .. core.formspec_escape(tooltip) .. "," ..
"0=" .. core.formspec_escape(defaulttexturedir .. "blank.png") .. "," ..
"1=" .. core.formspec_escape(defaulttexturedir ..
(flagname and "server_flags_" .. flagname .. ".png" or "blank.png")) .. "," ..
"2=" .. core.formspec_escape(defaulttexturedir .. "server_ping_4.png") .. "," ..
"3=" .. core.formspec_escape(defaulttexturedir .. "server_ping_3.png") .. "," ..
"4=" .. core.formspec_escape(defaulttexturedir .. "server_ping_2.png") .. "," ..
"5=" .. core.formspec_escape(defaulttexturedir .. "server_ping_1.png") .. "," ..
"6=" .. core.formspec_escape(defaulttexturedir .. "server_flags_mc.png") .. "," ..
"7=" .. core.formspec_escape(defaulttexturedir .. "server_flags_mt.png")
"1=" .. core.formspec_escape(defaulttexturedir .. "server_flags_favorite.png") .. "," ..
"2=" .. core.formspec_escape(defaulttexturedir .. "server_flags_mc.png") .. "," ..
"3=" .. core.formspec_escape(defaulttexturedir .. "server_flags_mt.png") .. "," ..
"4=" .. core.formspec_escape(defaulttexturedir .. "server_flags_damage.png") .. "," ..
"5=" .. core.formspec_escape(defaulttexturedir .. "server_flags_creative.png") .. "," ..
"6=" .. core.formspec_escape(defaulttexturedir .. "server_flags_pvp.png") .. "," ..
"14=" .. core.formspec_escape(defaulttexturedir .. "server_ping_4.png") .. "," ..
"13=" .. core.formspec_escape(defaulttexturedir .. "server_ping_3.png") .. "," ..
"12=" .. core.formspec_escape(defaulttexturedir .. "server_ping_2.png") .. "," ..
"11=" .. core.formspec_escape(defaulttexturedir .. "server_ping_1.png")
end
--------------------------------------------------------------------------------
@ -102,22 +104,22 @@ function render_serverlist_row(spec, is_favorite, is_approved)
details = "1,"
else
if is_approved then
details = "6,"
details = "2,"
else
details = "7,"
details = "3,"
end
end
if spec.ping then
local ping = spec.ping * 1000
if ping <= 50 then
details = details .. "2,"
details = details .. "14,"
elseif ping <= 100 then
details = details .. "3,"
details = details .. "13,"
elseif ping <= 250 then
details = details .. "4,"
details = details .. "12,"
else
details = details .. "5,"
details = details .. "11,"
end
else
details = details .. "0,"
@ -134,7 +136,7 @@ function render_serverlist_row(spec, is_favorite, is_approved)
elseif clients_percent <= 60 then clients_color = '#a1e587' -- 0-60%: green
elseif clients_percent <= 90 then clients_color = '#ffdc97' -- 60-90%: yellow
elseif clients_percent == 100 then clients_color = '#dd5b5b' -- full server: red (darker)
else clients_color = '#ffba97' -- 90-100%: orange
else clients_color = '#ffba97' -- 90-100%: orange
end
details = details .. clients_color .. ',' ..
@ -147,20 +149,14 @@ function render_serverlist_row(spec, is_favorite, is_approved)
details = details .. ',?,/,?,'
end
if spec.creative then
details = details .. "1,"
else
details = details .. "0,"
end
if spec.damage then
details = details .. "1,"
details = details .. "4,"
else
details = details .. "0,"
details = details .. "5,"
end
if spec.pvp then
details = details .. "1,"
details = details .. "6,"
else
details = details .. "0,"
end

View File

@ -56,13 +56,13 @@ local function create_world_formspec(dialogdata)
"size[11.5,3.75,false]" ..
"background[0,0;11.5,3;" .. core.formspec_escape(defaulttexturedir ..
"bg_dialog.png") .. ";true]" ..
"label[2,0;" .. fgettext("World name") .. "]"..
"label[1.5,0;" .. fgettext("World name:") .. "]"..
"field[4.5,0.4;6,0.5;te_world_name;;]" ..
"label[2,1;" .. fgettext("Seed") .. "]"..
"label[1.5,1;" .. fgettext("Seed:") .. "]"..
"field[4.5,1.4;6,0.5;te_seed;;".. current_seed .. "]" ..
"label[2,2;" .. fgettext("Mapgen") .. "]"..
"label[1.5,2;" .. fgettext("Mapgen:") .. "]"..
"dropdown[4.2,2;6.3;dd_mapgen;" .. mglist .. ";" .. selindex .. "]" ..
"dropdown[600.2,6;6.3;games;" .. gamemgr.gamelist() .. ";1]" ..

View File

@ -21,8 +21,7 @@ local function delete_world_formspec(dialogdata)
"size[11.5,3.75,false]" ..
"background[0,0;11.5,3;" .. core.formspec_escape(defaulttexturedir ..
"bg_dialog.png") .. ";true]" ..
"label[5,1.4;" ..
fgettext("Delete World") .. "]" ..
"label[5,1.4;" .. fgettext("Delete World") .. "]" ..
"label[5,1.8;" .. fgettext("\"$1\"?", dialogdata.delete_name) .. "]" ..
"button[3.25,3.4;2.5,0.5;world_delete_confirm;" .. fgettext("Delete") .. "]" ..
"button[5.75,3.4;2.5,0.5;world_delete_cancel;" .. fgettext("Cancel") .. "]"

View File

@ -36,11 +36,13 @@ dofile(basepath .. DIR_DELIM .. "fstk" .. DIR_DELIM .. "ui.lua")
dofile(menupath .. DIR_DELIM .. "common.lua")
dofile(menupath .. DIR_DELIM .. "gamemgr.lua")
dofile(menupath .. DIR_DELIM .. "textures.lua")
dofile(menupath .. DIR_DELIM .. "dlg_create_world.lua")
--dofile(menupath .. DIR_DELIM .. "dlg_delete_mod.lua")
dofile(menupath .. DIR_DELIM .. "dlg_delete_world.lua")
--dofile(menupath .. DIR_DELIM .. "dlg_rename_modpack.lua")
dofile(menupath .. DIR_DELIM .. "dlg_config_world.lua")
if not use_simple_menu then
dofile(menupath .. DIR_DELIM .. "modmgr.lua")
-- dofile(menupath .. DIR_DELIM .. "store.lua")
@ -88,14 +90,11 @@ local function init_globals()
menudata.worldlist:add_sort_mechanism("alphabetic", sort_worlds_alphabetic)
menudata.worldlist:set_sortmode("alphabetic")
local default_game = "default"
mm_texture.init()
-- Create main tabview
local tv_main = tabview_create("maintab", {x = 12, y = 5.4}, {x = 0, y = 0})
tv_main:set_autosave_tab(true)
tv_main:add(tabs.local_game)
tv_main:add(tabs.play_online)
@ -107,15 +106,19 @@ local function init_globals()
--tv_main:add(tabs.mods)
tv_main:add(tabs.credits)
tv_main:set_autosave_tab(true)
tv_main:set_global_event_handler(main_event_handler)
tv_main:set_fixed_size(false)
tv_main:set_tab(core.settings:get("maintab_LAST"))
local last_tab = core.settings:get("maintab_LAST")
if last_tab and tv_main.current_tab ~= last_tab then
tv_main:set_tab(last_tab)
end
ui.set_default("maintab")
tv_main:show()
-- Create modstore ui
--if PLATFORM == "Android" then
--if use_simple_menu then
-- modstore.init({x = 12, y = 6}, 3, 2)
--else
-- modstore.init({x = 12, y = 8}, 4, 3)

View File

@ -81,8 +81,7 @@ local function get_formspec(tabview, name, tabdata)
"text,align=right;" .. -- clients
"text,align=center,padding=0.25;" .. -- "/"
"text,align=right,padding=0.25;" .. -- clients_max
image_column(fgettext("Creative mode"), "creative") .. ",padding=0.25;" ..
image_column(fgettext("Damage enabled"), "damage") .. ",padding=0.25;" ..
image_column(fgettext("Server mode"), "damage") .. ",padding=0.25;" ..
image_column(fgettext("PvP enabled"), "pvp") .. ",padding=0.25;" ..
"color,span=1;" ..
"text,padding=0.25]" ..

View File

@ -73,7 +73,7 @@ local Formatter = {
end
}
local widths = { 55, 9, 9, 9, 5, 5, 5 }
local widths = { 50, 8, 8, 8, 5, 5, 5 }
local txt_row_format = sprintf(" %%-%ds | %%%ds | %%%ds | %%%ds | %%%ds | %%%ds | %%%ds", unpack(widths))
local HR = {}

View File

@ -42,6 +42,12 @@ minetest.register_node("mesecons_button:button_stone_off", {
minetest.sound_play("mesecons_button_push", {pos=pos})
minetest.get_node_timer(pos):start(1)
end,
on_rightclick = function (pos, node)
minetest.swap_node(pos, {name = "mesecons_button:button_stone_on", param2=node.param2})
mesecon.receptor_on(pos, mesecon.rules.buttonlike_get(node))
minetest.sound_play("mesecons_button_push", {pos=pos})
minetest.get_node_timer(pos):start(1)
end,
sounds = default.node_sound_stone_defaults(),
mesecons = {receptor = {
state = mesecon.state.off,
@ -105,6 +111,12 @@ minetest.register_node("mesecons_button:button_wood_off", {
minetest.sound_play("mesecons_button_push", {pos=pos})
minetest.get_node_timer(pos):start(1)
end,
on_rightclick = function (pos, node)
minetest.swap_node(pos, {name = "mesecons_button:button_wood_on", param2=node.param2})
mesecon.receptor_on(pos, mesecon.rules.buttonlike_get(node))
minetest.sound_play("mesecons_button_push", {pos=pos})
minetest.get_node_timer(pos):start(1)
end,
sounds = default.node_sound_stone_defaults(),
mesecons = {receptor = {
state = mesecon.state.off,

View File

@ -36,9 +36,9 @@ end
for i = 1, 4 do
local groups = {}
if i == 1 then
groups = {bendy = 2, snappy = 1, dig_immediate = 2}
groups = {bendy = 2, snappy = 1, dig_immediate = 2, attached_node = 1}
else
groups = {bendy = 2, snappy = 1, dig_immediate = 2, not_in_creative_inventory = 1}
groups = {bendy = 2, snappy = 1, dig_immediate = 2, attached_node = 1, not_in_creative_inventory = 1}
end
local delaytime

View File

@ -32,7 +32,7 @@ minetest.register_node("mesecons_lightstone:lightstone_off", {
minetest.register_node("mesecons_lightstone:lightstone_on", {
tiles = {"jeija_lightstone_gray_on.png"},
is_ground_content = false,
groups = {cracky=2,not_in_creative_inventory=1, mesecon = 2},
groups = {cracky=2, not_in_creative_inventory=1, mesecon = 2},
drop = "mesecons_lightstone:lightstone_off",
light_source = minetest.LIGHT_MAX - 2,
sounds = default.node_sound_glass_defaults(),

View File

@ -3,6 +3,7 @@ minetest.register_node("mesecons_noteblock:noteblock", {
tiles = {"mesecons_noteblock.png"},
is_ground_content = false,
groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2},
stack_max = 1,
on_punch = function (pos, node) -- change sound when punched
node.param2 = (node.param2+1)%12
mesecon.noteblock_play(pos, node.param2)

View File

@ -65,7 +65,7 @@ local piston_remove_pusher = function (pos, node)
return
end
minetest.remove_node(pusherpos)
minetest.remove_node(pusherpos)
minetest.sound_play("piston_retract", {
pos = pos,
max_hear_distance = 20,
@ -174,6 +174,7 @@ minetest.register_node("mesecons_pistons:piston_normal_off", {
"mesecons_piston_pusher_front.png"
},
groups = {cracky = 3},
stack_max = 1,
paramtype2 = "facedir",
after_place_node = piston_orientate,
mesecons_piston = pistonspec_normal,
@ -253,6 +254,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_off", {
"mesecons_piston_pusher_front_sticky.png"
},
groups = {cracky = 3},
stack_max = 1,
paramtype2 = "facedir",
after_place_node = piston_orientate,
mesecons_piston = pistonspec_sticky,

View File

@ -93,7 +93,7 @@ mesecon.register_pressure_plate(
{"default_wood.png"},
{"default_wood.png"},
{{"default:wood", "default:wood"}},
{ choppy = 3, oddly_breakable_by_hand = 3 },
{ choppy = 3, oddly_breakable_by_hand = 3, attached_node = 1 },
default.node_sound_wood_defaults())
mesecon.register_pressure_plate(
@ -102,5 +102,5 @@ mesecon.register_pressure_plate(
{"default_stone.png"},
{"default_stone.png"},
{{"default:cobble", "default:cobble"}},
{ cracky = 3, oddly_breakable_by_hand = 3 },
{ cracky = 3, oddly_breakable_by_hand = 3, attached_node = 1 },
default.node_sound_stone_defaults())

View File

@ -14,7 +14,7 @@ minetest.register_node("mesecons_solarpanel:solar_panel_on", {
wall_side = { -2/16, -8/16, -8/16, -8/16, 8/16, 8/16 },
},
drop = "mesecons_solarpanel:solar_panel_off",
groups = {dig_immediate=3, not_in_creative_inventory = 1},
groups = {dig_immediate = 3, attached_node = 1, not_in_creative_inventory = 1},
sounds = default.node_sound_glass_defaults(),
mesecons = {receptor = {
state = mesecon.state.on,
@ -38,7 +38,7 @@ minetest.register_node("mesecons_solarpanel:solar_panel_off", {
wall_top = { -8/16, 2/16, -8/16, 8/16, 8/16, 8/16 },
wall_side = { -2/16, -8/16, -8/16, -8/16, 8/16, 8/16 },
},
groups = {dig_immediate=3},
groups = {dig_immediate = 3, attached_node = 1},
description="Solar Panel",
sounds = default.node_sound_glass_defaults(),
mesecons = {receptor = {

View File

@ -58,7 +58,7 @@ local torch_selectionbox =
walkable = false,
paramtype2 = "wallmounted",
selection_box = torch_selectionbox,
groups = {dig_immediate = 3, not_in_creative_inventory = 1},
groups = {dig_immediate = 3, attached_node = 1, not_in_creative_inventory = 1},
drop = "mesecons_torch:mesecon_torch_on",
sounds = default.node_sound_defaults(),
mesecons = {receptor = {

View File

@ -39,7 +39,7 @@ mesecon.register_node("mesecons_walllever:wall_lever", {
},
node_box = {
type = "fixed",
fixed = {{ -2/16, -3/16, 8/16, 2/16, 3/16, 4/16 }, -- the base
fixed = {{ -2/16, -3/16, 8/16, 2/16, 3/16, 4/16 }, -- the base
{ -1/16, -8/16, 7/16, 1/16, 0/16, 5/16 }} -- the lever itself.
},
mesecons = {receptor = {
@ -58,8 +58,8 @@ mesecon.register_node("mesecons_walllever:wall_lever", {
},
node_box = {
type = "fixed",
fixed = {{ -2/16, -3/16, 8/16, 2/16, 3/16, 4/16 }, -- the base
{ -1/16, 0/16, 7/16, 1/16, 8/16, 5/16 }} -- the lever itself.
fixed = {{ -2/16, -3/16, 8/16, 2/16, 3/16, 4/16 }, -- the base
{ -1/16, 0/16, 7/16, 1/16, 8/16, 5/16 }} -- the lever itself.
},
on_rotate = false,
mesecons = {receptor = {

View File

@ -24,7 +24,6 @@ minetest.register_alias("glass", "default:glass")
minetest.register_alias("wooden_fence", "default:fence_wood")
minetest.register_alias("ladder", "default:ladder")
minetest.register_alias("wood", "default:wood")
minetest.register_alias("cloud", "default:cloud")
minetest.register_alias("water_flowing", "default:water_flowing")
minetest.register_alias("water_source", "default:water_source")
minetest.register_alias("lava_flowing", "default:lava_flowing")

View File

@ -228,14 +228,12 @@ minetest.register_craftitem("default:glowstone_dust", {
minetest.register_craftitem("default:fish_raw", {
description = "Raw Fish",
groups = {},
inventory_image = "default_fish.png",
on_use = minetest.item_eat(2),
})
minetest.register_craftitem("default:fish", {
description = "Cooked Fish",
groups = {},
inventory_image = "default_fish_cooked.png",
on_use = minetest.item_eat(4),
})

View File

@ -872,10 +872,11 @@ minetest.register_node("default:cactus", {
})
minetest.register_abm({
label = "Cactus damage",
nodenames = {"default:cactus"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
action = function(pos)
local players = minetest.get_objects_inside_radius(pos, 1)
for i, player in ipairs(players) do
player:set_hp(player:get_hp() - 2)
@ -1393,7 +1394,7 @@ minetest.register_node("default:ladder_wood", {
--wall_bottom = = <default>
--wall_side = = <default>
},
groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2, attached_node = 1},
legacy_wallmounted = true,
sounds = default.node_sound_wood_defaults(),
})
@ -1538,18 +1539,6 @@ minetest.register_node("default:quartz_pillar", {
sounds = default.node_sound_stone_defaults(),
})
--
-- Misc
--
minetest.register_node("default:cloud", {
description = "Cloud",
tiles = {"default_cloud.png"},
is_ground_content = false,
sounds = default.node_sound_defaults(),
groups = {not_in_creative_inventory = 1},
})
--
-- register trees for leafdecay
--

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 B

View File

@ -489,7 +489,7 @@ function default.sapling_on_place(itemstack, placer, pointed_thing,
return itemstack
end
-- Check tree volume for protection
if core.intersects_protection(
if minetest.is_area_protected(
vector.add(pos, minp_relative),
vector.add(pos, maxp_relative),
player_name,

View File

@ -43,8 +43,8 @@ minetest.register_node("fire:basic_flame", {
name = "fire_basic_flame_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
aspect_w = 32,
aspect_h = 32,
length = 1
},
},
@ -103,7 +103,7 @@ minetest.register_node("fire:permanent_flame", {
sunlight_propagates = true,
floodable = true,
damage_per_second = 4,
groups = {igniter = 2, dig_immediate = 3},
groups = {igniter = 2, dig_immediate = 3, not_in_creative_inventory = 1},
drop = "",
on_flood = flood_flame,

View File

@ -122,7 +122,7 @@ minetest.register_node("itemframes:frame",{
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = {choppy = 2, dig_immediate = 2},
groups = {choppy = 2, dig_immediate = 2, attached_node = 1},
legacy_wallmounted = true,
sounds = default.node_sound_wood_defaults(),
after_place_node = function(pos, placer, itemstack)

View File

@ -94,10 +94,8 @@ mobs:spawn({
name = "mobs_animal:bear",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass"},
min_light = 0,
interval = 30,
chance = 15000,
chance = 30000,
min_height = 0,
max_height = 31000,
day_toggle = true,
})

View File

@ -104,10 +104,8 @@ mobs:spawn({
name = "mobs_animal:bunny",
nodes = {"default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass"},
min_light = 10,
interval = 30,
chance = 8000,
chance = 20000,
min_height = 0,
max_height = 31000,
day_toggle = true,
})

View File

@ -77,10 +77,8 @@ mobs:spawn({
name = "mobs_animal:chicken",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"},
min_light = 5,
interval = 30,
chance = 8000,
chance = 20000,
min_height = 0,
max_height = 31000,
day_toggle = true,
})

View File

@ -129,10 +129,8 @@ mobs:spawn({
name = "mobs_animal:cow",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_dry_grass", "default:dirt_with_grass"},
min_light = 5,
interval = 30,
chance = 10000,
chance = 20000,
min_height = 0,
max_height = 31000,
day_toggle = true,
})

View File

@ -62,10 +62,8 @@ mobs:spawn({
name = "mobs_animal:wolf",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass"},
min_light = 0,
interval = 30,
chance = 15000,
chance = 20000,
min_height = 0,
max_height = 31000,
day_toggle = true,
})

View File

@ -55,10 +55,8 @@ mobs:spawn({
name = "mobs_animal:kitten",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass"},
min_light = 10,
interval = 30,
chance = 10000,
chance = 20000,
min_height = 0,
max_height = 31000,
day_toggle = true,
})

View File

@ -59,10 +59,8 @@ mobs:spawn({
name = "mobs_animal:pig",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass"},
min_light = 5,
interval = 30,
chance = 15000,
chance = 20000,
min_height = 0,
max_height = 31000,
day_toggle = true,
})

View File

@ -158,10 +158,8 @@ mobs:spawn({
name = "mobs_animal:sheep_white",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"},
min_light = 7,
interval = 30,
chance = 40000,
chance = 100000,
min_height = 0,
max_height = 31000,
day_toggle = true,
})
@ -169,10 +167,8 @@ mobs:spawn({
name = "mobs_animal:sheep_grey",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"},
min_light = 7,
interval = 30,
chance = 40000,
chance = 100000,
min_height = 0,
max_height = 31000,
day_toggle = true,
})
@ -180,10 +176,8 @@ mobs:spawn({
name = "mobs_animal:sheep_dark_grey",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"},
min_light = 7,
interval = 30,
chance = 40000,
chance = 100000,
min_height = 0,
max_height = 31000,
day_toggle = true,
})
@ -191,10 +185,8 @@ mobs:spawn({
name = "mobs_animal:sheep_black",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:dirt_with_dry_grass", "default:dirt_with_grass"},
min_light = 7,
interval = 30,
chance = 40000,
chance = 100000,
min_height = 0,
max_height = 31000,
day_toggle = true,
})
@ -202,9 +194,7 @@ mobs:spawn({
name = "mobs_animal:sheep_brown",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:dirt_with_dry_grass", "default:dirt_with_grass"},
min_light = 7,
interval = 30,
chance = 40000,
chance = 100000,
min_height = 0,
max_height = 31000,
day_toggle = true,
})

View File

@ -52,11 +52,9 @@ mobs:register_mob("mobs_monster:skeleton", {
mobs:spawn({
name = "mobs_monster:skeleton",
nodes = {"default:dirt", "default:sandstone", "default:sand", "default:redsand", "default:stone", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass", "default:cobble", "default:mossycobble"},
min_light = 0,
max_light = 10,
chance = 7000,
min_height = -50,
max_height = 31000,
chance = 15000,
min_height = -64,
})
mobs:register_egg("mobs_monster:skeleton", "Skeleton egg", "mobs_chicken_egg.png^default_bone.png", 1)

View File

@ -62,12 +62,9 @@ mobs:register_mob("mobs_monster:spider", {
mobs:spawn({
name = "mobs_monster:spider",
nodes = {"default:dirt", "default:sandstone", "default:sand", "default:redsand", "default:redsand", "default:stone", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass", "default:cobble", "default:mossycobble"},
min_light = 0,
max_light = 12,
interval = 30,
chance = 10000,
min_height = -50,
max_height = 31000,
chance = 20000,
min_height = -64,
})
mobs:register_egg("mobs_monster:spider", "Spider egg", "mobs_chicken_egg.png^mobs_cobweb.png", 1)
@ -138,12 +135,8 @@ mobs:register_mob("mobs_monster:small_spider", {
mobs:spawn({
name = "mobs_monster:small_spider",
nodes = {"default:dirt", "default:sandstone", "default:sand", "default:redsand", "default:redsand", "default:stone", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass", "default:cobble", "default:mossycobble"},
min_light = 0,
max_light = 15,
interval = 30,
chance = 10000,
min_height = -50,
max_height = 31000,
chance = 20000,
min_height = -64,
})
minetest.register_craft({

View File

@ -52,11 +52,9 @@ mobs:register_mob("mobs_monster:zombie", {
mobs:spawn({
name = "mobs_monster:zombie",
nodes = {"default:dirt", "default:sandstone", "default:sand", "default:redsand", "default:stone", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass", "default:cobble", "default:mossycobble"},
min_light = 0,
max_light = 10,
chance = 7000,
min_height = -50,
max_height = 31000,
chance = 15000,
min_height = -64,
})
mobs:register_egg("mobs_monster:zombie", "Zombie Head", "zombie_head.png", 0)

View File

@ -37,7 +37,6 @@ end
-- Load settings
local damage_enabled = minetest.settings:get_bool("enable_damage")
local mobs_spawn = minetest.settings:get_bool("mobs_spawn") ~= false
local peaceful_only = minetest.settings:get_bool("only_peaceful_mobs")
local disable_blood = minetest.settings:get_bool("mobs_disable_blood") ~= true
@ -48,8 +47,14 @@ local spawn_protected = minetest.settings:get_bool("mobs_spawn_protected") ~= fa
local remove_far = minetest.settings:get_bool("remove_far_mobs") ~= false
local difficulty = tonumber(minetest.settings:get("mob_difficulty")) or 1.0
local show_health = minetest.settings:get_bool("mob_show_health") ~= true
local max_per_block = tonumber(minetest.settings:get("max_objects_per_block") or 99)
local max_per_block = tonumber(minetest.settings:get("max_objects_per_block"))
local mob_chance_multiplier = tonumber(minetest.settings:get("mob_chance_multiplier") or 1)
local lifetime = 1200 -- 20 min
local spawn_interval = 10
if not minetest.is_singleplayer() then
lifetime = 300 -- 5 min
spawn_interval = 60
end
-- Peaceful mode message so players will know there are no monsters
if peaceful_only then
@ -74,10 +79,6 @@ local node_ice = "default:ice"
local node_snowblock = "default:snowblock"
local node_snow = "default:snow"
mobs.fallback_node = minetest.registered_aliases["mapgen_dirt"] or "default:dirt"
local lifetime = 1200 -- 20 min
if not minetest.is_singleplayer() then
lifetime = 300 -- 5 min
end
local mob_class = {
stepheight = 1.1, -- was 0.6
@ -900,16 +901,15 @@ function mob_class:do_env_damage()
if self.light_damage ~= 0 then
local light = minetest.get_node_light(pos) or 0
if light >= self.light_damage_min
and light <= self.light_damage_max then
self.health = self.health - self.light_damage
pos.y = pos.y + 0.75 -- for particle effect position
effect(pos, 5, "heart.png")
self.nametag = "Health: " .. self.health .. " / " .. self.hp_max
self:update_tag()
if show_health then
self.nametag = "Health: " .. self.health .. " / " .. self.hp_max
self:update_tag()
end
if self:check_for_death({type = "light"}) then return end
end
end
@ -2707,22 +2707,6 @@ end
-- only play hit sound and show blood effects if damage is 1 or over
if damage >= 1 then
-- weapon sounds
--[[ if weapon_def.sounds then
local s = random(0, #weapon_def.sounds)
minetest.sound_play(weapon_def.sounds[s], {
object = self.object,
max_hear_distance = 8
})
else
minetest.sound_play("default_punch", {
object = self.object,
max_hear_distance = 5
})
end ]]
-- blood_particles
if not disable_blood and self.blood_amount > 0 then
@ -3584,7 +3568,7 @@ function mobs:spawn(def)
def.neighbors or {"air"},
def.min_light or 0,
def.max_light or 15,
def.interval or 30,
def.interval or spawn_interval,
def.chance or 5000,
def.active_object_count or 1,
def.min_height or -31000,
@ -4166,7 +4150,7 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame)
end
-- make sound when fed so many times
--self:mob_sound(self.sounds.random)
self:mob_sound(self.sounds.random)
end
return true