All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.minecraft.server.EntitySnowball Maven / Gradle / Ivy

There is a newer version: 2.4.0
Show newest version
package net.minecraft.server;

import org.bukkit.entity.Snowball;
import org.jetbrains.annotations.NotNull;

public class EntitySnowball extends EntityProjectile {

  public EntitySnowball(World world) {
    super(world);
  }

  public EntitySnowball(World world, EntityLiving entityliving) {
    super(world, entityliving);
  }

  public EntitySnowball(World world, double d0, double d1, double d2) {
    super(world, d0, d1, d2);
  }

  @NotNull
  @Override
  public Snowball getEntity() {
    return (Snowball) super.getEntity();
  }

  protected void a(MovingObjectPosition movingobjectposition) {
    if (movingobjectposition.entity != null) {
      byte b0 = 0;

      if (movingobjectposition.entity instanceof EntityBlaze) {
        b0 = 3;
      }

      movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.getShooter()), b0);
    }

    for (int i = 0; i < 8; ++i) {
      this.world.addParticle(EnumParticle.SNOWBALL, this.locX, this.locY, this.locZ, 0.0D, 0.0D, 0.0D);
    }

    if (!this.world.isClientSide) {
      this.die();
    }

  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy