registerEntity() public static method

public static registerEntity ( $className, $force = false )
Example #1
0
 public function onEnable()
 {
     $this->hitSessions = [];
     Entity::registerEntity(SlapperCreeper::class, true);
     Entity::registerEntity(SlapperBat::class, true);
     Entity::registerEntity(SlapperSheep::class, true);
     Entity::registerEntity(SlapperPigZombie::class, true);
     /*Entity::registerEntity(SlapperGhast::class,true);
     		Entity::registerEntity(SlapperIronGolem::class,true);
     		Entity::registerEntity(SlapperSnowman::class,true);
     		Entity::registerEntity(SlapperOcelot::class,true);
     		*/
     Entity::registerEntity(SlapperHuman::class, true);
     Entity::registerEntity(SlapperVillager::class, true);
     Entity::registerEntity(SlapperZombie::class, true);
     Entity::registerEntity(SlapperSquid::class, true);
     Entity::registerEntity(SlapperCow::class, true);
     Entity::registerEntity(SlapperSpider::class, true);
     Entity::registerEntity(SlapperPig::class, true);
     Entity::registerEntity(SlapperMushroomCow::class, true);
     Entity::registerEntity(SlapperWolf::class, true);
     Entity::registerEntity(SlapperLavaSlime::class, true);
     Entity::registerEntity(SlapperSilverfish::class, true);
     Entity::registerEntity(SlapperSkeleton::class, true);
     Entity::registerEntity(SlapperSlime::class, true);
     Entity::registerEntity(SlapperChicken::class, true);
     Entity::registerEntity(SlapperEnderman::class, true);
     Entity::registerEntity(SlapperCaveSpider::class, true);
     $this->getLogger()->debug("Entities have been registered!");
     $this->getServer()->getPluginManager()->registerEvents($this, $this);
     $this->getLogger()->debug("Events have been registered!");
     $this->saveDefaultConfig();
     $this->getLogger()->debug("Config has been saved!!!");
     $this->getLogger()->info("Slapper is enabled! Time to slap!");
 }
Example #2
0
 public function onEnable()
 {
     Block::$creative[] = [self::RAILS, 0];
     Block::$creative[] = [self::POWERED_RAILS, 0];
     Block::$creative[] = [self::MINECART, 0];
     Block::$list[self::RAILS] = Rails::class;
     //Block::$list[self::POWERED_RAILS] = PoweredRails::class;
     Item::$list[self::MINECART] = MinecartItem::class;
     Entity::registerEntity(MinecartEntity::class);
 }
 public function __construct()
 {
     $classes = [Cow::class, Pig::class, Sheep::class, Chicken::class, Wolf::class, Ocelot::class, Mooshroom::class, Rabbit::class, IronGolem::class, SnowGolem::class, Zombie::class, Creeper::class, Skeleton::class, Spider::class, PigZombie::class, Enderman::class, Silverfish::class, CaveSpider::class, ZombieVillager::class, Ghast::class, Blaze::class, FireBall::class];
     foreach ($classes as $name) {
         Entity::registerEntity($name);
         /*$item = Item::get(Item::SPAWN_EGG, $id);
           if(!Item::isCreativeItem($item)){
               Item::addCreativeItem($item);
           }*/
     }
 }
Example #4
0
 public function onEnable()
 {
     @mkdir($this->getDataFolder());
     $this->saveDefaultConfig();
     $this->getCommand("pet")->setExecutor(new Commands\Commands($this));
     $this->website = $this->read_cfg("website");
     $this->petLevel = $this->read_cfg("petworld");
     $this->db = new \BuddyPets\Database\Database($this);
     $this->getServer()->getPluginManager()->registerEvents(new EventListener($this), $this);
     Entity::registerEntity(\BuddyPets\Entities\Pets::class, true);
 }
