Rename mobs global to mcl_mobs

This commit is contained in:
Elias Fleckenstein 2022-05-25 14:44:49 +02:00 committed by cora
parent e0f70b54ec
commit ff33794487
48 changed files with 290 additions and 290 deletions

View File

@ -1,7 +1,7 @@
-- API for Mobs Redo: MineClone 2 Edition (MRM)
mobs = {}
mcl_mobs = {}
local MAX_MOB_NAME_LENGTH = 30
local HORNY_TIME = 30
@ -22,7 +22,7 @@ MOB_CAP.water = 15
local S = minetest.get_translator("mcl_mobs")
-- Invisibility mod check
mobs.invis = {}
mcl_mobs.invis = {}
-- localize math functions
local pi = math.pi
@ -76,7 +76,7 @@ local stuck_path_timeout = 10 -- how long will mob follow path before giving up
local node_ice = "mcl_core:ice"
local node_snowblock = "mcl_core:snowblock"
local node_snow = "mcl_core:snow"
mobs.fallback_node = minetest.registered_aliases["mapgen_dirt"] or "mcl_core:dirt"
mcl_mobs.fallback_node = minetest.registered_aliases["mapgen_dirt"] or "mcl_core:dirt"
minetest.register_chatcommand("clearmobs",{
privs={maphack=true},
@ -326,7 +326,7 @@ local set_yaw = function(self, yaw, delay, dtime)
end
-- global function to set mob yaw
function mobs:yaw(self, yaw, delay, dtime)
function mcl_mobs:yaw(self, yaw, delay, dtime)
set_yaw(self, yaw, delay, dtime)
end
@ -397,7 +397,7 @@ end
-- above function exported for mount.lua
function mobs:set_animation(self, anim)
function mcl_mobs:set_animation(self, anim)
set_animation(self, anim)
end
@ -601,7 +601,7 @@ local damage_effect = function(self, damage)
end
end
mobs.death_effect = function(pos, yaw, collisionbox, rotate)
mcl_mobs.death_effect = function(pos, yaw, collisionbox, rotate)
local min, max
if collisionbox then
min = {x=collisionbox[1], y=collisionbox[2], z=collisionbox[3]}
@ -896,7 +896,7 @@ local check_for_death = function(self, cause, cmi_cause)
local yaw = self.object:get_rotation().y
mcl_burning.extinguish(self.object)
self.object:remove()
mobs.death_effect(dpos, yaw, cbox, not self.instant_death)
mcl_mobs.death_effect(dpos, yaw, cbox, not self.instant_death)
end
if length <= 0 then
kill(self)
@ -1008,7 +1008,7 @@ end
-- get node but use fallback for nil or unknown
local node_ok = function(pos, fallback)
fallback = fallback or mobs.fallback_node
fallback = fallback or mcl_mobs.fallback_node
local node = minetest.get_node_or_nil(pos)
@ -1403,7 +1403,7 @@ end
local follow_holding = function(self, clicker)
if self.nofollow then return false end
if mobs.invis[clicker:get_player_name()] then
if mcl_mobs.invis[clicker:get_player_name()] then
return false
end
@ -1551,7 +1551,7 @@ local breed = function(self)
end
end
local child = mobs:spawn_child(pos, parent1.name)
local child = mcl_mobs:spawn_child(pos, parent1.name)
local ent_c = child:get_luaentity()
@ -1787,7 +1787,7 @@ local smart_mobs = function(self, s, p, dist, dtime)
if ndef1 and (ndef1.buildable_to or ndef1.groups.liquid) then
minetest.set_node(s, {name = mobs.fallback_node})
minetest.set_node(s, {name = mcl_mobs.fallback_node})
end
end
@ -1922,7 +1922,7 @@ local monster_attack = function(self)
if objs[n]:is_player() then
if mobs.invis[ objs[n]:get_player_name() ] or (not object_in_range(self, objs[n])) then
if mcl_mobs.invis[ objs[n]:get_player_name() ] or (not object_in_range(self, objs[n])) then
type = ""
else
player = objs[n]
@ -2051,7 +2051,7 @@ local runaway_from = function(self)
if objs[n]:is_player() then
if mobs.invis[ objs[n]:get_player_name() ]
if mcl_mobs.invis[ objs[n]:get_player_name() ]
or self.owner == objs[n]:get_player_name()
or (not object_in_range(self, objs[n])) then
type = ""
@ -2133,7 +2133,7 @@ local follow_flop = function(self)
for n = 1, #players do
if (object_in_range(self, players[n]))
and not mobs.invis[ players[n]:get_player_name() ] then
and not mcl_mobs.invis[ players[n]:get_player_name() ] then
self.following = players[n]
@ -2290,7 +2290,7 @@ local function go_to_pos(entity,b)
if b.x > s.x then yaw = yaw + math.pi end
entity.object:set_yaw(yaw)
set_velocity(entity,entity.follow_velocity)
mobs:set_animation(entity, "walk")
mcl_mobs:set_animation(entity, "walk")
end
local function check_doors(self)
@ -2536,7 +2536,7 @@ local do_states = function(self, dtime)
or not self.attack:get_pos()
or not object_in_range(self, self.attack)
or self.attack:get_hp() <= 0
or (self.attack:is_player() and mobs.invis[ self.attack:get_player_name() ]) then
or (self.attack:is_player() and mcl_mobs.invis[ self.attack:get_player_name() ]) then
self.state = "stand"
set_velocity(self, 0)
@ -2906,7 +2906,7 @@ local plane_adjacents = {
vector.new(0,0,-1),
}
function mobs:gopath(self,target,callback_arrived)
function mcl_mobs:gopath(self,target,callback_arrived)
local p = self.object:get_pos()
local t = vector.offset(target,0,1,0)
local wp = minetest.find_path(p,t,150,1,4)
@ -3280,7 +3280,7 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
and self.state ~= "flop"
and (self.child == false or self.type == "monster")
and hitter:get_player_name() ~= self.owner
and not mobs.invis[ name ] then
and not mcl_mobs.invis[ name ] then
if not die then
-- attack whoever punched mob
@ -3775,7 +3775,7 @@ local do_tnt = function(obj, damage)
end
mobs.spawning_mobs = {}
mcl_mobs.spawning_mobs = {}
-- Code to execute before custom on_rightclick handling
local on_rightclick_prefix = function(self, clicker)
@ -3814,9 +3814,9 @@ local create_mob_on_rightclick = function(on_rightclick)
end
-- register mob entity
function mobs:register_mob(name, def)
function mcl_mobs:register_mob(name, def)
mobs.spawning_mobs[name] = true
mcl_mobs.spawning_mobs[name] = true
local can_despawn
if def.can_despawn ~= nil then
@ -4014,11 +4014,11 @@ if minetest.get_modpath("doc_identifier") ~= nil then
doc.sub.identifier.register_object(name, "basics", "mobs")
end
end -- END mobs:register_mob function
end -- END mcl_mobs:register_mob function
-- register arrow for shoot attack
function mobs:register_arrow(name, def)
function mcl_mobs:register_arrow(name, def)
if not name or not def then return end -- errorcheck
@ -4147,7 +4147,7 @@ end
-- no damage to nodes explosion
function mobs:safe_boom(self, pos, strength)
function mcl_mobs:safe_boom(self, pos, strength)
minetest.sound_play(self.sounds and self.sounds.explode or "tnt_explode", {
pos = pos,
gain = 1.0,
@ -4160,11 +4160,11 @@ end
-- make explosion with protection and tnt mod check
function mobs:boom(self, pos, strength, fire)
function mcl_mobs:boom(self, pos, strength, fire)
if mobs_griefing and not minetest.is_protected(pos, "") then
mcl_explosions.explode(pos, strength, { drop_chance = 1.0, fire = fire }, self.object)
else
mobs:safe_boom(self, pos, strength)
mcl_mobs:safe_boom(self, pos, strength)
end
-- delete the object after it punched the player to avoid nil entities in e.g. mcl_shields!!
@ -4177,7 +4177,7 @@ end
-- Note: This also introduces the “spawn_egg” group:
-- * spawn_egg=1: Spawn egg (generic mob, no metadata)
-- * spawn_egg=2: Spawn egg (captured/tamed mob, metadata)
function mobs:register_egg(mob, desc, background, addegg, no_creative)
function mcl_mobs:register_egg(mob, desc, background, addegg, no_creative)
local grp = {spawn_egg = 1}
@ -4284,19 +4284,19 @@ end
-- No-op in MCL2 (capturing mobs is not possible).
-- Provided for compability with Mobs Redo
function mobs:capture_mob(self, clicker, chance_hand, chance_net, chance_lasso, force_take, replacewith)
function mcl_mobs:capture_mob(self, clicker, chance_hand, chance_net, chance_lasso, force_take, replacewith)
return false
end
-- No-op in MCL2 (protecting mobs is not possible).
function mobs:protect(self, clicker)
function mcl_mobs:protect(self, clicker)
return false
end
-- feeding, taming and breeding (thanks blert2112)
function mobs:feed_tame(self, clicker, feed_count, breed, tame)
function mcl_mobs:feed_tame(self, clicker, feed_count, breed, tame)
if not self.follow then
return false
end
@ -4371,7 +4371,7 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame)
end
-- Spawn a child
function mobs:spawn_child(pos, mob_type)
function mcl_mobs:spawn_child(pos, mob_type)
local child = minetest.add_entity(pos, mob_type)
if not child then
return
@ -4418,7 +4418,7 @@ end
-- compatibility function for old entities to new modpack entities
function mobs:alias_mob(old_name, new_name)
function mcl_mobs:alias_mob(old_name, new_name)
-- spawn egg
minetest.register_alias(old_name, new_name)

View File

@ -12,7 +12,7 @@ local crash_threshold = 6.5 -- ignored if enable_crash=false
local node_ok = function(pos, fallback)
fallback = fallback or mobs.fallback_node
fallback = fallback or mcl_mobs.fallback_node
local node = minetest.get_node_or_nil(pos)
@ -119,7 +119,7 @@ end)
-------------------------------------------------------------------------------
function mobs.attach(entity, player)
function mcl_mobs.attach(entity, player)
local attach_at, eye_offset
@ -162,7 +162,7 @@ function mobs.attach(entity, player)
end
function mobs.detach(player, offset)
function mcl_mobs.detach(player, offset)
force_detach(player)
@ -185,7 +185,7 @@ function mobs.detach(player, offset)
end
function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
function mcl_mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
local rot_view = 0
@ -261,7 +261,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
if entity.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
if stand_anim then
mobs:set_animation(entity, stand_anim)
mcl_mobs:set_animation(entity, stand_anim)
end
return
@ -269,7 +269,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
-- set moving animation
if moving_anim then
mobs:set_animation(entity, moving_anim)
mcl_mobs:set_animation(entity, moving_anim)
end
-- Stop!
@ -388,7 +388,7 @@ end
-- directional flying routine by D00Med (edited by TenPlus1)
function mobs.fly(entity, dtime, speed, shoots, arrow, moving_anim, stand_anim)
function mcl_mobs.fly(entity, dtime, speed, shoots, arrow, moving_anim, stand_anim)
local ctrl = entity.driver:get_player_control()
local velo = entity.object:get_velocity()
@ -440,9 +440,9 @@ function mobs.fly(entity, dtime, speed, shoots, arrow, moving_anim, stand_anim)
-- change animation if stopped
if velo.x == 0 and velo.y == 0 and velo.z == 0 then
mobs:set_animation(entity, stand_anim)
mcl_mobs:set_animation(entity, stand_anim)
else
-- moving animation
mobs:set_animation(entity, moving_anim)
mcl_mobs:set_animation(entity, moving_anim)
end
end

View File

@ -205,7 +205,7 @@ end
-- global functions
function mobs:spawn_abm_check(pos, node, name)
function mcl_mobs:spawn_abm_check(pos, node, name)
-- global function to add additional spawn checks
-- return true to stop spawning mob
end
@ -241,7 +241,7 @@ WARNING: BIOME INTEGRATION NEEDED -> How to get biome through lua??
local spawn_dictionary = {}
local summary_chance = 0
function mobs:spawn_setup(def)
function mcl_mobs:spawn_setup(def)
if not mobs_spawn then return end
if not def then
@ -275,10 +275,10 @@ function mobs:spawn_setup(def)
chance = tonumber(numbers[1]) or chance
aoc = tonumber(numbers[2]) or aoc
if chance == 0 then
minetest.log("warning", string.format("[mobs] %s has spawning disabled", name))
minetest.log("warning", string.format("[mcl_mobs] %s has spawning disabled", name))
return
end
minetest.log("action", string.format("[mobs] Chance setting for %s changed to %s (total: %s)", name, chance, aoc))
minetest.log("action", string.format("[mcl_mobs] Chance setting for %s changed to %s (total: %s)", name, chance, aoc))
end
if chance < 1 then
@ -304,7 +304,7 @@ function mobs:spawn_setup(def)
summary_chance = summary_chance + chance
end
function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_light, max_light, interval, chance, aoc, min_height, max_height, day_toggle, on_spawn)
function mcl_mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_light, max_light, interval, chance, aoc, min_height, max_height, day_toggle, on_spawn)
-- Do mobs spawn at all?
if not mobs_spawn then
@ -320,11 +320,11 @@ function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_ligh
aoc = tonumber(numbers[2]) or aoc
if chance == 0 then
minetest.log("warning", string.format("[mobs] %s has spawning disabled", name))
minetest.log("warning", string.format("[mcl_mobs] %s has spawning disabled", name))
return
end
minetest.log("action", string.format("[mobs] Chance setting for %s changed to %s (total: %s)", name, chance, aoc))
minetest.log("action", string.format("[mcl_mobs] Chance setting for %s changed to %s (total: %s)", name, chance, aoc))
end
--load information into the spawn dictionary

