Merge pull request #15 from berengma/range
add protection check, fish die on dry land
This commit is contained in:
commit
03923b108c
@ -42,6 +42,8 @@ minetest.register_craftitem("water_life:riverfish", {
|
||||
if number.all > water_life.maxmobs or number.fish > 10 then return itemstack end
|
||||
|
||||
local name = placer:get_player_name()
|
||||
if minetest.is_protected(pos,name) then return itemstack end
|
||||
|
||||
local obj = minetest.add_entity(pos, "water_life:fish_tamed")
|
||||
obj = obj:get_luaentity()
|
||||
itemstack:take_item()
|
||||
|
1
init.lua
1
init.lua
@ -40,6 +40,7 @@ minetest.register_entity(":zombiestrd:shark", {
|
||||
|
||||
-- register shark food
|
||||
water_life.register_shark_food("water_life:fish") --fish is too small for sharks
|
||||
water_life.register_shark_food("water_life:fish_tamed")
|
||||
if minetest.get_modpath("wildlife") then
|
||||
water_life.register_shark_food("wildlife:deer")
|
||||
water_life.register_shark_food("wildlife:wolf")
|
||||
|
@ -9,6 +9,7 @@ local function fish_brain(self)
|
||||
return
|
||||
end
|
||||
if mobkit.timer(self,1) then
|
||||
if not self.isinliquid then mobkit.hurt(self,1) end
|
||||
local plyr = mobkit.get_nearby_player(self)
|
||||
if plyr and self.wild then
|
||||
water_life.hq_swimfrom(self,50,plyr,3)
|
||||
|
Loading…
x
Reference in New Issue
Block a user