mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 01:39:52 +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;
|
break;
|
||||||
}
|
}
|
||||||
$target = $this->getLevel()->getBlock($vector);
|
$target = $this->getLevel()->getBlock($vector);
|
||||||
|
$tile = $this->getLevel()->getTile($vector);
|
||||||
$pk = new UpdateBlockPacket;
|
$pk = new UpdateBlockPacket;
|
||||||
$pk->x = $target->x;
|
$pk->x = $target->x;
|
||||||
$pk->y = $target->y;
|
$pk->y = $target->y;
|
||||||
@ -1744,6 +1745,9 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
$pk->block = $target->getID();
|
$pk->block = $target->getID();
|
||||||
$pk->meta = $target->getDamage();
|
$pk->meta = $target->getDamage();
|
||||||
$this->directDataPacket($pk);
|
$this->directDataPacket($pk);
|
||||||
|
if($tile instanceof Spawnable){
|
||||||
|
$tile->spawnTo($this);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ProtocolInfo::PLAYER_ARMOR_EQUIPMENT_PACKET:
|
case ProtocolInfo::PLAYER_ARMOR_EQUIPMENT_PACKET:
|
||||||
if($this->spawned === false or $this->blocked === true){
|
if($this->spawned === false or $this->blocked === true){
|
||||||
|
@ -101,6 +101,9 @@ class SimpleTransactionGroup implements TransactionGroup{
|
|||||||
|
|
||||||
Server::getInstance()->getPluginManager()->callEvent($ev = new InventoryTransactionEvent($this));
|
Server::getInstance()->getPluginManager()->callEvent($ev = new InventoryTransactionEvent($this));
|
||||||
if($ev->isCancelled()){
|
if($ev->isCancelled()){
|
||||||
|
foreach($this->inventories as $inventory){
|
||||||
|
$inventory->sendContents($inventory->getViewers());
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user