From 519ee63a57304c8414aa782bf86aca5bd77c5be6 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 12 Jul 2017 22:09:37 +0200 Subject: [PATCH] Update mobs_mc --- mods/ENTITIES/mobs_mc/2_throwing.lua | 1 - mods/ENTITIES/mobs_mc/LICENSE-media.md | 2 +- mods/ENTITIES/mobs_mc/cow+mooshroom.lua | 4 ++-- mods/ENTITIES/mobs_mc/creeper.lua | 2 +- mods/ENTITIES/mobs_mc/ender_dragon.lua | 13 ++++++------- mods/ENTITIES/mobs_mc/enderman.lua | 2 +- mods/ENTITIES/mobs_mc/init.lua | 5 +++-- mods/ENTITIES/mobs_mc/llama.lua | 3 +++ mods/ENTITIES/mobs_mc/parrot.lua | 2 ++ mods/ENTITIES/mobs_mc/pig.lua | 5 +---- mods/ENTITIES/mobs_mc/rabbit.lua | 2 +- mods/ENTITIES/mobs_mc/sheep.lua | 2 +- mods/ENTITIES/mobs_mc/silverfish.lua | 2 +- mods/ENTITIES/mobs_mc/squid.lua | 2 +- mods/ENTITIES/mobs_mc/witch.lua | 2 +- mods/ENTITIES/mobs_mc/wither.lua | 15 ++++++++------- 16 files changed, 33 insertions(+), 31 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/2_throwing.lua b/mods/ENTITIES/mobs_mc/2_throwing.lua index 458c60ede..77f3f6cca 100644 --- a/mods/ENTITIES/mobs_mc/2_throwing.lua +++ b/mods/ENTITIES/mobs_mc/2_throwing.lua @@ -114,7 +114,6 @@ local throwing_shoot_arrow = function(itemstack, player) player:get_inventory():remove_item("main", arrow[1]) end local playerpos = player:getpos() - --local obj = minetest.env:add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, arrow[2]) --current local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, arrow[2]) --mc local dir = player:get_look_dir() obj:setvelocity({x=dir.x*22, y=dir.y*22, z=dir.z*22}) diff --git a/mods/ENTITIES/mobs_mc/LICENSE-media.md b/mods/ENTITIES/mobs_mc/LICENSE-media.md index 73b62feb7..5af2ee46b 100644 --- a/mods/ENTITIES/mobs_mc/LICENSE-media.md +++ b/mods/ENTITIES/mobs_mc/LICENSE-media.md @@ -23,7 +23,7 @@ Origin of those models: ## Textures -* Most mob and item textures from [Pixel Perfection](https://www.planetminecraft.com/texture_pack/131pixel-perfection/), a texture pack for Minecraft. +* Mob and item textures from [Pixel Perfection](https://www.planetminecraft.com/texture_pack/131pixel-perfection/), a texture pack for Minecraft. * Author: [XSSheep](https://www.planetminecraft.com/member/xssheep/) * License: CC BY-SA 4.0 * “Spawn egg” textures (`mobs_mc_spawn_icon_*`) by 22i diff --git a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua index dcce43478..83bfd8539 100644 --- a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua +++ b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua @@ -99,7 +99,7 @@ mooshroom_def.on_rightclick = function(self, clicker) local cow = minetest.add_entity(pos, "mobs_mc:cow") cow:setyaw(oldyaw) - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then item:add_wear(mobs_mc.misc.shears_wear) clicker:get_inventory():set_stack("main", clicker:get_wield_index(), item) end @@ -145,6 +145,6 @@ mobs:alias_mob("mobs_animal:cow", "mobs_mc:cow") mobs:register_egg("mobs_mc:cow", S("Cow"), "mobs_mc_spawn_icon_cow.png", 0) mobs:register_egg("mobs_mc:mooshroom", S("Mooshroom"), "mobs_mc_spawn_icon_mooshroom.png", 0) -if minetest.setting_get("log_mods") then +if minetest.settings:get_bool("log_mods") then minetest.log("action", "MC Cow loaded") end diff --git a/mods/ENTITIES/mobs_mc/creeper.lua b/mods/ENTITIES/mobs_mc/creeper.lua index 1e951efee..4e47f0b41 100644 --- a/mods/ENTITIES/mobs_mc/creeper.lua +++ b/mods/ENTITIES/mobs_mc/creeper.lua @@ -40,7 +40,7 @@ mobs:register_mob("mobs_mc:creeper", { attack_type = "explode", explosion_radius = 3, - -- TODO: Disable Mobs Redo fire + explosion_fire = false, -- Force-ignite creeper with flint and steel and explode after 1.5 seconds. -- TODO: Make creeper flash after doing this as well. diff --git a/mods/ENTITIES/mobs_mc/ender_dragon.lua b/mods/ENTITIES/mobs_mc/ender_dragon.lua index c14e46e1d..200804eaa 100644 --- a/mods/ENTITIES/mobs_mc/ender_dragon.lua +++ b/mods/ENTITIES/mobs_mc/ender_dragon.lua @@ -108,7 +108,7 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon2", { local pos = self.object:getpos() - local n = minetest.env:get_node(pos).name + local n = minetest.get_node(pos).name if self.timer == 0 then self.timer = os.time() @@ -118,7 +118,7 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon2", { self.object:remove() end - local objects = minetest.env:get_objects_inside_radius(pos, 1) + local objects = minetest.get_objects_inside_radius(pos, 1) for _,obj in ipairs(objects) do local name = obj:get_entity_name() if name~="mobs_mc:roar_of_the_dragon2" and name ~= "mobs_mc:enderdragon" then @@ -131,13 +131,13 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon2", { end end - minetest.env:set_node(pos, {name="air"}) + minetest.set_node(pos, {name="air"}) if math.random(1,2)==1 then dx = math.random(-1,1) dy = math.random(-1,1) dz = math.random(-1,1) local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} - minetest.env:set_node(p, {name="air"}) + minetest.set_node(p, {name="air"}) end end }) @@ -146,7 +146,7 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon2", { mobs:register_arrow(":mobs_mc:fireball2", { visual = "sprite", visual_size = {x = 1.5, y = 1.5}, - textures = {"fire_basic_flame.png"}, + textures = {"mobs_mc_dragon_fireball.png"}, --textures = {"mobs_skeleton2_front.png^[makealpha:255,255,255 "}, velocity = 6, @@ -171,7 +171,7 @@ mobs:register_arrow(":mobs_mc:fireball2", { -- node hit, bursts into flame hit_node = function(self, pos, node) - mobs:explosion(pos, 3, 1, 1) + mobs:explosion(pos, 3, 0, 1) --from tnt minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 2*64}) @@ -179,4 +179,3 @@ mobs:register_arrow(":mobs_mc:fireball2", { }) mobs:register_egg("mobs_mc:enderdragon", S("Ender Dragon"), "mobs_mc_spawn_icon_dragon.png", 0) - diff --git a/mods/ENTITIES/mobs_mc/enderman.lua b/mods/ENTITIES/mobs_mc/enderman.lua index d2447b793..43bbd615a 100644 --- a/mods/ENTITIES/mobs_mc/enderman.lua +++ b/mods/ENTITIES/mobs_mc/enderman.lua @@ -21,7 +21,7 @@ local place_frequency = 10 mobs:register_mob("mobs_mc:enderman", { type = "monster", runaway = true, - pathfinding = 2, + pathfinding = 1, stepheight = 1.2, hp_min = 40, hp_max = 40, diff --git a/mods/ENTITIES/mobs_mc/init.lua b/mods/ENTITIES/mobs_mc/init.lua index ff2f4405d..63e98704d 100644 --- a/mods/ENTITIES/mobs_mc/init.lua +++ b/mods/ENTITIES/mobs_mc/init.lua @@ -113,5 +113,6 @@ COLISIONBOX in minetest press f5 to see where you are looking at then put these -- -- - -print ("[MOD] Mobs Redo 'MC' loaded") +if minetest.settings:get_bool("log_mods") then + minetest.log("action", "[MOD] Mobs Redo 'MC' loaded") +end diff --git a/mods/ENTITIES/mobs_mc/llama.lua b/mods/ENTITIES/mobs_mc/llama.lua index 1eb49c88f..ac3acebcc 100644 --- a/mods/ENTITIES/mobs_mc/llama.lua +++ b/mods/ENTITIES/mobs_mc/llama.lua @@ -138,6 +138,9 @@ mobs:register_mob("mobs_mc:llama", { }) +--spawn +--mobs:register_spawn("mobs_mc:llama", mobs_mc.spawn.savanna, minetest.LIGHT_MAX+1, 0, 15000, 1, 40) + -- spawn eggs mobs:register_egg("mobs_mc:llama", S("Llama"), "mobs_mc_spawn_icon_llama.png", 0) diff --git a/mods/ENTITIES/mobs_mc/parrot.lua b/mods/ENTITIES/mobs_mc/parrot.lua index 40ff07515..8c1e95ab6 100644 --- a/mods/ENTITIES/mobs_mc/parrot.lua +++ b/mods/ENTITIES/mobs_mc/parrot.lua @@ -88,6 +88,8 @@ mobs:register_mob("mobs_mc:parrot", { --spawn +-- TODO: Increase spawn chance if polished +--mobs:spawn_specific("mobs_mc:parrot", mobs_mc.spawn.jungle, {"air"}, 0, minetest.LIGHT_MAX+1, 20, 20000, 2, 15, 20) -- spawn eggs mobs:register_egg("mobs_mc:parrot", S("Parrot"), "mobs_mc_spawn_icon_parrot.png", 0) diff --git a/mods/ENTITIES/mobs_mc/pig.lua b/mods/ENTITIES/mobs_mc/pig.lua index ffd97a50c..aa4944f9b 100644 --- a/mods/ENTITIES/mobs_mc/pig.lua +++ b/mods/ENTITIES/mobs_mc/pig.lua @@ -177,9 +177,6 @@ mobs:alias_mob("mobs:pig", "mobs_mc:pig") mobs:register_egg("mobs_mc:pig", S("Pig"), "mobs_mc_spawn_icon_pig.png", 0) -if minetest.settings:get("log_mods") then - - - +if minetest.settings:get_bool("log_mods") then minetest.log("action", "MC Pig loaded") end diff --git a/mods/ENTITIES/mobs_mc/rabbit.lua b/mods/ENTITIES/mobs_mc/rabbit.lua index 932cf7f30..b0cbaded8 100644 --- a/mods/ENTITIES/mobs_mc/rabbit.lua +++ b/mods/ENTITIES/mobs_mc/rabbit.lua @@ -169,6 +169,6 @@ mobs:register_egg("mobs_mc:killer_bunny", S("Killer Bunny"), "mobs_mc_spawn_icon -- compatibility mobs:alias_mob("mobs:bunny", "mobs_mc:rabbit") -if minetest.setting_get("log_mods") then +if minetest.settings:get_bool("log_mods") then minetest.log("action", "MC Bunny loaded") end diff --git a/mods/ENTITIES/mobs_mc/sheep.lua b/mods/ENTITIES/mobs_mc/sheep.lua index 3f33b25c4..48176e721 100644 --- a/mods/ENTITIES/mobs_mc/sheep.lua +++ b/mods/ENTITIES/mobs_mc/sheep.lua @@ -85,10 +85,10 @@ mobs:register_mob("mobs_mc:sheep", { replace_what = mobs_mc.replace.sheep, -- Properly regrow wool after eating grass on_replace = function(self, pos, oldnode, newnode) - self.gotten = false if not self.color or not colors[self.color] then self.color = "unicolor_white" end + self.gotten = false self.drops = { {name = mobs_mc.items.mutton_raw, chance = 1, diff --git a/mods/ENTITIES/mobs_mc/silverfish.lua b/mods/ENTITIES/mobs_mc/silverfish.lua index 8fd4d5759..cc1f68297 100644 --- a/mods/ENTITIES/mobs_mc/silverfish.lua +++ b/mods/ENTITIES/mobs_mc/silverfish.lua @@ -49,7 +49,7 @@ mobs:register_egg("mobs_mc:silverfish", S("Silverfish"), "mobs_mc_spawn_icon_sil -- Monster egg blocks (Minetest Game) if minetest.get_modpath("default") and mobs_mc.create_monster_egg_nodes then local spawn_silverfish = function(pos, oldnode, oldmetadata, digger) - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then minetest.add_entity(pos, "mobs_mc:silverfish") end end diff --git a/mods/ENTITIES/mobs_mc/squid.lua b/mods/ENTITIES/mobs_mc/squid.lua index 35ef26ec6..c1b291eb9 100644 --- a/mods/ENTITIES/mobs_mc/squid.lua +++ b/mods/ENTITIES/mobs_mc/squid.lua @@ -60,7 +60,7 @@ mobs:register_mob("mobs_mc:squid", { -- Spawn near the water surface -local water = tonumber(minetest.setting_get("water_level")) or 0 +local water = tonumber(minetest.settings:get("water_level")) or 0 --name, nodes, neighbours, minlight, maxlight, interval, chance, active_object_count, min_height, max_height mobs:spawn_specific("mobs_mc:squid", mobs_mc.spawn.water, {mobs_mc.items.water_source}, 0, minetest.LIGHT_MAX+1, 30, 5500, 3, water-16, water) diff --git a/mods/ENTITIES/mobs_mc/witch.lua b/mods/ENTITIES/mobs_mc/witch.lua index b9862a1e1..ce2f92a65 100644 --- a/mods/ENTITIES/mobs_mc/witch.lua +++ b/mods/ENTITIES/mobs_mc/witch.lua @@ -31,7 +31,7 @@ mobs:register_mob("mobs_mc:witch", { damage = 2, walk_velocity = 1.2, run_velocity = 2.4, - pathfinding = 2, + pathfinding = 1, group_attack = true, attack_type = "dogshoot", arrow = "mobs:potion_arrow", diff --git a/mods/ENTITIES/mobs_mc/wither.lua b/mods/ENTITIES/mobs_mc/wither.lua index 866e66897..eec5488d5 100644 --- a/mods/ENTITIES/mobs_mc/wither.lua +++ b/mods/ENTITIES/mobs_mc/wither.lua @@ -58,7 +58,7 @@ mobs:register_mob("mobs_mc:wither", { light_damage = 0, attack_type = "dogshoot", explosion_radius = 3, - explosion_fire = 0, + explosion_fire = false, dogshoot_stop = true, arrow = "mobs_mc:fireball", reach = 5, @@ -83,7 +83,7 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon", { local pos = self.object:getpos() - local n = minetest.env:get_node(pos).name + local n = minetest.get_node(pos).name if self.timer == 0 then self.timer = os.time() @@ -93,7 +93,7 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon", { self.object:remove() end - local objects = minetest.env:get_objects_inside_radius(pos, 1) + local objects = minetest.get_objects_inside_radius(pos, 1) for _,obj in ipairs(objects) do local name = obj:get_entity_name() if name~="mobs_mc:roar_of_the_dragon" and name ~= "mobs_mc:wither" then @@ -106,13 +106,13 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon", { end end - minetest.env:set_node(pos, {name="air"}) + minetest.set_node(pos, {name="air"}) if math.random(1,2)==1 then dx = math.random(-1,1) dy = math.random(-1,1) dz = math.random(-1,1) local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} - minetest.env:set_node(p, {name="air"}) + minetest.set_node(p, {name="air"}) end end }) @@ -120,8 +120,9 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon", { -- fireball (weapon) mobs:register_arrow(":mobs_mc:fireball", { visual = "sprite", - visual_size = {x = 1.5, y = 1.5}, - textures = {"mobs_skeleton2_front.png^[makealpha:255,255,255 "}, + visual_size = {x = 0.75, y = 0.75}, + -- TODO: 3D projectile, replace tetxture + textures = {"mobs_mc_TEMP_wither_projectile.png"}, velocity = 6, -- direct hit, no fire... just plenty of pain