HugeExplosionSeedParticle.java

net.minecraft.client.particle.HugeExplosionSeedParticle

信息

  • 全限定名:net.minecraft.client.particle.HugeExplosionSeedParticle
  • 类型:public class
  • 包:net.minecraft.client.particle
  • 源码路径:src/main/java/net/minecraft/client/particle/HugeExplosionSeedParticle.java
  • 起始行号:L11
  • 继承:NoRenderParticle
  • 职责:

    TODO

字段/常量

内部类/嵌套类型

  • net.minecraft.client.particle.HugeExplosionSeedParticle.Provider
    • 类型: class
    • 修饰符: public static
    • 源码定位: L33
    • 说明:

      TODO

构造器

private HugeExplosionSeedParticle(ClientLevel level, double x, double y, double z) @ L12

  • 构造器名:HugeExplosionSeedParticle
  • 源码定位:L12
  • 修饰符:private

参数:

  • level: ClientLevel
  • x: double
  • y: double
  • z: double

说明:

TODO

方法

下面的方法块按源码顺序生成。

public void tick() @ L17

  • 方法名:tick
  • 源码定位:L17
  • 返回类型:void
  • 修饰符:public

参数:

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class HugeExplosionSeedParticle extends NoRenderParticle {
    private HugeExplosionSeedParticle(ClientLevel level, double x, double y, double z) {
        super(level, x, y, z, 0.0, 0.0, 0.0);
        this.lifetime = 8;
    }
 
    @Override
    public void tick() {
        for (int i = 0; i < 6; i++) {
            double xx = this.x + (this.random.nextDouble() - this.random.nextDouble()) * 4.0;
            double yy = this.y + (this.random.nextDouble() - this.random.nextDouble()) * 4.0;
            double zz = this.z + (this.random.nextDouble() - this.random.nextDouble()) * 4.0;
            this.level.addParticle(ParticleTypes.EXPLOSION, xx, yy, zz, (float)this.age / this.lifetime, 0.0, 0.0);
        }
 
        this.age++;
        if (this.age == this.lifetime) {
            this.remove();
        }
    }
 
    @OnlyIn(Dist.CLIENT)
    public static class Provider implements ParticleProvider<SimpleParticleType> {
        public Particle createParticle(
            SimpleParticleType options, ClientLevel level, double x, double y, double z, double xAux, double yAux, double zAux, RandomSource random
        ) {
            return new HugeExplosionSeedParticle(level, x, y, z);
        }
    }
}

引用的其他类