Example #5
0
 public function onEnable()
 {
     @mkdir($this->getDataFolder());
     $this->initMessage();
     $this->registerCommand($this->get("commands-entities"), "EconomyEntities", "economyentities");
     Entity::registerEntity(Entities::class, true);
     $this->move_pk = new MovePlayerPacket();
     $this->getServer()->getPluginManager()->registerEvents($this, $this);
     $this->configyml = new Config($this->getDataFolder() . "config.yml", Config::YAML, array("BotSpawn" => true, "RespawnTime" => 20, "BotSpawnCount" => 0, "Reward-DelayTime" => 60));
     $this->rewardList = (new Config($this->getDataFolder() . "rewardList.yml", Config::YAML, array("chickin-item-id" => Item::EGG, "chickin-item-count" => 1, "villager-item-id" => [Item::WOOD, Item::WORKBENCH, Item::SNOW, Item::CLAY, Item::HAY_BALE, Item::SIGN, Item::MELON_SLICE, Item::COOKED_PORKCHOP, Item::WOODEN_AXE], "villager-item-count" => 1, "skelleton-item-id" => Item::BONE, "skelleton-item-count" => 1, "pig-item-id" => Item::RAW_PORKCHOP, "pig-item-count" => 1, "cow-item-id" => Item::RAW_BEEF, "cow-item-count" => 1, "sheep-item-id" => Item::WOOL, "sheep-item-count" => 1)))->getAll();
     $this->config = $this->configyml->getAll();
     $this->initSpawn();
     $this->getServer()->getScheduler()->scheduleRepeatingTask(new CallbackTask([$this, "BotUpdate"]), 12);
 }
Example #6
0
 public function onEnable()
 {
     if (self::$instance == null) {
         self::$instance = $this;
     }
     if (!file_exists($this->getDataFolder())) {
         @mkdir($this->getDataFolder());
     }
     $this->initMessage();
     $this->attributeLoader = new AttributeLoader($this);
     $this->attributeProvider = new AttributeProvider($this);
     $this->listenerLoader = new ListenerLoader($this);
     $this->eventListener = new EventListener($this);
     Entity::registerEntity("PlayHarder\\ExperienceOrb", true);
     $this->getServer()->getPluginManager()->registerEvents($this, $this);
     $this->getServer()->getScheduler()->scheduleRepeatingTask(new AutoSaveTask($this), 12000);
 }
Example #7
0
 public function __construct(LegionPE $main)
 {
     $this->main = $main;
     $this->pvpChannel = $this->main->getChannelManager()->joinChannel($main, "kitpvp", Channel::CLASS_MODULAR);
     $this->main->getServer()->getPluginManager()->registerEvents($this, $this->main);
     Entity::registerEntity(PvpBowHolder::class, true);
     Entity::registerEntity(PvpKitModel::class, true);
     Entity::registerEntity(PvpUpgradeDummyShop::class, true);
     $this->getMain()->getServer()->getPluginManager()->registerEvents($this->chunkListener = $cl = new PvpGameChunkListener($this), $this->getMain());
     for ($id = 1; $id <= 5; $id++) {
         $loc = Settings::kitpvp_getNpcLocation($this->getMain()->getServer(), $id);
         $this->chunkListener->addModel($loc, $id);
     }
     foreach (Settings::kitpvp_getShopLocations($this->getMain()->getServer()) as $col => $loc) {
         $cl->addShop($loc, $col);
     }
 }
Example #8
0
 public function onEnable()
 {
     JobManager::registerJob(new JobArcher());
     SkillManager::registerSkill(new SkillArrowRepeat());
     SkillManager::registerSkill(new SkillDash());
     SkillManager::registerSkill(new SkillDualArrow());
     SkillManager::registerSkill(new SkillExplosionArrow());
     SkillManager::registerSkill(new SkillArrowMastery());
     SkillManager::registerSkill(new SkillSplitShot());
     SkillManager::registerSkill(new SkillQuickShot());
     SkillManager::registerSkill(new SkillManaIncrease());
     SkillManager::registerSkill(new SkillBowMastery());
     SkillManager::registerSkill(new SkillLightningShot());
     $this->getServer()->getPluginManager()->registerEvents($this, $this);
     Entity::registerEntity("Khinenw\\Archer\\EffectArrow");
     ToAruPG::addAllTranslation($this->getResource("translation.yml"));
     self::$instance = $this;
 }
