mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Merge commit '7a072931d'
This commit is contained in:
commit
ab62a792e1
25
composer.lock
generated
25
composer.lock
generated
@ -530,12 +530,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/NBT.git",
|
||||
"reference": "f2517ec187a8306a3d3f594bf06a7c828645b9d7"
|
||||
"reference": "6b2234572b5d06a0532e3851e72bdc108e0c4387"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/NBT/zipball/f2517ec187a8306a3d3f594bf06a7c828645b9d7",
|
||||
"reference": "f2517ec187a8306a3d3f594bf06a7c828645b9d7",
|
||||
"url": "https://api.github.com/repos/pmmp/NBT/zipball/6b2234572b5d06a0532e3851e72bdc108e0c4387",
|
||||
"reference": "6b2234572b5d06a0532e3851e72bdc108e0c4387",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -559,7 +559,7 @@
|
||||
"LGPL-3.0"
|
||||
],
|
||||
"description": "PHP library for working with Named Binary Tags",
|
||||
"time": "2020-03-04T18:52:35+00:00"
|
||||
"time": "2020-04-15T11:29:45+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/raklib",
|
||||
@ -760,6 +760,20 @@
|
||||
"MIT"
|
||||
],
|
||||
"description": "PHPStan - PHP Static Analysis Tool",
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/ondrejmirtes",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://www.patreon.com/phpstan",
|
||||
"type": "patreon"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-03-22T16:51:47+00:00"
|
||||
},
|
||||
{
|
||||
@ -911,5 +925,6 @@
|
||||
"ext-zip": "*",
|
||||
"ext-zlib": ">=1.2.11"
|
||||
},
|
||||
"platform-dev": []
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "1.1.0"
|
||||
}
|
||||
|
@ -31,10 +31,11 @@ use pocketmine\network\mcpe\serializer\NetworkBinaryStream;
|
||||
class ActorEventPacket extends DataPacket implements ClientboundPacket, ServerboundPacket{
|
||||
public const NETWORK_ID = ProtocolInfo::ACTOR_EVENT_PACKET;
|
||||
|
||||
public const JUMP = 1;
|
||||
public const HURT_ANIMATION = 2;
|
||||
public const DEATH_ANIMATION = 3;
|
||||
public const ARM_SWING = 4;
|
||||
|
||||
public const STOP_ATTACK = 5;
|
||||
public const TAME_FAIL = 6;
|
||||
public const TAME_SUCCESS = 7;
|
||||
public const SHAKE_WET = 8;
|
||||
@ -51,16 +52,18 @@ class ActorEventPacket extends DataPacket implements ClientboundPacket, Serverbo
|
||||
public const IRON_GOLEM_OFFER_FLOWER = 19;
|
||||
public const IRON_GOLEM_WITHDRAW_FLOWER = 20;
|
||||
public const LOVE_PARTICLES = 21; //breeding
|
||||
|
||||
public const VILLAGER_ANGRY = 22;
|
||||
public const VILLAGER_HAPPY = 23;
|
||||
public const WITCH_SPELL_PARTICLES = 24;
|
||||
public const FIREWORK_PARTICLES = 25;
|
||||
|
||||
public const IN_LOVE_PARTICLES = 26;
|
||||
public const SILVERFISH_SPAWN_ANIMATION = 27;
|
||||
|
||||
public const GUARDIAN_ATTACK = 28;
|
||||
public const WITCH_DRINK_POTION = 29;
|
||||
public const WITCH_THROW_POTION = 30;
|
||||
public const MINECART_TNT_PRIME_FUSE = 31;
|
||||
|
||||
public const CREEPER_PRIME_FUSE = 32;
|
||||
public const AIR_SUPPLY_EXPIRED = 33;
|
||||
public const PLAYER_ADD_XP_LEVELS = 34;
|
||||
public const ELDER_GUARDIAN_CURSE = 35;
|
||||
public const AGENT_ARM_SWING = 36;
|
||||
@ -80,6 +83,11 @@ class ActorEventPacket extends DataPacket implements ClientboundPacket, Serverbo
|
||||
public const ENTITY_SPAWN = 67; //used for MinecraftEventing stuff, not needed
|
||||
public const DRAGON_PUKE = 68; //they call this puke particles
|
||||
public const ITEM_ENTITY_MERGE = 69;
|
||||
public const START_SWIM = 70;
|
||||
public const BALLOON_POP = 71;
|
||||
public const TREASURE_HUNT = 72;
|
||||
public const AGENT_SUMMON = 73;
|
||||
public const CHARGED_CROSSBOW = 74;
|
||||
|
||||
//TODO: add more events
|
||||
|
||||
|
@ -35,6 +35,7 @@ class AnimatePacket extends DataPacket implements ClientboundPacket, Serverbound
|
||||
|
||||
public const ACTION_STOP_SLEEP = 3;
|
||||
public const ACTION_CRITICAL_HIT = 4;
|
||||
public const ACTION_MAGICAL_CRITICAL_HIT = 5;
|
||||
public const ACTION_ROW_RIGHT = 128;
|
||||
public const ACTION_ROW_LEFT = 129;
|
||||
|
||||
|
@ -33,7 +33,7 @@ class InteractPacket extends DataPacket implements ServerboundPacket{
|
||||
|
||||
public const ACTION_LEAVE_VEHICLE = 3;
|
||||
public const ACTION_MOUSEOVER = 4;
|
||||
|
||||
public const ACTION_OPEN_NPC = 5;
|
||||
public const ACTION_OPEN_INVENTORY = 6;
|
||||
|
||||
/** @var int */
|
||||
|
@ -31,8 +31,12 @@ use pocketmine\network\mcpe\serializer\NetworkBinaryStream;
|
||||
class LabTablePacket extends DataPacket implements ClientboundPacket, ServerboundPacket{
|
||||
public const NETWORK_ID = ProtocolInfo::LAB_TABLE_PACKET;
|
||||
|
||||
public const TYPE_START_COMBINE = 0;
|
||||
public const TYPE_START_REACTION = 1;
|
||||
public const TYPE_RESET = 2;
|
||||
|
||||
/** @var int */
|
||||
public $uselessByte; //0 for client -> server, 1 for server -> client. Seems useless.
|
||||
public $type;
|
||||
|
||||
/** @var int */
|
||||
public $x;
|
||||
@ -45,13 +49,13 @@ class LabTablePacket extends DataPacket implements ClientboundPacket, Serverboun
|
||||
public $reactionType;
|
||||
|
||||
protected function decodePayload(NetworkBinaryStream $in) : void{
|
||||
$this->uselessByte = $in->getByte();
|
||||
$this->type = $in->getByte();
|
||||
$in->getSignedBlockPosition($this->x, $this->y, $this->z);
|
||||
$this->reactionType = $in->getByte();
|
||||
}
|
||||
|
||||
protected function encodePayload(NetworkBinaryStream $out) : void{
|
||||
$out->putByte($this->uselessByte);
|
||||
$out->putByte($this->type);
|
||||
$out->putSignedBlockPosition($this->x, $this->y, $this->z);
|
||||
$out->putByte($this->reactionType);
|
||||
}
|
||||
|
@ -26,17 +26,33 @@ namespace pocketmine\network\mcpe\protocol;
|
||||
#include <rules/DataPacket.h>
|
||||
|
||||
use pocketmine\network\mcpe\handler\PacketHandler;
|
||||
use pocketmine\network\mcpe\protocol\types\StructureEditorData;
|
||||
use pocketmine\network\mcpe\serializer\NetworkBinaryStream;
|
||||
|
||||
class StructureBlockUpdatePacket extends DataPacket implements ServerboundPacket{
|
||||
public const NETWORK_ID = ProtocolInfo::STRUCTURE_BLOCK_UPDATE_PACKET;
|
||||
|
||||
/** @var int */
|
||||
public $x;
|
||||
/** @var int */
|
||||
public $y;
|
||||
/** @var int */
|
||||
public $z;
|
||||
/** @var StructureEditorData */
|
||||
public $structureEditorData;
|
||||
/** @var bool */
|
||||
public $isPowered;
|
||||
|
||||
protected function decodePayload(NetworkBinaryStream $in) : void{
|
||||
//TODO
|
||||
$in->getBlockPosition($this->x, $this->y, $this->z);
|
||||
$this->structureEditorData = $in->getStructureEditorData();
|
||||
$this->isPowered = $in->getBool();
|
||||
}
|
||||
|
||||
protected function encodePayload(NetworkBinaryStream $out) : void{
|
||||
//TODO
|
||||
$out->putBlockPosition($this->x, $this->y, $this->z);
|
||||
$out->putStructureEditorData($this->structureEditorData);
|
||||
$out->putBool($this->isPowered);
|
||||
}
|
||||
|
||||
public function handle(PacketHandler $handler) : bool{
|
||||
|
@ -36,7 +36,7 @@ class UpdateEquipPacket extends DataPacket implements ClientboundPacket{
|
||||
/** @var int */
|
||||
public $windowType;
|
||||
/** @var int */
|
||||
public $unknownVarint; //TODO: find out what this is (vanilla always sends 0)
|
||||
public $windowSlotCount; //useless, seems to be part of a standard container header
|
||||
/** @var int */
|
||||
public $entityUniqueId;
|
||||
/** @var string */
|
||||
@ -45,7 +45,7 @@ class UpdateEquipPacket extends DataPacket implements ClientboundPacket{
|
||||
protected function decodePayload(NetworkBinaryStream $in) : void{
|
||||
$this->windowId = $in->getByte();
|
||||
$this->windowType = $in->getByte();
|
||||
$this->unknownVarint = $in->getVarInt();
|
||||
$this->windowSlotCount = $in->getVarInt();
|
||||
$this->entityUniqueId = $in->getEntityUniqueId();
|
||||
$this->namedtag = $in->getRemaining();
|
||||
}
|
||||
@ -53,7 +53,7 @@ class UpdateEquipPacket extends DataPacket implements ClientboundPacket{
|
||||
protected function encodePayload(NetworkBinaryStream $out) : void{
|
||||
$out->putByte($this->windowId);
|
||||
$out->putByte($this->windowType);
|
||||
$out->putVarInt($this->unknownVarint);
|
||||
$out->putVarInt($this->windowSlotCount);
|
||||
$out->putEntityUniqueId($this->entityUniqueId);
|
||||
$out->put($this->namedtag);
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ class UpdateTradePacket extends DataPacket implements ClientboundPacket{
|
||||
/** @var int */
|
||||
public $windowType = WindowTypes::TRADING; //Mojang hardcoded this -_-
|
||||
/** @var int */
|
||||
public $thisIsAlwaysZero = 0; //hardcoded to 0
|
||||
public $windowSlotCount = 0; //useless, seems to be part of a standard container header
|
||||
/** @var int */
|
||||
public $tradeTier;
|
||||
/** @var int */
|
||||
@ -58,7 +58,7 @@ class UpdateTradePacket extends DataPacket implements ClientboundPacket{
|
||||
protected function decodePayload(NetworkBinaryStream $in) : void{
|
||||
$this->windowId = $in->getByte();
|
||||
$this->windowType = $in->getByte();
|
||||
$this->thisIsAlwaysZero = $in->getVarInt();
|
||||
$this->windowSlotCount = $in->getVarInt();
|
||||
$this->tradeTier = $in->getVarInt();
|
||||
$this->traderEid = $in->getEntityUniqueId();
|
||||
$this->playerEid = $in->getEntityUniqueId();
|
||||
@ -71,7 +71,7 @@ class UpdateTradePacket extends DataPacket implements ClientboundPacket{
|
||||
protected function encodePayload(NetworkBinaryStream $out) : void{
|
||||
$out->putByte($this->windowId);
|
||||
$out->putByte($this->windowType);
|
||||
$out->putVarInt($this->thisIsAlwaysZero);
|
||||
$out->putVarInt($this->windowSlotCount);
|
||||
$out->putVarInt($this->tradeTier);
|
||||
$out->putEntityUniqueId($this->traderEid);
|
||||
$out->putEntityUniqueId($this->playerEid);
|
||||
|
48
src/network/mcpe/protocol/types/StructureEditorData.php
Normal file
48
src/network/mcpe/protocol/types/StructureEditorData.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?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;
|
||||
|
||||
class StructureEditorData{
|
||||
public const TYPE_DATA = 0;
|
||||
public const TYPE_SAVE = 1;
|
||||
public const TYPE_LOAD = 2;
|
||||
public const TYPE_CORNER = 3;
|
||||
public const TYPE_INVALID = 4;
|
||||
public const TYPE_EXPORT = 5;
|
||||
|
||||
/** @var string */
|
||||
public $structureName;
|
||||
/** @var string */
|
||||
public $structureDataField;
|
||||
/** @var bool */
|
||||
public $includePlayers;
|
||||
/** @var bool */
|
||||
public $showBoundingBox;
|
||||
/** @var int */
|
||||
public $structureBlockType;
|
||||
/** @var StructureSettings */
|
||||
public $structureSettings;
|
||||
/** @var int */
|
||||
public $structureRedstoneSaveMove;
|
||||
}
|
@ -23,6 +23,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\network\mcpe\protocol\types;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
|
||||
class StructureSettings{
|
||||
/** @var string */
|
||||
public $paletteName;
|
||||
@ -52,4 +54,6 @@ class StructureSettings{
|
||||
public $integrityValue;
|
||||
/** @var int */
|
||||
public $integritySeed;
|
||||
/** @var Vector3 */
|
||||
public $pivot;
|
||||
}
|
||||
|
@ -51,6 +51,7 @@ use pocketmine\network\mcpe\protocol\types\entity\Vec3MetadataProperty;
|
||||
use pocketmine\network\mcpe\protocol\types\SkinAnimation;
|
||||
use pocketmine\network\mcpe\protocol\types\SkinData;
|
||||
use pocketmine\network\mcpe\protocol\types\SkinImage;
|
||||
use pocketmine\network\mcpe\protocol\types\StructureEditorData;
|
||||
use pocketmine\network\mcpe\protocol\types\StructureSettings;
|
||||
use pocketmine\utils\BinaryDataException;
|
||||
use pocketmine\utils\BinaryStream;
|
||||
@ -644,6 +645,7 @@ class NetworkBinaryStream extends BinaryStream{
|
||||
$result->mirror = $this->getByte();
|
||||
$result->integrityValue = $this->getFloat();
|
||||
$result->integritySeed = $this->getInt();
|
||||
$result->pivot = $this->getVector3();
|
||||
|
||||
return $result;
|
||||
}
|
||||
@ -662,5 +664,34 @@ class NetworkBinaryStream extends BinaryStream{
|
||||
$this->putByte($structureSettings->mirror);
|
||||
$this->putFloat($structureSettings->integrityValue);
|
||||
$this->putInt($structureSettings->integritySeed);
|
||||
$this->putVector3($structureSettings->pivot);
|
||||
}
|
||||
|
||||
public function getStructureEditorData() : StructureEditorData{
|
||||
$result = new StructureEditorData();
|
||||
|
||||
$result->structureName = $this->getString();
|
||||
$result->structureDataField = $this->getString();
|
||||
|
||||
$result->includePlayers = $this->getBool();
|
||||
$result->showBoundingBox = $this->getBool();
|
||||
|
||||
$result->structureBlockType = $this->getVarInt();
|
||||
$result->structureSettings = $this->getStructureSettings();
|
||||
$result->structureRedstoneSaveMove = $this->getVarInt();
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function putStructureEditorData(StructureEditorData $structureEditorData) : void{
|
||||
$this->putString($structureEditorData->structureName);
|
||||
$this->putString($structureEditorData->structureDataField);
|
||||
|
||||
$this->putBool($structureEditorData->includePlayers);
|
||||
$this->putBool($structureEditorData->showBoundingBox);
|
||||
|
||||
$this->putVarInt($structureEditorData->structureBlockType);
|
||||
$this->putStructureSettings($structureEditorData->structureSettings);
|
||||
$this->putVarInt($structureEditorData->structureRedstoneSaveMove);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user