mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-13 21:05:08 +00:00
Compare commits
4 Commits
api/3.0.0-
...
1.7dev-743
Author | SHA1 | Date | |
---|---|---|---|
a3fa8adf4a | |||
cacd0f5d8f | |||
3600542d78 | |||
e0ed877494 |
@ -126,7 +126,7 @@ class TimingsCommand extends VanillaCommand{
|
||||
}
|
||||
list(, $headers) = $result;
|
||||
foreach($headers as $headerGroup){
|
||||
if(isset($headerGroup["location"]) and preg_match('#^http://paste\\.ubuntu\\.com/([0-9]{1,})/#', trim($headerGroup["location"]), $match)){
|
||||
if(isset($headerGroup["location"]) and preg_match('#^http://paste\\.ubuntu\\.com/([A-Za-z0-9+\/=]+)/#', trim($headerGroup["location"]), $match)){
|
||||
$pasteId = $match[1];
|
||||
break;
|
||||
}
|
||||
@ -134,7 +134,7 @@ class TimingsCommand extends VanillaCommand{
|
||||
if(isset($pasteId)){
|
||||
$sender->sendMessage(new TranslationContainer("pocketmine.command.timings.timingsUpload", ["http://paste.ubuntu.com/" . $pasteId . "/"]));
|
||||
$sender->sendMessage(new TranslationContainer("pocketmine.command.timings.timingsRead",
|
||||
["http://" . $sender->getServer()->getProperty("timings.host", "timings.pmmp.io") . "/?url=$pasteId"]));
|
||||
["http://" . $sender->getServer()->getProperty("timings.host", "timings.pmmp.io") . "/?url=" . urlencode($pasteId)]));
|
||||
}else{
|
||||
$sender->sendMessage(new TranslationContainer("pocketmine.command.timings.pasteError"));
|
||||
}
|
||||
|
@ -165,16 +165,16 @@ class ExperienceOrb extends Entity{
|
||||
}
|
||||
|
||||
$currentTarget = $this->getTargetPlayer();
|
||||
if($currentTarget !== null and $currentTarget->distanceSquared($this) > self::MAX_TARGET_DISTANCE ** 2){
|
||||
$currentTarget = null;
|
||||
}
|
||||
|
||||
if($this->lookForTargetTime >= 20){
|
||||
if($currentTarget === null or $currentTarget->distanceSquared($this) > self::MAX_TARGET_DISTANCE ** 2){
|
||||
$this->setTargetPlayer(null);
|
||||
|
||||
if($currentTarget === null){
|
||||
$newTarget = $this->level->getNearestEntity($this, self::MAX_TARGET_DISTANCE, Human::class);
|
||||
|
||||
if($newTarget instanceof Human and !($newTarget instanceof Player and $newTarget->isSpectator())){
|
||||
$currentTarget = $newTarget;
|
||||
$this->setTargetPlayer($currentTarget);
|
||||
}
|
||||
}
|
||||
|
||||
@ -183,6 +183,8 @@ class ExperienceOrb extends Entity{
|
||||
$this->lookForTargetTime += $tickDiff;
|
||||
}
|
||||
|
||||
$this->setTargetPlayer($currentTarget);
|
||||
|
||||
if($currentTarget !== null){
|
||||
$vector = $currentTarget->subtract($this)->add(0, $currentTarget->getEyeHeight() / 2, 0)->divide(self::MAX_TARGET_DISTANCE);
|
||||
|
||||
|
@ -823,8 +823,10 @@ class Level implements ChunkManager, Metadatable{
|
||||
$this->checkSleep();
|
||||
}
|
||||
|
||||
$this->server->batchPackets($this->players, $this->globalPackets);
|
||||
$this->globalPackets = [];
|
||||
if(!empty($this->players) and !empty($this->globalPackets)){
|
||||
$this->server->batchPackets($this->players, $this->globalPackets);
|
||||
$this->globalPackets = [];
|
||||
}
|
||||
|
||||
foreach($this->chunkPackets as $index => $entries){
|
||||
Level::getXZ($index, $chunkX, $chunkZ);
|
||||
|
@ -39,15 +39,15 @@ interface ProtocolInfo{
|
||||
/**
|
||||
* Actual Minecraft: PE protocol version
|
||||
*/
|
||||
public const CURRENT_PROTOCOL = 160;
|
||||
public const CURRENT_PROTOCOL = 201;
|
||||
/**
|
||||
* Current Minecraft PE version reported by the server. This is usually the earliest currently supported version.
|
||||
*/
|
||||
public const MINECRAFT_VERSION = 'v1.2.7';
|
||||
public const MINECRAFT_VERSION = 'v1.2.10';
|
||||
/**
|
||||
* Version number sent to clients in ping responses.
|
||||
*/
|
||||
public const MINECRAFT_VERSION_NETWORK = '1.2.7';
|
||||
public const MINECRAFT_VERSION_NETWORK = '1.2.10';
|
||||
|
||||
public const LOGIN_PACKET = 0x01;
|
||||
public const PLAY_STATUS_PACKET = 0x02;
|
||||
|
@ -96,6 +96,8 @@ class StartGamePacket extends DataPacket{
|
||||
public $defaultPlayerPermission = PlayerPermissions::MEMBER; //TODO
|
||||
/** @var int */
|
||||
public $xboxLiveBroadcastMode = 0; //TODO: find values
|
||||
/** @var int */
|
||||
public $serverChunkTickRadius = 4; //TODO (leave as default for now)
|
||||
|
||||
/** @var string */
|
||||
public $levelId = ""; //base64 string, usually the same as world folder name in vanilla
|
||||
@ -143,6 +145,7 @@ class StartGamePacket extends DataPacket{
|
||||
$this->hasTrustPlayersEnabled = $this->getBool();
|
||||
$this->defaultPlayerPermission = $this->getVarInt();
|
||||
$this->xboxLiveBroadcastMode = $this->getVarInt();
|
||||
$this->serverChunkTickRadius = $this->getLInt();
|
||||
|
||||
$this->levelId = $this->getString();
|
||||
$this->worldName = $this->getString();
|
||||
@ -186,6 +189,7 @@ class StartGamePacket extends DataPacket{
|
||||
$this->putBool($this->hasTrustPlayersEnabled);
|
||||
$this->putVarInt($this->defaultPlayerPermission);
|
||||
$this->putVarInt($this->xboxLiveBroadcastMode);
|
||||
$this->putLInt($this->serverChunkTickRadius);
|
||||
|
||||
$this->putString($this->levelId);
|
||||
$this->putString($this->worldName);
|
||||
|
Reference in New Issue
Block a user