Search in sources :

Example 1 with ChemthrowerEffect_RandomTeleport

use of blusunrize.immersiveengineering.api.tool.ChemthrowerHandler.ChemthrowerEffect_RandomTeleport in project ImmersiveEngineering by BluSunrize.

the class ThermalFoundationHelper method init.

@Override
public void init() {
    ChemthrowerHandler.registerEffect("coal", new ChemthrowerEffect_Potion(null, 0, IEPotions.flammable, 100, 0));
    ChemthrowerHandler.registerFlammable("coal");
    ChemthrowerHandler.registerEffect("crude_oil", new ChemthrowerEffect_Potion(null, 0, new PotionEffect(IEPotions.flammable, 140, 0), new PotionEffect(MobEffects.BLINDNESS, 80, 1)));
    ChemthrowerHandler.registerFlammable("crude_oil");
    ChemthrowerHandler.registerEffect("refined_oil", new ChemthrowerEffect_Potion(null, 0, IEPotions.flammable, 100, 1));
    ChemthrowerHandler.registerFlammable("refined_oil");
    ChemthrowerHandler.registerEffect("resin", new ChemthrowerEffect_Potion(null, 0, IEPotions.sticky, 100, 1));
    ChemthrowerHandler.registerEffect("tree_oil", new ChemthrowerEffect_Potion(null, 0, IEPotions.flammable, 120, 0));
    ChemthrowerHandler.registerFlammable("tree_oil");
    ChemthrowerHandler.registerEffect("redstone", new ChemthrowerEffect_Potion(null, 0, IEPotions.conductive, 100, 1));
    ChemthrowerHandler.registerEffect("glowstone", new ChemthrowerEffect_Potion(null, 0, new PotionEffect(MobEffects.GLOWING, 120, 0), new PotionEffect(MobEffects.SPEED, 120, 0), new PotionEffect(MobEffects.JUMP_BOOST, 120, 0)));
    ChemthrowerHandler.registerEffect("ender", new ChemthrowerEffect_RandomTeleport(null, 0, 1));
    try {
        Class c_DamageHelper = Class.forName("cofh.lib.util.helpers.DamageHelper");
        DamageSource pyrotheum = (DamageSource) c_DamageHelper.getDeclaredField("pyrotheum").get(null);
        Field f_explodeCreepers = Class.forName("cofh.thermalfoundation.fluid.BlockFluidPyrotheum").getDeclaredField("effect");
        f_explodeCreepers.setAccessible(true);
        if ((boolean) f_explodeCreepers.get(null))
            ChemthrowerHandler.registerEffect("pyrotheum", new ChemthrowerEffect_Damage(pyrotheum, 3) {

                @Override
                public void applyToEntity(EntityLivingBase target, @Nullable EntityPlayer shooter, ItemStack thrower, Fluid fluid) {
                    super.applyToEntity(target, shooter, thrower, fluid);
                    if (target instanceof EntityCreeper) {
                        target.getEntityWorld().createExplosion(target, target.posX, target.posY, target.posZ, 6.0F, target.getEntityWorld().getGameRules().getBoolean("mobGriefing"));
                        target.setDead();
                    }
                }
            });
        else
            ChemthrowerHandler.registerEffect("pyrotheum", new ChemthrowerEffect_Damage(pyrotheum, 3));
        DamageSource cryotheum = (DamageSource) c_DamageHelper.getDeclaredField("cryotheum").get(null);
        ChemthrowerHandler.registerEffect("cryotheum", new ChemthrowerEffect_Potion(cryotheum, 2, MobEffects.SLOWNESS, 50, 3));
    } catch (Exception e) {
    }
    ChemthrowerHandler.registerEffect("aerotheum", new ChemthrowerEffect_Potion(null, 0, new PotionEffect(MobEffects.INVISIBILITY, 60, 0), new PotionEffect(MobEffects.WATER_BREATHING, 300, 0)));
    ChemthrowerHandler.registerEffect("petrotheum", new ChemthrowerEffect_Potion(null, 0, new PotionEffect(MobEffects.HASTE, 300, 2), new PotionEffect(MobEffects.NIGHT_VISION, 300, 0), new PotionEffect(MobEffects.RESISTANCE, 300, 1)) {

        @Override
        public void applyToBlock(World worldObj, RayTraceResult mop, @Nullable EntityPlayer shooter, ItemStack thrower, Fluid fluid) {
            IBlockState state = worldObj.getBlockState(mop.getBlockPos());
            if (state.getBlock() == Blocks.STONE || state.getBlock() == Blocks.COBBLESTONE || state.getBlock() == Blocks.STONEBRICK || state.getBlock() == Blocks.MOSSY_COBBLESTONE)
                worldObj.setBlockState(mop.getBlockPos(), Blocks.GRAVEL.getDefaultState());
        }
    });
    ChemthrowerHandler.registerEffect("mana", new ChemthrowerEffect_RandomTeleport(null, 0, .01f));
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) DamageSource(net.minecraft.util.DamageSource) ChemthrowerEffect_Damage(blusunrize.immersiveengineering.api.tool.ChemthrowerHandler.ChemthrowerEffect_Damage) PotionEffect(net.minecraft.potion.PotionEffect) Fluid(net.minecraftforge.fluids.Fluid) RayTraceResult(net.minecraft.util.math.RayTraceResult) World(net.minecraft.world.World) ChemthrowerEffect_Potion(blusunrize.immersiveengineering.api.tool.ChemthrowerHandler.ChemthrowerEffect_Potion) ChemthrowerEffect_RandomTeleport(blusunrize.immersiveengineering.api.tool.ChemthrowerHandler.ChemthrowerEffect_RandomTeleport) Field(java.lang.reflect.Field) EntityCreeper(net.minecraft.entity.monster.EntityCreeper) EntityLivingBase(net.minecraft.entity.EntityLivingBase) EntityPlayer(net.minecraft.entity.player.EntityPlayer) ItemStack(net.minecraft.item.ItemStack) Nullable(javax.annotation.Nullable)

