mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-04 00:55:14 +00:00
Updated ItemFrameDropItemPacket for >=1.0.3, fix decode errors
Sorry, this DOES NOT FIX creative, blame Mojang. https://bugs.mojang.com/browse/MCPE-20070
This commit is contained in:
@ -2950,13 +2950,13 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
|
|
||||||
$tile = $this->level->getTile($this->temporalVector->setComponents($packet->x, $packet->y, $packet->z));
|
$tile = $this->level->getTile($this->temporalVector->setComponents($packet->x, $packet->y, $packet->z));
|
||||||
if($tile instanceof ItemFrame){
|
if($tile instanceof ItemFrame){
|
||||||
if(!$tile->getItem()->equals($packet->item) and !$this->isCreative(true)){
|
if($this->isSpectator()){
|
||||||
$tile->spawnTo($this);
|
$tile->spawnTo($this);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(lcg_value() <= $tile->getItemDropChance() and $packet->item->getId() !== Item::AIR){
|
if(lcg_value() <= $tile->getItemDropChance()){
|
||||||
$this->level->dropItem($tile->getBlock(), $packet->item); //Use the packet item to handle creative drops correctly
|
$this->level->dropItem($tile->getBlock(), $tile->getItem());
|
||||||
}
|
}
|
||||||
$tile->setItem(null);
|
$tile->setItem(null);
|
||||||
$tile->setItemRotation(0);
|
$tile->setItemRotation(0);
|
||||||
|
@ -30,11 +30,9 @@ class ItemFrameDropItemPacket extends DataPacket{
|
|||||||
public $x;
|
public $x;
|
||||||
public $y;
|
public $y;
|
||||||
public $z;
|
public $z;
|
||||||
public $item;
|
|
||||||
|
|
||||||
public function decode(){
|
public function decode(){
|
||||||
$this->getBlockCoords($this->x, $this->y, $this->z);
|
$this->getBlockCoords($this->x, $this->y, $this->z);
|
||||||
$this->item = $this->getSlot();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function encode(){
|
public function encode(){
|
||||||
|
Reference in New Issue
Block a user