Example #9
0
 public function onEnable()
 {
     $this->spawner = [];
     $this->classtab = [];
     $ns = "aliuly\\mobsters\\idiots\\";
     foreach (["Chicken", "Pig", "Sheep", "Cow", "Mooshroom", "Wolf", "Enderman", "Spider", "Skeleton", "PigZombie", "Creeper", "Silverfish", "-Zombie", "-Villager"] as $type) {
         $class = $ns . $type;
         if ($type[0] == "-") {
             $type = substr($type, 1);
             $class = $ns . $type;
         } else {
             $id = $class::NETWORK_ID;
             Item::addCreativeItem(Item::get(Item::SPAWN_EGG, $id));
         }
         Entity::registerEntity($class);
         $this->classtab[$class::NETWORK_ID] = $class;
         $this->classtab[strtolower($type)] = $class;
     }
     $this->getServer()->getPluginManager()->registerEvents($this, $this);
     $this->getServer()->getScheduler()->scheduleRepeatingTask(new SpawnerTask($this), 200);
 }
Example #10
0
 public function onEnable()
 {
     @mkdir($this->getDataFolder());
     $this->saveDefaultConfig();
     $this->cfg = $this->getConfig()->getAll();
     $this->getCommand("ping")->setExecutor(new Commands\Commands($this));
     $this->getCommand("hb")->setExecutor(new Commands\Commands($this));
     $this->getCommand("hb")->setExecutor(new Commands\Commands($this));
     $this->getServer()->getPluginManager()->registerEvents(new EventListener($this), $this);
     Entity::registerEntity(Herobrine::class);
     Entity::registerEntity(HerobrineBat::class);
     Entity::registerEntity(UndeadPlayer::class);
     $this->herobrineTask = new HerobrineTask($this);
     if (isset($this->cfg["herobrine"])) {
         if ($this->cfg["herobrine"] == true) {
             $this->herobrineTask->herobrine_active = true;
             if (isset($this->cfg["herobrine_chance"])) {
                 $this->herobrineTask->herobrine_chance = (int) $this->cfg["herobrine_chance"];
             }
             $msg = "Activating Herobrine On Startup with chance " . $this->herobrineTask->herobrine_chance;
             Server::getInstance()->getLogger()->info(Main::PREFIX . $msg);
         }
     }
     $this->getServer()->getScheduler()->scheduleRepeatingTask($this->herobrineTask, 20);
     $this->savePlayerPositionsTask = new \Wattz\Tasks\SavePlayerPositionsTask($this);
     $this->getServer()->getScheduler()->scheduleRepeatingTask($this->savePlayerPositionsTask, 300);
     $this->db = new \Wattz\Database($this, $this->cfg);
     // cache warp aliases
     foreach ($this->cfg["warps"] as $currentwarpkey => $currentwarp) {
         if (isset($currentwarp["names"])) {
             foreach ($currentwarp["names"] as $currentwarpname) {
                 $this->warpaliases[$currentwarpname] = $currentwarpkey;
             }
         }
     }
     $this->initWarpCommands();
     print_r($this->warpaliases);
     Server::getInstance()->getLogger()->info(Main::PREFIX . "Ready");
 }
