Search in sources :

Example 71 with ZenMethod

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);
}
Also used : IThirst(toughasnails.api.stat.capability.IThirst) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 72 with ZenMethod

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);
}
Also used : EntityPlayer(net.minecraft.entity.player.EntityPlayer) IDecayCapability(thebetweenlands.api.capability.IDecayCapability) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 73 with ZenMethod

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));
    }
}
Also used : EntityPlayer(net.minecraft.entity.player.EntityPlayer) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 74 with ZenMethod

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");
    }
}
Also used : CombatType(thebetweenlands.common.capability.circlegem.CircleGem.CombatType) CircleGemType(thebetweenlands.common.capability.circlegem.CircleGemType) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 75 with ZenMethod

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;
}
Also used : EntityPlayer(net.minecraft.entity.player.EntityPlayer) ZenMethod(stanhebben.zenscript.annotations.ZenMethod) Method(java.lang.reflect.Method) PlayerProgress(hellfirepvp.astralsorcery.common.data.research.PlayerProgress) InvocationTargetException(java.lang.reflect.InvocationTargetException) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Aggregations

ZenMethod (stanhebben.zenscript.annotations.ZenMethod)147 ItemStack (net.minecraft.item.ItemStack)52 IItemStack (minetweaker.api.item.IItemStack)28 IItemStack (crafttweaker.api.item.IItemStack)23 EntityPlayer (net.minecraft.entity.player.EntityPlayer)16 FluidStack (net.minecraftforge.fluids.FluidStack)10 IDecayCapability (thebetweenlands.api.capability.IDecayCapability)8 PharmacologyEffect (minechem.potion.PharmacologyEffect)6 IIngredient (crafttweaker.api.item.IIngredient)5 RecipeData (com.mrcrayfish.furniture.api.RecipeData)4 IThirst (toughasnails.api.stat.capability.IThirst)4 NetRecipe (betterwithaddons.crafting.recipes.NetRecipe)3 TableRecipeShaped (com.blakebr0.extendedcrafting.crafting.table.TableRecipeShaped)3 ZenDoc (crafttweaker.annotations.ZenDoc)3 HashMap (java.util.HashMap)3 Function (java.util.function.Function)3 PotionChemical (minechem.potion.PotionChemical)3 MineTweakerMC.getItemStack (minetweaker.api.minecraft.MineTweakerMC.getItemStack)3 Ingredient (net.minecraft.item.crafting.Ingredient)3 CherryBoxRecipe (betterwithaddons.crafting.recipes.CherryBoxRecipe)2