Guest User

Untitled

a guest
Oct 6th, 2014
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. package mymod.entity.EntityRifleBolt;
  2.  
  3. import net.minecraft.entity.EntityLivingBase;
  4. import net.minecraft.entity.monster.EntityBlaze;
  5. import net.minecraft.entity.projectile.EntityThrowable;
  6. import net.minecraft.util.DamageSource;
  7. import net.minecraft.util.MovingObjectPosition;
  8. import net.minecraft.world.World;
  9.  
  10. public class EntityRifleBolt extends EntityThrowable
  11. {
  12. private static final String __OBFID = "CL_00001722";
  13.  
  14. public EntityRifleBolt(World p_i1773_1_)
  15. {
  16. super(p_i1773_1_);
  17. }
  18.  
  19. public EntityRifleBolt(World p_i1774_1_, EntityLivingBase p_i1774_2_)
  20. {
  21. super(p_i1774_1_, p_i1774_2_);
  22. }
  23.  
  24. public EntityRifleBolt(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
  25. {
  26. super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
  27. }
  28.  
  29. /**
  30. * Called when this EntityThrowable hits a block or entity.
  31. */
  32. protected void onImpact(MovingObjectPosition p_70184_1_)
  33. {
  34. if (p_70184_1_.entityHit != null)
  35. {
  36. byte b0 = 5;
  37.  
  38. if (p_70184_1_.entityHit instanceof EntityBlaze)
  39. {
  40. b0 = 5;
  41. }
  42.  
  43. p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)b0);
  44. }
  45.  
  46. for (int i = 0; i < 8; ++i)
  47. {
  48. this.worldObj.spawnParticle("crit", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
  49. }
  50.  
  51. if (!this.worldObj.isRemote)
  52. {
  53. this.setDead();
  54. }
  55.  
  56. this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)1.0F, true);
  57. this.setDead();
  58. }
  59. protected float getGravityVelocity()
  60. {
  61. return 0.0F;
  62. }
  63. {
  64. }
  65. {
  66. }
  67.  
  68. }
Advertisement
Add Comment
Please, Sign In to add comment