View File

@ -198,7 +198,7 @@ if c("egg") then
local egg_GRAVITY = 9
local egg_VELOCITY = 19
mobs:register_arrow("mobs_mc:egg_entity", {
mcl_mobs:register_arrow("mobs_mc:egg_entity", {
visual = "sprite",
visual_size = {x=.5, y=.5},
textures = {"mobs_chicken_egg.png"},
@ -318,7 +318,7 @@ end
local snowball_GRAVITY = 9
local snowball_VELOCITY = 19
mobs:register_arrow("mobs_mc:snowball_entity", {
mcl_mobs:register_arrow("mobs_mc:snowball_entity", {
visual = "sprite",
visual_size = {x=.5, y=.5},
textures = {"mcl_throwing_snowball.png"},

View File

@ -3,7 +3,7 @@ local function is_forbidden_node(pos, node)
return minetest.get_item_group(node.name, "stair") > 0 or minetest.get_item_group(node.name, "slab") > 0 or minetest.get_item_group(node.name, "carpet") > 0
end
function mobs:spawn_abm_check(pos, node, name)
function mcl_mobs:spawn_abm_check(pos, node, name)
-- Don't spawn monsters on mycelium
if (node.name == "mcl_core:mycelium" or node.name == "mcl_core:mycelium_snow") and minetest.registered_entities[name].type == "monster" then
return true

View File

@ -4,7 +4,7 @@
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:agent", {
mcl_mobs:register_mob("mobs_mc:agent", {
type = "npc",
spawn_class = "passive",
passive = true,
@ -36,4 +36,4 @@ mobs:register_mob("mobs_mc:agent", {
},
})
mobs:register_egg("mobs_mc:agent", S("Agent"), "mobs_mc_spawn_icon_agent.png", 0)
mcl_mobs:register_egg("mobs_mc:agent", S("Agent"), "mobs_mc_spawn_icon_agent.png", 0)

View File

@ -2,7 +2,7 @@
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:bat", {
mcl_mobs:register_mob("mobs_mc:bat", {
description = S("Bat"),
type = "animal",
spawn_class = "ambient",
@ -65,7 +65,7 @@ else
end
-- Spawn on solid blocks at or below Sea level and the selected light level
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:bat",
"overworld",
"ground",
@ -143,4 +143,4 @@ mobs_mc.spawn_height.water-1)
-- spawn eggs
mobs:register_egg("mobs_mc:bat", S("Bat"), "mobs_mc_spawn_icon_bat.png", 0)
mcl_mobs:register_egg("mobs_mc:bat", S("Bat"), "mobs_mc_spawn_icon_bat.png", 0)

View File

@ -12,7 +12,7 @@ local mod_target = minetest.get_modpath("mcl_target")
--###################
mobs:register_mob("mobs_mc:blaze", {
mcl_mobs:register_mob("mobs_mc:blaze", {
description = S("Blaze"),
type = "monster",
spawn_class = "hostile",
@ -131,7 +131,7 @@ mobs:register_mob("mobs_mc:blaze", {
end,
})
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:blaze",
"nether",
"ground",
@ -145,7 +145,7 @@ mobs_mc.spawn_height.nether_min,
mobs_mc.spawn_height.nether_max)
-- Blaze fireball
mobs:register_arrow("mobs_mc:blaze_fireball", {
mcl_mobs:register_arrow("mobs_mc:blaze_fireball", {
visual = "sprite",
visual_size = {x = 0.3, y = 0.3},
textures = {"mcl_fire_fire_charge.png"},
@ -200,4 +200,4 @@ mobs:register_arrow("mobs_mc:blaze_fireball", {
})
-- spawn eggs
mobs:register_egg("mobs_mc:blaze", S("Blaze"), "mobs_mc_spawn_icon_blaze.png", 0)
mcl_mobs:register_egg("mobs_mc:blaze", S("Blaze"), "mobs_mc_spawn_icon_blaze.png", 0)

View File

@ -8,7 +8,7 @@ local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:chicken", {
mcl_mobs:register_mob("mobs_mc:chicken", {
description = S("Chicken"),
type = "animal",
spawn_class = "passive",
@ -69,9 +69,9 @@ mobs:register_mob("mobs_mc:chicken", {
fear_height = 4,
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 1, true, true) then return end
if mobs:protect(self, clicker) then return end
if mobs:capture_mob(self, clicker, 0, 60, 5, false, nil) then return end
if mcl_mobs:feed_tame(self, clicker, 1, true, true) then return end
if mcl_mobs:protect(self, clicker) then return end
if mcl_mobs:capture_mob(self, clicker, 0, 60, 5, false, nil) then return end
end,
do_custom = function(self, dtime)
@ -101,7 +101,7 @@ mobs:register_mob("mobs_mc:chicken", {
})
--spawn
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:chicken",
"overworld",
"ground",
@ -151,4 +151,4 @@ mobs_mc.spawn_height.water,
mobs_mc.spawn_height.overworld_max)
-- spawn eggs
mobs:register_egg("mobs_mc:chicken", S("Chicken"), "mobs_mc_spawn_icon_chicken.png", 0)
mcl_mobs:register_egg("mobs_mc:chicken", S("Chicken"), "mobs_mc_spawn_icon_chicken.png", 0)

View File

@ -49,8 +49,8 @@ local cow_def = {
},
follow = mobs_mc.follow.cow,
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 1, true, true) then return end
if mobs:protect(self, clicker) then return end
if mcl_mobs:feed_tame(self, clicker, 1, true, true) then return end
if mcl_mobs:protect(self, clicker) then return end
if self.child then
return
@ -71,14 +71,14 @@ local cow_def = {
end
return
end
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
mcl_mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
end,
follow = mobs_mc.items.wheat,
view_range = 10,
fear_height = 4,
}
mobs:register_mob("mobs_mc:cow", cow_def)
mcl_mobs:register_mob("mobs_mc:cow", cow_def)
-- Mooshroom
local mooshroom_def = table.copy(cow_def)
@ -86,8 +86,8 @@ mooshroom_def.description = S("Mooshroom")
mooshroom_def.mesh = "mobs_mc_cow.b3d"
mooshroom_def.textures = { {"mobs_mc_mooshroom.png", "mobs_mc_mushroom_red.png"}, {"mobs_mc_mooshroom_brown.png", "mobs_mc_mushroom_brown.png" } }
mooshroom_def.on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 1, true, true) then return end
if mobs:protect(self, clicker) then return end
if mcl_mobs:feed_tame(self, clicker, 1, true, true) then return end
if mcl_mobs:protect(self, clicker) then return end
if self.child then
return
@ -140,13 +140,13 @@ mooshroom_def.on_rightclick = function(self, clicker)
minetest.add_item(pos, {name = mobs_mc.items.mushroom_stew})
end
end
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
mcl_mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
end
mobs:register_mob("mobs_mc:mooshroom", mooshroom_def)
mcl_mobs:register_mob("mobs_mc:mooshroom", mooshroom_def)
-- Spawning
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:cow",
"overworld",
"ground",
@ -198,7 +198,7 @@ mobs_mc.spawn_height.overworld_max)
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:mooshroom",
"overworld",
"ground",
@ -215,5 +215,5 @@ mobs_mc.spawn_height.overworld_min,
mobs_mc.spawn_height.overworld_max)
-- spawn egg
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)
mcl_mobs:register_egg("mobs_mc:cow", S("Cow"), "mobs_mc_spawn_icon_cow.png", 0)
mcl_mobs:register_egg("mobs_mc:mooshroom", S("Mooshroom"), "mobs_mc_spawn_icon_mooshroom.png", 0)

View File

@ -9,7 +9,7 @@ local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:creeper", {
mcl_mobs:register_mob("mobs_mc:creeper", {
type = "monster",
spawn_class = "hostile",
hp_min = 20,
@ -77,7 +77,7 @@ mobs:register_mob("mobs_mc:creeper", {
if self._forced_explosion_countdown_timer ~= nil then
self._forced_explosion_countdown_timer = self._forced_explosion_countdown_timer - dtime
if self._forced_explosion_countdown_timer <= 0 then
mobs:boom(self, mcl_util.get_object_center(self.object), self.explosion_strength)
mcl_mobs:boom(self, mcl_util.get_object_center(self.object), self.explosion_strength)
end
end
end,
@ -129,7 +129,7 @@ mobs:register_mob("mobs_mc:creeper", {
view_range = 16,
})
mobs:register_mob("mobs_mc:creeper_charged", {
mcl_mobs:register_mob("mobs_mc:creeper_charged", {
description = S("Creeper"),
type = "monster",
spawn_class = "hostile",
@ -199,7 +199,7 @@ mobs:register_mob("mobs_mc:creeper_charged", {
if self._forced_explosion_countdown_timer ~= nil then
self._forced_explosion_countdown_timer = self._forced_explosion_countdown_timer - dtime
if self._forced_explosion_countdown_timer <= 0 then
mobs:boom(self, mcl_util.get_object_center(self.object), self.explosion_strength)
mcl_mobs:boom(self, mcl_util.get_object_center(self.object), self.explosion_strength)
end
end
end,
@ -254,7 +254,7 @@ mobs:register_mob("mobs_mc:creeper_charged", {
glow = 3,
})
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:creeper",
"overworld",
"ground",
@ -408,4 +408,4 @@ mobs_mc.spawn_height.overworld_min,
mobs_mc.spawn_height.overworld_max)
-- spawn eggs
mobs:register_egg("mobs_mc:creeper", S("Creeper"), "mobs_mc_spawn_icon_creeper.png", 0)
mcl_mobs:register_egg("mobs_mc:creeper", S("Creeper"), "mobs_mc_spawn_icon_creeper.png", 0)

View File

@ -4,7 +4,7 @@
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:enderdragon", {
mcl_mobs:register_mob("mobs_mc:enderdragon", {
description = S("Ender Dragon"),
type = "monster",
spawn_class = "hostile",
@ -109,7 +109,7 @@ mobs:register_mob("mobs_mc:enderdragon", {
local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false
-- dragon fireball (projectile)
mobs:register_arrow("mobs_mc:dragon_fireball", {
mcl_mobs:register_arrow("mobs_mc:dragon_fireball", {
visual = "sprite",
visual_size = {x = 1.25, y = 1.25},
textures = {"mobs_mc_dragon_fireball.png"},
@ -133,10 +133,10 @@ mobs:register_arrow("mobs_mc:dragon_fireball", {
-- node hit, explode
hit_node = function(self, pos, node)
mobs:boom(self, pos, 2)
mcl_mobs:boom(self, pos, 2)
end
})
mobs:register_egg("mobs_mc:enderdragon", S("Ender Dragon"), "mobs_mc_spawn_icon_dragon.png", 0, true)
mcl_mobs:register_egg("mobs_mc:enderdragon", S("Ender Dragon"), "mobs_mc_spawn_icon_dragon.png", 0, true)
mcl_wip.register_wip_item("mobs_mc:enderdragon")

View File

@ -189,7 +189,7 @@ end
local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false
mobs:register_mob("mobs_mc:enderman", {
mcl_mobs:register_mob("mobs_mc:enderman", {
description = S("Enderman"),
type = "monster",
spawn_class = "passive",
@ -431,7 +431,7 @@ mobs:register_mob("mobs_mc:enderman", {
self.base_texture = create_enderman_textures(block_type, self._taken_node)
self.object:set_properties({ textures = self.base_texture })
self.animation = select_enderman_animation("block")
mobs:set_animation(self, self.animation.current)
mcl_mobs:set_animation(self, self.animation.current)
if def.sounds and def.sounds.dug then
minetest.sound_play(def.sounds.dug, {pos = take_pos, max_hear_distance = 16}, true)
end
@ -454,7 +454,7 @@ mobs:register_mob("mobs_mc:enderman", {
local def = minetest.registered_nodes[self._taken_node]
-- Update animation accordingly (removes visible block)
self.animation = select_enderman_animation("normal")
mobs:set_animation(self, self.animation.current)
mcl_mobs:set_animation(self, self.animation.current)
if def.sounds and def.sounds.place then
minetest.sound_play(def.sounds.place, {pos = place_pos, max_hear_distance = 16}, true)
end
@ -565,7 +565,7 @@ mobs:register_mob("mobs_mc:enderman", {
-- End spawn
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:enderman",
"end",
"ground",
@ -580,7 +580,7 @@ minetest.LIGHT_MAX+1,
mobs_mc.spawn_height.end_min,
mobs_mc.spawn_height.end_max)
-- Overworld spawn
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:enderman",
"overworld",
"ground",
@ -734,7 +734,7 @@ mobs_mc.spawn_height.overworld_min,
mobs_mc.spawn_height.overworld_max)
-- Nether spawn (rare)
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:enderman",
"nether",
"ground",
@ -750,4 +750,4 @@ mobs_mc.spawn_height.nether_min,
mobs_mc.spawn_height.nether_max)
-- spawn eggs
mobs:register_egg("mobs_mc:enderman", S("Enderman"), "mobs_mc_spawn_icon_enderman.png", 0)
mcl_mobs:register_egg("mobs_mc:enderman", S("Enderman"), "mobs_mc_spawn_icon_enderman.png", 0)

View File

@ -4,7 +4,7 @@
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:endermite", {
mcl_mobs:register_mob("mobs_mc:endermite", {
description = S("Endermite"),
type = "monster",
spawn_class = "hostile",
@ -38,4 +38,4 @@ mobs:register_mob("mobs_mc:endermite", {
reach = 1,
})
mobs:register_egg("mobs_mc:endermite", S("Endermite"), "mobs_mc_spawn_icon_endermite.png", 0)
mcl_mobs:register_egg("mobs_mc:endermite", S("Endermite"), "mobs_mc_spawn_icon_endermite.png", 0)

View File

@ -10,7 +10,7 @@ local S = minetest.get_translator("mobs_mc")
--###################
mobs:register_mob("mobs_mc:ghast", {
mcl_mobs:register_mob("mobs_mc:ghast", {
description = S("Ghast"),
type = "monster",
spawn_class = "hostile",
@ -76,7 +76,7 @@ mobs:register_mob("mobs_mc:ghast", {
})
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:ghast",
"nether",
"ground",
@ -92,7 +92,7 @@ mobs_mc.spawn_height.nether_min,
mobs_mc.spawn_height.nether_max)
-- fireball (projectile)
mobs:register_arrow("mobs_mc:fireball", {
mcl_mobs:register_arrow("mobs_mc:fireball", {
visual = "sprite",
visual_size = {x = 1, y = 1},
textures = {"mcl_fire_fire_charge.png"},
@ -105,7 +105,7 @@ mobs:register_arrow("mobs_mc:fireball", {
full_punch_interval = 1.0,
damage_groups = {fleshy = 6},
}, nil)
mobs:boom(self, self.object:get_pos(), 1, true)
mcl_mobs:boom(self, self.object:get_pos(), 1, true)
end,
hit_mob = function(self, mob)
@ -113,11 +113,11 @@ mobs:register_arrow("mobs_mc:fireball", {
full_punch_interval = 1.0,
damage_groups = {fleshy = 6},
}, nil)
mobs:boom(self, self.object:get_pos(), 1, true)
mcl_mobs:boom(self, self.object:get_pos(), 1, true)
end,
hit_node = function(self, pos, node)
mobs:boom(self, pos, 1, true)
mcl_mobs:boom(self, pos, 1, true)
end
})
@ -125,4 +125,4 @@ mobs:register_arrow("mobs_mc:fireball", {
-- spawn eggs
mobs:register_egg("mobs_mc:ghast", S("Ghast"), "mobs_mc_spawn_icon_ghast.png", 0)
mcl_mobs:register_egg("mobs_mc:ghast", S("Ghast"), "mobs_mc_spawn_icon_ghast.png", 0)

View File

@ -4,7 +4,7 @@
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:guardian", {
mcl_mobs:register_mob("mobs_mc:guardian", {
description = S("Guardian"),
type = "monster",
spawn_class = "hostile",
@ -99,7 +99,7 @@ mobs:register_mob("mobs_mc:guardian", {
-- Spawning disabled due to size issues
-- TODO: Re-enable spawning
--mobs:spawn_specific("mobs_mc:guardian", mobs_mc.spawn.water, mobs_mc.spawn_water, 0, minetest.LIGHT_MAX+1, 30, 25000, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.water - 10)
--mcl_mobs:spawn_specific("mobs_mc:guardian", mobs_mc.spawn.water, mobs_mc.spawn_water, 0, minetest.LIGHT_MAX+1, 30, 25000, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.water - 10)
-- spawn eggs
mobs:register_egg("mobs_mc:guardian", S("Guardian"), "mobs_mc_spawn_icon_guardian.png", 0)
mcl_mobs:register_egg("mobs_mc:guardian", S("Guardian"), "mobs_mc_spawn_icon_guardian.png", 0)

View File

@ -6,7 +6,7 @@
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:guardian_elder", {
mcl_mobs:register_mob("mobs_mc:guardian_elder", {
description = S("Elder Guardian"),
type = "monster",
spawn_class = "hostile",
@ -109,8 +109,8 @@ mobs:register_mob("mobs_mc:guardian_elder", {
-- Spawning disabled due to size issues <- what do you mean? -j4i
-- TODO: Re-enable spawning
-- mobs:spawn_specific("mobs_mc:guardian_elder", mobs_mc.spawn.water, mobs_mc.spawn_water, 0, minetest.LIGHT_MAX+1, 30, 40000, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.water-18)
-- mcl_mobs:spawn_specific("mobs_mc:guardian_elder", mobs_mc.spawn.water, mobs_mc.spawn_water, 0, minetest.LIGHT_MAX+1, 30, 40000, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.water-18)
-- spawn eggs
mobs:register_egg("mobs_mc:guardian_elder", S("Elder Guardian"), "mobs_mc_spawn_icon_guardian_elder.png", 0)
mcl_mobs:register_egg("mobs_mc:guardian_elder", S("Elder Guardian"), "mobs_mc_spawn_icon_guardian_elder.png", 0)

View File

@ -161,7 +161,7 @@ local horse = {
-- Some weird human is riding. Buck them off?
if self.driver and not self.tamed and self.buck_off_time <= 0 then
if math.random() < 0.2 then
mobs.detach(self.driver, {x = 1, y = 0, z = 1})
mcl_mobs.detach(self.driver, {x = 1, y = 0, z = 1})
-- TODO bucking animation
else
-- Nah, can't be bothered. Think about it again in one second
@ -182,7 +182,7 @@ local horse = {
-- if driver present and horse has a saddle allow control of horse
if self.driver and self._saddle then
mobs.drive(self, "walk", "stand", false, dtime)
mcl_mobs.drive(self, "walk", "stand", false, dtime)
return false -- skip rest of mob functions
end
@ -198,7 +198,7 @@ local horse = {
end
-- also detach from horse properly
if self.driver then
mobs.detach(self.driver, {x = 1, y = 0, z = 1})
mcl_mobs.detach(self.driver, {x = 1, y = 0, z = 1})
end
end,
@ -235,7 +235,7 @@ local horse = {
-- Trying to ride
elseif not self.driver then
self.object:set_properties({stepheight = 1.1})
mobs.attach(self, clicker)
mcl_mobs.attach(self, clicker)
self.buck_off_time = 40 -- TODO how long does it take in minecraft?
if self.temper > 100 then
self.tamed = true -- NOTE taming can only be finished by riding the horse
@ -247,7 +247,7 @@ local horse = {
-- Clicking on the horse while riding ==> unmount
elseif self.driver and self.driver == clicker then
mobs.detach(clicker, {x = 1, y = 0, z = 1})
mcl_mobs.detach(clicker, {x = 1, y = 0, z = 1})
end
-- If nothing happened temper_increase = 0 and addition does nothing
@ -263,7 +263,7 @@ local horse = {
elseif (iname == mobs_mc.items.golden_carrot) then
heal = 4
end
if heal > 0 and mobs:feed_tame(self, clicker, heal, true, false) then
if heal > 0 and mcl_mobs:feed_tame(self, clicker, heal, true, false) then
return
end
end
@ -278,11 +278,11 @@ local horse = {
elseif (iname == mobs_mc.items.hay_bale) then
heal = 20
end
if heal > 0 and mobs:feed_tame(self, clicker, heal, false, false) then
if heal > 0 and mcl_mobs:feed_tame(self, clicker, heal, false, false) then
return
end
if mobs:protect(self, clicker) then
if mcl_mobs:protect(self, clicker) then
return
end
@ -294,7 +294,7 @@ local horse = {
-- detatch player already riding horse
if self.driver and clicker == self.driver then
mobs.detach(clicker, {x = 1, y = 0, z = 1})
mcl_mobs.detach(clicker, {x = 1, y = 0, z = 1})
-- Put on saddle if tamed
elseif not self.driver and not self._saddle
@ -355,18 +355,18 @@ local horse = {
elseif not self.driver and self._saddle then
self.object:set_properties({stepheight = 1.1})
mobs.attach(self, clicker)
mcl_mobs.attach(self, clicker)
-- Used to capture horse
elseif not self.driver and iname ~= "" then
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
mcl_mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
end
end
end,
on_breed = function(parent1, parent2)
local pos = parent1.object:get_pos()
local child = mobs:spawn_child(pos, parent1.name)
local child = mcl_mobs:spawn_child(pos, parent1.name)
if child then
local ent_c = child:get_luaentity()
local p = math.random(1, 2)
@ -415,7 +415,7 @@ local horse = {
end,
}
mobs:register_mob("mobs_mc:horse", horse)
mcl_mobs:register_mob("mobs_mc:horse", horse)
-- Skeleton horse
local skeleton_horse = table.copy(horse)
@ -438,7 +438,7 @@ skeleton_horse.sounds = {
distance = 16,
}
skeleton_horse.harmed_by_heal = true
mobs:register_mob("mobs_mc:skeleton_horse", skeleton_horse)
mcl_mobs:register_mob("mobs_mc:skeleton_horse", skeleton_horse)
-- Zombie horse
local zombie_horse = table.copy(horse)
@ -462,7 +462,7 @@ zombie_horse.sounds = {
distance = 16,
}
zombie_horse.harmed_by_heal = true
mobs:register_mob("mobs_mc:zombie_horse", zombie_horse)
mcl_mobs:register_mob("mobs_mc:zombie_horse", zombie_horse)
-- Donkey
local d = 0.86 -- donkey scale
@ -493,7 +493,7 @@ donkey.collisionbox = {
donkey.jump = true
donkey.jump_height = 3.75 -- can clear 1 block height
mobs:register_mob("mobs_mc:donkey", donkey)
mcl_mobs:register_mob("mobs_mc:donkey", donkey)
-- Mule
local m = 0.94
@ -511,11 +511,11 @@ mule.collisionbox = {
horse.collisionbox[5] * m,
horse.collisionbox[6] * m,
}
mobs:register_mob("mobs_mc:mule", mule)
mcl_mobs:register_mob("mobs_mc:mule", mule)
--===========================
--Spawn Function
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:horse",
"overworld",
"ground",
@ -566,7 +566,7 @@ mobs_mc.spawn_height.water+3,
mobs_mc.spawn_height.overworld_max)
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:donkey",
"overworld",
"ground",
@ -587,8 +587,8 @@ mobs_mc.spawn_height.water+3,
mobs_mc.spawn_height.overworld_max)
-- spawn eggs
mobs:register_egg("mobs_mc:horse", S("Horse"), "mobs_mc_spawn_icon_horse.png", 0)
mobs:register_egg("mobs_mc:skeleton_horse", S("Skeleton Horse"), "mobs_mc_spawn_icon_horse_skeleton.png", 0)
mcl_mobs:register_egg("mobs_mc:horse", S("Horse"), "mobs_mc_spawn_icon_horse.png", 0)
mcl_mobs:register_egg("mobs_mc:skeleton_horse", S("Skeleton Horse"), "mobs_mc_spawn_icon_horse_skeleton.png", 0)
--mobs:register_egg("mobs_mc:zombie_horse", S("Zombie Horse"), "mobs_mc_spawn_icon_horse_zombie.png", 0)
mobs:register_egg("mobs_mc:donkey", S("Donkey"), "mobs_mc_spawn_icon_donkey.png", 0)
mobs:register_egg("mobs_mc:mule", S("Mule"), "mobs_mc_spawn_icon_mule.png", 0)
mcl_mobs:register_egg("mobs_mc:donkey", S("Donkey"), "mobs_mc_spawn_icon_donkey.png", 0)
mcl_mobs:register_egg("mobs_mc:mule", S("Mule"), "mobs_mc_spawn_icon_mule.png", 0)

View File

@ -11,7 +11,7 @@ local S = minetest.get_translator("mobs_mc")
local etime = 0
mobs:register_mob("mobs_mc:iron_golem", {
mcl_mobs:register_mob("mobs_mc:iron_golem", {
description = S("Iron Golem"),
type = "npc",
spawn_class = "passive",
@ -84,7 +84,7 @@ mobs:register_mob("mobs_mc:iron_golem", {
etime = etime + dtime
if etime > 10 then
if self._home and vector.distance(self._home,self.object:get_pos()) > 50 then
mobs:gopath(self,self._home)
mcl_mobs:gopath(self,self._home)
end
end
end,
@ -92,7 +92,7 @@ mobs:register_mob("mobs_mc:iron_golem", {
-- spawn eggs
mobs:register_egg("mobs_mc:iron_golem", S("Iron Golem"), "mobs_mc_spawn_icon_iron_golem.png", 0)
mcl_mobs:register_egg("mobs_mc:iron_golem", S("Iron Golem"), "mobs_mc_spawn_icon_iron_golem.png", 0)
--[[ This is to be called when a pumpkin or jack'o lantern has been placed. Recommended: In the on_construct function of the node.

View File

@ -24,7 +24,7 @@ local carpets = {
unicolor_light_blue = { "mcl_wool:light_blue_carpet", "light_blue" },
}
mobs:register_mob("mobs_mc:llama", {
mcl_mobs:register_mob("mobs_mc:llama", {
description = S("Llama"),
type = "animal",
spawn_class = "passive",
@ -101,7 +101,7 @@ mobs:register_mob("mobs_mc:llama", {
-- if driver present allow control of llama
if self.driver then
mobs.drive(self, "walk", "stand", false, dtime)
mcl_mobs.drive(self, "walk", "stand", false, dtime)
return false -- skip rest of mob functions
end
@ -113,7 +113,7 @@ mobs:register_mob("mobs_mc:llama", {
-- detach from llama properly
if self.driver then
mobs.detach(self.driver, {x = 1, y = 0, z = 1})
mcl_mobs.detach(self.driver, {x = 1, y = 0, z = 1})
end
end,
@ -128,12 +128,12 @@ mobs:register_mob("mobs_mc:llama", {
local item = clicker:get_wielded_item()
if item:get_name() == mobs_mc.items.hay_bale then
-- Breed with hay bale
if mobs:feed_tame(self, clicker, 1, true, false) then return end
if mcl_mobs:feed_tame(self, clicker, 1, true, false) then return end
else
-- Feed with anything else
if mobs:feed_tame(self, clicker, 1, false, true) then return end
if mcl_mobs:feed_tame(self, clicker, 1, false, true) then return end
end
if mobs:protect(self, clicker) then return end
if mcl_mobs:protect(self, clicker) then return end
-- Make sure tamed llama is mature and being clicked by owner only
if self.tamed and not self.child and self.owner == clicker:get_player_name() then
@ -172,18 +172,18 @@ mobs:register_mob("mobs_mc:llama", {
-- detatch player already riding llama
if self.driver and clicker == self.driver then
mobs.detach(clicker, {x = 1, y = 0, z = 1})
mcl_mobs.detach(clicker, {x = 1, y = 0, z = 1})
-- attach player to llama
elseif not self.driver then
self.object:set_properties({stepheight = 1.1})
mobs.attach(self, clicker)
mcl_mobs.attach(self, clicker)
end
-- Used to capture llama
elseif not self.driver and clicker:get_wielded_item():get_name() ~= "" then
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
mcl_mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
end
end,
@ -196,7 +196,7 @@ mobs:register_mob("mobs_mc:llama", {
else
parent = parent2
end
child = mobs:spawn_child(pos, parent.name)
child = mcl_mobs:spawn_child(pos, parent.name)
if child then
local ent_c = child:get_luaentity()
ent_c.base_texture = table.copy(ent_c.base_texture)
@ -212,7 +212,7 @@ mobs:register_mob("mobs_mc:llama", {
})
--spawn
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:llama",
"overworld",
"ground",
@ -239,4 +239,4 @@ mobs_mc.spawn_height.water+15,
mobs_mc.spawn_height.overworld_max)
-- spawn eggs
mobs:register_egg("mobs_mc:llama", S("Llama"), "mobs_mc_spawn_icon_llama.png", 0)
mcl_mobs:register_egg("mobs_mc:llama", S("Llama"), "mobs_mc_spawn_icon_llama.png", 0)

View File

@ -99,7 +99,7 @@ local ocelot = {
end,
}
mobs:register_mob("mobs_mc:ocelot", ocelot)
mcl_mobs:register_mob("mobs_mc:ocelot", ocelot)
-- Cat
local cat = table.copy(ocelot)
@ -122,9 +122,9 @@ cat.sounds = {
distance = 16,
}
cat.on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 1, true, false) then return end
if mobs:capture_mob(self, clicker, 0, 60, 5, false, nil) then return end
if mobs:protect(self, clicker) then return end
if mcl_mobs:feed_tame(self, clicker, 1, true, false) then return end
if mcl_mobs:capture_mob(self, clicker, 0, 60, 5, false, nil) then return end
if mcl_mobs:protect(self, clicker) then return end
if self.child then return end
@ -149,13 +149,13 @@ cat.on_rightclick = function(self, clicker)
end
mobs:register_mob("mobs_mc:cat", cat)
mcl_mobs:register_mob("mobs_mc:cat", cat)
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
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:ocelot",
"overworld",
"ground",
@ -232,4 +232,4 @@ mobs:spawn({
-- spawn eggs
-- FIXME: The spawn icon shows a cat texture, not an ocelot texture
mobs:register_egg("mobs_mc:ocelot", S("Ocelot"), "mobs_mc_spawn_icon_cat.png", 0)
mcl_mobs:register_egg("mobs_mc:ocelot", S("Ocelot"), "mobs_mc_spawn_icon_cat.png", 0)

View File

@ -11,7 +11,7 @@ local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:parrot", {
mcl_mobs:register_mob("mobs_mc:parrot", {
description = S("Parrot"),
type = "npc",
spawn_class = "passive",
@ -84,15 +84,15 @@ mobs:register_mob("mobs_mc:parrot", {
end
-- Feed to tame, but not breed
if mobs:feed_tame(self, clicker, 1, false, true) then return end
if mobs:protect(self, clicker) then return end
if mobs:capture_mob(self, clicker, 0, 50, 80, false, nil) then return end
if mcl_mobs:feed_tame(self, clicker, 1, false, true) then return end
if mcl_mobs:protect(self, clicker) then return end
if mcl_mobs:capture_mob(self, clicker, 0, 50, 80, false, nil) then return end
end,
})
-- Parrots spawn rarely in jungles. TODO: Also check for jungle *biome* <- I'll get to this eventually -j4i
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:parrot",
"overworld",
"ground",
@ -111,4 +111,4 @@ mobs_mc.spawn_height.water+7,
mobs_mc.spawn_height.overworld_max)
-- spawn eggs
mobs:register_egg("mobs_mc:parrot", S("Parrot"), "mobs_mc_spawn_icon_parrot.png", 0)
mcl_mobs:register_egg("mobs_mc:parrot", S("Parrot"), "mobs_mc_spawn_icon_parrot.png", 0)

View File

@ -2,7 +2,7 @@
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:pig", {
mcl_mobs:register_mob("mobs_mc:pig", {
description = S("Pig"),
type = "animal",
spawn_class = "passive",
@ -69,7 +69,7 @@ mobs:register_mob("mobs_mc:pig", {
-- if driver present allow control of horse
if self.driver then
mobs.drive(self, "walk", "stand", false, dtime)
mcl_mobs.drive(self, "walk", "stand", false, dtime)
return false -- skip rest of mob functions
end
@ -82,7 +82,7 @@ mobs:register_mob("mobs_mc:pig", {
-- drop saddle when horse is killed while riding
-- also detach from horse properly
if self.driver then
mobs.detach(self.driver, {x = 1, y = 0, z = 1})
mcl_mobs.detach(self.driver, {x = 1, y = 0, z = 1})
end
end,
@ -94,9 +94,9 @@ mobs:register_mob("mobs_mc:pig", {
local wielditem = clicker:get_wielded_item()
-- Feed pig
if wielditem:get_name() ~= mobs_mc.items.carrot_on_a_stick then
if mobs:feed_tame(self, clicker, 1, true, true) then return end
if mcl_mobs:feed_tame(self, clicker, 1, true, true) then return end
end
if mobs:protect(self, clicker) then return end
if mcl_mobs:protect(self, clicker) then return end
if self.child then
return
@ -139,13 +139,13 @@ mobs:register_mob("mobs_mc:pig", {
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})
mcl_mobs.detach(clicker, {x=1, y=0, z=0})
return
elseif not self.driver and self.saddle == "yes" and wielditem:get_name() == mobs_mc.items.carrot_on_a_stick then
-- Ride pig if it has a saddle and player uses a carrot on a stick
mobs.attach(self, clicker)
mcl_mobs.attach(self, clicker)
if not minetest.is_creative_enabled(clicker:get_player_name()) then
@ -167,13 +167,13 @@ mobs:register_mob("mobs_mc:pig", {
-- Capture pig
elseif not self.driver and clicker:get_wielded_item():get_name() ~= "" then
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
mcl_mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
end
end,
on_breed = function(parent1, parent2)
local pos = parent1.object:get_pos()
local child = mobs:spawn_child(pos, parent1.name)
local child = mcl_mobs:spawn_child(pos, parent1.name)
if child then
local ent_c = child:get_luaentity()
ent_c.tamed = true
@ -183,7 +183,7 @@ mobs:register_mob("mobs_mc:pig", {
end,
})
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:pig",
"overworld",
"ground",
@ -234,4 +234,4 @@ mobs_mc.spawn_height.overworld_min,
mobs_mc.spawn_height.overworld_max)
-- spawn eggs
mobs:register_egg("mobs_mc:pig", S("Pig"), "mobs_mc_spawn_icon_pig.png", 0)
mcl_mobs:register_egg("mobs_mc:pig", S("Pig"), "mobs_mc_spawn_icon_pig.png", 0)

View File

@ -7,7 +7,7 @@ local S = minetest.get_translator("mobs_mc")
--###################
mobs:register_mob("mobs_mc:polar_bear", {
mcl_mobs:register_mob("mobs_mc:polar_bear", {
description = S("Polar Bear"),
type = "animal",
spawn_class = "passive",
@ -68,7 +68,7 @@ mobs:register_mob("mobs_mc:polar_bear", {
})
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:polar_bear",
"overworld",
"ground",
@ -87,4 +87,4 @@ mobs_mc.spawn_height.overworld_min,
mobs_mc.spawn_height.overworld_max)
-- spawn egg
mobs:register_egg("mobs_mc:polar_bear", S("Polar Bear"), "mobs_mc_spawn_icon_polarbear.png", 0)
mcl_mobs:register_egg("mobs_mc:polar_bear", S("Polar Bear"), "mobs_mc_spawn_icon_polarbear.png", 0)

View File

@ -61,9 +61,9 @@ local rabbit = {
replace_what = mobs_mc.replace.rabbit,
on_rightclick = function(self, clicker)
-- Feed, tame protect or capture
if mobs:feed_tame(self, clicker, 1, true, true) then return end
if mobs:protect(self, clicker) then return end
if mobs:capture_mob(self, clicker, 0, 50, 80, false, nil) then return end
if mcl_mobs:feed_tame(self, clicker, 1, true, true) then return end
if mcl_mobs:protect(self, clicker) then return end
if mcl_mobs:capture_mob(self, clicker, 0, 50, 80, false, nil) then return end
end,
do_custom = function(self)
-- Easter egg: Change texture if rabbit is named “Toast”
@ -80,7 +80,7 @@ local rabbit = {
end,
}
mobs:register_mob("mobs_mc:rabbit", rabbit)
mcl_mobs:register_mob("mobs_mc:rabbit", rabbit)
-- The killer bunny (Only with spawn egg)
local killer_bunny = table.copy(rabbit)
@ -106,12 +106,12 @@ killer_bunny.do_custom = function(self)
end
end
mobs:register_mob("mobs_mc:killer_bunny", killer_bunny)
mcl_mobs:register_mob("mobs_mc:killer_bunny", killer_bunny)
-- Mob spawning rules.
-- Different skins depending on spawn location <- we'll get to this when the spawning algorithm is fleshed out
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:rabbit",
"overworld",
"ground",
@ -159,7 +159,7 @@ spawn_desert.on_spawn = function(self, pos)
self.base_texture = { "mobs_mc_rabbit_gold.png" }
self.object:set_properties({textures = self.base_texture})
end
mobs:spawn(spawn_desert)
mcl_mobs:spawn(spawn_desert)
local spawn_snow = table.copy(spawn)
spawn_snow.nodes = mobs_mc.spawn.snow
@ -176,7 +176,7 @@ spawn_snow.on_spawn = function(self, pos)
self.base_texture = { texture }
self.object:set_properties({textures = self.base_texture})
end
mobs:spawn(spawn_snow)
mcl_mobs:spawn(spawn_snow)
local spawn_grass = table.copy(spawn)
spawn_grass.nodes = mobs_mc.spawn.grassland
@ -196,11 +196,11 @@ spawn_grass.on_spawn = function(self, pos)
self.base_texture = { texture }
self.object:set_properties({textures = self.base_texture})
end
mobs:spawn(spawn_grass)
mcl_mobs:spawn(spawn_grass)
]]--
-- Spawn egg
mobs:register_egg("mobs_mc:rabbit", S("Rabbit"), "mobs_mc_spawn_icon_rabbit.png", 0)
mcl_mobs:register_egg("mobs_mc:rabbit", S("Rabbit"), "mobs_mc_spawn_icon_rabbit.png", 0)
-- Note: This spawn egg does not exist in Minecraft
mobs:register_egg("mobs_mc:killer_bunny", S("Killer Bunny"), "mobs_mc_spawn_icon_rabbit.png^[colorize:#FF0000:192", 0) -- TODO: Update inventory image
mcl_mobs:register_egg("mobs_mc:killer_bunny", S("Killer Bunny"), "mobs_mc_spawn_icon_rabbit.png^[colorize:#FF0000:192", 0) -- TODO: Update inventory image

View File

@ -55,7 +55,7 @@ end
local gotten_texture = { "blank.png", "mobs_mc_sheep.png" }
--mcsheep
mobs:register_mob("mobs_mc:sheep", {
mcl_mobs:register_mob("mobs_mc:sheep", {
description = S("Sheep"),
type = "animal",
spawn_class = "passive",
@ -195,8 +195,8 @@ mobs:register_mob("mobs_mc:sheep", {
on_rightclick = function(self, clicker)
local item = clicker:get_wielded_item()
if mobs:feed_tame(self, clicker, 1, true, true) then return end
if mobs:protect(self, clicker) then return end
if mcl_mobs:feed_tame(self, clicker, 1, true, true) then return end
if mcl_mobs:protect(self, clicker) then return end
if item:get_name() == mobs_mc.items.shears and not self.gotten and not self.child then
self.gotten = true
@ -252,12 +252,12 @@ mobs:register_mob("mobs_mc:sheep", {
end
return
end
if mobs:capture_mob(self, clicker, 0, 5, 70, false, nil) then return end
if mcl_mobs:capture_mob(self, clicker, 0, 5, 70, false, nil) then return end
end,
on_breed = function(parent1, parent2)
-- Breed sheep and choose a fur color for the child.
local pos = parent1.object:get_pos()
local child = mobs:spawn_child(pos, parent1.name)
local child = mcl_mobs:spawn_child(pos, parent1.name)
if child then
local ent_c = child:get_luaentity()
local color1 = parent1.color
@ -304,7 +304,7 @@ mobs:register_mob("mobs_mc:sheep", {
end
end,
})
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:sheep",
"overworld",
"ground",
@ -355,4 +355,4 @@ mobs_mc.spawn_height.overworld_min,
mobs_mc.spawn_height.overworld_max)
-- spawn eggs
mobs:register_egg("mobs_mc:sheep", S("Sheep"), "mobs_mc_spawn_icon_sheep.png", 0)
mcl_mobs:register_egg("mobs_mc:sheep", S("Sheep"), "mobs_mc_spawn_icon_sheep.png", 0)

View File

@ -11,7 +11,7 @@ local S = minetest.get_translator("mobs_mc")
-- animation 45-80 is transition between passive and attack stance
mobs:register_mob("mobs_mc:shulker", {
mcl_mobs:register_mob("mobs_mc:shulker", {
description = S("Shulker"),
type = "monster",
spawn_class = "hostile",
@ -55,7 +55,7 @@ mobs:register_mob("mobs_mc:shulker", {
})
-- bullet arrow (weapon)
mobs:register_arrow("mobs_mc:shulkerbullet", {
mcl_mobs:register_arrow("mobs_mc:shulkerbullet", {
visual = "sprite",
visual_size = {x = 0.25, y = 0.25},
textures = {"mobs_mc_shulkerbullet.png"},
@ -80,9 +80,9 @@ mobs:register_arrow("mobs_mc:shulkerbullet", {
})
mobs:register_egg("mobs_mc:shulker", S("Shulker"), "mobs_mc_spawn_icon_shulker.png", 0)
mcl_mobs:register_egg("mobs_mc:shulker", S("Shulker"), "mobs_mc_spawn_icon_shulker.png", 0)
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:shulker",
"end",
"ground",

View File

@ -4,7 +4,7 @@
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:silverfish", {
mcl_mobs:register_mob("mobs_mc:silverfish", {
description = S("Silverfish"),
type = "monster",
spawn_class = "hostile",
@ -49,7 +49,7 @@ mobs:register_mob("mobs_mc:silverfish", {
reach = 1,
})
mobs:register_egg("mobs_mc:silverfish", S("Silverfish"), "mobs_mc_spawn_icon_silverfish.png", 0)
mcl_mobs:register_egg("mobs_mc:silverfish", S("Silverfish"), "mobs_mc_spawn_icon_silverfish.png", 0)
-- Monster egg blocks (Minetest Game)
if minetest.get_modpath("default") and mobs_mc.create_monster_egg_nodes then

View File

@ -102,7 +102,7 @@ local skeleton = {
harmed_by_heal = true,
}
mobs:register_mob("mobs_mc:skeleton", skeleton)
mcl_mobs:register_mob("mobs_mc:skeleton", skeleton)
--###################
@ -139,10 +139,10 @@ table.insert(stray.drops, {
end,
})
mobs:register_mob("mobs_mc:stray", stray)
mcl_mobs:register_mob("mobs_mc:stray", stray)
-- Overworld spawn
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:skeleton",
"overworld",
"ground",
@ -297,7 +297,7 @@ mobs_mc.spawn_height.overworld_max)
-- Nether spawn
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:skeleton",
"nether",
"ground",
@ -314,7 +314,7 @@ mobs_mc.spawn_height.nether_max)
-- Stray spawn
-- TODO: Spawn directly under the sky
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:stray",
"overworld",
"ground",
@ -334,5 +334,5 @@ mobs_mc.spawn_height.overworld_max)
-- spawn eggs
mobs:register_egg("mobs_mc:skeleton", S("Skeleton"), "mobs_mc_spawn_icon_skeleton.png", 0)
mobs:register_egg("mobs_mc:stray", S("Stray"), "mobs_mc_spawn_icon_stray.png", 0)
mcl_mobs:register_egg("mobs_mc:skeleton", S("Skeleton"), "mobs_mc_spawn_icon_skeleton.png", 0)
mcl_mobs:register_egg("mobs_mc:stray", S("Stray"), "mobs_mc_spawn_icon_stray.png", 0)

View File

@ -9,7 +9,7 @@ local S = minetest.get_translator("mobs_mc")
--################### WITHER SKELETON
--###################
mobs:register_mob("mobs_mc:witherskeleton", {
mcl_mobs:register_mob("mobs_mc:witherskeleton", {
description = S("Wither Skeleton"),
type = "monster",
spawn_class = "hostile",
@ -96,7 +96,7 @@ mobs:register_mob("mobs_mc:witherskeleton", {
})
--spawn
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:witherskeleton",
"nether",
"ground",
@ -112,4 +112,4 @@ mobs_mc.spawn_height.nether_min,
mobs_mc.spawn_height.nether_max)
-- spawn eggs
mobs:register_egg("mobs_mc:witherskeleton", S("Wither Skeleton"), "mobs_mc_spawn_icon_witherskeleton.png", 0)
mcl_mobs:register_egg("mobs_mc:witherskeleton", S("Wither Skeleton"), "mobs_mc_spawn_icon_witherskeleton.png", 0)

View File

@ -109,7 +109,7 @@ local slime_big = {
on_die = spawn_children_on_die("mobs_mc:slime_small", 4, 1.0, 1.5),
use_texture_alpha = true,
}
mobs:register_mob("mobs_mc:slime_big", slime_big)
mcl_mobs:register_mob("mobs_mc:slime_big", slime_big)
local slime_small = table.copy(slime_big)
slime_small.sounds.base_pitch = 1.15
@ -126,7 +126,7 @@ slime_small.run_velocity = 1.3
slime_small.jump_height = 4.3
slime_small.spawn_small_alternative = "mobs_mc:slime_tiny"
slime_small.on_die = spawn_children_on_die("mobs_mc:slime_tiny", 4, 0.6, 1.0)
mobs:register_mob("mobs_mc:slime_small", slime_small)
mcl_mobs:register_mob("mobs_mc:slime_small", slime_small)
local slime_tiny = table.copy(slime_big)
slime_tiny.sounds.base_pitch = 1.3
@ -151,12 +151,12 @@ slime_tiny.jump_height = 3
slime_tiny.spawn_small_alternative = nil
slime_tiny.on_die = nil
mobs:register_mob("mobs_mc:slime_tiny", slime_tiny)
mcl_mobs:register_mob("mobs_mc:slime_tiny", slime_tiny)
local smin = mobs_mc.spawn_height.overworld_min
local smax = mobs_mc.spawn_height.water - 23
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:slime_tiny",
"overworld",
"ground",
@ -200,7 +200,7 @@ minetest.LIGHT_MAX+1,
smin,
smax)
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:slime_small",
"overworld",
"ground",
@ -244,7 +244,7 @@ minetest.LIGHT_MAX+1,
smin,
smax)
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:slime_big",
"overworld",
"ground",
@ -348,7 +348,7 @@ local magma_cube_big = {
on_die = spawn_children_on_die("mobs_mc:magma_cube_small", 3, 0.8, 1.5),
fire_resistant = true,
}
mobs:register_mob("mobs_mc:magma_cube_big", magma_cube_big)
mcl_mobs:register_mob("mobs_mc:magma_cube_big", magma_cube_big)
local magma_cube_small = table.copy(magma_cube_big)
magma_cube_small.sounds.jump = "mobs_mc_magma_cube_small"
@ -369,7 +369,7 @@ magma_cube_small.reach = 2.75
magma_cube_small.armor = 66
magma_cube_small.spawn_small_alternative = "mobs_mc:magma_cube_tiny"
magma_cube_small.on_die = spawn_children_on_die("mobs_mc:magma_cube_tiny", 4, 0.6, 1.0)
mobs:register_mob("mobs_mc:magma_cube_small", magma_cube_small)
mcl_mobs:register_mob("mobs_mc:magma_cube_small", magma_cube_small)
local magma_cube_tiny = table.copy(magma_cube_big)
magma_cube_tiny.sounds.jump = "mobs_mc_magma_cube_small"
@ -391,13 +391,13 @@ magma_cube_tiny.drops = {}
magma_cube_tiny.spawn_small_alternative = nil
magma_cube_tiny.on_die = nil
mobs:register_mob("mobs_mc:magma_cube_tiny", magma_cube_tiny)
mcl_mobs:register_mob("mobs_mc:magma_cube_tiny", magma_cube_tiny)
local mmin = mobs_mc.spawn_height.nether_min
local mmax = mobs_mc.spawn_height.nether_max
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:magma_cube_tiny",
"nether",
"ground",
@ -413,7 +413,7 @@ mmin,
mmax)
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:magma_cube_small",
"nether",
"ground",
@ -428,7 +428,7 @@ minetest.LIGHT_MAX+1,
mmin,
mmax)
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:magma_cube_big",
"nether",
"ground",
@ -443,11 +443,11 @@ minetest.LIGHT_MAX+1,
mmin,
mmax)
--mobs:spawn_specific("mobs_mc:magma_cube_tiny", mobs_mc.spawn.nether_fortress, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 11000, 4, mmin, mmax)
--mobs:spawn_specific("mobs_mc:magma_cube_small", mobs_mc.spawn.nether_fortress, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 11100, 4, mmin, mmax)
--mobs:spawn_specific("mobs_mc:magma_cube_big", mobs_mc.spawn.nether_fortress, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 11200, 4, mmin, mmax)
--mcl_mobs:spawn_specific("mobs_mc:magma_cube_tiny", mobs_mc.spawn.nether_fortress, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 11000, 4, mmin, mmax)
--mcl_mobs:spawn_specific("mobs_mc:magma_cube_small", mobs_mc.spawn.nether_fortress, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 11100, 4, mmin, mmax)
--mcl_mobs:spawn_specific("mobs_mc:magma_cube_big", mobs_mc.spawn.nether_fortress, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 11200, 4, mmin, mmax)
-- spawn eggs
mobs:register_egg("mobs_mc:magma_cube_big", S("Magma Cube"), "mobs_mc_spawn_icon_magmacube.png")
mobs:register_egg("mobs_mc:slime_big", S("Slime"), "mobs_mc_spawn_icon_slime.png")
mcl_mobs:register_egg("mobs_mc:magma_cube_big", S("Magma Cube"), "mobs_mc_spawn_icon_magmacube.png")
mcl_mobs:register_egg("mobs_mc:slime_big", S("Slime"), "mobs_mc_spawn_icon_slime.png")

View File

@ -20,7 +20,7 @@ local gotten_texture = {
"blank.png",
}
mobs:register_mob("mobs_mc:snowman", {
mcl_mobs:register_mob("mobs_mc:snowman", {
description = S("Snow Golem"),
type = "npc",
spawn_class = "passive",
@ -196,4 +196,4 @@ mobs_mc.tools.check_snow_golem_summon = function(pos)
end
-- Spawn egg
mobs:register_egg("mobs_mc:snowman", S("Snow Golem"), "mobs_mc_spawn_icon_snowman.png", 0)
mcl_mobs:register_egg("mobs_mc:snowman", S("Snow Golem"), "mobs_mc_spawn_icon_snowman.png", 0)

View File

@ -69,7 +69,7 @@ local spider = {
run_end = 20,
},
}
mobs:register_mob("mobs_mc:spider", spider)
mcl_mobs:register_mob("mobs_mc:spider", spider)
-- Cave spider
local cave_spider = table.copy(spider)
@ -86,10 +86,10 @@ cave_spider.walk_velocity = 1.3
cave_spider.run_velocity = 3.2
cave_spider.sounds = table.copy(spider.sounds)
cave_spider.sounds.base_pitch = 1.25
mobs:register_mob("mobs_mc:cave_spider", cave_spider)
mcl_mobs:register_mob("mobs_mc:cave_spider", cave_spider)
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:spider",
"overworld",
"ground",
@ -243,5 +243,5 @@ mobs_mc.spawn_height.overworld_min,
mobs_mc.spawn_height.overworld_max)
-- spawn eggs
mobs:register_egg("mobs_mc:spider", S("Spider"), "mobs_mc_spawn_icon_spider.png", 0)
mobs:register_egg("mobs_mc:cave_spider", S("Cave Spider"), "mobs_mc_spawn_icon_cave_spider.png", 0)
mcl_mobs:register_egg("mobs_mc:spider", S("Spider"), "mobs_mc_spawn_icon_spider.png", 0)
mcl_mobs:register_egg("mobs_mc:cave_spider", S("Cave Spider"), "mobs_mc_spawn_icon_cave_spider.png", 0)

View File

@ -6,7 +6,7 @@
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:squid", {
mcl_mobs:register_mob("mobs_mc:squid", {
description = S("Squid"),
type = "animal",
spawn_class = "water",
@ -63,7 +63,7 @@ mobs:register_mob("mobs_mc:squid", {
local water = mobs_mc.spawn_height.water
--name, nodes, neighbours, minlight, maxlight, interval, chance, active_object_count, min_height, max_height
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:squid",
"overworld",
"water",
@ -217,4 +217,4 @@ water-16,
water+1)
-- spawn eggs
mobs:register_egg("mobs_mc:squid", S("Squid"), "mobs_mc_spawn_icon_squid.png", 0)
mcl_mobs:register_egg("mobs_mc:squid", S("Squid"), "mobs_mc_spawn_icon_squid.png", 0)

View File

@ -9,7 +9,7 @@ local S = minetest.get_translator("mobs_mc")
--################### VEX
--###################
mobs:register_mob("mobs_mc:vex", {
mcl_mobs:register_mob("mobs_mc:vex", {
description = S("Vex"),
type = "monster",
spawn_class = "hostile",
@ -94,4 +94,4 @@ mobs:register_mob("mobs_mc:vex", {
-- spawn eggs
mobs:register_egg("mobs_mc:vex", S("Vex"), "mobs_mc_spawn_icon_vex.png", 0)
mcl_mobs:register_egg("mobs_mc:vex", S("Vex"), "mobs_mc_spawn_icon_vex.png", 0)

View File

@ -577,7 +577,7 @@ local function go_home(entity)
entity.state = "go_home"
local b=entity._bed
if not b then return end
mobs:gopath(entity,b,function(entity,b)
mcl_mobs:gopath(entity,b,function(entity,b)
if vector.distance(entity.object:get_pos(),b) < 2 then
entity.state = "stand"
set_velocity(entity,0)
@ -619,7 +619,7 @@ local function look_for_job(self)
local m=minetest.get_meta(n)
if m:get_string("villager") == "" then
--minetest.log("goingt to jobsite "..minetest.pos_to_string(n) )
local gp = mobs:gopath(self,n,function()
local gp = mcl_mobs:gopath(self,n,function()
--minetest.log("arrived jobsite "..minetest.pos_to_string(n) )
end)
if gp then return end
@ -1200,7 +1200,7 @@ end)
--[=======[ MOB REGISTRATION AND SPAWNING ]=======]
mobs:register_mob("mobs_mc:villager", {
mcl_mobs:register_mob("mobs_mc:villager", {
description = S("Villager"),
type = "npc",
spawn_class = "passive",
@ -1259,7 +1259,7 @@ mobs:register_mob("mobs_mc:villager", {
end
end
if clicker then
mobs:feed_tame(self, clicker, 1, true, false)
mcl_mobs:feed_tame(self, clicker, 1, true, false)
return
end
return true --do not pick up
@ -1267,7 +1267,7 @@ mobs:register_mob("mobs_mc:villager", {
on_rightclick = function(self, clicker)
local trg=vector.new(0,9,0)
if self._jobsite then
mobs:gopath(self,self._jobsite,function()
mcl_mobs:gopath(self,self._jobsite,function()
--minetest.log("arrived at jobsite")
end)
end
@ -1375,7 +1375,7 @@ mobs:register_mob("mobs_mc:villager", {
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:villager",
"overworld",
"ground",
@ -1406,4 +1406,4 @@ mobs_mc.spawn_height.water+1,
mobs_mc.spawn_height.overworld_max)
-- spawn eggs
mobs:register_egg("mobs_mc:villager", S("Villager"), "mobs_mc_spawn_icon_villager.png", 0)
mcl_mobs:register_egg("mobs_mc:villager", S("Villager"), "mobs_mc_spawn_icon_villager.png", 0)

View File

@ -11,7 +11,7 @@ local S = minetest.get_translator("mobs_mc")
local pr = PseudoRandom(os.time()*666)
mobs:register_mob("mobs_mc:evoker", {
mcl_mobs:register_mob("mobs_mc:evoker", {
description = S("Evoker"),
type = "monster",
spawn_class = "hostile",
@ -84,4 +84,4 @@ mobs:register_mob("mobs_mc:evoker", {
})
-- spawn eggs
mobs:register_egg("mobs_mc:evoker", S("Evoker"), "mobs_mc_spawn_icon_evoker.png", 0)
mcl_mobs:register_egg("mobs_mc:evoker", S("Evoker"), "mobs_mc_spawn_icon_evoker.png", 0)

View File

@ -6,7 +6,7 @@
local S = minetest.get_translator("mobs_mc")
local mod_bows = minetest.get_modpath("mcl_bows") ~= nil
mobs:register_mob("mobs_mc:illusioner", {
mcl_mobs:register_mob("mobs_mc:illusioner", {
description = S("Illusioner"),
type = "monster",
spawn_class = "hostile",
@ -61,4 +61,4 @@ mobs:register_mob("mobs_mc:illusioner", {
fear_height = 4,
})
mobs:register_egg("mobs_mc:illusioner", S("Illusioner"), "mobs_mc_spawn_icon_illusioner.png", 0)
mcl_mobs:register_egg("mobs_mc:illusioner", S("Illusioner"), "mobs_mc_spawn_icon_illusioner.png", 0)

View File

@ -10,7 +10,7 @@ local S = minetest.get_translator("mobs_mc")
--###################
mobs:register_mob("mobs_mc:vindicator", {
mcl_mobs:register_mob("mobs_mc:vindicator", {
description = S("Vindicator"),
type = "monster",
spawn_class = "hostile",
@ -72,4 +72,4 @@ mobs:register_mob("mobs_mc:vindicator", {
})
-- spawn eggs
mobs:register_egg("mobs_mc:vindicator", S("Vindicator"), "mobs_mc_spawn_icon_vindicator.png", 0)
mcl_mobs:register_egg("mobs_mc:vindicator", S("Vindicator"), "mobs_mc_spawn_icon_vindicator.png", 0)

View File

@ -25,7 +25,7 @@ local professions = {
nitwit = "mobs_mc_villager.png",
}
mobs:register_mob("mobs_mc:villager_zombie", {
mcl_mobs:register_mob("mobs_mc:villager_zombie", {
description = S("Zombie Villager"),
type = "monster",
spawn_class = "hostile",
@ -147,7 +147,7 @@ mobs:register_mob("mobs_mc:villager_zombie", {
harmed_by_heal = true,
})
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:villager_zombie",
"overworld",
"ground",
@ -239,7 +239,7 @@ mobs:spawn_specific(
4,
mobs_mc.spawn_height.overworld_min,
mobs_mc.spawn_height.overworld_max)
--mobs:spawn_specific("mobs_mc:villager_zombie", "overworld", "ground", 0, 7, 30, 60000, 4, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max)
--mcl_mobs:spawn_specific("mobs_mc:villager_zombie", "overworld", "ground", 0, 7, 30, 60000, 4, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max)
-- spawn eggs
mobs:register_egg("mobs_mc:villager_zombie", S("Zombie Villager"), "mobs_mc_spawn_icon_zombie_villager.png", 0)
mcl_mobs:register_egg("mobs_mc:villager_zombie", S("Zombie Villager"), "mobs_mc_spawn_icon_zombie_villager.png", 0)

View File

@ -12,7 +12,7 @@ local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:witch", {
mcl_mobs:register_mob("mobs_mc:witch", {
description = S("Witch"),
type = "monster",
spawn_class = "hostile",
@ -72,7 +72,7 @@ mobs:register_mob("mobs_mc:witch", {
})
-- potion projectile (EXPERIMENTAL)
mobs:register_arrow("mobs_mc:potion_arrow", {
mcl_mobs:register_arrow("mobs_mc:potion_arrow", {
visual = "sprite",
visual_size = {x = 0.5, y = 0.5},
--textures = {"vessels_glass_bottle.png"}, --TODO fix to else if default
@ -101,9 +101,9 @@ mobs:register_arrow("mobs_mc:potion_arrow", {
})
-- TODO: Spawn when witch works properly <- eventually -j4i
--mobs:spawn_specific("mobs_mc:witch", mobs_mc.spawn.jungle, {"air"}, 0, minetest.LIGHT_MAX-6, 12, 20000, 2, mobs_mc.spawn_height.water-6, mobs_mc.spawn_height.overworld_max)
--mcl_mobs:spawn_specific("mobs_mc:witch", mobs_mc.spawn.jungle, {"air"}, 0, minetest.LIGHT_MAX-6, 12, 20000, 2, mobs_mc.spawn_height.water-6, mobs_mc.spawn_height.overworld_max)
-- spawn eggs
mobs:register_egg("mobs_mc:witch", S("Witch"), "mobs_mc_spawn_icon_witch.png", 0, true)
mcl_mobs:register_egg("mobs_mc:witch", S("Witch"), "mobs_mc_spawn_icon_witch.png", 0, true)
mcl_wip.register_wip_item("mobs_mc:witch")

View File

@ -9,7 +9,7 @@ local S = minetest.get_translator("mobs_mc")
--################### WITHER
--###################
mobs:register_mob("mobs_mc:wither", {
mcl_mobs:register_mob("mobs_mc:wither", {
description = S("Wither"),
type = "monster",
spawn_class = "hostile",
@ -83,7 +83,7 @@ mobs:register_mob("mobs_mc:wither", {
local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false
mobs:register_arrow("mobs_mc:wither_skull", {
mcl_mobs:register_arrow("mobs_mc:wither_skull", {
visual = "sprite",
visual_size = {x = 0.75, y = 0.75},
-- TODO: 3D projectile, replace tetxture
@ -96,7 +96,7 @@ mobs:register_arrow("mobs_mc:wither_skull", {
full_punch_interval = 0.5,
damage_groups = {fleshy = 8},
}, nil)
mobs:boom(self, self.object:get_pos(), 1)
mcl_mobs:boom(self, self.object:get_pos(), 1)
end,
hit_mob = function(self, mob)
@ -104,17 +104,17 @@ mobs:register_arrow("mobs_mc:wither_skull", {
full_punch_interval = 0.5,
damage_groups = {fleshy = 8},
}, nil)
mobs:boom(self, self.object:get_pos(), 1)
mcl_mobs:boom(self, self.object:get_pos(), 1)
end,
-- node hit, explode
hit_node = function(self, pos, node)
mobs:boom(self, pos, 1)
mcl_mobs:boom(self, pos, 1)
end
})
-- TODO: Add blue wither skull
--Spawn egg
mobs:register_egg("mobs_mc:wither", S("Wither"), "mobs_mc_spawn_icon_wither.png", 0, true)
mcl_mobs:register_egg("mobs_mc:wither", S("Wither"), "mobs_mc_spawn_icon_wither.png", 0, true)
mcl_wip.register_wip_item("mobs_mc:wither")

View File

@ -57,7 +57,7 @@ local wolf = {
fear_height = 4,
follow = mobs_mc.follow.wolf,
on_rightclick = function(self, clicker)
-- Try to tame wolf (intentionally does NOT use mobs:feed_tame)
-- Try to tame wolf (intentionally does NOT use mcl_mobs:feed_tame)
local tool = clicker:get_wielded_item()
local dog, ent
@ -94,7 +94,7 @@ local wolf = {
specific_attack = { "player", "mobs_mc:sheep" },
}
mobs:register_mob("mobs_mc:wolf", wolf)
mcl_mobs:register_mob("mobs_mc:wolf", wolf)
-- Tamed wolf
@ -148,9 +148,9 @@ dog.specific_attack = nil
dog.on_rightclick = function(self, clicker)
local item = clicker:get_wielded_item()
if mobs:protect(self, clicker) then
if mcl_mobs:protect(self, clicker) then
return
elseif item:get_name() ~= "" and mobs:capture_mob(self, clicker, 0, 2, 80, false, nil) then
elseif item:get_name() ~= "" and mcl_mobs:capture_mob(self, clicker, 0, 2, 80, false, nil) then
return
elseif is_food(item:get_name()) then
-- Feed to increase health
@ -230,10 +230,10 @@ dog.on_rightclick = function(self, clicker)
end
end
mobs:register_mob("mobs_mc:dog", dog)
mcl_mobs:register_mob("mobs_mc:dog", dog)
-- Spawn
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:wolf",
"overworld",
"ground",
@ -263,4 +263,4 @@ minetest.LIGHT_MAX+1,
mobs_mc.spawn_height.water+3,
mobs_mc.spawn_height.overworld_max)
mobs:register_egg("mobs_mc:wolf", S("Wolf"), "mobs_mc_spawn_icon_wolf.png", 0)
mcl_mobs:register_egg("mobs_mc:wolf", S("Wolf"), "mobs_mc_spawn_icon_wolf.png", 0)

View File

@ -97,7 +97,7 @@ local zombie = {
harmed_by_heal = true,
}
mobs:register_mob("mobs_mc:zombie", zombie)
mcl_mobs:register_mob("mobs_mc:zombie", zombie)
-- Baby zombie.
-- A smaller and more dangerous variant of the zombie
@ -112,7 +112,7 @@ baby_zombie.walk_velocity = 1.2
baby_zombie.run_velocity = 2.4
baby_zombie.child = 1
mobs:register_mob("mobs_mc:baby_zombie", baby_zombie)
mcl_mobs:register_mob("mobs_mc:baby_zombie", baby_zombie)
-- Husk.
-- Desert variant of the zombie
@ -130,7 +130,7 @@ husk.sunlight_damage = 0
husk.drops = drops_common
-- TODO: Husks avoid water
mobs:register_mob("mobs_mc:husk", husk)
mcl_mobs:register_mob("mobs_mc:husk", husk)
-- Baby husk.
-- A smaller and more dangerous variant of the husk
@ -144,12 +144,12 @@ baby_husk.walk_velocity = 1.2
baby_husk.run_velocity = 2.4
baby_husk.child = 1
mobs:register_mob("mobs_mc:baby_husk", baby_husk)
mcl_mobs:register_mob("mobs_mc:baby_husk", baby_husk)
-- Spawning
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:zombie",
"overworld",
"ground",
@ -241,7 +241,7 @@ mobs:spawn_specific(
mobs_mc.spawn_height.overworld_min,
mobs_mc.spawn_height.overworld_max)
-- Baby zombie is 20 times less likely than regular zombies
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:baby_zombie",
"overworld",
"ground",
@ -334,7 +334,7 @@ mobs_mc.spawn_height.overworld_min,
mobs_mc.spawn_height.overworld_max)
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:husk",
"overworld",
"ground",
@ -348,7 +348,7 @@ mobs:spawn_specific(
4,
mobs_mc.spawn_height.overworld_min,
mobs_mc.spawn_height.overworld_max)
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:baby_husk",
"overworld",
"ground",
@ -364,5 +364,5 @@ mobs_mc.spawn_height.overworld_min,
mobs_mc.spawn_height.overworld_max)
-- Spawn eggs
mobs:register_egg("mobs_mc:husk", S("Husk"), "mobs_mc_spawn_icon_husk.png", 0)
mobs:register_egg("mobs_mc:zombie", S("Zombie"), "mobs_mc_spawn_icon_zombie.png", 0)
mcl_mobs:register_egg("mobs_mc:husk", S("Husk"), "mobs_mc_spawn_icon_husk.png", 0)
mcl_mobs:register_egg("mobs_mc:zombie", S("Zombie"), "mobs_mc_spawn_icon_zombie.png", 0)

View File

@ -89,7 +89,7 @@ local pigman = {
fire_damage_resistant = true,
}
mobs:register_mob("mobs_mc:pigman", pigman)
mcl_mobs:register_mob("mobs_mc:pigman", pigman)
-- Baby pigman.
-- A smaller and more dangerous variant of the pigman
@ -110,10 +110,10 @@ baby_pigman.run_velocity = 2.4
baby_pigman.light_damage = 0
baby_pigman.child = 1
mobs:register_mob("mobs_mc:baby_pigman", baby_pigman)
mcl_mobs:register_mob("mobs_mc:baby_pigman", baby_pigman)
-- Regular spawning in the Nether
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:pigman",
"nether",
"ground",
@ -128,7 +128,7 @@ minetest.LIGHT_MAX+1,
mobs_mc.spawn_height.nether_min,
mobs_mc.spawn_height.nether_max)
-- Baby zombie is 20 times less likely than regular zombies
mobs:spawn_specific(
mcl_mobs:spawn_specific(
"mobs_mc:baby_pigman",
"nether",
"ground",
@ -147,4 +147,4 @@ mobs_mc.spawn_height.nether_max)
--mobs:spawn_specific("mobs_mc:pigman", mobs_mc.spawn.nether_portal, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 500, 4, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max)
-- spawn eggs
mobs:register_egg("mobs_mc:pigman", S("Zombie Pigman"), "mobs_mc_spawn_icon_zombie_pigman.png", 0)
mcl_mobs:register_egg("mobs_mc:pigman", S("Zombie Pigman"), "mobs_mc_spawn_icon_zombie_pigman.png", 0)

View File

@ -9,7 +9,7 @@ function mcl_bells.ring_once(pos)
local vv=minetest.get_objects_inside_radius(pos,150)
for _,o in pairs(vv) do
if o.type == "npc" then
mobs:gopath(o:get_luaentity(),pos,function() end)
mcl_mobs:gopath(o:get_luaentity(),pos,function() end)
end
end
end

View File

@ -155,7 +155,7 @@ local function spawn_mobs(pos, elapsed)
end
-- are we spawning a registered mob?
if not mobs.spawning_mobs[mob] then
if not mcl_mobs.spawning_mobs[mob] then
minetest.log("error", "[mcl_mobspawners] Mob Spawner: Mob doesn't exist: "..mob)
return
end

View File

@ -38,7 +38,7 @@ minetest.register_node("mcl_villages:structblock", {drawtype="airlike",groups =
-- register inhabitants
--
if minetest.get_modpath("mobs_mc") then
mobs:register_spawn("mobs_mc:villager", --name
mcl_mobs:register_spawn("mobs_mc:villager", --name
{"mcl_core:stonebrickcarved"}, --nodes
15, --max_light
0, --min_light