Example #11
0
 private function registerEntities()
 {
     Entity::registerEntity(Arrow::class);
     Entity::registerEntity(DroppedItem::class);
     Entity::registerEntity(FallingSand::class);
     Entity::registerEntity(PrimedTNT::class);
     Entity::registerEntity(Snowball::class);
     Entity::registerEntity(Villager::class);
     Entity::registerEntity(Zombie::class);
     Entity::registerEntity(Squid::class);
     Entity::registerEntity(Human::class, true);
 }
 public function __construct(Plugin $plugin, $xfg)
 {
     $this->owner = $plugin;
     $this->keepers = [];
     $cfg = (new Config($plugin->getDataFolder() . "shops.yml", Config::YAML))->getAll();
     $this->state = [];
     foreach ($cfg as $i => $j) {
         $this->keepers[$i] = [];
         if (isset($j["messages"])) {
             $this->keepers[$i]["messages"] = $j["messages"];
         } else {
             $this->keepers[$i]["messages"] = [];
         }
         $this->keepers[$i]["attack"] = isset($j["attack"]) ? $j["attack"] : 5;
         $this->keepers[$i]["slim"] = isset($j["slim"]) ? $j["slim"] : false;
         $this->keepers[$i]["displayName"] = isset($j["display"]) ? $j["display"] : "default";
         // Load the skin in memory
         if (is_file($plugin->getDataFolder() . $j["skin"])) {
             $this->keepers[$i]["skin"] = zlib_decode(file_get_contents($plugin->getDataFolder() . $j["skin"]));
         } else {
             $this->keepers[$i]["skin"] = null;
         }
         if (isset($cfg[$i]["msgs"])) {
             $this->keepers[$i]["msgs"] = $cfg[$i]["msgs"];
         }
         $items = isset($cfg[$i]["items"]) && $cfg[$i]["items"] ? $cfg[$i]["items"] : ["IRON_SWORD,2", "APPLE,10,1"];
         $this->keepers[$i]["items"] = [];
         foreach ($items as $n) {
             $t = explode(",", $n);
             if (count($t) < 2 || count($t) > 3) {
                 $plugin->getLogger()->error(mc::_("Item error: %1%", $n));
                 continue;
             }
             $item = Item::fromString(array_shift($t));
             if ($item->getId() == Item::AIR) {
                 $plugin->getLogger()->error(mc::_("Unknown Item error: %1%", $n));
                 continue;
             }
             $price = intval(array_pop($t));
             if ($price <= 0) {
                 $plugin->getLogger()->error(mc::_("Invalid price: %1%", $n));
                 continue;
             }
             if (count($t)) {
                 $qty = intval($t[0]);
                 if ($qty <= 0 || $qty >= $item->getMaxStackSize()) {
                     $plugin->getLogger()->error(mc::_("Bad quantity: %1%", $n));
                     continue;
                 }
                 $item->setCount($qty);
             }
             echo "Item: " . $item->getId() . "," . $item->getCount() . "\n";
             //##DEBUG
             $this->keepers[$i]["items"][implode(":", [$item->getId(), $item->getDamage()])] = [$item, $price];
         }
         if (count($this->keepers[$i]["items"])) {
             continue;
         }
         $plugin->getLogger()->error(mc::_("ShopKeep %1% disabled!", $i));
         unset($this->keepers[$i]);
         continue;
     }
     if (count($this->keepers) == 0) {
         $plugin->getLogger()->error(mc::_("No shopkeepers found!"));
         $this->keepers = null;
         return;
     }
     Entity::registerEntity(TraderNpc::class, true);
     $this->owner->getServer()->getPluginManager()->registerEvents($this, $this->owner);
     $this->owner->getServer()->getScheduler()->scheduleRepeatingTask(new PluginCallbackTask($this->owner, [$this, "spamPlayers"], [$xfg["range"], $xfg["freq"]]), $xfg["ticks"]);
 }
 public function onEnable()
 {
     Entity::registerEntity(Chair::class, true);
     $this->getServer()->getPluginManager()->registerEvents($this, $this);
 }
Example #14
0
 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 !!!!");
 }
Example #15
0
 private function registerEntities()
 {
     Entity::registerEntity(Arrow::class);
     Entity::registerEntity(DroppedItem::class);
     Entity::registerEntity(FallingSand::class);
     Entity::registerEntity(PrimedTNT::class);
     Entity::registerEntity(Snowball::class);
     Entity::registerEntity(Bat::class);
     Entity::registerEntity(Blaze::class);
     Entity::registerEntity(Villager::class);
     Entity::registerEntity(Zombie::class);
     Entity::registerEntity(Squid::class);
     Entity::registerEntity(Ghast::class);
     Entity::registerEntity(CavernSpider::class);
     Entity::registerEntity(Chicken::class);
     Entity::registerEntity(Cow::class);
     Entity::registerEntity(Creeper::class);
     Entity::registerEntity(Enderman::class);
     //Entity::registerEntity(Ozelot::class);
     Entity::registerEntity(Pig::class);
     Entity::registerEntity(PigZombie::class);
     Entity::registerEntity(Sheep::class);
     Entity::registerEntity(Silverfish::class);
     Entity::registerEntity(Skeleton::class);
     Entity::registerEntity(Slime::class);
     Entity::registerEntity(Spider::class);
     Entity::registerEntity(MagmaCube::class);
     Entity::registerEntity(Mooshroom::class);
     Entity::registerEntity(Wolf::class);
     Entity::registerEntity(Human::class, \true);
 }
