Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.svk.industrialGuns.entity;
- import com.svk.industrialGuns.client.particle.ColoredParticleCubeHeap;
- import com.svk.industrialGuns.client.particle.ColoredParticleSpell;
- import com.svk.industrialGuns.client.particle.ColoredParticleTrail;
- import com.svk.industrialGuns.client.particle.ParticleLava;
- import cpw.mods.fml.relauncher.Side;
- import cpw.mods.fml.relauncher.SideOnly;
- import net.minecraft.client.Minecraft;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.projectile.EntityThrowable;
- import net.minecraft.util.DamageSource;
- import net.minecraft.util.MathHelper;
- import net.minecraft.util.MovingObjectPosition;
- import net.minecraft.world.World;
- public class EntityIncineratorShell extends EntityBullet
- {
- public EntityIncineratorShell(World world, EntityLivingBase entity)
- {
- super(world, entity);
- }
- @Override
- public void onUpdate()
- {
- super.onUpdate();
- life++;
- if(life > 50)
- {
- this.setDead();
- }
- this.motionX = this.bylletMotionX * getVelocity();
- this.motionY = this.bylletMotionY * getVelocity();
- this.motionZ = this.bylletMotionZ * getVelocity();
- this.bylletMotionY -= 0.1F;
- this.setPosition(this.posX, this.posY, this.posZ);
- if(!this.worldObj.isRemote)
- {
- this.spawnParticle();
- }
- }
- protected float getVelocity()
- {
- return speed;
- }
- protected float getGravityVelocity()
- {
- return gravity;
- }
- @Override
- protected void onImpact(MovingObjectPosition mop)
- {
- if(mop.entityHit != null && !(mop.entityHit instanceof EntityIncineratorShell))
- {
- mop.entityHit.hurtResistantTime = 0;
- mop.entityHit.attackEntityFrom(DamageSource.cactus, damage);
- this.setDead();
- }
- if(!(mop.hitInfo instanceof Entity))
- {
- this.setDead();
- }
- }
- @SideOnly(Side.CLIENT)
- private void spawnParticle()
- {
- for(int i = 0; i < 5; i++)
- {
- Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleLava(this.worldObj, this.posX, this.posY, this.posZ));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment