Пример #1
0
 @Override
 public void tick(Hero hero) {
   super.tick(hero);
   Player player = hero.getPlayer();
   double healAmount = hero.getMaxHealth() * tickHealPercent;
   hero.setHealth(hero.getHealth() + healAmount);
   hero.syncHealth();
   if (hero.isVerbose()) {
     player.sendMessage(Messaging.createFullHealthBar(hero.getHealth(), hero.getMaxHealth()));
   }
 }
Пример #2
0
 @Override
 public void onPlayerJoin(PlayerJoinEvent event) {
   Player player = event.getPlayer();
   Hero hero = plugin.getHeroManager().getHero(player);
   hero.syncExperience();
   hero.syncHealth();
   hero.checkInventory();
   if (plugin.getConfigManager().getProperties().prefixClassName) {
     player.setDisplayName("[" + hero.getHeroClass().getName() + "]" + player.getName());
   }
 }