Example 2 with ChemthrowerEffect_RandomTeleport

use of blusunrize.immersiveengineering.api.tool.ChemthrowerHandler.ChemthrowerEffect_RandomTeleport in project ImmersiveEngineering by BluSunrize.

the class FoundryHelper method init.

@Override
public void init() {
    ChemthrowerHandler.registerEffect("liquidenderpearl", new ChemthrowerEffect_RandomTeleport(null, 0, .25f));
    ChemthrowerHandler.registerEffect("liquidredstone", new ChemthrowerEffect_Potion(null, 0, IEPotions.conductive, 100, 1));
    ChemthrowerHandler.registerEffect("liquidglowstone", new ChemthrowerEffect_Potion(null, 0, new PotionEffect(MobEffects.GLOWING, 200, 0), new PotionEffect(MobEffects.SPEED, 200, 0), new PotionEffect(MobEffects.JUMP_BOOST, 200, 0)));
}
Also used : ChemthrowerEffect_RandomTeleport(blusunrize.immersiveengineering.api.tool.ChemthrowerHandler.ChemthrowerEffect_RandomTeleport) PotionEffect(net.minecraft.potion.PotionEffect) ChemthrowerEffect_Potion(blusunrize.immersiveengineering.api.tool.ChemthrowerHandler.ChemthrowerEffect_Potion)

Aggregations

ChemthrowerEffect_Potion (blusunrize.immersiveengineering.api.tool.ChemthrowerHandler.ChemthrowerEffect_Potion)2 ChemthrowerEffect_RandomTeleport (blusunrize.immersiveengineering.api.tool.ChemthrowerHandler.ChemthrowerEffect_RandomTeleport)2 PotionEffect (net.minecraft.potion.PotionEffect)2 ChemthrowerEffect_Damage (blusunrize.immersiveengineering.api.tool.ChemthrowerHandler.ChemthrowerEffect_Damage)1 Field (java.lang.reflect.Field)1 Nullable (javax.annotation.Nullable)1 IBlockState (net.minecraft.block.state.IBlockState)1 EntityLivingBase (net.minecraft.entity.EntityLivingBase)1 EntityCreeper (net.minecraft.entity.monster.EntityCreeper)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 ItemStack (net.minecraft.item.ItemStack)1 DamageSource (net.minecraft.util.DamageSource)1 RayTraceResult (net.minecraft.util.math.RayTraceResult)1 World (net.minecraft.world.World)1 Fluid (net.minecraftforge.fluids.Fluid)1