use of hellfirepvp.astralsorcery.common.data.research.PlayerProgress in project RandomTweaker by Project-RT.
the class IPlayerExpansionAS method modifyPerkExp.
@ZenMethod
public static boolean modifyPerkExp(IPlayer player, double exp) {
EntityPlayer mcPlayer = CraftTweakerMC.getPlayer(player);
PlayerProgress prog = ResearchManager.getProgress(mcPlayer);
if (IPlayerExpansionAS.getAttunedConstellation(player) == null) {
CraftTweakerAPI.logInfo("This Player is not constellations");
return false;
}
try {
Class<? extends PlayerProgress> progClass = prog.getClass();
Method setExp = progClass.getMethod("modifyExp", double.class, EntityPlayer.class);
setExp.setAccessible(true);
setExp.invoke(prog, exp, mcPlayer);
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
CraftTweakerAPI.logError("Maybe you need to report this error", e);
}
return true;
}
use of hellfirepvp.astralsorcery.common.data.research.PlayerProgress in project RandomTweaker by Project-RT.
the class IPlayerExpansionAS method setPerkExp.
@ZenMethod
public static boolean setPerkExp(IPlayer player, double exp) {
PlayerProgress prog = ResearchManager.getProgress(CraftTweakerMC.getPlayer(player));
if (IPlayerExpansionAS.getAttunedConstellation(player) == null) {
CraftTweakerAPI.logInfo("This Player is not constellations");
return false;
}
try {
Class<? extends PlayerProgress> progClass = prog.getClass();
Method setExp = progClass.getDeclaredMethod("setExp", double.class);
setExp.setAccessible(true);
setExp.invoke(prog, exp);
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
CraftTweakerAPI.logError("Maybe you need to report this error", e);
}
return true;
}
Aggregations