mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 09:19:42 +00:00
Fixed breaking Spawnable tiles and cancelling it
This commit is contained in:
parent
5e97da2e11
commit
a669797ccb
@ -1737,6 +1737,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
break;
|
||||
}
|
||||
$target = $this->getLevel()->getBlock($vector);
|
||||
$tile = $this->getLevel()->getTile($vector);
|
||||
$pk = new UpdateBlockPacket;
|
||||
$pk->x = $target->x;
|
||||
$pk->y = $target->y;
|
||||
@ -1744,6 +1745,9 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
$pk->block = $target->getID();
|
||||
$pk->meta = $target->getDamage();
|
||||
$this->directDataPacket($pk);
|
||||
if($tile instanceof Spawnable){
|
||||
$tile->spawnTo($this);
|
||||
}
|
||||
break;
|
||||
case ProtocolInfo::PLAYER_ARMOR_EQUIPMENT_PACKET:
|
||||
if($this->spawned === false or $this->blocked === true){
|
||||
|
@ -101,6 +101,9 @@ class SimpleTransactionGroup implements TransactionGroup{
|
||||
|
||||
Server::getInstance()->getPluginManager()->callEvent($ev = new InventoryTransactionEvent($this));
|
||||
if($ev->isCancelled()){
|
||||
foreach($this->inventories as $inventory){
|
||||
$inventory->sendContents($inventory->getViewers());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user