use of stanhebben.zenscript.annotations.ZenMethod in project RandomTweaker by Project-RT.
the class IPlayerExpansionTAN method setExhaustion.
@ZenMethod
public static void setExhaustion(IPlayer player, float exhaustion) {
IThirst cap = ThirstHelper.getThirstData(CraftTweakerMC.getPlayer(player));
cap.setExhaustion(exhaustion);
}
use of stanhebben.zenscript.annotations.ZenMethod in project RandomTweaker by Project-RT.
the class IPlayerExpansionTBL method setDecaySaturationLevel.
@ZenMethod
public static void setDecaySaturationLevel(IPlayer player, float saturation) {
EntityPlayer mcPlayer = CraftTweakerMC.getPlayer(player);
IDecayCapability cap = mcPlayer.getCapability(CapabilityRegistry.CAPABILITY_DECAY, null);
assert cap != null;
cap.getDecayStats().setDecaySaturationLevel(saturation);
}
use of stanhebben.zenscript.annotations.ZenMethod in project RandomTweaker by Project-RT.
the class IPlayerExpansionTF method teleportTwilight.
@ZenMethod
public static void teleportTwilight(IPlayer playerIn) {
int destination = TFConfig.dimension.dimensionID;
EntityPlayer player = CraftTweakerMC.getPlayer(playerIn);
if (player.isDead || player.world.isRemote)
return;
if (player instanceof EntityPlayerMP) {
player.changeDimension(destination, RTTeleporter.getTeleporterForDim(((EntityPlayerMP) player).server, destination));
}
}
use of stanhebben.zenscript.annotations.ZenMethod in project RandomTweaker by Project-RT.
the class BLCircleGem method addGem.
@ZenMethod
public static void addGem(IEntity entity, String gemType, String combatType) {
CircleGemType circleGemType = getCircleGemType(gemType);
CombatType combatType1 = getCombatType(combatType);
if (circleGemType != null) {
if (combatType1 != null) {
CircleGemHelper.addGem(CraftTweakerMC.getEntity(entity), circleGemType, combatType1);
} else {
CraftTweakerAPI.logError("combatType was non-existent");
}
} else {
CraftTweakerAPI.logError("gemType was non-existent");
}
}
use of stanhebben.zenscript.annotations.ZenMethod 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;
}
Aggregations