From 0a36a67f7861a588508a03d630ae3f07ff5b9b35 Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Wed, 11 Jan 2023 01:12:08 +0300 Subject: [PATCH] heLL --- src/PocketMinecraftServer.php | 7 ++++++- src/entity/Living.php | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/PocketMinecraftServer.php b/src/PocketMinecraftServer.php index b3851784..05183557 100644 --- a/src/PocketMinecraftServer.php +++ b/src/PocketMinecraftServer.php @@ -81,8 +81,13 @@ class PocketMinecraftServer{ "discord-msg" => false, "discord-ru-smiles" => false, "discord-webhook-url" => "none", - "discord-bot-name" => "NostalgiaCore Logger" + "discord-bot-name" => "NostalgiaCore Logger", + "despawn-mobs" => true, + "mob-despawn-ticks" => 18000, + ]); + Living::$despawnMobs = $this->extraprops->get("despawn-mobs"); + Living::$despawnTimer = $this->extraprops->get("mob-despawn-ticks"); Entity::$allowedAI = $this->extraprops->get("enable-mob-ai"); Entity::$updateOnTick = $this->extraprops->get("experemental-mob-features"); if(Entity::$updateOnTick){ diff --git a/src/entity/Living.php b/src/entity/Living.php index 877352c1..a2216d08 100644 --- a/src/entity/Living.php +++ b/src/entity/Living.php @@ -1,8 +1,10 @@ target = false; @@ -13,7 +15,7 @@ abstract class Living extends Entity implements Damageable, Pathfindable{ $this->canBeAttacked = true; $this->hasGravity = true; $this->hasKnockback = true; - $this->server->schedule(18000, [$this, "close"]); //900*20 + if(self::$despawnMobs) $this->server->schedule(self::$despawnTimer, [$this, "close"]); //900*20 } public function hasPath(){