EntityNobody.java 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. package me.km.entities;
  2. import net.minecraft.block.material.Material;
  3. import net.minecraft.block.state.IBlockState;
  4. import net.minecraft.entity.Entity;
  5. import net.minecraft.entity.MoverType;
  6. import net.minecraft.entity.effect.EntityLightningBolt;
  7. import net.minecraft.nbt.NBTTagCompound;
  8. import net.minecraft.util.SoundEvent;
  9. import net.minecraft.util.math.BlockPos;
  10. import net.minecraft.world.World;
  11. import net.minecraftforge.fml.relauncher.Side;
  12. import net.minecraftforge.fml.relauncher.SideOnly;
  13. public class EntityNobody extends Entity
  14. {
  15. public EntityNobody(World w)
  16. {
  17. super(w);
  18. }
  19. @Override
  20. public void onUpdate()
  21. {
  22. this.onEntityUpdate();
  23. }
  24. @Override
  25. public void onEntityUpdate()
  26. {
  27. this.world.profiler.startSection("entityBaseTick");
  28. if(this.isRiding() && this.getRidingEntity().isDead)
  29. {
  30. this.dismountRidingEntity();
  31. }
  32. if(this.rideCooldown > 0)
  33. {
  34. --this.rideCooldown;
  35. }
  36. if(this.posY < -64.0D)
  37. {
  38. this.outOfWorld();
  39. }
  40. this.firstUpdate = false;
  41. this.world.profiler.endSection();
  42. }
  43. @Override
  44. public void move(MoverType type, double x, double y, double z)
  45. {
  46. }
  47. @Override
  48. protected void doBlockCollisions()
  49. {
  50. }
  51. @Override
  52. public void playSound(SoundEvent soundIn, float volume, float pitch)
  53. {
  54. }
  55. @Override
  56. public boolean isSilent()
  57. {
  58. return true;
  59. }
  60. @Override
  61. public void setSilent(boolean isSilent)
  62. {
  63. }
  64. @Override
  65. public boolean hasNoGravity()
  66. {
  67. return true;
  68. }
  69. @Override
  70. public void setNoGravity(boolean noGravity)
  71. {
  72. }
  73. @Override
  74. protected boolean canTriggerWalking()
  75. {
  76. return false;
  77. }
  78. @Override
  79. protected void updateFallState(double y, boolean onGroundIn, IBlockState state, BlockPos pos)
  80. {
  81. }
  82. @Override
  83. protected void dealFireDamage(int amount)
  84. {
  85. }
  86. @Override
  87. public boolean isWet()
  88. {
  89. return false;
  90. }
  91. @Override
  92. public boolean isInWater()
  93. {
  94. return false;
  95. }
  96. @Override
  97. public boolean isOverWater()
  98. {
  99. return false;
  100. }
  101. @Override
  102. public boolean handleWaterMovement()
  103. {
  104. return false;
  105. }
  106. @Override
  107. protected void doWaterSplashEffect()
  108. {
  109. }
  110. @Override
  111. public void spawnRunningParticles()
  112. {
  113. }
  114. @Override
  115. protected void createRunningParticles()
  116. {
  117. }
  118. @Override
  119. public boolean isInsideOfMaterial(Material materialIn)
  120. {
  121. return false;
  122. }
  123. @Override
  124. public boolean isInLava()
  125. {
  126. return false;
  127. }
  128. @Override
  129. public void moveRelative(float strafe, float up, float forward, float friction)
  130. {
  131. }
  132. @SideOnly(Side.CLIENT)
  133. @Override
  134. public int getBrightnessForRender()
  135. {
  136. return 0;
  137. }
  138. @Override
  139. public float getBrightness()
  140. {
  141. return 0;
  142. }
  143. @Override
  144. public void applyEntityCollision(Entity entityIn)
  145. {
  146. }
  147. @Override
  148. public void addVelocity(double x, double y, double z)
  149. {
  150. }
  151. @Override
  152. public void setPortal(BlockPos pos)
  153. {
  154. }
  155. @Override
  156. public void onStruckByLightning(EntityLightningBolt lightningBolt)
  157. {
  158. }
  159. @Override
  160. protected boolean pushOutOfBlocks(double x, double y, double z)
  161. {
  162. return false;
  163. }
  164. @Override
  165. public String getName()
  166. {
  167. if(this.hasCustomName())
  168. {
  169. return this.getCustomNameTag();
  170. }
  171. return "Nobody";
  172. }
  173. @Override
  174. public boolean isPushedByWater()
  175. {
  176. return true;
  177. }
  178. @Override
  179. protected void entityInit() {
  180. }
  181. @Override
  182. protected void readEntityFromNBT(NBTTagCompound compound)
  183. {
  184. }
  185. @Override
  186. protected void writeEntityToNBT(NBTTagCompound compound)
  187. {
  188. }
  189. }