當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Item::removeCreativeItem方法代碼示例

本文整理匯總了PHP中pocketmine\item\Item::removeCreativeItem方法的典型用法代碼示例。如果您正苦於以下問題:PHP Item::removeCreativeItem方法的具體用法?PHP Item::removeCreativeItem怎麽用?PHP Item::removeCreativeItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pocketmine\item\Item的用法示例。


在下文中一共展示了Item::removeCreativeItem方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: onEnable

 public function onEnable()
 {
     $this->getLogger()->info("MyOwnWorld Is Loading!");
     $this->getServer()->getPluginManager()->registerEvents($this, $this);
     $this->tasks['ZombieGenerate'] = $this->getServer()->getScheduler()->scheduleRepeatingTask(new CallbackTask([$this, "MobGenerate"]), 20 * 10);
     $this->getServer()->getScheduler()->scheduleRepeatingTask(new CallbackTask([$this, "TimeFix"]), 20);
     $this->getServer()->getScheduler()->scheduleRepeatingTask(new CallbackTask([$this, "RotationTimer"]), 2);
     //注冊自定義實體
     Entity::registerEntity('MyOwnWorld\\Entities\\Pig');
     //豬
     Entity::registerEntity('MyOwnWorld\\Entities\\Sheep');
     //羊
     Entity::registerEntity('MyOwnWorld\\Entities\\Cow');
     //牛
     Entity::registerEntity('MyOwnWorld\\Entities\\Chicken');
     //雞
     Entity::registerEntity('MyOwnWorld\\Entities\\Creeper');
     Entity::registerEntity('MyOwnWorld\\Entities\\Skeleton');
     Entity::registerEntity('MyOwnWorld\\Entities\\Enderman');
     //添加支持的物品
     Item::addCreativeItem(Item::get(Item::SPAWN_EGG, 38));
     //末影人
     Item::addCreativeItem(Item::get(Item::SPAWN_EGG, 33));
     //苦力怕
     Item::addCreativeItem(Item::get(Item::SPAWN_EGG, 34));
     //骷髏
     Item::addCreativeItem(Item::get(Item::SPAWN_EGG, 12));
     //豬
     Item::addCreativeItem(Item::get(Item::SPAWN_EGG, 13));
     //羊
     Item::addCreativeItem(Item::get(Item::SPAWN_EGG, 11));
     //牛
     Item::addCreativeItem(Item::get(Item::SPAWN_EGG, 10));
     //雞
     Item::addCreativeItem(Item::get(Item::WOODEN_HOE, 0));
     Item::addCreativeItem(Item::get(Item::WOODEN_SHOVEL, 0));
     Item::addCreativeItem(Item::get(Item::WOODEN_SWORD, 0));
     Item::addCreativeItem(Item::get(Item::STONE_HOE, 0));
     Item::addCreativeItem(Item::get(Item::STONE_SHOVEL, 0));
     Item::addCreativeItem(Item::get(Item::STONE_SWORD, 0));
     Item::addCreativeItem(Item::get(Item::DIAMOND_HOE, 0));
     Item::addCreativeItem(Item::get(Item::DIAMOND_SHOVEL, 0));
     Item::addCreativeItem(Item::get(Item::DIAMOND_SWORD, 0));
     Item::removeCreativeItem(Item::get(Item::PAINTING, 0));
     Item::removeCreativeItem(Item::get(Item::MONSTER_SPAWNER, 0));
     Item::removeCreativeItem(Item::get(Item::MINECART, 0));
     Item::removeCreativeItem(Item::get(288, 0));
     $this->ZombieAI = new ZombieAI($this);
     $this->CreeperAI = new CreeperAI($this);
     $this->SkeletonAI = new SkeletonAI($this);
     $this->CowAI = new CowAI($this);
     $this->PigAI = new PigAI($this);
     $this->SheepAI = new SheepAI($this);
     $this->ChickenAI = new ChickenAI($this);
     $this->getLogger()->info("MyOwnWorld Loaded !!!!");
 }
開發者ID:edwinyoo44,項目名稱:MyOwnWorld,代碼行數:56,代碼來源:MyOwnWorld.php


注:本文中的pocketmine\item\Item::removeCreativeItem方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。