mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
Support 0.7.0
This commit is contained in:
parent
048dfd2e98
commit
0fefb140f4
21 changed files with 48 additions and 44 deletions
|
|
@ -18,7 +18,7 @@ class AnimatePacket extends RakNetDataPacket{
|
|||
return ProtocolInfo6::ANIMATE_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
return ProtocolInfo8::ANIMATE_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_11){
|
||||
return ProtocolInfo9::ANIMATE_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::ANIMATE_PACKET;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ class ChatPacket extends RakNetDataPacket{
|
|||
return ProtocolInfo6::CHAT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
return ProtocolInfo8::CHAT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_11){
|
||||
return ProtocolInfo9::CHAT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::CHAT_PACKET;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class ContainerAckPacket extends RakNetDataPacket{
|
|||
return ProtocolInfo6::CONTAINER_ACK_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
return ProtocolInfo8::CONTAINER_ACK_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_11){
|
||||
return ProtocolInfo9::CONTAINER_ACK_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::CONTAINER_ACK_PACKET;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class ContainerClosePacket extends RakNetDataPacket{
|
|||
return ProtocolInfo6::CONTAINER_CLOSE_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
return ProtocolInfo8::CONTAINER_CLOSE_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_11){
|
||||
return ProtocolInfo9::CONTAINER_CLOSE_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::CONTAINER_CLOSE_PACKET;
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ class ContainerOpenPacket extends RakNetDataPacket{
|
|||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::CONTAINER_OPEN_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
return ProtocolInfo8::CONTAINER_OPN_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
|
||||
return ProtocolInfo8::CONTAINER_OPEN_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_11){
|
||||
return ProtocolInfo9::CONTAINER_OPEN_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::CONTAINER_OPEN_PACKET;
|
||||
|
|
@ -37,7 +37,7 @@ class ContainerOpenPacket extends RakNetDataPacket{
|
|||
$this->putByte($this->slots);
|
||||
if ($this->PROTOCOL <= ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
$this->putString($this->unknownstring);
|
||||
ConsoleAPI::debug($this->unknownstring);
|
||||
ConsoleAPI::info($this->unknownstring);
|
||||
}else{
|
||||
$this->putInt($this->x);
|
||||
$this->putInt($this->y);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class ContainerSetContentPacket extends RakNetDataPacket{
|
|||
return ProtocolInfo6::CONTAINER_SET_CONTENT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
return ProtocolInfo8::CONTAINER_SET_CONTENT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_11){
|
||||
return ProtocolInfo9::CONTAINER_SET_CONTENT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::CONTAINER_SET_CONTENT_PACKET;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class ContainerSetDataPacket extends RakNetDataPacket{
|
|||
return ProtocolInfo6::CONTAINER_SET_DATA_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
return ProtocolInfo8::CONTAINER_SET_DATA_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_11){
|
||||
return ProtocolInfo9::CONTAINER_SET_DATA_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::CONTAINER_SET_DATA_PACKET;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class ContainerSetSlotPacket extends RakNetDataPacket{
|
|||
return ProtocolInfo6::CONTAINER_SET_SLOT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
return ProtocolInfo8::CONTAINER_SET_SLOT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_11){
|
||||
return ProtocolInfo9::CONTAINER_SET_SLOT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::CONTAINER_SET_SLOT_PACKET;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class DropItemPacket extends RakNetDataPacket{
|
|||
return ProtocolInfo6::DROP_ITEM_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
return ProtocolInfo8::DROP_ITEM_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_11){
|
||||
return ProtocolInfo9::DROP_ITEM_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::DROP_ITEM_PACKET;
|
||||
|
|
@ -23,17 +23,12 @@ class DropItemPacket extends RakNetDataPacket{
|
|||
}
|
||||
|
||||
public function decode(){
|
||||
//if($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8)$this->reset();
|
||||
$this->eid = $this->getInt();
|
||||
$this->randomly = $this->getByte();
|
||||
$this->item = $this->getSlot();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
/*$this->reset();
|
||||
$this->putInt($this->eid);
|
||||
$this->putByte($this->unknown);
|
||||
$this->putSlot($this->item);*/
|
||||
}
|
||||
|
||||
public function eidsToGlobal(Player $p){
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class EntityDataPacket extends RakNetDataPacket{
|
|||
return ProtocolInfo6::ENTITY_DATA_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9) {
|
||||
return ProtocolInfo8::ENTITY_DATA_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12) {
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_11) {
|
||||
return ProtocolInfo9::ENTITY_DATA_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::ENTITY_DATA_PACKET;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ class LoginPacket extends RakNetDataPacket{
|
|||
}
|
||||
|
||||
public function decode(){
|
||||
//if($this->PROTOCOL <= ProtocolInfo9::CURRENT_PROTOCOL_9)$this->reset();
|
||||
$this->username = $this->getString();
|
||||
$this->protocol1 = $this->getInt();
|
||||
$this->protocol2 = $this->getInt();
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class MessagePacket extends RakNetDataPacket{
|
|||
}
|
||||
|
||||
public function decode(){
|
||||
if($this->PROTOCOL > ProtocolInfo9::CURRENT_PROTOCOL_9){ //0.6.1 and below From NostalgiaCore-BackPort Author:Gameherobrine
|
||||
if($this->PROTOCOL > ProtocolInfo12::CURRENT_PROTOCOL_11){ //0.6.1 and below From NostalgiaCore-BackPort Author:Gameherobrine
|
||||
$this->source = $this->getString();
|
||||
}else {
|
||||
$this->source = "";
|
||||
|
|
@ -22,7 +22,7 @@ class MessagePacket extends RakNetDataPacket{
|
|||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
if($this->PROTOCOL > ProtocolInfo9::CURRENT_PROTOCOL_9){ //0.6.1 and below From NostalgiaCore-BackPort Author:Gameherobrine
|
||||
if($this->PROTOCOL > ProtocolInfo12::CURRENT_PROTOCOL_11){ //0.6.1 and below From NostalgiaCore-BackPort Author:Gameherobrine
|
||||
$this->putString($this->source);
|
||||
}
|
||||
$this->putString($this->message);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class PlayerEquipmentPacket extends RakNetDataPacket{
|
|||
$this->eid = $this->getInt();
|
||||
$this->item = $this->getShort();
|
||||
$this->meta = $this->getShort();
|
||||
if($this->PROTOCOL >= ProtocolInfo12::CURRENT_PROTOCOL_12){$this->slot = $this->getSignedByte();}
|
||||
if($this->PROTOCOL >= ProtocolInfo12::CURRENT_PROTOCOL_11){$this->slot = $this->getSignedByte();}
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
|
|
@ -33,7 +33,7 @@ class PlayerEquipmentPacket extends RakNetDataPacket{
|
|||
$this->putInt($this->eid);
|
||||
$this->putShort(BlockAPI::convertHighItemIdsToOldItemIds($this->PROTOCOL, $this->item));
|
||||
$this->putShort($this->meta);
|
||||
if($this->PROTOCOL >= ProtocolInfo12::CURRENT_PROTOCOL_12){$this->putByte($this->slot);}
|
||||
if($this->PROTOCOL >= ProtocolInfo12::CURRENT_PROTOCOL_11){$this->putByte($this->slot);}
|
||||
}
|
||||
|
||||
public function eidsToGlobal(Player $p){
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class RespawnPacket extends RakNetDataPacket{
|
|||
return ProtocolInfo6::RESPAWN_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
return ProtocolInfo8::RESPAWN_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_11){
|
||||
return ProtocolInfo9::RESPAWN_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::RESPAWN_PACKET;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class SendInventoryPacket extends RakNetDataPacket{
|
|||
return ProtocolInfo6::SEND_INVENTORY_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
return ProtocolInfo8::SEND_INVENTORY_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_11){
|
||||
return ProtocolInfo9::SEND_INVENTORY_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::SEND_INVENTORY_PACKET;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class SetHealthPacket extends RakNetDataPacket{
|
|||
return ProtocolInfo6::SET_HEALTH_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
return ProtocolInfo8::SET_HEALTH_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_11){
|
||||
return ProtocolInfo9::SET_HEALTH_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::SET_HEALTH_PACKET;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ class SetSpawnPositionPacket extends RakNetDataPacket{
|
|||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
return ProtocolInfo8::SET_SPAWN_POSITION_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_11){
|
||||
return ProtocolInfo9::SET_SPAWN_POSITION_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::SET_SPAWN_POSITION_PACKET;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue