当前位置: 首页>>代码示例>>PHP>>正文


PHP Player::getWindowId方法代码示例

本文整理汇总了PHP中pocketmine\Player::getWindowId方法的典型用法代码示例。如果您正苦于以下问题:PHP Player::getWindowId方法的具体用法?PHP Player::getWindowId怎么用?PHP Player::getWindowId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pocketmine\Player的用法示例。


在下文中一共展示了Player::getWindowId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onClose

 public function onClose(Player $who)
 {
     $pk = new ContainerClosePacket();
     $pk->windowid = $who->getWindowId($this);
     $who->dataPacket($pk);
     parent::onClose($who);
 }
开发者ID:Cecil107,项目名称:PocketMine-0.13.0,代码行数:7,代码来源:ContainerInventory.php

示例2: onClose

 public function onClose(Player $who)
 {
     $pk = new ContainerClosePacket();
     $pk->windowid = $who->getWindowId($this);
     $who->dataPacket($pk->setChannel(Network::CHANNEL_WORLD_EVENTS));
     parent::onClose($who);
 }
开发者ID:mattiasaxelsson,项目名称:PocketMine-MP,代码行数:7,代码来源:ContainerInventory.php

示例3: fillUpChest

 public static function fillUpChest(Block $chest, Player $player)
 {
     if ($chest->getId() == Item::CHEST || $chest->getId()) {
         if ($player->gamemode == Player::CREATIVE) {
             $player->sendMessage("[HG] You are in creative Mode");
             return;
         }
         if (!$player->isOp()) {
             $pk = new ContainerSetContentPacket();
             $pk->windowid = $player->getWindowId($player->getInventory());
             // ContainerSetContentPacket::SPECIAL_INVENTORY;
             for ($i = 1; $i < 5; $i++) {
                 $pk->slots[] = HungerGameKit::randomItems();
             }
             $player->dataPacket($pk->setChannel(Network::CHANNEL_WORLD_EVENTS));
             if ($player->getInventory() != null) {
                 $player->getInventory()->sendContents($player);
             }
             // $player->sendMessage ( "[HG] openning chest" );
         }
     }
 }
开发者ID:robozeri,项目名称:SG,代码行数:22,代码来源:PlayerHelper.php

示例4: openChest

 public static function openChest(Block $chest, Player $player)
 {
     if ($chest->getId() == Item::CHEST) {
         if ($player->gamemode == Player::CREATIVE) {
             $player->sendMessage("[HG] You are in creative Mode");
             return;
         }
         if (!$player->isOp()) {
             $pk = new ContainerOpenPacket();
             $pk->windowid = $player->getWindowId($player->getInventory());
             $pk->type = InventoryType::CHEST;
             $pk->slots = $player->getInventory()->getSize();
             $pk->x = $chest->x;
             $pk->y = $chest->y;
             $pk->z = $chest->z;
             $player->dataPacket($pk->setChannel(Network::CHANNEL_WORLD_EVENTS));
             $player->getInventory()->sendContents($player);
         }
     }
 }
开发者ID:robozeri,项目名称:SG,代码行数:20,代码来源:MagicUtil.php


注:本文中的pocketmine\Player::getWindowId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。