mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 07:39:57 +00:00
Fixed a few wrong fields
This commit is contained in:
parent
f6ecf51516
commit
1f5ff78f06
@ -1153,7 +1153,7 @@ class Player{
|
|||||||
case ProtocolInfo::PING_PACKET:
|
case ProtocolInfo::PING_PACKET:
|
||||||
case ProtocolInfo::PONG_PACKET:
|
case ProtocolInfo::PONG_PACKET:
|
||||||
case ProtocolInfo::MOVE_PLAYER_PACKET:
|
case ProtocolInfo::MOVE_PLAYER_PACKET:
|
||||||
case ProtocolInfo::MOVE_REQUEST_CHUNK:
|
case ProtocolInfo::REQUEST_CHUNK_PACKET:
|
||||||
case ProtocolInfo::ANIMATE_PACKET:
|
case ProtocolInfo::ANIMATE_PACKET:
|
||||||
case ProtocolInfo::SET_HEALTH_PACKET:
|
case ProtocolInfo::SET_HEALTH_PACKET:
|
||||||
continue;
|
continue;
|
||||||
@ -1589,7 +1589,6 @@ class Player{
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$blockVector = new Vector3($packet->x, $packet->y, $packet->z);
|
$blockVector = new Vector3($packet->x, $packet->y, $packet->z);
|
||||||
|
|
||||||
if(($this->spawned === false or $this->blocked === true) and $packet->face >= 0 and $packet->face <= 5){
|
if(($this->spawned === false or $this->blocked === true) and $packet->face >= 0 and $packet->face <= 5){
|
||||||
@ -1639,6 +1638,7 @@ class Player{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($this->blocked === true or ($this->entity->position instanceof Vector3 and $blockVector->distance($this->entity->position) > 10)){
|
if($this->blocked === true or ($this->entity->position instanceof Vector3 and $blockVector->distance($this->entity->position) > 10)){
|
||||||
|
|
||||||
}elseif($this->getSlot($this->slot)->getID() !== $packet->item or ($this->getSlot($this->slot)->isTool() === false and $this->getSlot($this->slot)->getMetadata() !== $packet->meta)){
|
}elseif($this->getSlot($this->slot)->getID() !== $packet->item or ($this->getSlot($this->slot)->isTool() === false and $this->getSlot($this->slot)->getMetadata() !== $packet->meta)){
|
||||||
$this->sendInventorySlot($this->slot);
|
$this->sendInventorySlot($this->slot);
|
||||||
}else{
|
}else{
|
||||||
@ -2042,15 +2042,15 @@ class Player{
|
|||||||
$pk->y = $this->windows[$packet->windowid]->y;
|
$pk->y = $this->windows[$packet->windowid]->y;
|
||||||
$pk->z = $this->windows[$packet->windowid]->z;
|
$pk->z = $this->windows[$packet->windowid]->z;
|
||||||
$pk->case1 = 1;
|
$pk->case1 = 1;
|
||||||
$pk->case2 = 2;
|
$pk->case2 = 0;
|
||||||
$this->server->api->player->broadcastPacket($this->level->players, $pk);
|
$this->server->api->player->broadcastPacket($this->level->players, $pk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($this->windows[$packet->windowid]);
|
unset($this->windows[$packet->windowid]);
|
||||||
|
|
||||||
$this->dataPacket(ProtocolInfo::CONTAINER_CLOSE_PACKET, array(
|
$pk = new ContainerClosePacket;
|
||||||
"windowid" => $packet->windowid,
|
$pk->windowid = $packet->windowid;
|
||||||
));
|
$this->dataPacket($pk);
|
||||||
break;
|
break;
|
||||||
case ProtocolInfo::CONTAINER_SET_SLOT_PACKET:
|
case ProtocolInfo::CONTAINER_SET_SLOT_PACKET:
|
||||||
if($this->spawned === false or $this->blocked === true){
|
if($this->spawned === false or $this->blocked === true){
|
||||||
|
@ -27,7 +27,7 @@ class ContainerClosePacket extends RakNetDataPacket{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function decode(){
|
public function decode(){
|
||||||
$this->windowid = $this->getInt();
|
$this->windowid = $this->getByte();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function encode(){
|
public function encode(){
|
||||||
|
@ -32,8 +32,8 @@ class RemoveBlockPacket extends RakNetDataPacket{
|
|||||||
public function decode(){
|
public function decode(){
|
||||||
$this->eid = $this->getInt();
|
$this->eid = $this->getInt();
|
||||||
$this->x = $this->getInt();
|
$this->x = $this->getInt();
|
||||||
$this->y = $this->getInt();
|
|
||||||
$this->z = $this->getInt();
|
$this->z = $this->getInt();
|
||||||
|
$this->y = $this->getByte();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function encode(){
|
public function encode(){
|
||||||
|
@ -28,7 +28,7 @@ class Cache{
|
|||||||
|
|
||||||
public static function get($identifier){
|
public static function get($identifier){
|
||||||
if(isset(self::$cached[$identifier])){
|
if(isset(self::$cached[$identifier])){
|
||||||
self::$cached[$identifier][1] += $minTTL;
|
self::$cached[$identifier][1] = microtime(true) + self::$cached[$identifier][2];
|
||||||
return self::$cached[$identifier][0];
|
return self::$cached[$identifier][0];
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -1000,9 +1000,9 @@ class Entity extends Position{
|
|||||||
$this->server->api->dhandle("entity.event", array("entity" => $this, "event" => 2)); //Ouch! sound
|
$this->server->api->dhandle("entity.event", array("entity" => $this, "event" => 2)); //Ouch! sound
|
||||||
}
|
}
|
||||||
if($this->player instanceof Player){
|
if($this->player instanceof Player){
|
||||||
$this->player->dataPacket(ProtocolInfo::SET_HEALTH_PACKET, array(
|
$pk = new SetHealthPacket;
|
||||||
"health" => $this->health,
|
$pk->health = $this->health;
|
||||||
));
|
$this->player->dataPacket($pk);
|
||||||
}
|
}
|
||||||
if($this->health <= 0 and $this->dead === false){
|
if($this->health <= 0 and $this->dead === false){
|
||||||
$this->spawnDrops();
|
$this->spawnDrops();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user