mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 20:19:44 +00:00
Support Sign for MCPE 0.6.0
This commit is contained in:
parent
da53ee6735
commit
1b25bd4694
4 changed files with 12 additions and 41 deletions
|
|
@ -7,7 +7,13 @@ class EntityDataPacket extends RakNetDataPacket{
|
|||
public $namedtag;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
if($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::ENTITY_DATA_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9) {
|
||||
return ProtocolInfo8::ENTITY_DATA_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12) {
|
||||
return ProtocolInfo9::ENTITY_DATA_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::ENTITY_DATA_PACKET;
|
||||
}
|
||||
return ProtocolInfo::ENTITY_DATA_PACKET;
|
||||
|
|
@ -26,6 +32,7 @@ class EntityDataPacket extends RakNetDataPacket{
|
|||
$this->putByte($this->y);
|
||||
$this->putShort($this->z);
|
||||
$this->put($this->namedtag);
|
||||
console($this->namedtag);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
<?php
|
||||
|
||||
class SignUpdatePacket extends RakNetDataPacket{
|
||||
public $x;
|
||||
public $y;
|
||||
public $z;
|
||||
public $content;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::SIGN_UPDATE_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::SIGN_UPDATE_PACKET) {
|
||||
return ProtocolInfo8::SIGN_UPDATE_PACKET;
|
||||
}
|
||||
return ProtocolInfo9::SIGN_UPDATE_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
//$this->reset();
|
||||
$this->x = $this->getShort();
|
||||
$this->y = $this->getByte();
|
||||
$this->z = $this->getShort();
|
||||
$this->content = $this->getString();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
//$this->reset();
|
||||
$this->putShort($this->x);
|
||||
$this->putByte($this->y);
|
||||
$this->putShort($this->z);
|
||||
$this->putString($this->content);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue