mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 23:15:29 +00:00
Added far-generated loaded chunk to garbage collection
This commit is contained in:
parent
0db009b08f
commit
79e864f4f1
@ -1651,7 +1651,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
}elseif($target instanceof Player){
|
}elseif($target instanceof Player){
|
||||||
if(($target->getGamemode() & 0x01) > 0){
|
if(($target->getGamemode() & 0x01) > 0){
|
||||||
break;
|
break;
|
||||||
}elseif($this->server->getConfigBoolean("pvp") === false or $this->server->getDifficulty() === 0){
|
}elseif($this->server->getConfigBoolean("pvp") !== true or $this->server->getDifficulty() === 0){
|
||||||
$cancelled = true;
|
$cancelled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -414,6 +414,8 @@ abstract class Entity extends Position implements Metadatable{
|
|||||||
|
|
||||||
public function entityBaseTick(){
|
public function entityBaseTick(){
|
||||||
//TODO: check vehicles
|
//TODO: check vehicles
|
||||||
|
|
||||||
|
|
||||||
if($this->dead === true and !($this instanceof Player)){
|
if($this->dead === true and !($this instanceof Player)){
|
||||||
$this->close();
|
$this->close();
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ abstract class Timings{
|
|||||||
public static function getPluginTaskTimings(TaskHandler $task, $period){
|
public static function getPluginTaskTimings(TaskHandler $task, $period){
|
||||||
$ftask = $task->getTask();
|
$ftask = $task->getTask();
|
||||||
if($ftask instanceof PluginTask and $ftask->getOwner() !== null){
|
if($ftask instanceof PluginTask and $ftask->getOwner() !== null){
|
||||||
$plugin = $ftask->getOwner()->getDescription()->getName();
|
$plugin = $ftask->getOwner()->getDescription()->getFullName();
|
||||||
}elseif($task->timingName !== null){
|
}elseif($task->timingName !== null){
|
||||||
$plugin = "Scheduler";
|
$plugin = "Scheduler";
|
||||||
}else{
|
}else{
|
||||||
|
@ -252,7 +252,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function close(){
|
public function close(){
|
||||||
if($this->autoSave){
|
if($this->getAutoSave()){
|
||||||
$this->provider->saveChunks();
|
$this->provider->saveChunks();
|
||||||
}
|
}
|
||||||
$this->provider->close();
|
$this->provider->close();
|
||||||
@ -1721,6 +1721,13 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
$X = null;
|
$X = null;
|
||||||
$Z = null;
|
$Z = null;
|
||||||
|
|
||||||
|
foreach($this->chunks as $index => $chunk){
|
||||||
|
if(!isset($this->usedChunks[$index])){
|
||||||
|
Level::getXZ($index, $X, $Z);
|
||||||
|
$this->unloadChunkRequest($X, $Z, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(count($this->unloadQueue) > 0){
|
if(count($this->unloadQueue) > 0){
|
||||||
foreach($this->unloadQueue as $index => $time){
|
foreach($this->unloadQueue as $index => $time){
|
||||||
Level::getXZ($index, $X, $Z);
|
Level::getXZ($index, $X, $Z);
|
||||||
|
@ -272,6 +272,13 @@ abstract class PluginBase implements Plugin{
|
|||||||
return $this->description->getName();
|
return $this->description->getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public final function getFullName(){
|
||||||
|
return $this->description->getFullName();
|
||||||
|
}
|
||||||
|
|
||||||
protected function getFile(){
|
protected function getFile(){
|
||||||
return $this->file;
|
return $this->file;
|
||||||
}
|
}
|
||||||
|
@ -708,7 +708,7 @@ class PluginManager{
|
|||||||
throw new \Exception("Plugin attempted to register " . $event . " while not enabled");
|
throw new \Exception("Plugin attempted to register " . $event . " while not enabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
$timings = new TimingsHandler("Plugin: ".$plugin->getDescription()->getName()." Event: ".get_class($listener)."::".($executor instanceof MethodEventExecutor ? $executor->getMethod() : "???")."(".(new \ReflectionClass($event))->getShortName().")", self::$pluginParentTimer);
|
$timings = new TimingsHandler("Plugin: ".$plugin->getDescription()->getFullName()." Event: ".get_class($listener)."::".($executor instanceof MethodEventExecutor ? $executor->getMethod() : "???")."(".(new \ReflectionClass($event))->getShortName().")", self::$pluginParentTimer);
|
||||||
|
|
||||||
$this->getEventListeners($event)->register(new RegisteredListener($listener, $executor, $priority, $plugin, $ignoreCancelled, $timings));
|
$this->getEventListeners($event)->register(new RegisteredListener($listener, $executor, $priority, $plugin, $ignoreCancelled, $timings));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user