mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Merge network refactors
This commit is contained in:
@ -21,10 +21,9 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
namespace pocketmine\network\mcpe;
|
||||
|
||||
|
||||
use pocketmine\network\mcpe\protocol\AddBehaviorTreePacket;
|
||||
use pocketmine\network\mcpe\protocol\AddEntityPacket;
|
||||
use pocketmine\network\mcpe\protocol\AddHangingEntityPacket;
|
||||
use pocketmine\network\mcpe\protocol\AddItemEntityPacket;
|
||||
@ -38,10 +37,11 @@ use pocketmine\network\mcpe\protocol\BlockEntityDataPacket;
|
||||
use pocketmine\network\mcpe\protocol\BlockEventPacket;
|
||||
use pocketmine\network\mcpe\protocol\BlockPickRequestPacket;
|
||||
use pocketmine\network\mcpe\protocol\BossEventPacket;
|
||||
use pocketmine\network\mcpe\protocol\CameraPacket;
|
||||
use pocketmine\network\mcpe\protocol\ChangeDimensionPacket;
|
||||
use pocketmine\network\mcpe\protocol\ChunkRadiusUpdatedPacket;
|
||||
use pocketmine\network\mcpe\protocol\ClientboundMapItemDataPacket;
|
||||
use pocketmine\network\mcpe\protocol\ClientToServerHandshakePacket;
|
||||
use pocketmine\network\mcpe\protocol\ClientboundMapItemDataPacket;
|
||||
use pocketmine\network\mcpe\protocol\CommandBlockUpdatePacket;
|
||||
use pocketmine\network\mcpe\protocol\CommandStepPacket;
|
||||
use pocketmine\network\mcpe\protocol\ContainerClosePacket;
|
||||
@ -55,6 +55,8 @@ use pocketmine\network\mcpe\protocol\DataPacket;
|
||||
use pocketmine\network\mcpe\protocol\DisconnectPacket;
|
||||
use pocketmine\network\mcpe\protocol\DropItemPacket;
|
||||
use pocketmine\network\mcpe\protocol\EntityEventPacket;
|
||||
use pocketmine\network\mcpe\protocol\EntityFallPacket;
|
||||
use pocketmine\network\mcpe\protocol\EventPacket;
|
||||
use pocketmine\network\mcpe\protocol\ExplodePacket;
|
||||
use pocketmine\network\mcpe\protocol\FullChunkDataPacket;
|
||||
use pocketmine\network\mcpe\protocol\GameRulesChangedPacket;
|
||||
@ -71,12 +73,12 @@ use pocketmine\network\mcpe\protocol\MobEffectPacket;
|
||||
use pocketmine\network\mcpe\protocol\MobEquipmentPacket;
|
||||
use pocketmine\network\mcpe\protocol\MoveEntityPacket;
|
||||
use pocketmine\network\mcpe\protocol\MovePlayerPacket;
|
||||
use pocketmine\network\mcpe\protocol\PlayerActionPacket;
|
||||
use pocketmine\network\mcpe\protocol\EntityFallPacket;
|
||||
use pocketmine\network\mcpe\protocol\PlayerInputPacket;
|
||||
use pocketmine\network\mcpe\protocol\PlayerListPacket;
|
||||
use pocketmine\network\mcpe\protocol\PlaySoundPacket;
|
||||
use pocketmine\network\mcpe\protocol\PlayStatusPacket;
|
||||
use pocketmine\network\mcpe\protocol\PlayerActionPacket;
|
||||
use pocketmine\network\mcpe\protocol\PlayerInputPacket;
|
||||
use pocketmine\network\mcpe\protocol\PlayerListPacket;
|
||||
use pocketmine\network\mcpe\protocol\PurchaseReceiptPacket;
|
||||
use pocketmine\network\mcpe\protocol\RemoveBlockPacket;
|
||||
use pocketmine\network\mcpe\protocol\RemoveEntityPacket;
|
||||
use pocketmine\network\mcpe\protocol\ReplaceItemInSlotPacket;
|
||||
@ -85,8 +87,8 @@ use pocketmine\network\mcpe\protocol\ResourcePackChunkDataPacket;
|
||||
use pocketmine\network\mcpe\protocol\ResourcePackChunkRequestPacket;
|
||||
use pocketmine\network\mcpe\protocol\ResourcePackClientResponsePacket;
|
||||
use pocketmine\network\mcpe\protocol\ResourcePackDataInfoPacket;
|
||||
use pocketmine\network\mcpe\protocol\ResourcePacksInfoPacket;
|
||||
use pocketmine\network\mcpe\protocol\ResourcePackStackPacket;
|
||||
use pocketmine\network\mcpe\protocol\ResourcePacksInfoPacket;
|
||||
use pocketmine\network\mcpe\protocol\RespawnPacket;
|
||||
use pocketmine\network\mcpe\protocol\RiderJumpPacket;
|
||||
use pocketmine\network\mcpe\protocol\ServerToClientHandshakePacket;
|
||||
@ -101,198 +103,395 @@ use pocketmine\network\mcpe\protocol\SetSpawnPositionPacket;
|
||||
use pocketmine\network\mcpe\protocol\SetTimePacket;
|
||||
use pocketmine\network\mcpe\protocol\SetTitlePacket;
|
||||
use pocketmine\network\mcpe\protocol\ShowCreditsPacket;
|
||||
use pocketmine\network\mcpe\protocol\ShowStoreOfferPacket;
|
||||
use pocketmine\network\mcpe\protocol\SimpleEventPacket;
|
||||
use pocketmine\network\mcpe\protocol\SpawnExperienceOrbPacket;
|
||||
use pocketmine\network\mcpe\protocol\StartGamePacket;
|
||||
use pocketmine\network\mcpe\protocol\StopSoundPacket;
|
||||
use pocketmine\network\mcpe\protocol\StructureBlockUpdatePacket;
|
||||
use pocketmine\network\mcpe\protocol\TakeItemEntityPacket;
|
||||
use pocketmine\network\mcpe\protocol\TextPacket;
|
||||
use pocketmine\network\mcpe\protocol\TransferPacket;
|
||||
use pocketmine\network\mcpe\protocol\UpdateAttributesPacket;
|
||||
use pocketmine\network\mcpe\protocol\UpdateBlockPacket;
|
||||
use pocketmine\network\mcpe\protocol\UpdateEquipPacket;
|
||||
use pocketmine\network\mcpe\protocol\UpdateTradePacket;
|
||||
use pocketmine\network\mcpe\protocol\UseItemPacket;
|
||||
use pocketmine\Server;
|
||||
|
||||
interface NetworkSession{
|
||||
abstract class NetworkSession{
|
||||
|
||||
/**
|
||||
* @return Server
|
||||
*/
|
||||
public function getServer();
|
||||
abstract public function handleDataPacket(DataPacket $packet);
|
||||
|
||||
public function handleDataPacket(DataPacket $pk);
|
||||
public function handleLogin(LoginPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleLogin(LoginPacket $packet) : bool;
|
||||
public function handlePlayStatus(PlayStatusPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handlePlayStatus(PlayStatusPacket $packet) : bool;
|
||||
public function handleServerToClientHandshake(ServerToClientHandshakePacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleServerToClientHandshake(ServerToClientHandshakePacket $packet) : bool;
|
||||
public function handleClientToServerHandshake(ClientToServerHandshakePacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleClientToServerHandshake(ClientToServerHandshakePacket $packet) : bool;
|
||||
public function handleDisconnect(DisconnectPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleDisconnect(DisconnectPacket $packet) : bool;
|
||||
public function handleResourcePacksInfo(ResourcePacksInfoPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleResourcePacksInfo(ResourcePacksInfoPacket $packet) : bool;
|
||||
public function handleResourcePackStack(ResourcePackStackPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleResourcePackStack(ResourcePackStackPacket $packet) : bool;
|
||||
public function handleResourcePackClientResponse(ResourcePackClientResponsePacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleResourcePackClientResponse(ResourcePackClientResponsePacket $packet) : bool;
|
||||
public function handleText(TextPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleText(TextPacket $packet) : bool;
|
||||
public function handleSetTime(SetTimePacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleSetTime(SetTimePacket $packet) : bool;
|
||||
public function handleStartGame(StartGamePacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleStartGame(StartGamePacket $packet) : bool;
|
||||
public function handleAddPlayer(AddPlayerPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleAddPlayer(AddPlayerPacket $packet) : bool;
|
||||
public function handleAddEntity(AddEntityPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleAddEntity(AddEntityPacket $packet) : bool;
|
||||
public function handleRemoveEntity(RemoveEntityPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleRemoveEntity(RemoveEntityPacket $packet) : bool;
|
||||
public function handleAddItemEntity(AddItemEntityPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleAddItemEntity(AddItemEntityPacket $packet) : bool;
|
||||
public function handleAddHangingEntity(AddHangingEntityPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleAddHangingEntity(AddHangingEntityPacket $packet) : bool;
|
||||
public function handleTakeItemEntity(TakeItemEntityPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleTakeItemEntity(TakeItemEntityPacket $packet) : bool;
|
||||
public function handleMoveEntity(MoveEntityPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleMoveEntity(MoveEntityPacket $packet) : bool;
|
||||
public function handleMovePlayer(MovePlayerPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleMovePlayer(MovePlayerPacket $packet) : bool;
|
||||
public function handleRiderJump(RiderJumpPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleRiderJump(RiderJumpPacket $packet) : bool;
|
||||
public function handleRemoveBlock(RemoveBlockPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleRemoveBlock(RemoveBlockPacket $packet) : bool;
|
||||
public function handleUpdateBlock(UpdateBlockPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleUpdateBlock(UpdateBlockPacket $packet) : bool;
|
||||
public function handleAddPainting(AddPaintingPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleAddPainting(AddPaintingPacket $packet) : bool;
|
||||
public function handleExplode(ExplodePacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleExplode(ExplodePacket $packet) : bool;
|
||||
public function handleLevelSoundEvent(LevelSoundEventPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleLevelSoundEvent(LevelSoundEventPacket $packet) : bool;
|
||||
public function handleLevelEvent(LevelEventPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleLevelEvent(LevelEventPacket $packet) : bool;
|
||||
public function handleBlockEvent(BlockEventPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleBlockEvent(BlockEventPacket $packet) : bool;
|
||||
public function handleEntityEvent(EntityEventPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleEntityEvent(EntityEventPacket $packet) : bool;
|
||||
public function handleMobEffect(MobEffectPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleMobEffect(MobEffectPacket $packet) : bool;
|
||||
public function handleUpdateAttributes(UpdateAttributesPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleUpdateAttributes(UpdateAttributesPacket $packet) : bool;
|
||||
public function handleMobEquipment(MobEquipmentPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleMobEquipment(MobEquipmentPacket $packet) : bool;
|
||||
public function handleMobArmorEquipment(MobArmorEquipmentPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleMobArmorEquipment(MobArmorEquipmentPacket $packet) : bool;
|
||||
public function handleInteract(InteractPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleInteract(InteractPacket $packet) : bool;
|
||||
public function handleBlockPickRequest(BlockPickRequestPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleBlockPickRequest(BlockPickRequestPacket $packet) : bool;
|
||||
public function handleUseItem(UseItemPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleUseItem(UseItemPacket $packet) : bool;
|
||||
public function handlePlayerAction(PlayerActionPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handlePlayerAction(PlayerActionPacket $packet) : bool;
|
||||
public function handleEntityFall(EntityFallPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleEntityFall(EntityFallPacket $packet) : bool;
|
||||
public function handleHurtArmor(HurtArmorPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleHurtArmor(HurtArmorPacket $packet) : bool;
|
||||
public function handleSetEntityData(SetEntityDataPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleSetEntityData(SetEntityDataPacket $packet) : bool;
|
||||
public function handleSetEntityMotion(SetEntityMotionPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleSetEntityMotion(SetEntityMotionPacket $packet) : bool;
|
||||
public function handleSetEntityLink(SetEntityLinkPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleSetEntityLink(SetEntityLinkPacket $packet) : bool;
|
||||
public function handleSetHealth(SetHealthPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleSetHealth(SetHealthPacket $packet) : bool;
|
||||
public function handleSetSpawnPosition(SetSpawnPositionPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleSetSpawnPosition(SetSpawnPositionPacket $packet) : bool;
|
||||
public function handleAnimate(AnimatePacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleAnimate(AnimatePacket $packet) : bool;
|
||||
public function handleRespawn(RespawnPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleRespawn(RespawnPacket $packet) : bool;
|
||||
public function handleDropItem(DropItemPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleDropItem(DropItemPacket $packet) : bool;
|
||||
public function handleInventoryAction(InventoryActionPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleInventoryAction(InventoryActionPacket $packet) : bool;
|
||||
public function handleContainerOpen(ContainerOpenPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleContainerOpen(ContainerOpenPacket $packet) : bool;
|
||||
public function handleContainerClose(ContainerClosePacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleContainerClose(ContainerClosePacket $packet) : bool;
|
||||
public function handleContainerSetSlot(ContainerSetSlotPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleContainerSetSlot(ContainerSetSlotPacket $packet) : bool;
|
||||
public function handleContainerSetData(ContainerSetDataPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleContainerSetData(ContainerSetDataPacket $packet) : bool;
|
||||
public function handleContainerSetContent(ContainerSetContentPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleContainerSetContent(ContainerSetContentPacket $packet) : bool;
|
||||
public function handleCraftingData(CraftingDataPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleCraftingData(CraftingDataPacket $packet) : bool;
|
||||
public function handleCraftingEvent(CraftingEventPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleCraftingEvent(CraftingEventPacket $packet) : bool;
|
||||
public function handleAdventureSettings(AdventureSettingsPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleAdventureSettings(AdventureSettingsPacket $packet) : bool;
|
||||
public function handleBlockEntityData(BlockEntityDataPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleBlockEntityData(BlockEntityDataPacket $packet) : bool;
|
||||
public function handlePlayerInput(PlayerInputPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handlePlayerInput(PlayerInputPacket $packet) : bool;
|
||||
public function handleFullChunkData(FullChunkDataPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleFullChunkData(FullChunkDataPacket $packet) : bool;
|
||||
public function handleSetCommandsEnabled(SetCommandsEnabledPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleSetCommandsEnabled(SetCommandsEnabledPacket $packet) : bool;
|
||||
public function handleSetDifficulty(SetDifficultyPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleSetDifficulty(SetDifficultyPacket $packet) : bool;
|
||||
public function handleChangeDimension(ChangeDimensionPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleChangeDimension(ChangeDimensionPacket $packet) : bool;
|
||||
public function handleSetPlayerGameType(SetPlayerGameTypePacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleSetPlayerGameType(SetPlayerGameTypePacket $packet) : bool;
|
||||
public function handlePlayerList(PlayerListPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handlePlayerList(PlayerListPacket $packet) : bool;
|
||||
public function handleSimpleEvent(SimpleEventPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
//public function handleTelemetryEvent(EventPacket $packet) : bool; //TODO
|
||||
public function handleEvent(EventPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleSpawnExperienceOrb(SpawnExperienceOrbPacket $packet) : bool;
|
||||
public function handleSpawnExperienceOrb(SpawnExperienceOrbPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleClientboundMapItemData(ClientboundMapItemDataPacket $packet) : bool;
|
||||
public function handleClientboundMapItemData(ClientboundMapItemDataPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleMapInfoRequest(MapInfoRequestPacket $packet) : bool; //TODO
|
||||
public function handleMapInfoRequest(MapInfoRequestPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleRequestChunkRadius(RequestChunkRadiusPacket $packet) : bool;
|
||||
public function handleRequestChunkRadius(RequestChunkRadiusPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleChunkRadiusUpdated(ChunkRadiusUpdatedPacket $packet) : bool;
|
||||
public function handleChunkRadiusUpdated(ChunkRadiusUpdatedPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleItemFrameDropItem(ItemFrameDropItemPacket $packet) : bool;
|
||||
public function handleItemFrameDropItem(ItemFrameDropItemPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleReplaceItemInSlot(ReplaceItemInSlotPacket $packet) : bool;
|
||||
public function handleReplaceItemInSlot(ReplaceItemInSlotPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleGameRulesChanged(GameRulesChangedPacket $packet) : bool;
|
||||
public function handleGameRulesChanged(GameRulesChangedPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
//public function handleCamera(CameraPacket $packet) : bool; //edu only :(
|
||||
public function handleCamera(CameraPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleAddItem(AddItemPacket $packet) : bool;
|
||||
public function handleAddItem(AddItemPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleBossEvent(BossEventPacket $packet) : bool;
|
||||
public function handleBossEvent(BossEventPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleShowCredits(ShowCreditsPacket $packet) : bool;
|
||||
public function handleShowCredits(ShowCreditsPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleAvailableCommands(AvailableCommandsPacket $packet) : bool;
|
||||
public function handleAvailableCommands(AvailableCommandsPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleCommandStep(CommandStepPacket $packet) : bool;
|
||||
public function handleCommandStep(CommandStepPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleCommandBlockUpdate(CommandBlockUpdatePacket $packet) : bool;
|
||||
public function handleCommandBlockUpdate(CommandBlockUpdatePacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleUpdateTrade(UpdateTradePacket $packet) : bool;
|
||||
public function handleUpdateTrade(UpdateTradePacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleResourcePackDataInfo(ResourcePackDataInfoPacket $packet) : bool;
|
||||
public function handleUpdateEquip(UpdateEquipPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleResourcePackChunkData(ResourcePackChunkDataPacket $packet) : bool;
|
||||
public function handleResourcePackDataInfo(ResourcePackDataInfoPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleResourcePackChunkRequest(ResourcePackChunkRequestPacket $packet) : bool;
|
||||
public function handleResourcePackChunkData(ResourcePackChunkDataPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleTransfer(TransferPacket $packet) : bool;
|
||||
public function handleResourcePackChunkRequest(ResourcePackChunkRequestPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handlePlaySound(PlaySoundPacket $packet) : bool;
|
||||
public function handleTransfer(TransferPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleStopSound(StopSoundPacket $packet) : bool;
|
||||
public function handlePlaySound(PlaySoundPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleStopSound(StopSoundPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleSetTitle(SetTitlePacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleAddBehaviorTree(AddBehaviorTreePacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleStructureBlockUpdate(StructureBlockUpdatePacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleShowStoreOffer(ShowStoreOfferPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handlePurchaseReceipt(PurchaseReceiptPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleSetTitle(SetTitlePacket $packet) : bool;
|
||||
}
|
232
src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter.php
Normal file
232
src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter.php
Normal file
@ -0,0 +1,232 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\network\mcpe;
|
||||
|
||||
|
||||
use pocketmine\event\server\DataPacketReceiveEvent;
|
||||
use pocketmine\event\Timings;
|
||||
use pocketmine\network\mcpe\protocol\AdventureSettingsPacket;
|
||||
use pocketmine\network\mcpe\protocol\AnimatePacket;
|
||||
use pocketmine\network\mcpe\protocol\BlockEntityDataPacket;
|
||||
use pocketmine\network\mcpe\protocol\BlockPickRequestPacket;
|
||||
use pocketmine\network\mcpe\protocol\BossEventPacket;
|
||||
use pocketmine\network\mcpe\protocol\ClientToServerHandshakePacket;
|
||||
use pocketmine\network\mcpe\protocol\CommandBlockUpdatePacket;
|
||||
use pocketmine\network\mcpe\protocol\CommandStepPacket;
|
||||
use pocketmine\network\mcpe\protocol\ContainerClosePacket;
|
||||
use pocketmine\network\mcpe\protocol\ContainerSetSlotPacket;
|
||||
use pocketmine\network\mcpe\protocol\CraftingEventPacket;
|
||||
use pocketmine\network\mcpe\protocol\DataPacket;
|
||||
use pocketmine\network\mcpe\protocol\DropItemPacket;
|
||||
use pocketmine\network\mcpe\protocol\EntityEventPacket;
|
||||
use pocketmine\network\mcpe\protocol\EntityFallPacket;
|
||||
use pocketmine\network\mcpe\protocol\InteractPacket;
|
||||
use pocketmine\network\mcpe\protocol\ItemFrameDropItemPacket;
|
||||
use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;
|
||||
use pocketmine\network\mcpe\protocol\LoginPacket;
|
||||
use pocketmine\network\mcpe\protocol\MapInfoRequestPacket;
|
||||
use pocketmine\network\mcpe\protocol\MobArmorEquipmentPacket;
|
||||
use pocketmine\network\mcpe\protocol\MobEquipmentPacket;
|
||||
use pocketmine\network\mcpe\protocol\MovePlayerPacket;
|
||||
use pocketmine\network\mcpe\protocol\PlayerActionPacket;
|
||||
use pocketmine\network\mcpe\protocol\PlayerInputPacket;
|
||||
use pocketmine\network\mcpe\protocol\RemoveBlockPacket;
|
||||
use pocketmine\network\mcpe\protocol\RequestChunkRadiusPacket;
|
||||
use pocketmine\network\mcpe\protocol\ResourcePackChunkRequestPacket;
|
||||
use pocketmine\network\mcpe\protocol\ResourcePackClientResponsePacket;
|
||||
use pocketmine\network\mcpe\protocol\SetPlayerGameTypePacket;
|
||||
use pocketmine\network\mcpe\protocol\ShowCreditsPacket;
|
||||
use pocketmine\network\mcpe\protocol\SpawnExperienceOrbPacket;
|
||||
use pocketmine\network\mcpe\protocol\TextPacket;
|
||||
use pocketmine\network\mcpe\protocol\UseItemPacket;
|
||||
use pocketmine\Player;
|
||||
use pocketmine\Server;
|
||||
|
||||
class PlayerNetworkSessionAdapter extends NetworkSession{
|
||||
|
||||
/** @var Server */
|
||||
private $server;
|
||||
/** @var Player */
|
||||
private $player;
|
||||
|
||||
public function __construct(Server $server, Player $player){
|
||||
$this->server = $server;
|
||||
$this->player = $player;
|
||||
}
|
||||
|
||||
public function handleDataPacket(DataPacket $packet){
|
||||
//TODO: Remove this hack once InteractPacket spam issue is fixed
|
||||
if($packet->buffer === "\x21\x04\x00"){
|
||||
return;
|
||||
}
|
||||
|
||||
$timings = Timings::getReceiveDataPacketTimings($packet);
|
||||
$timings->startTiming();
|
||||
|
||||
$packet->decode();
|
||||
if(!$packet->feof()){
|
||||
$remains = substr($packet->buffer, $packet->offset);
|
||||
$this->server->getLogger()->debug("Still " . strlen($remains) . " bytes unread in " . $packet->getName() . ": 0x" . bin2hex($remains));
|
||||
}
|
||||
|
||||
$this->server->getPluginManager()->callEvent($ev = new DataPacketReceiveEvent($this->player, $packet));
|
||||
if(!$ev->isCancelled() and !$packet->handle($this)){
|
||||
$this->server->getLogger()->debug("Unhandled " . $packet->getName() . " received from " . $this->player->getName() . ": 0x" . bin2hex($packet->buffer));
|
||||
}
|
||||
|
||||
$timings->stopTiming();
|
||||
}
|
||||
|
||||
public function handleLogin(LoginPacket $packet) : bool{
|
||||
return $this->player->handleLogin($packet);
|
||||
}
|
||||
|
||||
public function handleClientToServerHandshake(ClientToServerHandshakePacket $packet) : bool{
|
||||
return $this->player->handleClientToServerHandshake($packet);
|
||||
}
|
||||
|
||||
public function handleResourcePackClientResponse(ResourcePackClientResponsePacket $packet) : bool{
|
||||
return $this->player->handleResourcePackClientResponse($packet);
|
||||
}
|
||||
|
||||
public function handleText(TextPacket $packet) : bool{
|
||||
return $this->player->handleText($packet);
|
||||
}
|
||||
|
||||
public function handleMovePlayer(MovePlayerPacket $packet) : bool{
|
||||
return $this->player->handleMovePlayer($packet);
|
||||
}
|
||||
|
||||
public function handleRemoveBlock(RemoveBlockPacket $packet) : bool{
|
||||
return $this->player->handleRemoveBlock($packet);
|
||||
}
|
||||
|
||||
public function handleLevelSoundEvent(LevelSoundEventPacket $packet) : bool{
|
||||
return $this->player->handleLevelSoundEvent($packet);
|
||||
}
|
||||
|
||||
public function handleEntityEvent(EntityEventPacket $packet) : bool{
|
||||
return $this->player->handleEntityEvent($packet);
|
||||
}
|
||||
|
||||
public function handleMobEquipment(MobEquipmentPacket $packet) : bool{
|
||||
return $this->player->handleMobEquipment($packet);
|
||||
}
|
||||
|
||||
public function handleMobArmorEquipment(MobArmorEquipmentPacket $packet) : bool{
|
||||
return true; //Not used
|
||||
}
|
||||
|
||||
public function handleInteract(InteractPacket $packet) : bool{
|
||||
return $this->player->handleInteract($packet);
|
||||
}
|
||||
|
||||
public function handleBlockPickRequest(BlockPickRequestPacket $packet) : bool{
|
||||
return $this->player->handleBlockPickRequest($packet);
|
||||
}
|
||||
|
||||
public function handleUseItem(UseItemPacket $packet) : bool{
|
||||
return $this->player->handleUseItem($packet);
|
||||
}
|
||||
|
||||
public function handlePlayerAction(PlayerActionPacket $packet) : bool{
|
||||
return $this->player->handlePlayerAction($packet);
|
||||
}
|
||||
|
||||
public function handleEntityFall(EntityFallPacket $packet) : bool{
|
||||
return true; //Not used
|
||||
}
|
||||
|
||||
public function handleAnimate(AnimatePacket $packet) : bool{
|
||||
return $this->player->handleAnimate($packet);
|
||||
}
|
||||
|
||||
public function handleDropItem(DropItemPacket $packet) : bool{
|
||||
return $this->player->handleDropItem($packet);
|
||||
}
|
||||
|
||||
public function handleContainerClose(ContainerClosePacket $packet) : bool{
|
||||
return $this->player->handleContainerClose($packet);
|
||||
}
|
||||
|
||||
public function handleContainerSetSlot(ContainerSetSlotPacket $packet) : bool{
|
||||
return $this->player->handleContainerSetSlot($packet);
|
||||
}
|
||||
|
||||
public function handleCraftingEvent(CraftingEventPacket $packet) : bool{
|
||||
return $this->player->handleCraftingEvent($packet);
|
||||
}
|
||||
|
||||
public function handleAdventureSettings(AdventureSettingsPacket $packet) : bool{
|
||||
return $this->player->handleAdventureSettings($packet);
|
||||
}
|
||||
|
||||
public function handleBlockEntityData(BlockEntityDataPacket $packet) : bool{
|
||||
return $this->player->handleBlockEntityData($packet);
|
||||
}
|
||||
|
||||
public function handlePlayerInput(PlayerInputPacket $packet) : bool{
|
||||
return $this->player->handlePlayerInput($packet);
|
||||
}
|
||||
|
||||
public function handleSetPlayerGameType(SetPlayerGameTypePacket $packet) : bool{
|
||||
return $this->player->handleSetPlayerGameType($packet);
|
||||
}
|
||||
|
||||
public function handleSpawnExperienceOrb(SpawnExperienceOrbPacket $packet) : bool{
|
||||
return $this->player->handleSpawnExperienceOrb($packet);
|
||||
}
|
||||
|
||||
public function handleMapInfoRequest(MapInfoRequestPacket $packet) : bool{
|
||||
return $this->player->handleMapInfoRequest($packet);
|
||||
}
|
||||
|
||||
public function handleRequestChunkRadius(RequestChunkRadiusPacket $packet) : bool{
|
||||
return $this->player->handleRequestChunkRadius($packet);
|
||||
}
|
||||
|
||||
public function handleItemFrameDropItem(ItemFrameDropItemPacket $packet) : bool{
|
||||
return $this->player->handleItemFrameDropItem($packet);
|
||||
}
|
||||
|
||||
public function handleBossEvent(BossEventPacket $packet) : bool{
|
||||
return $this->player->handleBossEvent($packet);
|
||||
}
|
||||
|
||||
public function handleShowCredits(ShowCreditsPacket $packet) : bool{
|
||||
return $this->player->handleShowCredits($packet);
|
||||
}
|
||||
|
||||
public function handleCommandStep(CommandStepPacket $packet) : bool{
|
||||
return $this->player->handleCommandStep($packet);
|
||||
}
|
||||
|
||||
public function handleCommandBlockUpdate(CommandBlockUpdatePacket $packet) : bool{
|
||||
return $this->player->handleCommandBlockUpdate($packet);
|
||||
}
|
||||
|
||||
public function handleResourcePackChunkRequest(ResourcePackChunkRequestPacket $packet) : bool{
|
||||
return $this->player->handleResourcePackChunkRequest($packet);
|
||||
}
|
||||
}
|
@ -27,6 +27,7 @@ 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;
|
||||
@ -142,9 +143,7 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
|
||||
$logger->debug("Packet " . (isset($pk) ? get_class($pk) : "unknown") . " 0x" . bin2hex($packet->buffer));
|
||||
$logger->logException($e);
|
||||
|
||||
if(isset($this->players[$identifier])){
|
||||
$this->interface->blockAddress($this->players[$identifier]->getAddress(), 5);
|
||||
}
|
||||
$this->interface->blockAddress($this->players[$identifier]->getAddress(), 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -199,7 +198,6 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
|
||||
$identifier = $this->identifiers[$h];
|
||||
if(!$packet->isEncoded){
|
||||
$packet->encode();
|
||||
$packet->isEncoded = true;
|
||||
}
|
||||
|
||||
if($packet instanceof BatchPacket){
|
||||
@ -236,7 +234,7 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
|
||||
|
||||
private function getPacket($buffer){
|
||||
$pid = ord($buffer{0});
|
||||
if(($data = $this->network->getPacket($pid)) === null){
|
||||
if(($data = PacketPool::getPacketById($pid)) === null){
|
||||
return null;
|
||||
}
|
||||
$data->setBuffer($buffer, 1);
|
||||
|
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\network\mcpe\protocol;
|
||||
|
||||
#include <rules/DataPacket.h>
|
||||
|
||||
use pocketmine\network\mcpe\NetworkSession;
|
||||
|
||||
class AddBehaviorTreePacket extends DataPacket{
|
||||
const NETWORK_ID = ProtocolInfo::ADD_BEHAVIOR_TREE_PACKET;
|
||||
|
||||
/** @var string */
|
||||
public $unknownString1;
|
||||
|
||||
public function decodePayload(){
|
||||
$this->unknownString1 = $this->getString();
|
||||
}
|
||||
|
||||
public function encodePayload(){
|
||||
$this->putString($this->unknownString1);
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $session) : bool{
|
||||
return $session->handleAddBehaviorTree($this);
|
||||
}
|
||||
}
|
@ -30,12 +30,15 @@ use pocketmine\network\mcpe\NetworkSession;
|
||||
#ifndef COMPILE
|
||||
use pocketmine\utils\Binary;
|
||||
#endif
|
||||
use pocketmine\utils\BinaryStream;
|
||||
|
||||
class BatchPacket extends DataPacket{
|
||||
const NETWORK_ID = 0xfe;
|
||||
|
||||
public $payload;
|
||||
public $compressed = false;
|
||||
/** @var string */
|
||||
public $payload = "";
|
||||
/** @var int */
|
||||
protected $compressionLevel = 7;
|
||||
|
||||
public function canBeBatched() : bool{
|
||||
return false;
|
||||
@ -46,12 +49,16 @@ class BatchPacket extends DataPacket{
|
||||
}
|
||||
|
||||
public function decodePayload(){
|
||||
$this->payload = $this->getRemaining();
|
||||
$data = $this->getRemaining();
|
||||
try{
|
||||
$this->payload = zlib_decode($data, 1024 * 1024 * 64); //Max 64MB
|
||||
}catch(\ErrorException $e){ //zlib decode error
|
||||
$this->payload = "";
|
||||
}
|
||||
}
|
||||
|
||||
public function encodePayload(){
|
||||
assert($this->compressed);
|
||||
$this->put($this->payload);
|
||||
$this->put(zlib_encode($this->payload, ZLIB_ENCODING_DEFLATE, $this->compressionLevel));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -68,33 +75,31 @@ class BatchPacket extends DataPacket{
|
||||
$this->payload .= Binary::writeUnsignedVarInt(strlen($packet->buffer)) . $packet->buffer;
|
||||
}
|
||||
|
||||
public function compress(int $level = 7){
|
||||
assert(!$this->compressed);
|
||||
$this->payload = zlib_encode($this->payload, ZLIB_ENCODING_DEFLATE, $level);
|
||||
$this->compressed = true;
|
||||
/**
|
||||
* @return \Generator
|
||||
*/
|
||||
public function getPackets(){
|
||||
$stream = new BinaryStream($this->payload);
|
||||
while(!$stream->feof()){
|
||||
yield $stream->getString();
|
||||
}
|
||||
}
|
||||
|
||||
public function getCompressionLevel() : int{
|
||||
return $this->compressionLevel;
|
||||
}
|
||||
|
||||
public function setCompressionLevel(int $level){
|
||||
$this->compressionLevel = $level;
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $session) : bool{
|
||||
if(strlen($this->payload) < 2){
|
||||
if($this->payload === ""){
|
||||
return false;
|
||||
}
|
||||
|
||||
try{
|
||||
$str = zlib_decode($this->payload, 1024 * 1024 * 64); //Max 64MB
|
||||
}catch(\ErrorException $e){
|
||||
return false;
|
||||
}
|
||||
|
||||
if($str === ""){
|
||||
throw new \InvalidStateException("Decoded BatchPacket payload is empty");
|
||||
}
|
||||
|
||||
$this->setBuffer($str, 0);
|
||||
|
||||
$network = $session->getServer()->getNetwork();
|
||||
while(!$this->feof()){
|
||||
$buf = $this->getString();
|
||||
$pk = $network->getPacket(ord($buf{0}));
|
||||
foreach($this->getPackets() as $buf){
|
||||
$pk = PacketPool::getPacketById(ord($buf{0}));
|
||||
|
||||
if(!$pk->canBeBatched()){
|
||||
throw new \InvalidArgumentException("Received invalid " . get_class($pk) . " inside BatchPacket");
|
||||
|
51
src/pocketmine/network/mcpe/protocol/CameraPacket.php
Normal file
51
src/pocketmine/network/mcpe/protocol/CameraPacket.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\network\mcpe\protocol;
|
||||
|
||||
#include <rules/DataPacket.h>
|
||||
|
||||
use pocketmine\network\mcpe\NetworkSession;
|
||||
|
||||
class CameraPacket extends DataPacket{
|
||||
const NETWORK_ID = ProtocolInfo::CAMERA_PACKET;
|
||||
|
||||
/** @var int */
|
||||
public $cameraUniqueId;
|
||||
/** @var int */
|
||||
public $playerUniqueId;
|
||||
|
||||
public function decodePayload(){
|
||||
$this->cameraUniqueId = $this->getEntityUniqueId();
|
||||
$this->playerUniqueId = $this->getEntityUniqueId();
|
||||
}
|
||||
|
||||
public function encodePayload(){
|
||||
$this->putEntityUniqueId($this->cameraUniqueId);
|
||||
$this->putEntityUniqueId($this->playerUniqueId);
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $session) : bool{
|
||||
return $session->handleCamera($this);
|
||||
}
|
||||
}
|
@ -27,17 +27,11 @@ namespace pocketmine\network\mcpe\protocol;
|
||||
|
||||
|
||||
use pocketmine\network\mcpe\NetworkSession;
|
||||
use pocketmine\network\mcpe\protocol\types\ContainerIds;
|
||||
|
||||
class ContainerSetContentPacket extends DataPacket{
|
||||
const NETWORK_ID = ProtocolInfo::CONTAINER_SET_CONTENT_PACKET;
|
||||
|
||||
const SPECIAL_INVENTORY = 0;
|
||||
const SPECIAL_OFFHAND = 0x77;
|
||||
const SPECIAL_ARMOR = 0x78;
|
||||
const SPECIAL_CREATIVE = 0x79;
|
||||
const SPECIAL_HOTBAR = 0x7a;
|
||||
const SPECIAL_FIXED_INVENTORY = 0x7b;
|
||||
|
||||
public $windowid;
|
||||
public $targetEid;
|
||||
public $slots = [];
|
||||
@ -70,7 +64,7 @@ class ContainerSetContentPacket extends DataPacket{
|
||||
foreach($this->slots as $slot){
|
||||
$this->putSlot($slot);
|
||||
}
|
||||
if($this->windowid === self::SPECIAL_INVENTORY and count($this->hotbar) > 0){
|
||||
if($this->windowid === ContainerIds::INVENTORY and count($this->hotbar) > 0){
|
||||
$this->putUnsignedVarInt(count($this->hotbar));
|
||||
foreach($this->hotbar as $slot){
|
||||
$this->putVarInt($slot);
|
||||
|
@ -70,6 +70,7 @@ abstract class DataPacket extends BinaryStream{
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->encodePayload();
|
||||
$this->isEncoded = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
67
src/pocketmine/network/mcpe/protocol/EventPacket.php
Normal file
67
src/pocketmine/network/mcpe/protocol/EventPacket.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\network\mcpe\protocol;
|
||||
|
||||
#include <rules/DataPacket.h>
|
||||
|
||||
use pocketmine\network\mcpe\NetworkSession;
|
||||
|
||||
class EventPacket extends DataPacket{
|
||||
const NETWORK_ID = ProtocolInfo::EVENT_PACKET;
|
||||
|
||||
const TYPE_ACHIEVEMENT_AWARDED = 0;
|
||||
const TYPE_ENTITY_INTERACT = 1;
|
||||
const TYPE_PORTAL_BUILT = 2;
|
||||
const TYPE_PORTAL_USED = 3;
|
||||
const TYPE_MOB_KILLED = 4;
|
||||
const TYPE_CAULDRON_USED = 5;
|
||||
const TYPE_PLAYER_DEATH = 6;
|
||||
const TYPE_BOSS_KILLED = 7;
|
||||
const TYPE_AGENT_COMMAND = 8;
|
||||
const TYPE_AGENT_CREATED = 9;
|
||||
|
||||
public $playerRuntimeId;
|
||||
public $eventData;
|
||||
public $type;
|
||||
|
||||
public function decodePayload(){
|
||||
$this->playerRuntimeId = $this->getEntityRuntimeId();
|
||||
$this->eventData = $this->getVarInt();
|
||||
$this->type = $this->getByte();
|
||||
|
||||
//TODO: nice confusing mess
|
||||
}
|
||||
|
||||
public function encodePayload(){
|
||||
$this->putEntityRuntimeId($this->playerRuntimeId);
|
||||
$this->putVarInt($this->eventData);
|
||||
$this->putByte($this->type);
|
||||
|
||||
//TODO: also nice confusing mess
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $session) : bool{
|
||||
return $session->handleEvent($this);
|
||||
}
|
||||
}
|
157
src/pocketmine/network/mcpe/protocol/PacketPool.php
Normal file
157
src/pocketmine/network/mcpe/protocol/PacketPool.php
Normal file
@ -0,0 +1,157 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\network\mcpe\protocol;
|
||||
|
||||
class PacketPool{
|
||||
/** @var \SplFixedArray<DataPacket> */
|
||||
protected static $pool = null;
|
||||
|
||||
public static function init(){
|
||||
static::$pool = new \SplFixedArray(256);
|
||||
|
||||
//Normal packets
|
||||
static::registerPacket(new LoginPacket());
|
||||
static::registerPacket(new PlayStatusPacket());
|
||||
static::registerPacket(new ServerToClientHandshakePacket());
|
||||
static::registerPacket(new ClientToServerHandshakePacket());
|
||||
static::registerPacket(new DisconnectPacket());
|
||||
static::registerPacket(new ResourcePacksInfoPacket());
|
||||
static::registerPacket(new ResourcePackStackPacket());
|
||||
static::registerPacket(new ResourcePackClientResponsePacket());
|
||||
static::registerPacket(new TextPacket());
|
||||
static::registerPacket(new SetTimePacket());
|
||||
static::registerPacket(new StartGamePacket());
|
||||
static::registerPacket(new AddPlayerPacket());
|
||||
static::registerPacket(new AddEntityPacket());
|
||||
static::registerPacket(new RemoveEntityPacket());
|
||||
static::registerPacket(new AddItemEntityPacket());
|
||||
static::registerPacket(new AddHangingEntityPacket());
|
||||
static::registerPacket(new TakeItemEntityPacket());
|
||||
static::registerPacket(new MoveEntityPacket());
|
||||
static::registerPacket(new MovePlayerPacket());
|
||||
static::registerPacket(new RiderJumpPacket());
|
||||
static::registerPacket(new RemoveBlockPacket());
|
||||
static::registerPacket(new UpdateBlockPacket());
|
||||
static::registerPacket(new AddPaintingPacket());
|
||||
static::registerPacket(new ExplodePacket());
|
||||
static::registerPacket(new LevelSoundEventPacket());
|
||||
static::registerPacket(new LevelEventPacket());
|
||||
static::registerPacket(new BlockEventPacket());
|
||||
static::registerPacket(new EntityEventPacket());
|
||||
static::registerPacket(new MobEffectPacket());
|
||||
static::registerPacket(new UpdateAttributesPacket());
|
||||
static::registerPacket(new MobEquipmentPacket());
|
||||
static::registerPacket(new MobArmorEquipmentPacket());
|
||||
static::registerPacket(new InteractPacket());
|
||||
static::registerPacket(new BlockPickRequestPacket());
|
||||
static::registerPacket(new UseItemPacket());
|
||||
static::registerPacket(new PlayerActionPacket());
|
||||
static::registerPacket(new EntityFallPacket());
|
||||
static::registerPacket(new HurtArmorPacket());
|
||||
static::registerPacket(new SetEntityDataPacket());
|
||||
static::registerPacket(new SetEntityMotionPacket());
|
||||
static::registerPacket(new SetEntityLinkPacket());
|
||||
static::registerPacket(new SetHealthPacket());
|
||||
static::registerPacket(new SetSpawnPositionPacket());
|
||||
static::registerPacket(new AnimatePacket());
|
||||
static::registerPacket(new RespawnPacket());
|
||||
static::registerPacket(new DropItemPacket());
|
||||
static::registerPacket(new InventoryActionPacket());
|
||||
static::registerPacket(new ContainerOpenPacket());
|
||||
static::registerPacket(new ContainerClosePacket());
|
||||
static::registerPacket(new ContainerSetSlotPacket());
|
||||
static::registerPacket(new ContainerSetDataPacket());
|
||||
static::registerPacket(new ContainerSetContentPacket());
|
||||
static::registerPacket(new CraftingDataPacket());
|
||||
static::registerPacket(new CraftingEventPacket());
|
||||
static::registerPacket(new AdventureSettingsPacket());
|
||||
static::registerPacket(new BlockEntityDataPacket());
|
||||
static::registerPacket(new PlayerInputPacket());
|
||||
static::registerPacket(new FullChunkDataPacket());
|
||||
static::registerPacket(new SetCommandsEnabledPacket());
|
||||
static::registerPacket(new SetDifficultyPacket());
|
||||
static::registerPacket(new ChangeDimensionPacket());
|
||||
static::registerPacket(new SetPlayerGameTypePacket());
|
||||
static::registerPacket(new PlayerListPacket());
|
||||
static::registerPacket(new SimpleEventPacket());
|
||||
static::registerPacket(new EventPacket());
|
||||
static::registerPacket(new SpawnExperienceOrbPacket());
|
||||
static::registerPacket(new ClientboundMapItemDataPacket());
|
||||
static::registerPacket(new MapInfoRequestPacket());
|
||||
static::registerPacket(new RequestChunkRadiusPacket());
|
||||
static::registerPacket(new ChunkRadiusUpdatedPacket());
|
||||
static::registerPacket(new ItemFrameDropItemPacket());
|
||||
static::registerPacket(new ReplaceItemInSlotPacket());
|
||||
static::registerPacket(new GameRulesChangedPacket());
|
||||
static::registerPacket(new CameraPacket());
|
||||
static::registerPacket(new AddItemPacket());
|
||||
static::registerPacket(new BossEventPacket());
|
||||
static::registerPacket(new ShowCreditsPacket());
|
||||
static::registerPacket(new AvailableCommandsPacket());
|
||||
static::registerPacket(new CommandStepPacket());
|
||||
static::registerPacket(new CommandBlockUpdatePacket());
|
||||
static::registerPacket(new UpdateTradePacket());
|
||||
static::registerPacket(new UpdateEquipPacket());
|
||||
static::registerPacket(new ResourcePackDataInfoPacket());
|
||||
static::registerPacket(new ResourcePackChunkDataPacket());
|
||||
static::registerPacket(new ResourcePackChunkRequestPacket());
|
||||
static::registerPacket(new TransferPacket());
|
||||
static::registerPacket(new PlaySoundPacket());
|
||||
static::registerPacket(new StopSoundPacket());
|
||||
static::registerPacket(new SetTitlePacket());
|
||||
static::registerPacket(new AddBehaviorTreePacket());
|
||||
static::registerPacket(new StructureBlockUpdatePacket());
|
||||
static::registerPacket(new ShowStoreOfferPacket());
|
||||
static::registerPacket(new PurchaseReceiptPacket());
|
||||
|
||||
static::registerPacket(new BatchPacket());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DataPacket $packet
|
||||
*/
|
||||
public static function registerPacket(DataPacket $packet){
|
||||
static::$pool[$packet->pid()] = clone $packet;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $pid
|
||||
* @return DataPacket
|
||||
*/
|
||||
public static function getPacketById(int $pid) : DataPacket{
|
||||
return static::$pool[$pid] ?? new UnknownPacket();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $buffer
|
||||
* @return DataPacket
|
||||
*/
|
||||
public static function getPacket(string $buffer) : DataPacket{
|
||||
$pk = static::getPacketById(ord($buffer{0}));
|
||||
$pk->setBuffer($buffer);
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\network\mcpe\protocol;
|
||||
|
||||
#include <rules/DataPacket.h>
|
||||
|
||||
use pocketmine\network\mcpe\NetworkSession;
|
||||
|
||||
class PurchaseReceiptPacket extends DataPacket{
|
||||
const NETWORK_ID = ProtocolInfo::PURCHASE_RECEIPT_PACKET;
|
||||
|
||||
/** @var string[] */
|
||||
public $entries = [];
|
||||
|
||||
public function decodePayload(){
|
||||
$count = $this->getUnsignedVarInt();
|
||||
for($i = 0; $i < $count; ++$i){
|
||||
$this->entries[] = $this->getString();
|
||||
}
|
||||
}
|
||||
|
||||
public function encodePayload(){
|
||||
$this->putUnsignedVarInt(count($this->entries));
|
||||
foreach($this->entries as $entry){
|
||||
$this->putString($entry);
|
||||
}
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $session) : bool{
|
||||
return $session->handlePurchaseReceipt($this);
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\network\mcpe\protocol;
|
||||
|
||||
#include <rules/DataPacket.h>
|
||||
|
||||
use pocketmine\network\mcpe\NetworkSession;
|
||||
|
||||
class ShowStoreOfferPacket extends DataPacket{
|
||||
const NETWORK_ID = ProtocolInfo::SHOW_STORE_OFFER_PACKET;
|
||||
|
||||
public $offerId;
|
||||
|
||||
public function decodePayload(){
|
||||
$this->offerId = $this->getString();
|
||||
}
|
||||
|
||||
public function encodePayload(){
|
||||
$this->putString($this->offerId);
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $session) : bool{
|
||||
return $session->handleShowStoreOffer($this);
|
||||
}
|
||||
}
|
46
src/pocketmine/network/mcpe/protocol/SimpleEventPacket.php
Normal file
46
src/pocketmine/network/mcpe/protocol/SimpleEventPacket.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\network\mcpe\protocol;
|
||||
|
||||
#include <rules/DataPacket.h>
|
||||
|
||||
use pocketmine\network\mcpe\NetworkSession;
|
||||
|
||||
class SimpleEventPacket extends DataPacket{
|
||||
const NETWORK_ID = ProtocolInfo::SIMPLE_EVENT_PACKET;
|
||||
|
||||
public $unknownShort1;
|
||||
|
||||
public function decodePayload(){
|
||||
$this->unknownShort1 = $this->getLShort();
|
||||
}
|
||||
|
||||
public function encodePayload(){
|
||||
$this->putLShort($this->unknownShort1);
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $session) : bool{
|
||||
return $session->handleSimpleEvent($this);
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\network\mcpe\protocol;
|
||||
|
||||
#include <rules/DataPacket.h>
|
||||
|
||||
use pocketmine\network\mcpe\NetworkSession;
|
||||
|
||||
class StructureBlockUpdatePacket extends DataPacket{
|
||||
const NETWORK_ID = ProtocolInfo::STRUCTURE_BLOCK_UPDATE_PACKET;
|
||||
|
||||
public function decodePayload(){
|
||||
//TODO
|
||||
}
|
||||
|
||||
public function encodePayload(){
|
||||
//TODO
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $session) : bool{
|
||||
return $session->handleStructureBlockUpdate($this);
|
||||
}
|
||||
}
|
58
src/pocketmine/network/mcpe/protocol/UpdateEquipPacket.php
Normal file
58
src/pocketmine/network/mcpe/protocol/UpdateEquipPacket.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\network\mcpe\protocol;
|
||||
|
||||
#include <rules/DataPacket.h>
|
||||
|
||||
use pocketmine\network\mcpe\NetworkSession;
|
||||
|
||||
class UpdateEquipPacket extends DataPacket{
|
||||
const NETWORK_ID = ProtocolInfo::UPDATE_EQUIP_PACKET;
|
||||
|
||||
public $windowId;
|
||||
public $windowType;
|
||||
public $unknownVarint; //TODO: find out what this is (vanilla always sends 0)
|
||||
public $entityUniqueId;
|
||||
public $namedtag;
|
||||
|
||||
public function decodePayload(){
|
||||
$this->windowId = $this->getByte();
|
||||
$this->windowType = $this->getByte();
|
||||
$this->unknownVarint = $this->getVarInt();
|
||||
$this->entityUniqueId = $this->getEntityUniqueId();
|
||||
$this->namedtag = $this->get(true);
|
||||
}
|
||||
|
||||
public function encodePayload(){
|
||||
$this->putByte($this->windowId);
|
||||
$this->putByte($this->windowType);
|
||||
$this->putVarInt($this->unknownVarint);
|
||||
$this->putEntityUniqueId($this->entityUniqueId);
|
||||
$this->put($this->namedtag);
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $session) : bool{
|
||||
return $session->handleUpdateEquip($this);
|
||||
}
|
||||
}
|
38
src/pocketmine/network/mcpe/protocol/types/ContainerIds.php
Normal file
38
src/pocketmine/network/mcpe/protocol/types/ContainerIds.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\network\mcpe\protocol\types;
|
||||
|
||||
interface ContainerIds{
|
||||
|
||||
const NONE = -1;
|
||||
const INVENTORY = 0;
|
||||
const FIRST = 1;
|
||||
const LAST = 100;
|
||||
const OFFHAND = 119;
|
||||
const ARMOR = 120;
|
||||
const CREATIVE = 121;
|
||||
const HOTBAR = 122;
|
||||
const FIXED_INVENTORY = 123;
|
||||
|
||||
}
|
Reference in New Issue
Block a user