Merge pull request #3743 from hmy2001/patch-3

From TileEntityDataPacket in BlockEntityDataPacket
This commit is contained in:
Intyre 2015-11-25 17:05:16 +01:00
commit 2e5490fb5b
3 changed files with 10 additions and 10 deletions

View File

@ -23,7 +23,7 @@ namespace pocketmine\inventory;
use pocketmine\level\Level; use pocketmine\level\Level;
use pocketmine\network\Network; use pocketmine\network\Network;
use pocketmine\network\protocol\TileEventPacket; use pocketmine\network\protocol\BlockEventPacket;
use pocketmine\Player; use pocketmine\Player;
use pocketmine\tile\Chest; use pocketmine\tile\Chest;
@ -44,7 +44,7 @@ class ChestInventory extends ContainerInventory{
parent::onOpen($who); parent::onOpen($who);
if(count($this->getViewers()) === 1){ if(count($this->getViewers()) === 1){
$pk = new TileEventPacket(); $pk = new BlockEventPacket();
$pk->x = $this->getHolder()->getX(); $pk->x = $this->getHolder()->getX();
$pk->y = $this->getHolder()->getY(); $pk->y = $this->getHolder()->getY();
$pk->z = $this->getHolder()->getZ(); $pk->z = $this->getHolder()->getZ();
@ -58,7 +58,7 @@ class ChestInventory extends ContainerInventory{
public function onClose(Player $who){ public function onClose(Player $who){
if(count($this->getViewers()) === 1){ if(count($this->getViewers()) === 1){
$pk = new TileEventPacket(); $pk = new BlockEventPacket();
$pk->x = $this->getHolder()->getX(); $pk->x = $this->getHolder()->getX();
$pk->y = $this->getHolder()->getY(); $pk->y = $this->getHolder()->getY();
$pk->z = $this->getHolder()->getZ(); $pk->z = $this->getHolder()->getZ();
@ -70,4 +70,4 @@ class ChestInventory extends ContainerInventory{
} }
parent::onClose($who); parent::onClose($who);
} }
} }

View File

@ -24,7 +24,7 @@ namespace pocketmine\inventory;
use pocketmine\item\Item; use pocketmine\item\Item;
use pocketmine\level\Level; use pocketmine\level\Level;
use pocketmine\network\Network; use pocketmine\network\Network;
use pocketmine\network\protocol\TileEventPacket; use pocketmine\network\protocol\BlockEventPacket;
use pocketmine\Player; use pocketmine\Player;
use pocketmine\tile\Chest; use pocketmine\tile\Chest;
@ -99,7 +99,7 @@ class DoubleChestInventory extends ChestInventory implements InventoryHolder{
parent::onOpen($who); parent::onOpen($who);
if(count($this->getViewers()) === 1){ if(count($this->getViewers()) === 1){
$pk = new TileEventPacket(); $pk = new BlockEventPacket();
$pk->x = $this->right->getHolder()->getX(); $pk->x = $this->right->getHolder()->getX();
$pk->y = $this->right->getHolder()->getY(); $pk->y = $this->right->getHolder()->getY();
$pk->z = $this->right->getHolder()->getZ(); $pk->z = $this->right->getHolder()->getZ();
@ -113,7 +113,7 @@ class DoubleChestInventory extends ChestInventory implements InventoryHolder{
public function onClose(Player $who){ public function onClose(Player $who){
if(count($this->getViewers()) === 1){ if(count($this->getViewers()) === 1){
$pk = new TileEventPacket(); $pk = new BlockEventPacket();
$pk->x = $this->right->getHolder()->getX(); $pk->x = $this->right->getHolder()->getX();
$pk->y = $this->right->getHolder()->getY(); $pk->y = $this->right->getHolder()->getY();
$pk->z = $this->right->getHolder()->getZ(); $pk->z = $this->right->getHolder()->getZ();
@ -139,4 +139,4 @@ class DoubleChestInventory extends ChestInventory implements InventoryHolder{
public function getRightSide(){ public function getRightSide(){
return $this->right; return $this->right;
} }
} }

View File

@ -25,7 +25,7 @@ use pocketmine\level\format\FullChunk;
use pocketmine\nbt\NBT; use pocketmine\nbt\NBT;
use pocketmine\nbt\tag\Compound; use pocketmine\nbt\tag\Compound;
use pocketmine\network\Network; use pocketmine\network\Network;
use pocketmine\network\protocol\TileEntityDataPacket; use pocketmine\network\protocol\BlockEntityDataPacket;
use pocketmine\Player; use pocketmine\Player;
abstract class Spawnable extends Tile{ abstract class Spawnable extends Tile{
@ -37,7 +37,7 @@ abstract class Spawnable extends Tile{
$nbt = new NBT(NBT::LITTLE_ENDIAN); $nbt = new NBT(NBT::LITTLE_ENDIAN);
$nbt->setData($this->getSpawnCompound()); $nbt->setData($this->getSpawnCompound());
$pk = new TileEntityDataPacket(); $pk = new BlockEntityDataPacket();
$pk->x = $this->x; $pk->x = $this->x;
$pk->y = $this->y; $pk->y = $this->y;
$pk->z = $this->z; $pk->z = $this->z;