Example #16
0
 public function onEnable()
 {
     $server = $this->getServer();
     if (stripos($server->getVersion(), "10") || stripos($server->getVersion(), "11") || stripos($server->getVersion(), "12")) {
         $this->getLogger()->error($this->prefix . "Slapper currently only supports 0.13 servers or later. Disabling.");
         $server->getPluginManager()->disablePlugin($this);
     }
     $this->hitSessions = [];
     $this->idSessions = [];
     $this->updateSessions = [];
     Entity::registerEntity(SlapperCreeper::class, true);
     Entity::registerEntity(SlapperBat::class, true);
     Entity::registerEntity(SlapperSheep::class, true);
     Entity::registerEntity(SlapperPigZombie::class, true);
     Entity::registerEntity(SlapperGhast::class, true);
     Entity::registerEntity(SlapperBlaze::class, true);
     Entity::registerEntity(SlapperIronGolem::class, true);
     Entity::registerEntity(SlapperSnowman::class, true);
     Entity::registerEntity(SlapperOcelot::class, true);
     Entity::registerEntity(SlapperZombieVillager::class, true);
     Entity::registerEntity(SlapperHuman::class, true);
     Entity::registerEntity(SlapperVillager::class, true);
     Entity::registerEntity(SlapperZombie::class, true);
     Entity::registerEntity(SlapperSquid::class, true);
     Entity::registerEntity(SlapperCow::class, true);
     Entity::registerEntity(SlapperSpider::class, true);
     Entity::registerEntity(SlapperPig::class, true);
     Entity::registerEntity(SlapperMushroomCow::class, true);
     Entity::registerEntity(SlapperWolf::class, true);
     Entity::registerEntity(SlapperLavaSlime::class, true);
     Entity::registerEntity(SlapperSilverfish::class, true);
     Entity::registerEntity(SlapperSkeleton::class, true);
     Entity::registerEntity(SlapperSlime::class, true);
     Entity::registerEntity(SlapperChicken::class, true);
     Entity::registerEntity(SlapperEnderman::class, true);
     Entity::registerEntity(SlapperCaveSpider::class, true);
     Entity::registerEntity(SlapperBoat::class, true);
     Entity::registerEntity(SlapperMinecart::class, true);
     Entity::registerEntity(SlapperPrimedTNT::class, true);
     Entity::registerEntity(SlapperFallingSand::class, true);
     $this->getLogger()->debug("Entities have been registered!");
     $server->getPluginManager()->registerEvents($this, $this);
     $this->getLogger()->debug("Events have been registered!");
 }
Example #17
0
 private function registerEntities()
 {
     Entity::registerEntity(Arrow::class);
     Entity::registerEntity(DroppedItem::class);
     Entity::registerEntity(FallingSand::class);
     Entity::registerEntity(PrimedTNT::class);
     Entity::registerEntity(Snowball::class);
     Entity::registerEntity(Villager::class);
     Entity::registerEntity(Zombie::class);
     Entity::registerEntity(Squid::class);
     Entity::registerEntity(Chicken::class);
     Entity::registerEntity(Cow::class);
     Entity::registerEntity(Pig::class);
     Entity::registerEntity(Sheep::class);
     Entity::registerEntity(Wolf::class);
     Entity::registerEntity(Mooshroom::class);
     Entity::registerEntity(Creeper::class);
     Entity::registerEntity(Skeleton::class);
     Entity::registerEntity(Spider::class);
     Entity::registerEntity(PigZombie::class);
     Entity::registerEntity(Slime::class);
     Entity::registerEntity(Enderman::class);
     Entity::registerEntity(Silverfish::class);
     Entity::registerEntity(CaveSpider::class);
     Entity::registerEntity(Ghast::class);
     Entity::registerEntity(LavaSlime::class);
     Entity::registerEntity(Bat::class);
     Entity::registerEntity(Blaze::class);
     Entity::registerEntity(Ocelot::class);
     Entity::registerEntity(SnowGolem::class);
     Entity::registerEntity(IronGolem::class);
     Entity::registerEntity(Lightning::class);
     Entity::registerEntity(ExperienceOrb::class);
     Entity::registerEntity(ThrownExpBottle::class);
     Entity::registerEntity(Boat::class);
     Entity::registerEntity(Minecart::class);
     Entity::registerEntity(ThrownPotion::class);
     Entity::registerEntity(Painting::class);
     Entity::registerEntity(FishingHook::class);
     Entity::registerEntity(Egg::class);
     Entity::registerEntity(ZombieVillager::class);
     Entity::registerEntity(Human::class, true);
 }
