mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-27 21:59:52 +00:00
Fixed packets
This commit is contained in:
parent
a6c19734ce
commit
3af784012c
@ -2342,12 +2342,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ProtocolInfo::SEND_INVENTORY_PACKET: //TODO, Mojang, enable this ´^_^`
|
case ProtocolInfo::TILE_ENTITY_DATA_PACKET:
|
||||||
if($this->spawned === false){
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case ProtocolInfo::ENTITY_DATA_PACKET:
|
|
||||||
if($this->spawned === false or $this->blocked === true or $this->dead === true){
|
if($this->spawned === false or $this->blocked === true or $this->dead === true){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ use pocketmine\network\protocol\ContainerSetDataPacket;
|
|||||||
use pocketmine\network\protocol\ContainerSetSlotPacket;
|
use pocketmine\network\protocol\ContainerSetSlotPacket;
|
||||||
use pocketmine\network\protocol\DataPacket;
|
use pocketmine\network\protocol\DataPacket;
|
||||||
use pocketmine\network\protocol\DropItemPacket;
|
use pocketmine\network\protocol\DropItemPacket;
|
||||||
use pocketmine\network\protocol\EntityDataPacket;
|
use pocketmine\network\protocol\TileEntityDataPacket;
|
||||||
use pocketmine\network\protocol\EntityEventPacket;
|
use pocketmine\network\protocol\EntityEventPacket;
|
||||||
use pocketmine\network\protocol\ExplodePacket;
|
use pocketmine\network\protocol\ExplodePacket;
|
||||||
use pocketmine\network\protocol\HurtArmorPacket;
|
use pocketmine\network\protocol\HurtArmorPacket;
|
||||||
@ -348,7 +348,7 @@ class RakLibInterface implements ServerInstance, SourceInterface{
|
|||||||
$this->registerPacket(ProtocolInfo::CONTAINER_SET_CONTENT_PACKET, ContainerSetContentPacket::class);
|
$this->registerPacket(ProtocolInfo::CONTAINER_SET_CONTENT_PACKET, ContainerSetContentPacket::class);
|
||||||
$this->registerPacket(ProtocolInfo::CHAT_PACKET, ChatPacket::class);
|
$this->registerPacket(ProtocolInfo::CHAT_PACKET, ChatPacket::class);
|
||||||
$this->registerPacket(ProtocolInfo::ADVENTURE_SETTINGS_PACKET, AdventureSettingsPacket::class);
|
$this->registerPacket(ProtocolInfo::ADVENTURE_SETTINGS_PACKET, AdventureSettingsPacket::class);
|
||||||
$this->registerPacket(ProtocolInfo::ENTITY_DATA_PACKET, EntityDataPacket::class);
|
$this->registerPacket(ProtocolInfo::TILE_ENTITY_DATA_PACKET, TileEntityDataPacket::class);
|
||||||
$this->registerPacket(ProtocolInfo::SET_DIFFICULTY_PACKET, SetDifficultyPacket::class);
|
$this->registerPacket(ProtocolInfo::SET_DIFFICULTY_PACKET, SetDifficultyPacket::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ interface Info{
|
|||||||
//const CONTAINER_ACK_PACKET = 0xad;
|
//const CONTAINER_ACK_PACKET = 0xad;
|
||||||
const CHAT_PACKET = 0xae;
|
const CHAT_PACKET = 0xae;
|
||||||
const ADVENTURE_SETTINGS_PACKET = 0xaf;
|
const ADVENTURE_SETTINGS_PACKET = 0xaf;
|
||||||
const ENTITY_DATA_PACKET = 0xb0;
|
const TILE_ENTITY_DATA_PACKET = 0xb0;
|
||||||
//const PLAYER_INPUT_PACKET = 0xb1;
|
//const PLAYER_INPUT_PACKET = 0xb1;
|
||||||
const FULL_CHUNK_DATA_PACKET = 0xb2;
|
const FULL_CHUNK_DATA_PACKET = 0xb2;
|
||||||
const SET_DIFFICULTY_PACKET = 0xb3;
|
const SET_DIFFICULTY_PACKET = 0xb3;
|
||||||
|
@ -24,7 +24,7 @@ namespace pocketmine\network\protocol;
|
|||||||
#include <rules/DataPacket.h>
|
#include <rules/DataPacket.h>
|
||||||
|
|
||||||
|
|
||||||
class EntityDataPacket extends DataPacket{
|
class TileEntityDataPacket extends DataPacket{
|
||||||
public static $pool = [];
|
public static $pool = [];
|
||||||
public static $next = 0;
|
public static $next = 0;
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ class EntityDataPacket extends DataPacket{
|
|||||||
public $namedtag;
|
public $namedtag;
|
||||||
|
|
||||||
public function pid(){
|
public function pid(){
|
||||||
return Info::ENTITY_DATA_PACKET;
|
return Info::TILE_ENTITY_DATA_PACKET;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function decode(){
|
public function decode(){
|
@ -24,7 +24,7 @@ namespace pocketmine\tile;
|
|||||||
use pocketmine\level\format\FullChunk;
|
use pocketmine\level\format\FullChunk;
|
||||||
use pocketmine\nbt\NBT;
|
use pocketmine\nbt\NBT;
|
||||||
use pocketmine\nbt\tag\Compound;
|
use pocketmine\nbt\tag\Compound;
|
||||||
use pocketmine\network\protocol\EntityDataPacket;
|
use pocketmine\network\protocol\TileEntityDataPacket;
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
|
|
||||||
abstract class Spawnable extends Tile{
|
abstract class Spawnable extends Tile{
|
||||||
@ -36,7 +36,7 @@ abstract class Spawnable extends Tile{
|
|||||||
|
|
||||||
$nbt = new NBT(NBT::LITTLE_ENDIAN);
|
$nbt = new NBT(NBT::LITTLE_ENDIAN);
|
||||||
$nbt->setData($this->getSpawnCompound());
|
$nbt->setData($this->getSpawnCompound());
|
||||||
$pk = new EntityDataPacket();
|
$pk = new TileEntityDataPacket();
|
||||||
$pk->x = $this->x;
|
$pk->x = $this->x;
|
||||||
$pk->y = $this->y;
|
$pk->y = $this->y;
|
||||||
$pk->z = $this->z;
|
$pk->z = $this->z;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user