mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +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){
|
||||
if(($target->getGamemode() & 0x01) > 0){
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -414,6 +414,8 @@ abstract class Entity extends Position implements Metadatable{
|
||||
|
||||
public function entityBaseTick(){
|
||||
//TODO: check vehicles
|
||||
|
||||
|
||||
if($this->dead === true and !($this instanceof Player)){
|
||||
$this->close();
|
||||
|
||||
|
@ -127,7 +127,7 @@ abstract class Timings{
|
||||
public static function getPluginTaskTimings(TaskHandler $task, $period){
|
||||
$ftask = $task->getTask();
|
||||
if($ftask instanceof PluginTask and $ftask->getOwner() !== null){
|
||||
$plugin = $ftask->getOwner()->getDescription()->getName();
|
||||
$plugin = $ftask->getOwner()->getDescription()->getFullName();
|
||||
}elseif($task->timingName !== null){
|
||||
$plugin = "Scheduler";
|
||||
}else{
|
||||
|
@ -252,7 +252,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
}
|
||||
|
||||
public function close(){
|
||||
if($this->autoSave){
|
||||
if($this->getAutoSave()){
|
||||
$this->provider->saveChunks();
|
||||
}
|
||||
$this->provider->close();
|
||||
@ -1721,6 +1721,13 @@ class Level implements ChunkManager, Metadatable{
|
||||
$X = 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){
|
||||
foreach($this->unloadQueue as $index => $time){
|
||||
Level::getXZ($index, $X, $Z);
|
||||
|
@ -272,6 +272,13 @@ abstract class PluginBase implements Plugin{
|
||||
return $this->description->getName();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public final function getFullName(){
|
||||
return $this->description->getFullName();
|
||||
}
|
||||
|
||||
protected function getFile(){
|
||||
return $this->file;
|
||||
}
|
||||
|
@ -708,7 +708,7 @@ class PluginManager{
|
||||
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));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user