Advertisement
Guest User

Untitled

a guest
Feb 18th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 KB | None | 0 0
  1. public class EntityTesterBolt extends EntityThrowable {
  2.  
  3.     EntityLivingBase thrower;
  4.     public EntityTesterBolt(World p_i1777_1_, EntityLivingBase p_i1777_2_) {
  5.         super(p_i1777_1_, p_i1777_2_);
  6.         this.setSize(3, 3);
  7.         thrower = p_i1777_2_;
  8.         // TODO Auto-generated constructor stub
  9.     }
  10.  
  11.     @Override
  12.     protected void onImpact(MovingObjectPosition mop) {
  13.         // TODO Auto-generated method stub
  14.         if (mop.entityHit != null && mop.entityHit != thrower) {
  15.             mop.entityHit.attackEntityFrom(ModDamageSource.causeEnergyDamage(this, thrower), 4F);
  16.             this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2, false);
  17.             this.setDead();
  18.             return;
  19.         }
  20.         this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2, false);
  21.         this.setDead();
  22.         return;
  23.     }
  24.    
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement