mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-07-29 21:40:21 +02:00
Compare commits
2 Commits
c023ecc36f
...
350fc3647c
Author | SHA1 | Date | |
---|---|---|---|
350fc3647c | |||
70c68f6ebc |
15
api.lua
15
api.lua
@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi")
|
|||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20210411",
|
version = "20210504",
|
||||||
intllib = S,
|
intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
invis = minetest.global_exists("invisibility") and invisibility or {}
|
||||||
}
|
}
|
||||||
@ -224,10 +224,10 @@ function mob_class:collision()
|
|||||||
|
|
||||||
for _,object in ipairs(minetest.get_objects_inside_radius(pos, width)) do
|
for _,object in ipairs(minetest.get_objects_inside_radius(pos, width)) do
|
||||||
|
|
||||||
if object:is_player()
|
if object:is_player() then
|
||||||
or (object:get_luaentity()
|
-- or (object:get_luaentity()
|
||||||
and object:get_luaentity()._cmi_is_mob == true
|
-- and object:get_luaentity()._cmi_is_mob == true
|
||||||
and object ~= self.object) then
|
-- and object ~= self.object) then
|
||||||
|
|
||||||
local pos2 = object:get_pos()
|
local pos2 = object:get_pos()
|
||||||
local vec = {x = pos.x - pos2.x, z = pos.z - pos2.z}
|
local vec = {x = pos.x - pos2.x, z = pos.z - pos2.z}
|
||||||
@ -4127,7 +4127,10 @@ function mobs:register_arrow(name, def)
|
|||||||
|
|
||||||
minetest.register_entity(name, {
|
minetest.register_entity(name, {
|
||||||
|
|
||||||
physical = false,
|
physical = def.physical or false,
|
||||||
|
collide_with_objects = def.collide_with_objects or false,
|
||||||
|
static_save = false,
|
||||||
|
|
||||||
visual = def.visual,
|
visual = def.visual,
|
||||||
visual_size = def.visual_size,
|
visual_size = def.visual_size,
|
||||||
textures = def.textures,
|
textures = def.textures,
|
||||||
|
2
api.txt
2
api.txt
@ -465,6 +465,8 @@ This function registers a arrow for mobs with the attack type shoot.
|
|||||||
'visual' same is in minetest.register_entity()
|
'visual' same is in minetest.register_entity()
|
||||||
'visual_size' same is in minetest.register_entity()
|
'visual_size' same is in minetest.register_entity()
|
||||||
'textures' same is in minetest.register_entity()
|
'textures' same is in minetest.register_entity()
|
||||||
|
'physical' same is in minetest.register_entity() [default: false]
|
||||||
|
'collide_with_objects' same as above
|
||||||
'velocity' the velocity of the arrow
|
'velocity' the velocity of the arrow
|
||||||
'drop' if set to true any arrows hitting a node will drop as item
|
'drop' if set to true any arrows hitting a node will drop as item
|
||||||
'hit_player' a function that is called when the arrow hits a player;
|
'hit_player' a function that is called when the arrow hits a player;
|
||||||
|
Reference in New Issue
Block a user