Example #18
0
 public static function registerEntity($name)
 {
     $class = new \ReflectionClass($name);
     if (is_a($name, BaseEntity::class, true) and !$class->isAbstract()) {
         Entity::registerEntity($name, true);
         if ($name::NETWORK_ID !== -1) {
             self::$knownEntities[$name::NETWORK_ID] = $name;
         }
         self::$knownEntities[$class->getShortName()] = $name;
     }
 }
Example #19
0
 private function registerEntities()
 {
     Entity::registerEntity(Arrow::class);
     Entity::registerEntity(Bat::class);
     Entity::registerEntity(Blaze::class);
     Entity::registerEntity(Boat::class);
     Entity::registerEntity(CavernSpider::class);
     Entity::registerEntity(Chicken::class);
     Entity::registerEntity(Cow::class);
     Entity::registerEntity(Creeper::class);
     Entity::registerEntity(DroppedItem::class);
     Entity::registerEntity(Donkey::class);
     Entity::registerEntity(Egg::class);
     Entity::registerEntity(Enderman::class);
     Entity::registerEntity(ExperienceOrb::class);
     Entity::registerEntity(FallingSand::class);
     Entity::registerEntity(FishingHook::class);
     Entity::registerEntity(Ghast::class);
     Entity::registerEntity(Guardian::class);
     Entity::registerEntity(ElderGuardian::class);
     Entity::registerEntity(Horse::class);
     Entity::registerEntity(Husk::class);
     Entity::registerEntity(IronGolem::class);
     Entity::registerEntity(LargeFireball::class);
     Entity::registerEntity(LeashKnot::class);
     Entity::registerEntity(Lightning::class);
     Entity::registerEntity(MagmaCube::class);
     Entity::registerEntity(Minecart::class);
     Entity::registerEntity(MinecartChest::class);
     Entity::registerEntity(MinecartHopper::class);
     Entity::registerEntity(MinecartTNT::class);
     Entity::registerEntity(Mooshroom::class);
     Entity::registerEntity(Mule::class);
     Entity::registerEntity(Ozelot::class);
     Entity::registerEntity(Painting::class);
     Entity::registerEntity(Pig::class);
     Entity::registerEntity(PigZombie::class);
     Entity::registerEntity(PrimedTNT::class);
     Entity::registerEntity(Rabbit::class);
     Entity::registerEntity(Sheep::class);
     Entity::registerEntity(Silverfish::class);
     Entity::registerEntity(Skeleton::class);
     Entity::registerEntity(SkeletonHorse::class);
     Entity::registerEntity(Slime::class);
     Entity::registerEntity(SmallFireball::class);
     Entity::registerEntity(Snowball::class);
     Entity::registerEntity(SnowGolem::class);
     Entity::registerEntity(Spider::class);
     Entity::registerEntity(Squid::class);
     Entity::registerEntity(Stray::class);
     Entity::registerEntity(ThrownEnderPearl::class);
     Entity::registerEntity(ThrownExpBottle::class);
     Entity::registerEntity(ThrownPotion::class);
     Entity::registerEntity(TripoidCamera::class);
     Entity::registerEntity(Villager::class);
     Entity::registerEntity(Witch::class);
     Entity::registerEntity(Wither::class);
     Entity::registerEntity(WitherSkeleton::class);
     Entity::registerEntity(WitherSkull::class);
     Entity::registerEntity(Wolf::class);
     Entity::registerEntity(Zombie::class);
     Entity::registerEntity(ZombieHorse::class);
     Entity::registerEntity(ZombieVillager::class);
     Entity::registerEntity(Human::class, true);
 }
