Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.svk.industrialGuns.entity;
- import com.svk.industrialGuns.client.particle.ColoredParticleCube;
- import com.svk.industrialGuns.client.particle.ColoredParticleCubeHeap;
- import com.svk.industrialGuns.client.particle.ColoredParticleTrail;
- 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 EntityMezonShell extends EntityBullet
- {
- public EntityMezonShell(World world, EntityLivingBase entity)
- {
- super(world, entity);
- super.render = true;
- }
- @Override
- public void onUpdate()
- {
- super.onUpdate();
- life++;
- if(life > 120)
- {
- this.setDead();
- }
- this.motionX = this.bylletMotionX * getVelocity();
- this.motionY = this.bylletMotionY * getVelocity();
- this.motionZ = this.bylletMotionZ * getVelocity();
- this.setPosition(this.posX, this.posY, this.posZ);
- if(this.worldObj.isRemote)
- {
- EntityMezonCollateral entity = new EntityMezonCollateral(this.worldObj, this.getThrower());
- entity.bylletMotionX = bylletMotionX;
- entity.bylletMotionY = bylletMotionY;
- entity.bylletMotionZ = bylletMotionZ;
- entity.setPosition(this.posX, this.posY, this.posZ);
- this.worldObj.spawnEntityInWorld(entity);
- }
- }
- protected float getVelocity()
- {
- return speed;
- }
- protected float getGravityVelocity()
- {
- return gravity;
- }
- @Override
- protected void onImpact(MovingObjectPosition mop)
- {
- if(mop.entityHit != null && !(mop.entityHit instanceof EntityMezonShell))
- {
- mop.entityHit.hurtResistantTime = 0;
- mop.entityHit.attackEntityFrom(DamageSource.cactus, damage);
- this.setDead();
- }
- if(!(mop.hitInfo instanceof Entity))
- {
- this.setDead();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment