Add some despawning logic (but do not enable despawning yet)

This commit is contained in:
Wuzzy 2018-09-14 14:48:48 +02:00
parent 67ebf3366f
commit ad2fbb0008
5 changed files with 29 additions and 15 deletions

View file

@ -6,6 +6,7 @@ local S, NS = dofile(MP.."/intllib.lua")
mobs:register_mob("mobs_mc:bat", {
type = "animal",
can_despawn = true,
passive = true,
hp_min = 6,
hp_max = 6,

View file

@ -30,6 +30,7 @@ end
-- Ocelot
local ocelot = {
type = "animal",
can_despawn = true,
hp_min = 10,
hp_max = 10,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 0.69, 0.3},
@ -97,6 +98,7 @@ mobs:register_mob("mobs_mc:ocelot", ocelot)
-- Cat
local cat = table.copy(ocelot)
cat.textures = {{"mobs_mc_cat_black.png"}, {"mobs_mc_cat_red.png"}, {"mobs_mc_cat_siamese.png"}}
cat.can_despawn = false
cat.owner = ""
cat.order = "roam" -- "sit" or "roam"
cat.owner_loyal = true

View file

@ -10,6 +10,7 @@ local S, NS = dofile(MP.."/intllib.lua")
mobs:register_mob("mobs_mc:squid", {
type = "animal",
can_despawn = true,
passive = true,
hp_min = 10,
hp_max = 10,

View file

@ -22,7 +22,7 @@ end
-- Wolf
local wolf = {
type = "animal",
can_despawn = true,
hp_min = 8,
hp_max = 8,
passive = false,
@ -123,6 +123,7 @@ end
-- Tamed wolf (aka “dog”)
local dog = table.copy(wolf)
dog.can_despawn = false
dog.passive = true
dog.hp_min = 20
dog.hp_max = 20