Reduce BatchPacket hacks

we can't get rid of these hacks entirely because BAcKWARdS ComPaTIbilitY, but this at least ensures that things over PID 127 won't burn the house down when 1.12 gets here. This also reduces conflicts with 4.0 line.
This commit is contained in:
Dylan K. Taylor
2019-04-25 14:48:36 +01:00
parent 74b9922a28
commit 4a35516441
2 changed files with 5 additions and 9 deletions

View File

@ -27,7 +27,6 @@ use pocketmine\event\player\PlayerCreationEvent;
use pocketmine\network\AdvancedSourceInterface;
use pocketmine\network\mcpe\protocol\BatchPacket;
use pocketmine\network\mcpe\protocol\DataPacket;
use pocketmine\network\mcpe\protocol\PacketPool;
use pocketmine\network\mcpe\protocol\ProtocolInfo;
use pocketmine\network\Network;
use pocketmine\Player;
@ -166,7 +165,7 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
$address = $player->getAddress();
try{
if($packet->buffer !== ""){
$pk = PacketPool::getPacket($packet->buffer);
$pk = new BatchPacket($packet->buffer);
$player->handleDataPacket($pk);
}
}catch(\Throwable $e){