Example #20
0
 public function onEnable()
 {
     $this->supports_0_12 = substr($this->getServer()->getVersion(), 1, -8) === "0.11" ? false : true;
     $this->hitSessions = [];
     $this->idSessions = [];
     Entity::registerEntity(SlapperCreeper::class, true);
     Entity::registerEntity(SlapperBat::class, true);
     Entity::registerEntity(SlapperSheep::class, true);
     Entity::registerEntity(SlapperPigZombie::class, true);
     if ($this->supports_0_12) {
         Entity::registerEntity(SlapperGhast::class, true);
         Entity::registerEntity(SlapperBlaze::class, true);
         Entity::registerEntity(SlapperIronGolem::class, true);
         Entity::registerEntity(SlapperSnowman::class, true);
         Entity::registerEntity(SlapperOcelot::class, true);
         Entity::registerEntity(SlapperZombieVillager::class, true);
     } else {
         $this->getLogger()->info($this->prefix . "Old server; please update to use all the mobs!");
     }
     Entity::registerEntity(SlapperHuman::class, true);
     Entity::registerEntity(SlapperVillager::class, true);
     Entity::registerEntity(SlapperZombie::class, true);
     Entity::registerEntity(SlapperSquid::class, true);
     Entity::registerEntity(SlapperCow::class, true);
     Entity::registerEntity(SlapperSpider::class, true);
     Entity::registerEntity(SlapperPig::class, true);
     Entity::registerEntity(SlapperMushroomCow::class, true);
     Entity::registerEntity(SlapperWolf::class, true);
     Entity::registerEntity(SlapperLavaSlime::class, true);
     Entity::registerEntity(SlapperSilverfish::class, true);
     Entity::registerEntity(SlapperSkeleton::class, true);
     Entity::registerEntity(SlapperSlime::class, true);
     Entity::registerEntity(SlapperChicken::class, true);
     Entity::registerEntity(SlapperEnderman::class, true);
     Entity::registerEntity(SlapperCaveSpider::class, true);
     Entity::registerEntity(SlapperBoat::class, true);
     Entity::registerEntity(SlapperMinecart::class, true);
     Entity::registerEntity(SlapperPrimedTNT::class, true);
     Entity::registerEntity(SlapperFallingSand::class, true);
     $this->getLogger()->debug("Entities have been registered!");
     $this->getServer()->getPluginManager()->registerEvents($this, $this);
     $this->getLogger()->debug("Events have been registered!");
 }
Example #21
-1
 public function onEnable()
 {
     Item::$list[333] = BoatItem::class;
     Item::addCreativeItem(new Item(333));
     $this->getServer()->addRecipe((new BigShapelessRecipe(Item::get(333, 0, 1)))->addIngredient(Item::get(Item::WOODEN_PLANK, null, 5))->addIngredient(Item::get(Item::WOODEN_SHOVEL, null, 1)));
     Entity::registerEntity("\\amiexd\\entity\\Boat", true);
     $this->getServer()->getNetwork()->registerPacket(0xae, PlayerInputPacket::class);
     //$this->saveFiles();
     $this->reloadConfig();
     $this->dropitemworld = $this->getConfig()->get("dropitemworld");
     $this->saveDefaultConfig();
     $this->registerAll();
     $this->getServer()->getPluginManager()->registerEvents($this, $this);
     $this->EconomyS = $this->getServer()->getPluginManager()->getPlugin("EconomyAPI");
     $this->killrate = $this->getServer()->getPluginManager()->getPlugin("KillRate");
     $this->getServer()->getScheduler()->scheduleRepeatingTask(new CallbackTask(array($this, "gui1")), 10);
     $this->timer = 0;
 }