[mobs_mc] fix warnings

This commit is contained in:
AFCMS 2021-05-23 15:10:20 +02:00
parent 470f7b70bc
commit 335405f131
21 changed files with 37 additions and 48 deletions

View File

@ -83,7 +83,7 @@ mobs_mc.items = {
water_source = "default:water_source", water_source = "default:water_source",
water_flowing = "default:water_flowing", water_flowing = "default:water_flowing",
river_water_source = "default:river_water_source", river_water_source = "default:river_water_source",
water_flowing = "default:river_water_flowing", --water_flowing = "default:river_water_flowing",
black_dye = "dye:black", black_dye = "dye:black",
poppy = "flowers:rose", poppy = "flowers:rose",
dandelion = "flowers:dandelion_yellow", dandelion = "flowers:dandelion_yellow",
@ -128,7 +128,6 @@ mobs_mc.items = {
nether_portal = "nether:portal", nether_portal = "nether:portal",
netherrack = "nether:rack", netherrack = "nether:rack",
nether_brick_block = "nether:brick",
-- Wool (Minecraft color scheme) -- Wool (Minecraft color scheme)
wool_white = "wool:white", wool_white = "wool:white",

View File

@ -6,7 +6,7 @@
-- NOTE: Strings intentionally not marked for translation, other mods already have these items. -- NOTE: Strings intentionally not marked for translation, other mods already have these items.
-- TODO: Remove this file eventually, all items here are already outsourced in other mods. -- TODO: Remove this file eventually, all items here are already outsourced in other mods.
local S = minetest.get_translator("mobs_mc") --local S = minetest.get_translator("mobs_mc")
--maikerumines throwing code --maikerumines throwing code
--arrow (weapon) --arrow (weapon)

View File

@ -3,8 +3,9 @@
-- NOTE: Strings intentionally not marked for translation, other mods already have these items. -- NOTE: Strings intentionally not marked for translation, other mods already have these items.
-- TODO: Remove this file eventually, all items here are already outsourced in other mods. -- TODO: Remove this file eventually, all items here are already outsourced in other mods.
-- TODO: Add translation.
local S = minetest.get_translator("mobs_mc") --local S = minetest.get_translator("mobs_mc")
-- Heads system -- Heads system

View File

@ -20,7 +20,7 @@ mobs:register_mob("mobs_mc:blaze", {
xp_max = 10, xp_max = 10,
tilt_fly = false, tilt_fly = false,
hostile = true, hostile = true,
rotate = 270, --rotate = 270,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.79, 0.3}, collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.79, 0.3},
rotate = -180, rotate = -180,
visual = "mesh", visual = "mesh",

View File

@ -24,7 +24,6 @@ mobs:register_mob("mobs_mc:enderdragon", {
xp_max = 500, xp_max = 500,
collisionbox = {-2, 0, -2, 2, 2, 2}, collisionbox = {-2, 0, -2, 2, 2, 2},
eye_height = 1, eye_height = 1,
physical = false,
visual = "mesh", visual = "mesh",
mesh = "mobs_mc_dragon.b3d", mesh = "mobs_mc_dragon.b3d",
textures = { textures = {
@ -60,8 +59,6 @@ mobs:register_mob("mobs_mc:enderdragon", {
arrow = "mobs_mc:dragon_fireball", arrow = "mobs_mc:dragon_fireball",
shoot_interval = 0.5, shoot_interval = 0.5,
shoot_offset = -1.0, shoot_offset = -1.0,
xp_min = 500,
xp_max = 500,
animation = { animation = {
fly_speed = 8, stand_speed = 8, fly_speed = 8, stand_speed = 8,
stand_start = 0, stand_end = 20, stand_start = 0, stand_end = 20,
@ -114,8 +111,8 @@ mobs:register_mob("mobs_mc:enderdragon", {
fire_resistant = true, fire_resistant = true,
}) })
--TODO: replace this setting by a proper gamerules system
local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false local mobs_griefing = minetest.settings:get_bool("mobs_griefing", true)
-- dragon fireball (projectile) -- dragon fireball (projectile)
mobs:register_arrow("mobs_mc:dragon_fireball", { mobs:register_arrow("mobs_mc:dragon_fireball", {
@ -143,7 +140,9 @@ mobs:register_arrow("mobs_mc:dragon_fireball", {
-- node hit, explode -- node hit, explode
hit_node = function(self, pos, node) hit_node = function(self, pos, node)
--mobs:boom(self, pos, 2) --mobs:boom(self, pos, 2)
mcl_explosions.explode(self.object:get_pos(), 2,{ drop_chance = 1.0 }) if mobs_griefing then
mcl_explosions.explode(self.object:get_pos(), 2, { drop_chance = 1.0 })
end
end end
}) })

View File

@ -318,12 +318,12 @@ mobs:register_mob("mobs_mc:enderman", {
for n = 1, #objs do for n = 1, #objs do
local obj = objs[n] local obj = objs[n]
if obj then if obj then
if minetest.is_player(obj) then --if minetest.is_player(obj) then
-- Warp from players during day. -- Warp from players during day.
--if (minetest.get_timeofday() * 24000) > 5001 and (minetest.get_timeofday() * 24000) < 19000 then --if (minetest.get_timeofday() * 24000) > 5001 and (minetest.get_timeofday() * 24000) < 19000 then
-- self:teleport(nil) -- self:teleport(nil)
--end --end
else if not obj:is_player() then
local lua = obj:get_luaentity() local lua = obj:get_luaentity()
if lua then if lua then
if lua.name == "mcl_bows:arrow_entity" or lua.name == "mcl_throwing:snowball_entity" then if lua.name == "mcl_bows:arrow_entity" or lua.name == "mcl_throwing:snowball_entity" then

View File

@ -94,7 +94,6 @@ mobs:register_mob("mobs_mc:guardian", {
makes_footstep_sound = false, makes_footstep_sound = false,
fly_in = { mobs_mc.items.water_source, mobs_mc.items.river_water_source }, fly_in = { mobs_mc.items.water_source, mobs_mc.items.river_water_source },
jump = false, jump = false,
view_range = 16,
}) })
-- Spawning disabled due to size issues -- Spawning disabled due to size issues

View File

@ -104,7 +104,6 @@ mobs:register_mob("mobs_mc:guardian_elder", {
makes_footstep_sound = false, makes_footstep_sound = false,
fly_in = { mobs_mc.items.water_source, mobs_mc.items.river_water_source }, fly_in = { mobs_mc.items.water_source, mobs_mc.items.river_water_source },
jump = false, jump = false,
view_range = 16,
}) })
-- Spawning disabled due to size issues <- what do you mean? -j4i -- Spawning disabled due to size issues <- what do you mean? -j4i

View File

@ -38,9 +38,9 @@ end
local can_equip_horse_armor = function(entity_id) local can_equip_horse_armor = function(entity_id)
return entity_id == "mobs_mc:horse" or entity_id == "mobs_mc:skeleton_horse" or entity_id == "mobs_mc:zombie_horse" return entity_id == "mobs_mc:horse" or entity_id == "mobs_mc:skeleton_horse" or entity_id == "mobs_mc:zombie_horse"
end end
local can_equip_chest = function(entity_id) --[[local can_equip_chest = function(entity_id)
return entity_id == "mobs_mc:mule" or entity_id == "mobs_mc:donkey" return entity_id == "mobs_mc:mule" or entity_id == "mobs_mc:donkey"
end end]]
local can_breed = function(entity_id) local can_breed = function(entity_id)
return entity_id == "mobs_mc:horse" or "mobs_mc:mule" or entity_id == "mobs_mc:donkey" return entity_id == "mobs_mc:horse" or "mobs_mc:mule" or entity_id == "mobs_mc:donkey"
end end
@ -314,7 +314,7 @@ local horse = {
-- Make sure tamed horse is mature and being clicked by owner only -- Make sure tamed horse is mature and being clicked by owner only
if self.tamed and not self.child and self.owner == clicker:get_player_name() then if self.tamed and not self.child and self.owner == clicker:get_player_name() then
local inv = clicker:get_inventory() --local inv = clicker:get_inventory()
-- detatch player already riding horse -- detatch player already riding horse
if self.driver and clicker == self.driver then if self.driver and clicker == self.driver then

View File

@ -307,9 +307,9 @@ mobs:register_arrow("mobs_mc:spit", {
tail_distance_divider = 4, tail_distance_divider = 4,
hit_player = function(self, player) hit_player = function(self, player)
if rawget(_G, "armor") and armor.last_damage_types then --[[if rawget(_G, "armor") and armor.last_damage_types then
armor.last_damage_types[player:get_player_name()] = "spit" armor.last_damage_types[player:get_player_name()] = "spit"
end end]]
player:punch(self.object, 1.0, { player:punch(self.object, 1.0, {
full_punch_interval = 1.0, full_punch_interval = 1.0,
damage_groups = {fleshy = self._damage}, damage_groups = {fleshy = self._damage},
@ -319,7 +319,7 @@ mobs:register_arrow("mobs_mc:spit", {
hit_mob = function(self, mob) hit_mob = function(self, mob)
mob:punch(self.object, 1.0, { mob:punch(self.object, 1.0, {
full_punch_interval = 1.0, full_punch_interval = 1.0,
damage_groups = {fleshy = _damage}, damage_groups = {fleshy = self._damage},
}, nil) }, nil)
end, end,

View File

@ -151,7 +151,7 @@ end
mobs:register_mob("mobs_mc:cat", cat) mobs:register_mob("mobs_mc:cat", cat)
local base_spawn_chance = 5000 --local base_spawn_chance = 5000
-- Spawn ocelot -- Spawn ocelot
--they get the same as the llama because I'm trying to rework so much of this code right now -j4i --they get the same as the llama because I'm trying to rework so much of this code right now -j4i

View File

@ -163,7 +163,7 @@ mobs:register_mob("mobs_mc:pig", {
end end
-- Mount or detach player -- Mount or detach player
local name = clicker:get_player_name() --local name = clicker:get_player_name()
if self.driver and clicker == self.driver then if self.driver and clicker == self.driver then
-- Detach if already attached -- Detach if already attached
mobs.detach(clicker, {x=1, y=0, z=0}) mobs.detach(clicker, {x=1, y=0, z=0})

View File

@ -150,7 +150,6 @@ mobs:register_mob("mobs_mc:sheep", {
do_custom = function(self, dtime) do_custom = function(self, dtime)
if not self.initial_color_set then if not self.initial_color_set then
local r = math.random(0,100000) local r = math.random(0,100000)
local textures
if r <= 81836 then if r <= 81836 then
-- 81.836% -- 81.836%
self.color = "unicolor_white" self.color = "unicolor_white"

View File

@ -46,7 +46,6 @@ mobs:register_mob("mobs_mc:silverfish", {
view_range = 16, view_range = 16,
attack_type = "punch", attack_type = "punch",
damage = 1, damage = 1,
reach = 1,
}) })
mobs:register_egg("mobs_mc:silverfish", S("Silverfish"), "mobs_mc_spawn_icon_silverfish.png", 0) mobs:register_egg("mobs_mc:silverfish", S("Silverfish"), "mobs_mc_spawn_icon_silverfish.png", 0)

View File

@ -31,10 +31,6 @@ local skeleton = {
group_attack = true, group_attack = true,
visual = "mesh", visual = "mesh",
mesh = "mobs_mc_skeleton.b3d", mesh = "mobs_mc_skeleton.b3d",
textures = { {
"mcl_bows_bow_0.png", -- bow
"mobs_mc_skeleton.png", -- skeleton
} },
--head code --head code
has_head = false, has_head = false,

View File

@ -15,7 +15,7 @@ mobs:register_mob("mobs_mc:vex", {
spawn_class = "hostile", spawn_class = "hostile",
pathfinding = 1, pathfinding = 1,
passive = false, passive = false,
attack_type = "punch", attack_type = "dogfight",
physical = false, physical = false,
hp_min = 14, hp_min = 14,
hp_max = 14, hp_max = 14,
@ -36,7 +36,6 @@ mobs:register_mob("mobs_mc:vex", {
view_range = 16, view_range = 16,
walk_velocity = 3.2, walk_velocity = 3.2,
run_velocity = 5.9, run_velocity = 5.9,
attack_type = "dogfight",
sounds = { sounds = {
-- TODO: random -- TODO: random
death = "mobs_mc_vex_death", death = "mobs_mc_vex_death",

View File

@ -26,7 +26,6 @@ mobs:register_mob("mobs_mc:wither", {
{"mobs_mc_wither.png"}, {"mobs_mc_wither.png"},
}, },
visual_size = {x=4, y=4}, visual_size = {x=4, y=4},
makes_footstep_sound = true,
view_range = 16, view_range = 16,
fear_height = 4, fear_height = 4,
walk_velocity = 2, walk_velocity = 2,
@ -81,7 +80,7 @@ mobs:register_mob("mobs_mc:wither", {
end, end,
}) })
local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false --local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false
mobs:register_arrow("mobs_mc:wither_skull", { mobs:register_arrow("mobs_mc:wither_skull", {
visual = "sprite", visual = "sprite",

View File

@ -186,7 +186,7 @@ dog.on_rightclick = function(self, clicker)
if is_food(item:get_name()) then if is_food(item:get_name()) then
-- Feed to increase health -- Feed to increase health
local hp = self.health local hp = self.health
local hp_add = 0 local hp_add
-- Use eatable group to determine health boost -- Use eatable group to determine health boost
local eatable = minetest.get_item_group(item, "eatable") local eatable = minetest.get_item_group(item, "eatable")
if eatable > 0 then if eatable > 0 then