mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 23:59:53 +00:00
Fix formatting issues due to bad IDE settings
This commit is contained in:
parent
bb82e7be50
commit
747f7685e7
@ -1875,7 +1875,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
if($target instanceof Entity and $this->getGamemode() !== Player::VIEW and $this->dead !== true and $target->dead !== true){
|
if($target instanceof Entity and $this->getGamemode() !== Player::VIEW and $this->dead !== true and $target->dead !== true){
|
||||||
if($target instanceof DroppedItem or $target instanceof Arrow){
|
if($target instanceof DroppedItem or $target instanceof Arrow){
|
||||||
$this->kick("Attempting to attack an invalid entity");
|
$this->kick("Attempting to attack an invalid entity");
|
||||||
$this->server->getLogger()->warning("Player ". $this->getName() ." tried to attack an invalid entity");
|
$this->server->getLogger()->warning("Player " . $this->getName() . " tried to attack an invalid entity");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2621,7 +2621,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
$flags = 0;
|
$flags = 0;
|
||||||
$flags |= $this->fireTicks > 0 ? 1 : 0;
|
$flags |= $this->fireTicks > 0 ? 1 : 0;
|
||||||
//$flags |= ($this->crouched === true ? 0b10:0) << 1;
|
//$flags |= ($this->crouched === true ? 0b10:0) << 1;
|
||||||
$flags |= ($this->inAction === true ? 0b10000:0);
|
$flags |= ($this->inAction === true ? 0b10000 : 0);
|
||||||
$d = [
|
$d = [
|
||||||
0 => ["type" => 0, "value" => $flags],
|
0 => ["type" => 0, "value" => $flags],
|
||||||
1 => ["type" => 1, "value" => $this->airTicks],
|
1 => ["type" => 1, "value" => $this->airTicks],
|
||||||
|
@ -143,8 +143,8 @@ namespace pocketmine {
|
|||||||
if($response = Utils::getURL("http://ip-api.com/json")
|
if($response = Utils::getURL("http://ip-api.com/json")
|
||||||
and $ip_geolocation_data = json_decode($response, true)
|
and $ip_geolocation_data = json_decode($response, true)
|
||||||
and $ip_geolocation_data['status'] != 'fail'
|
and $ip_geolocation_data['status'] != 'fail'
|
||||||
and date_default_timezone_set($ip_geolocation_data['timezone']))
|
and date_default_timezone_set($ip_geolocation_data['timezone'])
|
||||||
{
|
){
|
||||||
//Again, for redundancy.
|
//Again, for redundancy.
|
||||||
ini_set("date.timezone", $ip_geolocation_data['timezone']);
|
ini_set("date.timezone", $ip_geolocation_data['timezone']);
|
||||||
}else{
|
}else{
|
||||||
@ -192,8 +192,7 @@ namespace pocketmine {
|
|||||||
//Detect the Time Zone string
|
//Detect the Time Zone string
|
||||||
preg_match($regex, $string, $matches);
|
preg_match($regex, $string, $matches);
|
||||||
|
|
||||||
if(!isset($matches[2]))
|
if(!isset($matches[2])){
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,6 +250,7 @@ namespace pocketmine {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $offset In the format of +09:00, +02:00, -04:00 etc.
|
* @param string $offset In the format of +09:00, +02:00, -04:00 etc.
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function parse_offset($offset){
|
function parse_offset($offset){
|
||||||
|
@ -149,8 +149,8 @@ class Server{
|
|||||||
*/
|
*/
|
||||||
private $tickCounter;
|
private $tickCounter;
|
||||||
private $nextTick = 0;
|
private $nextTick = 0;
|
||||||
private $tickAverage = [20,20,20,20,20];
|
private $tickAverage = [20, 20, 20, 20, 20];
|
||||||
private $useAverage = [20,20,20,20,20];
|
private $useAverage = [20, 20, 20, 20, 20];
|
||||||
|
|
||||||
/** @var \AttachableThreadedLogger */
|
/** @var \AttachableThreadedLogger */
|
||||||
private $logger;
|
private $logger;
|
||||||
@ -1898,7 +1898,7 @@ class Server{
|
|||||||
foreach($this->interfaces as $interface){
|
foreach($this->interfaces as $interface){
|
||||||
$interface->shutdown();
|
$interface->shutdown();
|
||||||
}
|
}
|
||||||
}catch (\Exception $e){
|
}catch(\Exception $e){
|
||||||
$this->logger->emergency("Crashed while crashing, killing process");
|
$this->logger->emergency("Crashed while crashing, killing process");
|
||||||
@kill(getmypid());
|
@kill(getmypid());
|
||||||
}
|
}
|
||||||
@ -2083,8 +2083,8 @@ class Server{
|
|||||||
foreach($this->getLevels() as $level){
|
foreach($this->getLevels() as $level){
|
||||||
try{
|
try{
|
||||||
$level->doTick($currentTick);
|
$level->doTick($currentTick);
|
||||||
}catch (\Exception $e){
|
}catch(\Exception $e){
|
||||||
$this->logger->critical("Could not tick level ".$level->getName().": ".$e->getMessage());
|
$this->logger->critical("Could not tick level " . $level->getName() . ": " . $e->getMessage());
|
||||||
if($this->logger instanceof MainLogger){
|
if($this->logger instanceof MainLogger){
|
||||||
$this->logger->logException($e);
|
$this->logger->logException($e);
|
||||||
}
|
}
|
||||||
@ -2152,7 +2152,7 @@ class Server{
|
|||||||
|
|
||||||
private function titleTick(){
|
private function titleTick(){
|
||||||
if(defined("pocketmine\\DEBUG") and \pocketmine\DEBUG >= 0 and \pocketmine\ANSI === true){
|
if(defined("pocketmine\\DEBUG") and \pocketmine\DEBUG >= 0 and \pocketmine\ANSI === true){
|
||||||
echo "\x1b]0;". $this->getName() . " " . $this->getPocketMineVersion() . " | Online " . count($this->players) . "/" . $this->getMaxPlayers() . " | RAM " . round((memory_get_usage() / 1024) / 1024, 2) . "/" . round((memory_get_usage(true) / 1024) / 1024, 2) . " MB | U " . round($this->mainInterface->getUploadUsage() / 1024, 2) . " D " . round($this->mainInterface->getDownloadUsage() / 1024, 2) . " kB/s | TPS " . $this->getTicksPerSecond() . " | Load ". $this->getTickUsage() . "%\x07";
|
echo "\x1b]0;" . $this->getName() . " " . $this->getPocketMineVersion() . " | Online " . count($this->players) . "/" . $this->getMaxPlayers() . " | RAM " . round((memory_get_usage() / 1024) / 1024, 2) . "/" . round((memory_get_usage(true) / 1024) / 1024, 2) . " MB | U " . round($this->mainInterface->getUploadUsage() / 1024, 2) . " D " . round($this->mainInterface->getDownloadUsage() / 1024, 2) . " kB/s | TPS " . $this->getTicksPerSecond() . " | Load " . $this->getTickUsage() . "%\x07";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2199,7 +2199,7 @@ class Server{
|
|||||||
|
|
||||||
try{
|
try{
|
||||||
$this->generationManager->process();
|
$this->generationManager->process();
|
||||||
}catch (\Exception $e){
|
}catch(\Exception $e){
|
||||||
if($this->logger instanceof MainLogger){
|
if($this->logger instanceof MainLogger){
|
||||||
$this->logger->logException($e);
|
$this->logger->logException($e);
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ class Mycelium extends Solid{
|
|||||||
return "Mycelium";
|
return "Mycelium";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHardness() {
|
public function getHardness(){
|
||||||
return 2.5;
|
return 2.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ class Torch extends Flowable{
|
|||||||
0 => 0,
|
0 => 0,
|
||||||
];
|
];
|
||||||
|
|
||||||
if($this->getSide($faces[$side])->isTransparent()=== true and !($side === 0 and $this->getSide(0)->getId() === self::FENCE)){
|
if($this->getSide($faces[$side])->isTransparent() === true and !($side === 0 and $this->getSide(0)->getId() === self::FENCE)){
|
||||||
$this->getLevel()->useBreakOn($this);
|
$this->getLevel()->useBreakOn($this);
|
||||||
|
|
||||||
return Level::BLOCK_UPDATE_NORMAL;
|
return Level::BLOCK_UPDATE_NORMAL;
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
abstract class Transparent extends Block{
|
abstract class Transparent extends Block{
|
||||||
|
|
||||||
public function isTransparent(){
|
public function isTransparent(){
|
||||||
|
@ -90,7 +90,8 @@ class Trapdoor extends Transparent{
|
|||||||
$this->y + 1,
|
$this->y + 1,
|
||||||
$this->z + $f
|
$this->z + $f
|
||||||
);
|
);
|
||||||
}if(($damage & 0x03) === 2){
|
}
|
||||||
|
if(($damage & 0x03) === 2){
|
||||||
$bb->setBounds(
|
$bb->setBounds(
|
||||||
$this->x + 1 - $f,
|
$this->x + 1 - $f,
|
||||||
$this->y,
|
$this->y,
|
||||||
@ -99,7 +100,8 @@ class Trapdoor extends Transparent{
|
|||||||
$this->y + 1,
|
$this->y + 1,
|
||||||
$this->z + 1
|
$this->z + 1
|
||||||
);
|
);
|
||||||
}if(($damage & 0x03) === 3){
|
}
|
||||||
|
if(($damage & 0x03) === 3){
|
||||||
$bb->setBounds(
|
$bb->setBounds(
|
||||||
$this->x,
|
$this->x,
|
||||||
$this->y,
|
$this->y,
|
||||||
|
@ -182,7 +182,7 @@ class SimpleCommandMap implements CommandMap{
|
|||||||
try{
|
try{
|
||||||
$target->execute($sender, $sentCommandLabel, $args);
|
$target->execute($sender, $sentCommandLabel, $args);
|
||||||
}catch(\Exception $e){
|
}catch(\Exception $e){
|
||||||
$this->server->getLogger()->critical("Unhandled exception executing command '". $commandLine ."' in ". $target.": ".$e->getMessage());
|
$this->server->getLogger()->critical("Unhandled exception executing command '" . $commandLine . "' in " . $target . ": " . $e->getMessage());
|
||||||
if(($logger = $sender->getServer()->getLogger()) instanceof MainLogger){
|
if(($logger = $sender->getServer()->getLogger()) instanceof MainLogger){
|
||||||
$logger->logException($e);
|
$logger->logException($e);
|
||||||
}
|
}
|
||||||
|
@ -113,7 +113,7 @@ class TimeCommand extends VanillaCommand{
|
|||||||
$level->setTime($level->getTime() + $value);
|
$level->setTime($level->getTime() + $value);
|
||||||
$level->checkTime();
|
$level->checkTime();
|
||||||
}
|
}
|
||||||
Command::broadcastCommandMessage($sender, "Added " . $value ." to time");
|
Command::broadcastCommandMessage($sender, "Added " . $value . " to time");
|
||||||
}else{
|
}else{
|
||||||
$sender->sendMessage(TextFormat::RED . "Usage: " . $this->usageMessage);
|
$sender->sendMessage(TextFormat::RED . "Usage: " . $this->usageMessage);
|
||||||
}
|
}
|
||||||
|
@ -119,8 +119,8 @@ class TimingsCommand extends VanillaCommand{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$sender->sendMessage("Timings uploaded to http://paste.ubuntu.com/".$matches[1]."/");
|
$sender->sendMessage("Timings uploaded to http://paste.ubuntu.com/" . $matches[1] . "/");
|
||||||
$sender->sendMessage("You can read the results at http://timings.aikar.co/?url=".$matches[1]);
|
$sender->sendMessage("You can read the results at http://timings.aikar.co/?url=" . $matches[1]);
|
||||||
fclose($fileTimings);
|
fclose($fileTimings);
|
||||||
}else{
|
}else{
|
||||||
fclose($fileTimings);
|
fclose($fileTimings);
|
||||||
|
@ -44,7 +44,7 @@ class VersionCommand extends VanillaCommand{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(count($args) === 0){
|
if(count($args) === 0){
|
||||||
$output = "This server is running ". $sender->getServer()->getName() . " version " . $sender->getServer()->getPocketMineVersion() . " 「" . $sender->getServer()->getCodename() . "」 (Implementing API version " . $sender->getServer()->getApiVersion() . " for Minecraft: PE " . $sender->getServer()->getVersion() . " protocol version " . Info::CURRENT_PROTOCOL . ")";
|
$output = "This server is running " . $sender->getServer()->getName() . " version " . $sender->getServer()->getPocketMineVersion() . " 「" . $sender->getServer()->getCodename() . "」 (Implementing API version " . $sender->getServer()->getApiVersion() . " for Minecraft: PE " . $sender->getServer()->getVersion() . " protocol version " . Info::CURRENT_PROTOCOL . ")";
|
||||||
if(\pocketmine\GIT_COMMIT !== str_repeat("00", 20)){
|
if(\pocketmine\GIT_COMMIT !== str_repeat("00", 20)){
|
||||||
$output .= " [git " . \pocketmine\GIT_COMMIT . "]";
|
$output .= " [git " . \pocketmine\GIT_COMMIT . "]";
|
||||||
}
|
}
|
||||||
|
@ -131,6 +131,7 @@ class FallingSand extends Entity{
|
|||||||
public function getBlock(){
|
public function getBlock(){
|
||||||
return $this->blockId;
|
return $this->blockId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDamage(){
|
public function getDamage(){
|
||||||
return $this->damage;
|
return $this->damage;
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,6 @@ abstract class Projectile extends Entity{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$tickDiff = max(1, $currentTick - $this->lastUpdate);
|
$tickDiff = max(1, $currentTick - $this->lastUpdate);
|
||||||
$this->lastUpdate = $currentTick;
|
$this->lastUpdate = $currentTick;
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ class TimingsHandler{
|
|||||||
}
|
}
|
||||||
|
|
||||||
fwrite($fp, "# Version " . Server::getInstance()->getVersion() . PHP_EOL);
|
fwrite($fp, "# Version " . Server::getInstance()->getVersion() . PHP_EOL);
|
||||||
fwrite($fp, "# ". Server::getInstance()->getName() . " " . Server::getInstance()->getPocketMineVersion() . PHP_EOL);
|
fwrite($fp, "# " . Server::getInstance()->getName() . " " . Server::getInstance()->getPocketMineVersion() . PHP_EOL);
|
||||||
|
|
||||||
$entities = 0;
|
$entities = 0;
|
||||||
$livingEntities = 0;
|
$livingEntities = 0;
|
||||||
|
@ -67,7 +67,7 @@ class QueryRegenerateEvent extends ServerEvent{
|
|||||||
|
|
||||||
$this->gametype = ($server->getGamemode() & 0x01) === 0 ? "SMP" : "CMP";
|
$this->gametype = ($server->getGamemode() & 0x01) === 0 ? "SMP" : "CMP";
|
||||||
$this->version = $server->getVersion();
|
$this->version = $server->getVersion();
|
||||||
$this->server_engine = $server->getName() ." ". $server->getPocketMineVersion();
|
$this->server_engine = $server->getName() . " " . $server->getPocketMineVersion();
|
||||||
$this->map = $server->getDefaultLevel() === null ? "unknown" : $server->getDefaultLevel()->getName();
|
$this->map = $server->getDefaultLevel() === null ? "unknown" : $server->getDefaultLevel()->getName();
|
||||||
$this->numPlayers = count($this->players);
|
$this->numPlayers = count($this->players);
|
||||||
$this->maxPlayers = $server->getMaxPlayers();
|
$this->maxPlayers = $server->getMaxPlayers();
|
||||||
|
@ -364,7 +364,6 @@ class PlayerInventory extends BaseInventory{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $index
|
* @param int $index
|
||||||
* @param Player|Player[] $target
|
* @param Player|Player[] $target
|
||||||
|
@ -644,7 +644,7 @@ class Item{
|
|||||||
}
|
}
|
||||||
|
|
||||||
final public function __toString(){
|
final public function __toString(){
|
||||||
return "Item " . $this->name . " (" . $this->id . ":" . ($this->meta === null ? "?" : $this->meta) . ")x".$this->count;
|
return "Item " . $this->name . " (" . $this->id . ":" . ($this->meta === null ? "?" : $this->meta) . ")x" . $this->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDestroySpeed(Block $block, Player $player){
|
public function getDestroySpeed(Block $block, Player $player){
|
||||||
|
@ -1709,7 +1709,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
$this->chunks[$index] = $chunk;
|
$this->chunks[$index] = $chunk;
|
||||||
}
|
}
|
||||||
if(ADVANCED_CACHE == true){
|
if(ADVANCED_CACHE == true){
|
||||||
Cache::remove("world:" . $this->getId() . ":". Level::chunkHash($x, $z));
|
Cache::remove("world:" . $this->getId() . ":" . Level::chunkHash($x, $z));
|
||||||
}
|
}
|
||||||
$chunk->setChanged();
|
$chunk->setChanged();
|
||||||
}
|
}
|
||||||
@ -1995,9 +1995,9 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
$this->provider->saveChunk($x, $z);
|
$this->provider->saveChunk($x, $z);
|
||||||
}
|
}
|
||||||
$this->provider->unloadChunk($x, $z, $safe);
|
$this->provider->unloadChunk($x, $z, $safe);
|
||||||
}catch (\Exception $e){
|
}catch(\Exception $e){
|
||||||
$logger = $this->server->getLogger();
|
$logger = $this->server->getLogger();
|
||||||
$logger->error("Error when unloading a chunk: ".$e->getMessage());
|
$logger->error("Error when unloading a chunk: " . $e->getMessage());
|
||||||
if($logger instanceof MainLogger){
|
if($logger instanceof MainLogger){
|
||||||
$logger->logException($e);
|
$logger->logException($e);
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,7 @@ class Chunk extends BaseChunk{
|
|||||||
}
|
}
|
||||||
|
|
||||||
return new Chunk($provider instanceof LevelProvider ? $provider : Anvil::class, $chunk->Level);
|
return new Chunk($provider instanceof LevelProvider ? $provider : Anvil::class, $chunk->Level);
|
||||||
}catch (\Exception $e){
|
}catch(\Exception $e){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -265,7 +265,7 @@ class Chunk extends BaseFullChunk{
|
|||||||
}
|
}
|
||||||
|
|
||||||
return new Chunk($provider instanceof LevelProvider ? $provider : McRegion::class, $chunk->Level);
|
return new Chunk($provider instanceof LevelProvider ? $provider : McRegion::class, $chunk->Level);
|
||||||
}catch (\Exception $e){
|
}catch(\Exception $e){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -253,7 +253,6 @@ class McRegion extends BaseLevelProvider{
|
|||||||
$chunk->setZ($chunkZ);
|
$chunk->setZ($chunkZ);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if($this->getChunk($chunkX, $chunkZ, false) !== $chunk){
|
if($this->getChunk($chunkX, $chunkZ, false) !== $chunk){
|
||||||
$this->unloadChunk($chunkX, $chunkZ, false);
|
$this->unloadChunk($chunkX, $chunkZ, false);
|
||||||
}
|
}
|
||||||
|
@ -216,7 +216,7 @@ class RegionLoader{
|
|||||||
|
|
||||||
try{
|
try{
|
||||||
$chunk = zlib_decode(substr($chunk, 5));
|
$chunk = zlib_decode(substr($chunk, 5));
|
||||||
}catch (\Exception $e){
|
}catch(\Exception $e){
|
||||||
$this->locationTable[$i] = [0, 0, 0]; //Corrupted chunk, remove it
|
$this->locationTable[$i] = [0, 0, 0]; //Corrupted chunk, remove it
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,8 @@ class GenerationChunkManager implements ChunkManager{
|
|||||||
$this->getChunk($chunkX, $chunkZ);
|
$this->getChunk($chunkX, $chunkZ);
|
||||||
$this->generator->generateChunk($chunkX, $chunkZ);
|
$this->generator->generateChunk($chunkX, $chunkZ);
|
||||||
$this->setChunkGenerated($chunkX, $chunkZ);
|
$this->setChunkGenerated($chunkX, $chunkZ);
|
||||||
}catch(\Exception $e){}
|
}catch(\Exception $e){
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function populateChunk($chunkX, $chunkZ){
|
public function populateChunk($chunkX, $chunkZ){
|
||||||
@ -163,7 +164,8 @@ class GenerationChunkManager implements ChunkManager{
|
|||||||
$chunk = $this->getChunk($chunkX, $chunkZ);
|
$chunk = $this->getChunk($chunkX, $chunkZ);
|
||||||
$chunk->setGenerated(true);
|
$chunk->setGenerated(true);
|
||||||
$this->changes["$chunkX:$chunkZ"] = $chunk;
|
$this->changes["$chunkX:$chunkZ"] = $chunk;
|
||||||
}catch(\Exception $e){}
|
}catch(\Exception $e){
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setChunkPopulated($chunkX, $chunkZ){
|
public function setChunkPopulated($chunkX, $chunkZ){
|
||||||
@ -171,7 +173,8 @@ class GenerationChunkManager implements ChunkManager{
|
|||||||
$chunk = $this->getChunk($chunkX, $chunkZ);
|
$chunk = $this->getChunk($chunkX, $chunkZ);
|
||||||
$chunk->setPopulated(true);
|
$chunk->setPopulated(true);
|
||||||
$this->changes["$chunkX:$chunkZ"] = $chunk;
|
$this->changes["$chunkX:$chunkZ"] = $chunk;
|
||||||
}catch(\Exception $e){}
|
}catch(\Exception $e){
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function requestChunk($chunkX, $chunkZ){
|
protected function requestChunk($chunkX, $chunkZ){
|
||||||
@ -222,7 +225,8 @@ class GenerationChunkManager implements ChunkManager{
|
|||||||
public function setBlockIdAt($x, $y, $z, $id){
|
public function setBlockIdAt($x, $y, $z, $id){
|
||||||
try{
|
try{
|
||||||
$this->getChunk($x >> 4, $z >> 4)->setBlockId($x & 0x0f, $y & 0x7f, $z & 0x0f, $id & 0xff);
|
$this->getChunk($x >> 4, $z >> 4)->setBlockId($x & 0x0f, $y & 0x7f, $z & 0x0f, $id & 0xff);
|
||||||
}catch(\Exception $e){}
|
}catch(\Exception $e){
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -253,7 +257,8 @@ class GenerationChunkManager implements ChunkManager{
|
|||||||
public function setBlockDataAt($x, $y, $z, $data){
|
public function setBlockDataAt($x, $y, $z, $data){
|
||||||
try{
|
try{
|
||||||
$this->getChunk($x >> 4, $z >> 4)->setBlockData($x & 0x0f, $y & 0x7f, $z & 0x0f, $data & 0x0f);
|
$this->getChunk($x >> 4, $z >> 4)->setBlockData($x & 0x0f, $y & 0x7f, $z & 0x0f, $data & 0x0f);
|
||||||
}catch(\Exception $e){}
|
}catch(\Exception $e){
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function shutdown(){
|
public function shutdown(){
|
||||||
|
@ -135,7 +135,7 @@ class GenerationManager{
|
|||||||
$this->readPacket();
|
$this->readPacket();
|
||||||
}
|
}
|
||||||
}catch(\Exception $e){
|
}catch(\Exception $e){
|
||||||
$this->logger->warning("[Generator Thread] Exception: ".$e->getMessage() . " on file \"".$e->getFile()."\" line ".$e->getLine());
|
$this->logger->warning("[Generator Thread] Exception: " . $e->getMessage() . " on file \"" . $e->getFile() . "\" line " . $e->getLine());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -271,7 +271,7 @@ class GenerationManager{
|
|||||||
$this->shutdown = true;
|
$this->shutdown = true;
|
||||||
}
|
}
|
||||||
}elseif(count($this->thread->getInternalQueue()) === 0){
|
}elseif(count($this->thread->getInternalQueue()) === 0){
|
||||||
$this->thread->synchronized(function(){
|
$this->thread->synchronized(function (){
|
||||||
$this->thread->wait(50000);
|
$this->thread->wait(50000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ class GenerationThread extends Thread{
|
|||||||
|
|
||||||
public function pushMainToThreadPacket($str){
|
public function pushMainToThreadPacket($str){
|
||||||
$this->internalQueue[] = $str;
|
$this->internalQueue[] = $str;
|
||||||
$this->synchronized(function(){
|
$this->synchronized(function (){
|
||||||
$this->notify();
|
$this->notify();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
namespace pocketmine\math;
|
namespace pocketmine\math;
|
||||||
|
|
||||||
use pocketmine\level\MovingObjectPosition;
|
use pocketmine\level\MovingObjectPosition;
|
||||||
|
|
||||||
class AxisAlignedBB{
|
class AxisAlignedBB{
|
||||||
|
@ -42,6 +42,7 @@ use pocketmine\utils\Utils;
|
|||||||
|
|
||||||
#ifndef COMPILE
|
#ifndef COMPILE
|
||||||
use pocketmine\utils\Binary;
|
use pocketmine\utils\Binary;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -180,11 +180,11 @@ class RakLibInterface implements ServerInstance, SourceInterface{
|
|||||||
$pk = $this->getPacket($packet->buffer);
|
$pk = $this->getPacket($packet->buffer);
|
||||||
$pk->decode();
|
$pk->decode();
|
||||||
$this->players[$identifier]->handleDataPacket($pk);
|
$this->players[$identifier]->handleDataPacket($pk);
|
||||||
}catch (\Exception $e){
|
}catch(\Exception $e){
|
||||||
if(\pocketmine\DEBUG > 1){
|
if(\pocketmine\DEBUG > 1){
|
||||||
$logger = $this->server->getLogger();
|
$logger = $this->server->getLogger();
|
||||||
if($logger instanceof MainLogger){
|
if($logger instanceof MainLogger){
|
||||||
$logger->debug("Packet ".get_class($pk)." 0x".bin2hex($packet->buffer));
|
$logger->debug("Packet " . get_class($pk) . " 0x" . bin2hex($packet->buffer));
|
||||||
$logger->logException($e);
|
$logger->logException($e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,10 +21,11 @@
|
|||||||
|
|
||||||
namespace pocketmine\network\protocol;
|
namespace pocketmine\network\protocol;
|
||||||
|
|
||||||
#include <rules/DataPacket.h>
|
#include <rules/DataPacket.h>
|
||||||
|
|
||||||
#ifndef COMPILE
|
#ifndef COMPILE
|
||||||
use pocketmine\utils\Binary;
|
use pocketmine\utils\Binary;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class AddMobPacket extends DataPacket{
|
class AddMobPacket extends DataPacket{
|
||||||
|
@ -21,10 +21,11 @@
|
|||||||
|
|
||||||
namespace pocketmine\network\protocol;
|
namespace pocketmine\network\protocol;
|
||||||
|
|
||||||
#include <rules/DataPacket.h>
|
#include <rules/DataPacket.h>
|
||||||
|
|
||||||
#ifndef COMPILE
|
#ifndef COMPILE
|
||||||
use pocketmine\utils\Binary;
|
use pocketmine\utils\Binary;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class AddPlayerPacket extends DataPacket{
|
class AddPlayerPacket extends DataPacket{
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
namespace pocketmine\network\protocol;
|
namespace pocketmine\network\protocol;
|
||||||
|
|
||||||
#include <rules/DataPacket.h>
|
#include <rules/DataPacket.h>
|
||||||
|
|
||||||
#ifndef COMPILE
|
#ifndef COMPILE
|
||||||
use pocketmine\utils\Binary;
|
use pocketmine\utils\Binary;
|
||||||
|
@ -21,10 +21,11 @@
|
|||||||
|
|
||||||
namespace pocketmine\network\protocol;
|
namespace pocketmine\network\protocol;
|
||||||
|
|
||||||
#include <rules/DataPacket.h>
|
#include <rules/DataPacket.h>
|
||||||
|
|
||||||
#ifndef COMPILE
|
#ifndef COMPILE
|
||||||
use pocketmine\utils\Binary;
|
use pocketmine\utils\Binary;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class SetEntityDataPacket extends DataPacket{
|
class SetEntityDataPacket extends DataPacket{
|
||||||
|
@ -109,7 +109,7 @@ class RCONInstance extends \Thread{
|
|||||||
}
|
}
|
||||||
|
|
||||||
for($n = 0; $n < $this->maxClients; ++$n){
|
for($n = 0; $n < $this->maxClients; ++$n){
|
||||||
$client = & $this->{"client" . $n};
|
$client = &$this->{"client" . $n};
|
||||||
if($client !== null){
|
if($client !== null){
|
||||||
if($this->{"status" . $n} !== -1 and $this->stop !== true){
|
if($this->{"status" . $n} !== -1 and $this->stop !== true){
|
||||||
if($this->{"status" . $n} === 0 and $this->{"timeout" . $n} < microtime(true)){ //Timeout
|
if($this->{"status" . $n} === 0 and $this->{"timeout" . $n} < microtime(true)){ //Timeout
|
||||||
|
@ -668,7 +668,7 @@ class PluginManager{
|
|||||||
try{
|
try{
|
||||||
$registration->callEvent($event);
|
$registration->callEvent($event);
|
||||||
}catch(\Exception $e){
|
}catch(\Exception $e){
|
||||||
$this->server->getLogger()->critical("Could not pass event ". $event->getEventName() ." to ". $registration->getPlugin()->getDescription()->getFullName() .": ".$e->getMessage()." on ".get_class($registration->getListener()));
|
$this->server->getLogger()->critical("Could not pass event " . $event->getEventName() . " to " . $registration->getPlugin()->getDescription()->getFullName() . ": " . $e->getMessage() . " on " . get_class($registration->getListener()));
|
||||||
if(($logger = $this->server->getLogger()) instanceof MainLogger){
|
if(($logger = $this->server->getLogger()) instanceof MainLogger){
|
||||||
$logger->logException($e);
|
$logger->logException($e);
|
||||||
}
|
}
|
||||||
|
@ -235,8 +235,8 @@ class ServerScheduler{
|
|||||||
$task->timings->startTiming();
|
$task->timings->startTiming();
|
||||||
try{
|
try{
|
||||||
$task->run($this->currentTick);
|
$task->run($this->currentTick);
|
||||||
}catch (\Exception $e){
|
}catch(\Exception $e){
|
||||||
Server::getInstance()->getLogger()->critical("Could not execute task ". $task->getTaskName() .": ".$e->getMessage());
|
Server::getInstance()->getLogger()->critical("Could not execute task " . $task->getTaskName() . ": " . $e->getMessage());
|
||||||
if(($logger = Server::getInstance()->getLogger()) instanceof MainLogger){
|
if(($logger = Server::getInstance()->getLogger()) instanceof MainLogger){
|
||||||
$logger->logException($e);
|
$logger->logException($e);
|
||||||
}
|
}
|
||||||
|
@ -238,7 +238,8 @@ class Furnace extends Tile implements InventoryHolder, Container{
|
|||||||
$this->namedtag->CookTime = new Short("CookTime", 0);
|
$this->namedtag->CookTime = new Short("CookTime", 0);
|
||||||
}
|
}
|
||||||
$ret = true;
|
$ret = true;
|
||||||
}else{;
|
}else{
|
||||||
|
;
|
||||||
if($this->getBlock()->getId() === Item::BURNING_FURNACE){
|
if($this->getBlock()->getId() === Item::BURNING_FURNACE){
|
||||||
$this->getLevel()->setBlock($this, Block::get(Item::FURNACE, $this->getBlock()->getDamage()), true);
|
$this->getLevel()->setBlock($this, Block::get(Item::FURNACE, $this->getBlock()->getDamage()), true);
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ class MainLogger extends \AttachableThreadedLogger{
|
|||||||
$errstr = substr($errstr, 0, $pos);
|
$errstr = substr($errstr, 0, $pos);
|
||||||
}
|
}
|
||||||
$errfile = \pocketmine\cleanPath($errfile);
|
$errfile = \pocketmine\cleanPath($errfile);
|
||||||
$this->log($type, get_class($e).": \"$errstr\" ($errno) in \"$errfile\" at line $errline");
|
$this->log($type, get_class($e) . ": \"$errstr\" ($errno) in \"$errfile\" at line $errline");
|
||||||
|
|
||||||
foreach(($trace = @\pocketmine\getTrace($trace === null ? 4 : 0, $trace)) as $i => $line){
|
foreach(($trace = @\pocketmine\getTrace($trace === null ? 4 : 0, $trace)) as $i => $line){
|
||||||
$this->debug($line);
|
$this->debug($line);
|
||||||
|
@ -59,7 +59,7 @@ class Utils{
|
|||||||
*/
|
*/
|
||||||
public static function getUniqueID($raw = false, $extra = ""){
|
public static function getUniqueID($raw = false, $extra = ""){
|
||||||
$machine = php_uname("a");
|
$machine = php_uname("a");
|
||||||
$machine .= file_exists("/proc/cpuinfo") ? implode(preg_grep("/model name/", file("/proc/cpuinfo"))): "";
|
$machine .= file_exists("/proc/cpuinfo") ? implode(preg_grep("/model name/", file("/proc/cpuinfo"))) : "";
|
||||||
$machine .= sys_get_temp_dir();
|
$machine .= sys_get_temp_dir();
|
||||||
$machine .= $extra;
|
$machine .= $extra;
|
||||||
$os = Utils::getOS();
|
$os = Utils::getOS();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user