OSDN Git Service

・ItemGrenadeクラスをItemAtomGrenadeクラスに変更
[chemicraft/chemicraft.git] / common / chemicraft / EntityAtomGrenade.java
1 package chemicraft;
2
3 import net.minecraft.src.DamageSource;
4 import net.minecraft.src.Entity;
5 import net.minecraft.src.EntityChicken;
6 import net.minecraft.src.EntityLiving;
7 import net.minecraft.src.EntityThrowable;
8 import net.minecraft.src.MovingObjectPosition;
9 import net.minecraft.src.World;
10
11 public class EntityAtomGrenade extends EntityThrowable
12 {
13
14         private int expSize;
15         private boolean expFire;
16
17         public EntityAtomGrenade(World par1World) {
18                 super(par1World);
19         }
20
21         public EntityAtomGrenade(World par1World, EntityLiving par2EntityLiving) {
22                 super(par1World, par2EntityLiving);
23         }
24
25         public EntityAtomGrenade(World par1World, double par2, double par4, double par6) {
26                 super(par1World, par2, par4, par6);
27         }
28
29         @Override
30         protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
31         {
32                 if (par1MovingObjectPosition.entityHit != null) {
33                         par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.thrower), 0);
34                         
35                 }
36
37                 if (!this.worldObj.isRemote) {
38                         this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, expSize, expFire);
39                 }
40
41         }
42
43 }