Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Copyright (C) 2016 Andrew Morin
- //Licensed under GNU GPL v3; see license.txt for complete license terms + conditions etc.
- package theishiopian.dungeonmagic.entity.spells;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.init.Blocks;
- import net.minecraft.init.SoundEvents;
- import net.minecraft.util.DamageSource;
- import net.minecraft.util.EnumParticleTypes;
- import net.minecraft.util.SoundCategory;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.RayTraceResult;
- import net.minecraft.util.math.RayTraceResult.Type;
- import net.minecraft.world.World;
- import theishiopian.dungeonmagic.entity.EntitySpell;
- public class EntityFirebolt extends EntitySpell
- {
- public EntityFirebolt(World world)
- {
- super(world);
- }
- public EntityFirebolt(World world, EntityLivingBase entity)
- {
- super(world, entity);
- caster = entity;
- System.out.println("FIREBOLT!");
- }
- public EntityFirebolt(World world, double x, double y, double z)
- {
- super(world, x, y, z);
- }
- @Override
- protected void onImpact(RayTraceResult result)
- {
- if(result.typeOfHit == Type.BLOCK)
- {
- setDead();
- }
- else if(result.entityHit != null)
- {
- if(result.entityHit != caster)
- {
- result.entityHit.attackEntityFrom(DamageSource.inFire, 5);
- setDead();
- }
- }
- }
- @Override
- public void onUpdate()
- {
- super.onUpdate();
- flame();
- }
- void flame()
- {
- this.worldObj.spawnParticle(EnumParticleTypes.FLAME, true, this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ, new int[0]);
- this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, true, this.posX, this.posY, this.posZ, 0, 0, 0, new int[0]);
- System.out.println("firespam");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement