mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-15 18:29:46 +00:00
Cleaned up isEncoded mess
This commit is contained in:
parent
6341d3a0dc
commit
3a214b7ce6
@ -1817,7 +1817,6 @@ class Server{
|
||||
*/
|
||||
public function broadcastPacket(array $players, DataPacket $packet){
|
||||
$packet->encode();
|
||||
$packet->isEncoded = true;
|
||||
$this->batchPackets($players, [$packet], false);
|
||||
}
|
||||
|
||||
@ -1867,7 +1866,6 @@ class Server{
|
||||
public function broadcastPacketsCallback(BatchPacket $pk, array $identifiers, bool $immediate = false){
|
||||
if(!$pk->isEncoded){
|
||||
$pk->encode();
|
||||
$pk->isEncoded = true;
|
||||
}
|
||||
|
||||
if($immediate){
|
||||
|
@ -112,7 +112,6 @@ class CraftingManager{
|
||||
}
|
||||
|
||||
$pk->encode();
|
||||
$pk->isEncoded = true;
|
||||
|
||||
$this->craftingDataCache = $pk;
|
||||
Timings::$craftingDataCacheRebuildTimer->stopTiming();
|
||||
|
@ -420,7 +420,6 @@ class PlayerInventory extends BaseInventory{
|
||||
$pk->entityRuntimeId = $this->getHolder()->getId();
|
||||
$pk->slots = $armor;
|
||||
$pk->encode();
|
||||
$pk->isEncoded = true;
|
||||
|
||||
foreach($target as $player){
|
||||
if($player === $this->getHolder()){
|
||||
@ -468,7 +467,6 @@ class PlayerInventory extends BaseInventory{
|
||||
$pk->entityRuntimeId = $this->getHolder()->getId();
|
||||
$pk->slots = $armor;
|
||||
$pk->encode();
|
||||
$pk->isEncoded = true;
|
||||
|
||||
foreach($target as $player){
|
||||
if($player === $this->getHolder()){
|
||||
|
@ -200,7 +200,6 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
|
||||
$identifier = $this->identifiers[$h];
|
||||
if(!$packet->isEncoded){
|
||||
$packet->encode();
|
||||
$packet->isEncoded = true;
|
||||
}
|
||||
|
||||
if($packet instanceof BatchPacket){
|
||||
|
@ -70,6 +70,7 @@ abstract class DataPacket extends BinaryStream{
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->encodePayload();
|
||||
$this->isEncoded = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user