mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 12:39:43 +00:00
heLL
This commit is contained in:
parent
ac289e964c
commit
0a36a67f78
2 changed files with 10 additions and 3 deletions
|
|
@ -81,8 +81,13 @@ class PocketMinecraftServer{
|
||||||
"discord-msg" => false,
|
"discord-msg" => false,
|
||||||
"discord-ru-smiles" => false,
|
"discord-ru-smiles" => false,
|
||||||
"discord-webhook-url" => "none",
|
"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::$allowedAI = $this->extraprops->get("enable-mob-ai");
|
||||||
Entity::$updateOnTick = $this->extraprops->get("experemental-mob-features");
|
Entity::$updateOnTick = $this->extraprops->get("experemental-mob-features");
|
||||||
if(Entity::$updateOnTick){
|
if(Entity::$updateOnTick){
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
abstract class Living extends Entity implements Damageable, Pathfindable{
|
abstract class Living extends Entity implements Damageable, Pathfindable{
|
||||||
public $target, $ai;
|
|
||||||
|
|
||||||
|
public static $despawnMobs, $despawnTimer;
|
||||||
|
|
||||||
|
public $target, $ai;
|
||||||
public $pathFinder, $path = null, $currentIndex = 0, $currentNode, $pathFollower;
|
public $pathFinder, $path = null, $currentIndex = 0, $currentNode, $pathFollower;
|
||||||
public function __construct(Level $level, $eid, $class, $type = 0, $data = array()){
|
public function __construct(Level $level, $eid, $class, $type = 0, $data = array()){
|
||||||
$this->target = false;
|
$this->target = false;
|
||||||
|
|
@ -13,7 +15,7 @@ abstract class Living extends Entity implements Damageable, Pathfindable{
|
||||||
$this->canBeAttacked = true;
|
$this->canBeAttacked = true;
|
||||||
$this->hasGravity = true;
|
$this->hasGravity = true;
|
||||||
$this->hasKnockback = 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(){
|
public function hasPath(){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue