mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-12-19 14:57:35 +01:00
e87f5f4f11
- Deleted a few outdated plugins from built-in Register - System.out -> System.err for errors - Blocked buying if you're holding a sign in your hand (allows, for example, for sign editors to work) - Updated Heroes package - Fixed WG integration (no longer throws errors, but uses ugly workaround) - Fixed a small bug in Register plugin loading message - Removed version checking for OddItem, WorldGuard and LWC
27 lines
863 B
Java
27 lines
863 B
Java
package com.Acrobot.ChestShop.Utils;
|
|
|
|
import com.Acrobot.ChestShop.Config.Config;
|
|
import com.Acrobot.ChestShop.Config.Property;
|
|
import com.herocraftonline.heroes.Heroes;
|
|
import com.herocraftonline.heroes.characters.Hero;
|
|
import com.herocraftonline.heroes.characters.classes.HeroClass;
|
|
import org.bukkit.entity.Player;
|
|
|
|
/**
|
|
* @author Acrobot
|
|
*/
|
|
public class uHeroes {
|
|
public static Heroes heroes;
|
|
|
|
public static void addHeroExp(Player p) {
|
|
if (heroes != null) {
|
|
Hero hero = heroes.getHeroManager().getHero(p);
|
|
if (hero.hasParty()) {
|
|
hero.getParty().gainExp(Config.getDouble(Property.HEROES_EXP), HeroClass.ExperienceType.EXTERNAL, p.getLocation());
|
|
} else {
|
|
hero.gainExp(Config.getDouble(Property.HEROES_EXP), HeroClass.ExperienceType.EXTERNAL);
|
|
}
|
|
}
|
|
}
|
|
}
|