FlameParticle.java

net.minecraft.client.particle.FlameParticle

信息

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

    TODO

字段/常量

内部类/嵌套类型

  • net.minecraft.client.particle.FlameParticle.Provider

    • 类型: class
    • 修饰符: public static
    • 源码定位: L40
    • 说明:

      TODO

  • net.minecraft.client.particle.FlameParticle.SmallFlameProvider

    • 类型: class
    • 修饰符: public static
    • 源码定位: L55
    • 说明:

      TODO

构造器

private FlameParticle(ClientLevel level, double x, double y, double z, double xd, double yd, double zd, TextureAtlasSprite sprite) @ L13

  • 构造器名:FlameParticle
  • 源码定位:L13
  • 修饰符:private

参数:

  • level: ClientLevel
  • x: double
  • y: double
  • z: double
  • xd: double
  • yd: double
  • zd: double
  • sprite: TextureAtlasSprite

说明:

TODO

方法

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

public SingleQuadParticle.Layer getLayer() @ L17

  • 方法名:getLayer
  • 源码定位:L17
  • 返回类型:SingleQuadParticle.Layer
  • 修饰符:public

参数:

说明:

TODO

public void move(double xa, double ya, double za) @ L22

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

参数:

  • xa: double
  • ya: double
  • za: double

说明:

TODO

public float getQuadSize(float a) @ L28

  • 方法名:getQuadSize
  • 源码定位:L28
  • 返回类型:float
  • 修饰符:public

参数:

  • a: float

说明:

TODO

public int getLightCoords(float a) @ L34

  • 方法名:getLightCoords
  • 源码定位:L34
  • 返回类型:int
  • 修饰符:public

参数:

  • a: float

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class FlameParticle extends RisingParticle {
    private FlameParticle(ClientLevel level, double x, double y, double z, double xd, double yd, double zd, TextureAtlasSprite sprite) {
        super(level, x, y, z, xd, yd, zd, sprite);
    }
 
    @Override
    public SingleQuadParticle.Layer getLayer() {
        return SingleQuadParticle.Layer.OPAQUE;
    }
 
    @Override
    public void move(double xa, double ya, double za) {
        this.setBoundingBox(this.getBoundingBox().move(xa, ya, za));
        this.setLocationFromBoundingbox();
    }
 
    @Override
    public float getQuadSize(float a) {
        float s = (this.age + a) / this.lifetime;
        return this.quadSize * (1.0F - s * s * 0.5F);
    }
 
    @Override
    public int getLightCoords(float a) {
        return LightCoordsUtil.addSmoothBlockEmission(super.getLightCoords(a), (this.age + a) / this.lifetime);
    }
 
    @OnlyIn(Dist.CLIENT)
    public static class Provider implements ParticleProvider<SimpleParticleType> {
        private final SpriteSet sprite;
 
        public Provider(SpriteSet sprite) {
            this.sprite = sprite;
        }
 
        public Particle createParticle(
            SimpleParticleType options, ClientLevel level, double x, double y, double z, double xAux, double yAux, double zAux, RandomSource random
        ) {
            return new FlameParticle(level, x, y, z, xAux, yAux, zAux, this.sprite.get(random));
        }
    }
 
    @OnlyIn(Dist.CLIENT)
    public static class SmallFlameProvider implements ParticleProvider<SimpleParticleType> {
        private final SpriteSet sprite;
 
        public SmallFlameProvider(SpriteSet sprite) {
            this.sprite = sprite;
        }
 
        public Particle createParticle(
            SimpleParticleType options, ClientLevel level, double x, double y, double z, double xAux, double yAux, double zAux, RandomSource random
        ) {
            FlameParticle particle = new FlameParticle(level, x, y, z, xAux, yAux, zAux, this.sprite.get(random));
            particle.scale(0.5F);
            return particle;
        }
    }
}

引用的其他类