From 335405f1310d9bc0bcc6d8ef9ccf8ffe618ee3cd Mon Sep 17 00:00:00 2001 From: AFCMS Date: Sun, 23 May 2021 15:10:20 +0200 Subject: [PATCH] [mobs_mc] fix warnings --- mods/ENTITIES/mobs_mc/0_gameconfig.lua | 3 +-- mods/ENTITIES/mobs_mc/2_throwing.lua | 2 +- mods/ENTITIES/mobs_mc/4_heads.lua | 3 ++- mods/ENTITIES/mobs_mc/blaze.lua | 2 +- mods/ENTITIES/mobs_mc/cow+mooshroom.lua | 4 ++-- mods/ENTITIES/mobs_mc/ender_dragon.lua | 13 ++++++------- mods/ENTITIES/mobs_mc/enderman.lua | 4 ++-- mods/ENTITIES/mobs_mc/guardian.lua | 3 +-- mods/ENTITIES/mobs_mc/guardian_elder.lua | 1 - mods/ENTITIES/mobs_mc/horse.lua | 6 +++--- mods/ENTITIES/mobs_mc/iron_golem.lua | 2 +- mods/ENTITIES/mobs_mc/llama.lua | 12 ++++++------ mods/ENTITIES/mobs_mc/ocelot.lua | 2 +- mods/ENTITIES/mobs_mc/parrot.lua | 2 +- mods/ENTITIES/mobs_mc/pig.lua | 4 ++-- mods/ENTITIES/mobs_mc/sheep.lua | 5 ++--- mods/ENTITIES/mobs_mc/silverfish.lua | 1 - mods/ENTITIES/mobs_mc/skeleton+stray.lua | 6 +----- mods/ENTITIES/mobs_mc/vex.lua | 3 +-- mods/ENTITIES/mobs_mc/wither.lua | 3 +-- mods/ENTITIES/mobs_mc/wolf.lua | 4 ++-- 21 files changed, 37 insertions(+), 48 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/0_gameconfig.lua b/mods/ENTITIES/mobs_mc/0_gameconfig.lua index c947e91859..f21d946fef 100644 --- a/mods/ENTITIES/mobs_mc/0_gameconfig.lua +++ b/mods/ENTITIES/mobs_mc/0_gameconfig.lua @@ -83,7 +83,7 @@ mobs_mc.items = { water_source = "default:water_source", water_flowing = "default:water_flowing", river_water_source = "default:river_water_source", - water_flowing = "default:river_water_flowing", + --water_flowing = "default:river_water_flowing", black_dye = "dye:black", poppy = "flowers:rose", dandelion = "flowers:dandelion_yellow", @@ -128,7 +128,6 @@ mobs_mc.items = { nether_portal = "nether:portal", netherrack = "nether:rack", - nether_brick_block = "nether:brick", -- Wool (Minecraft color scheme) wool_white = "wool:white", diff --git a/mods/ENTITIES/mobs_mc/2_throwing.lua b/mods/ENTITIES/mobs_mc/2_throwing.lua index 23ae86d80a..6f01ae6e67 100644 --- a/mods/ENTITIES/mobs_mc/2_throwing.lua +++ b/mods/ENTITIES/mobs_mc/2_throwing.lua @@ -6,7 +6,7 @@ -- 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. -local S = minetest.get_translator("mobs_mc") +--local S = minetest.get_translator("mobs_mc") --maikerumines throwing code --arrow (weapon) diff --git a/mods/ENTITIES/mobs_mc/4_heads.lua b/mods/ENTITIES/mobs_mc/4_heads.lua index 01b8ee5775..2ba0d548bf 100644 --- a/mods/ENTITIES/mobs_mc/4_heads.lua +++ b/mods/ENTITIES/mobs_mc/4_heads.lua @@ -3,8 +3,9 @@ -- 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: Add translation. -local S = minetest.get_translator("mobs_mc") +--local S = minetest.get_translator("mobs_mc") -- Heads system diff --git a/mods/ENTITIES/mobs_mc/blaze.lua b/mods/ENTITIES/mobs_mc/blaze.lua index 146e8da705..a5e6f2bd3c 100644 --- a/mods/ENTITIES/mobs_mc/blaze.lua +++ b/mods/ENTITIES/mobs_mc/blaze.lua @@ -20,7 +20,7 @@ mobs:register_mob("mobs_mc:blaze", { xp_max = 10, tilt_fly = false, hostile = true, - rotate = 270, + --rotate = 270, collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.79, 0.3}, rotate = -180, visual = "mesh", diff --git a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua index 0d6d31ffeb..6100e58998 100644 --- a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua +++ b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua @@ -89,7 +89,7 @@ local cow_def = { --head code has_head = true, head_bone = "head", - + swap_y_with_x = false, reverse_head_yaw = false, @@ -168,7 +168,7 @@ mooshroom_def.on_rightclick = function(self, clicker) pos.y = pos.y + 0.5 minetest.add_item(pos, {name = mobs_mc.items.mushroom_stew}) end - end + end end mobs:register_mob("mobs_mc:mooshroom", mooshroom_def) diff --git a/mods/ENTITIES/mobs_mc/ender_dragon.lua b/mods/ENTITIES/mobs_mc/ender_dragon.lua index 2111105d39..d2d040ad2b 100644 --- a/mods/ENTITIES/mobs_mc/ender_dragon.lua +++ b/mods/ENTITIES/mobs_mc/ender_dragon.lua @@ -16,7 +16,7 @@ mobs:register_mob("mobs_mc:enderdragon", { shoot_arrow = function(self, pos, dir) -- 2-4 damage per arrow local dmg = math.random(2,4) - mobs.shoot_projectile_handling("mobs_mc:dragon_fireball", pos, dir, self.object:get_yaw(), self.object, nil, dmg) + mobs.shoot_projectile_handling("mobs_mc:dragon_fireball", pos, dir, self.object:get_yaw(), self.object, nil, dmg) end, hp_max = 200, hp_min = 200, @@ -24,7 +24,6 @@ mobs:register_mob("mobs_mc:enderdragon", { xp_max = 500, collisionbox = {-2, 0, -2, 2, 2, 2}, eye_height = 1, - physical = false, visual = "mesh", mesh = "mobs_mc_dragon.b3d", textures = { @@ -60,8 +59,6 @@ mobs:register_mob("mobs_mc:enderdragon", { arrow = "mobs_mc:dragon_fireball", shoot_interval = 0.5, shoot_offset = -1.0, - xp_min = 500, - xp_max = 500, animation = { fly_speed = 8, stand_speed = 8, stand_start = 0, stand_end = 20, @@ -114,8 +111,8 @@ mobs:register_mob("mobs_mc:enderdragon", { fire_resistant = true, }) - -local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false +--TODO: replace this setting by a proper gamerules system +local mobs_griefing = minetest.settings:get_bool("mobs_griefing", true) -- dragon fireball (projectile) mobs:register_arrow("mobs_mc:dragon_fireball", { @@ -143,7 +140,9 @@ mobs:register_arrow("mobs_mc:dragon_fireball", { -- node hit, explode hit_node = function(self, pos, node) --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 }) diff --git a/mods/ENTITIES/mobs_mc/enderman.lua b/mods/ENTITIES/mobs_mc/enderman.lua index 9ebc3d6fab..0b69857117 100644 --- a/mods/ENTITIES/mobs_mc/enderman.lua +++ b/mods/ENTITIES/mobs_mc/enderman.lua @@ -318,12 +318,12 @@ mobs:register_mob("mobs_mc:enderman", { for n = 1, #objs do local obj = objs[n] if obj then - if minetest.is_player(obj) then + --if minetest.is_player(obj) then -- Warp from players during day. --if (minetest.get_timeofday() * 24000) > 5001 and (minetest.get_timeofday() * 24000) < 19000 then -- self:teleport(nil) --end - else + if not obj:is_player() then local lua = obj:get_luaentity() if lua then if lua.name == "mcl_bows:arrow_entity" or lua.name == "mcl_throwing:snowball_entity" then diff --git a/mods/ENTITIES/mobs_mc/guardian.lua b/mods/ENTITIES/mobs_mc/guardian.lua index 241ac34444..0916010d20 100644 --- a/mods/ENTITIES/mobs_mc/guardian.lua +++ b/mods/ENTITIES/mobs_mc/guardian.lua @@ -13,7 +13,7 @@ mobs:register_mob("mobs_mc:guardian", { xp_min = 10, xp_max = 10, breath_max = -1, - passive = false, + passive = false, attack_type = "punch", pathfinding = 1, view_range = 16, @@ -94,7 +94,6 @@ mobs:register_mob("mobs_mc:guardian", { makes_footstep_sound = false, fly_in = { mobs_mc.items.water_source, mobs_mc.items.river_water_source }, jump = false, - view_range = 16, }) -- Spawning disabled due to size issues diff --git a/mods/ENTITIES/mobs_mc/guardian_elder.lua b/mods/ENTITIES/mobs_mc/guardian_elder.lua index e44796bad6..0c871da7ab 100644 --- a/mods/ENTITIES/mobs_mc/guardian_elder.lua +++ b/mods/ENTITIES/mobs_mc/guardian_elder.lua @@ -104,7 +104,6 @@ mobs:register_mob("mobs_mc:guardian_elder", { makes_footstep_sound = false, fly_in = { mobs_mc.items.water_source, mobs_mc.items.river_water_source }, jump = false, - view_range = 16, }) -- Spawning disabled due to size issues <- what do you mean? -j4i diff --git a/mods/ENTITIES/mobs_mc/horse.lua b/mods/ENTITIES/mobs_mc/horse.lua index 461c60efd6..db23d410b9 100644 --- a/mods/ENTITIES/mobs_mc/horse.lua +++ b/mods/ENTITIES/mobs_mc/horse.lua @@ -38,9 +38,9 @@ end 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" 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" -end +end]] local can_breed = function(entity_id) return entity_id == "mobs_mc:horse" or "mobs_mc:mule" or entity_id == "mobs_mc:donkey" end @@ -314,7 +314,7 @@ local horse = { -- 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 - local inv = clicker:get_inventory() + --local inv = clicker:get_inventory() -- detatch player already riding horse if self.driver and clicker == self.driver then diff --git a/mods/ENTITIES/mobs_mc/iron_golem.lua b/mods/ENTITIES/mobs_mc/iron_golem.lua index 48e573e133..d68dc157b2 100644 --- a/mods/ENTITIES/mobs_mc/iron_golem.lua +++ b/mods/ENTITIES/mobs_mc/iron_golem.lua @@ -18,7 +18,7 @@ mobs:register_mob("mobs_mc:iron_golem", { passive = true, rotate = 270, hp_min = 100, - hp_max = 100, + hp_max = 100, protect = true, neutral = true, breath_max = -1, diff --git a/mods/ENTITIES/mobs_mc/llama.lua b/mods/ENTITIES/mobs_mc/llama.lua index 58f565ec10..9803b582bf 100644 --- a/mods/ENTITIES/mobs_mc/llama.lua +++ b/mods/ENTITIES/mobs_mc/llama.lua @@ -35,7 +35,7 @@ mobs:register_mob("mobs_mc:llama", { shoot_arrow = function(self, pos, dir) -- 2-4 damage per arrow local dmg = 1 - mobs.shoot_projectile_handling("mobs_mc:spit", pos, dir, self.object:get_yaw(), self.object, nil, dmg) + mobs.shoot_projectile_handling("mobs_mc:spit", pos, dir, self.object:get_yaw(), self.object, nil, dmg) end, hp_min = 15, hp_max = 30, @@ -146,7 +146,7 @@ mobs:register_mob("mobs_mc:llama", { self.tamed = true self.owner = clicker:get_player_name() return - end + end --ignore other logic --make baby grow faster @@ -307,19 +307,19 @@ mobs:register_arrow("mobs_mc:spit", { tail_distance_divider = 4, 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" - end + end]] player:punch(self.object, 1.0, { full_punch_interval = 1.0, damage_groups = {fleshy = self._damage}, }, nil) end, - hit_mob = function(self, mob) + hit_mob = function(self, mob) mob:punch(self.object, 1.0, { full_punch_interval = 1.0, - damage_groups = {fleshy = _damage}, + damage_groups = {fleshy = self._damage}, }, nil) end, diff --git a/mods/ENTITIES/mobs_mc/ocelot.lua b/mods/ENTITIES/mobs_mc/ocelot.lua index e36abec771..933d7aad48 100644 --- a/mods/ENTITIES/mobs_mc/ocelot.lua +++ b/mods/ENTITIES/mobs_mc/ocelot.lua @@ -151,7 +151,7 @@ end mobs:register_mob("mobs_mc:cat", cat) -local base_spawn_chance = 5000 +--local base_spawn_chance = 5000 -- Spawn ocelot --they get the same as the llama because I'm trying to rework so much of this code right now -j4i diff --git a/mods/ENTITIES/mobs_mc/parrot.lua b/mods/ENTITIES/mobs_mc/parrot.lua index de52c62523..88ab54ff55 100644 --- a/mods/ENTITIES/mobs_mc/parrot.lua +++ b/mods/ENTITIES/mobs_mc/parrot.lua @@ -44,7 +44,7 @@ mobs:register_mob("mobs_mc:parrot", { max = 2, looting = "common",}, }, - animation = { + animation = { stand_speed = 50, walk_speed = 50, fly_speed = 50, diff --git a/mods/ENTITIES/mobs_mc/pig.lua b/mods/ENTITIES/mobs_mc/pig.lua index d7433a092d..14c9595b62 100644 --- a/mods/ENTITIES/mobs_mc/pig.lua +++ b/mods/ENTITIES/mobs_mc/pig.lua @@ -130,7 +130,7 @@ mobs:register_mob("mobs_mc:pig", { -- Put saddle on pig local item = clicker:get_wielded_item() local wielditem = item - + if item:get_name() == mobs_mc.items.saddle and self.saddle ~= "yes" then self.base_texture = { "blank.png", -- baby @@ -163,7 +163,7 @@ mobs:register_mob("mobs_mc:pig", { end -- Mount or detach player - local name = clicker:get_player_name() + --local name = clicker:get_player_name() if self.driver and clicker == self.driver then -- Detach if already attached mobs.detach(clicker, {x=1, y=0, z=0}) diff --git a/mods/ENTITIES/mobs_mc/sheep.lua b/mods/ENTITIES/mobs_mc/sheep.lua index 1527fd6dac..7e01a14036 100644 --- a/mods/ENTITIES/mobs_mc/sheep.lua +++ b/mods/ENTITIES/mobs_mc/sheep.lua @@ -79,11 +79,11 @@ mobs:register_mob("mobs_mc:sheep", { makes_footstep_sound = true, walk_velocity = 1, run_velocity = 3, - + --head code has_head = true, head_bone = "head", - + swap_y_with_x = false, reverse_head_yaw = false, @@ -150,7 +150,6 @@ mobs:register_mob("mobs_mc:sheep", { do_custom = function(self, dtime) if not self.initial_color_set then local r = math.random(0,100000) - local textures if r <= 81836 then -- 81.836% self.color = "unicolor_white" diff --git a/mods/ENTITIES/mobs_mc/silverfish.lua b/mods/ENTITIES/mobs_mc/silverfish.lua index 148c4c722d..05485bc518 100644 --- a/mods/ENTITIES/mobs_mc/silverfish.lua +++ b/mods/ENTITIES/mobs_mc/silverfish.lua @@ -46,7 +46,6 @@ mobs:register_mob("mobs_mc:silverfish", { view_range = 16, attack_type = "punch", damage = 1, - reach = 1, }) mobs:register_egg("mobs_mc:silverfish", S("Silverfish"), "mobs_mc_spawn_icon_silverfish.png", 0) diff --git a/mods/ENTITIES/mobs_mc/skeleton+stray.lua b/mods/ENTITIES/mobs_mc/skeleton+stray.lua index 37b1fc6ddb..e0aaef2154 100644 --- a/mods/ENTITIES/mobs_mc/skeleton+stray.lua +++ b/mods/ENTITIES/mobs_mc/skeleton+stray.lua @@ -31,12 +31,8 @@ local skeleton = { group_attack = true, visual = "mesh", mesh = "mobs_mc_skeleton.b3d", - textures = { { - "mcl_bows_bow_0.png", -- bow - "mobs_mc_skeleton.png", -- skeleton - } }, - --head code + --head code has_head = false, head_bone = "head", diff --git a/mods/ENTITIES/mobs_mc/vex.lua b/mods/ENTITIES/mobs_mc/vex.lua index c23643cda0..da162e5bff 100644 --- a/mods/ENTITIES/mobs_mc/vex.lua +++ b/mods/ENTITIES/mobs_mc/vex.lua @@ -15,7 +15,7 @@ mobs:register_mob("mobs_mc:vex", { spawn_class = "hostile", pathfinding = 1, passive = false, - attack_type = "punch", + attack_type = "dogfight", physical = false, hp_min = 14, hp_max = 14, @@ -36,7 +36,6 @@ mobs:register_mob("mobs_mc:vex", { view_range = 16, walk_velocity = 3.2, run_velocity = 5.9, - attack_type = "dogfight", sounds = { -- TODO: random death = "mobs_mc_vex_death", diff --git a/mods/ENTITIES/mobs_mc/wither.lua b/mods/ENTITIES/mobs_mc/wither.lua index 7c9072f431..8bd8f53413 100644 --- a/mods/ENTITIES/mobs_mc/wither.lua +++ b/mods/ENTITIES/mobs_mc/wither.lua @@ -26,7 +26,6 @@ mobs:register_mob("mobs_mc:wither", { {"mobs_mc_wither.png"}, }, visual_size = {x=4, y=4}, - makes_footstep_sound = true, view_range = 16, fear_height = 4, walk_velocity = 2, @@ -81,7 +80,7 @@ mobs:register_mob("mobs_mc:wither", { 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", { visual = "sprite", diff --git a/mods/ENTITIES/mobs_mc/wolf.lua b/mods/ENTITIES/mobs_mc/wolf.lua index 89a4b46290..2ce142c33e 100644 --- a/mods/ENTITIES/mobs_mc/wolf.lua +++ b/mods/ENTITIES/mobs_mc/wolf.lua @@ -35,7 +35,7 @@ local wolf = { --head code has_head = false, head_bone = "head", - + swap_y_with_x = false, reverse_head_yaw = false, @@ -186,7 +186,7 @@ dog.on_rightclick = function(self, clicker) if is_food(item:get_name()) then -- Feed to increase health local hp = self.health - local hp_add = 0 + local hp_add -- Use eatable group to determine health boost local eatable = minetest.get_item_group(item, "eatable") if eatable > 0 then