content: package net.minecraft.entity.item;
  
  import net.minecraft.entity.Entity;
  import net.minecraft.init.Blocks;
  import net.minecraft.nbt.NBTTagCompound;
  import net.minecraft.util.BlockPos;
  import net.minecraft.util.DamageSource;
  import net.minecraft.util.MathHelper;
  import net.minecraft.world.World;
  import net.minecraft.world.WorldProviderEnd;
  
  public class EntityEnderCrystal extends Entity {
      public int innerRotation;
      public int health;
  
      public EntityEnderCrystal(World worldIn) {
          super(worldIn);
          this.preventEntitySpawning = true;
          this.setSize(2.0F, 2.0F);
          this.health = 5;
          this.innerRotation = this.rand.nextInt(100000);
      }
  
      public EntityEnderCrystal(World worldIn, double x, double y, double z) {
          this(worldIn);
          this.setPosition(x, y, z);
      }
  
      protected boolean canTriggerWalking() {
          return false;
      }
  
      protected void entityInit() {
          this.dataWatcher.addObject(8, Integer.valueOf(this.health));
      }
  
      public void onUpdate() {
          this.prevPosX = this.posX;
          this.prevPosY = this.posY;
          this.prevPosZ = this.posZ;
          ++this.innerRotation;
          this.dataWatcher.updateObject(8, Integer.valueOf(this.health));
          int i = MathHelper.floor_double(this.posX);
          int j = MathHelper.floor_double(this.posY);
          int k = MathHelper.floor_double(this.posZ);
  
          if (this.worldObj.provider instanceof WorldProviderEnd && this.worldObj.getBlockState(new BlockPos(i, j, k)).getBlock() != Blocks.fire) {
              this.worldObj.setBlockState(new BlockPos(i, j, k), Blocks.fire.getDefaultState());
          }
      }
  
      protected void writeEntityToNBT(NBTTagCompound tagCompound) {
      }
  
      protected void readEntityFromNBT(NBTTagCompound tagCompund) {
      }
  
      public boolean canBeCollidedWith() {
          return true;
      }
  
      public boolean attackEntityFrom(DamageSource source, float amount) {
          if (this.isEntityInvulnerable(source)) {
              return false;
          } else {
              if (!this.isDead && !this.worldObj.isRemote) {
                  this.health = 0;
  
                  if (this.health <= 0) {
                      this.setDead();
  
                      if (!this.worldObj.isRemote) {
                          this.worldObj.createExplosion(null, this.posX, this.posY, this.posZ, 6.0F, true);
                      }
                  }
              }
  
              return true;
          }
      }
  }
  