HugeExplosionParticle.java
net.minecraft.client.particle.HugeExplosionParticle
信息
- 全限定名:net.minecraft.client.particle.HugeExplosionParticle
- 类型:public class
- 包:net.minecraft.client.particle
- 源码路径:src/main/java/net/minecraft/client/particle/HugeExplosionParticle.java
- 起始行号:L10
- 继承:SingleQuadParticle
- 职责:
TODO
字段/常量
sprites- 类型:
SpriteSet - 修饰符:
private final - 源码定位:
L11 - 说明:
TODO
- 类型:
内部类/嵌套类型
net.minecraft.client.particle.HugeExplosionParticle.Provider- 类型:
class - 修饰符:
public static - 源码定位:
L48 - 说明:
TODO
- 类型:
构造器
protected HugeExplosionParticle(ClientLevel level, double x, double y, double z, double size, SpriteSet sprites) @ L13
- 构造器名:HugeExplosionParticle
- 源码定位:L13
- 修饰符:protected
参数:
- level: ClientLevel
- x: double
- y: double
- z: double
- size: double
- sprites: SpriteSet
说明:
TODO
方法
下面的方法块按源码顺序生成。
public int getLightCoords(float a) @ L25
- 方法名:getLightCoords
- 源码定位:L25
- 返回类型:int
- 修饰符:public
参数:
- a: float
说明:
TODO
public void tick() @ L30
- 方法名:tick
- 源码定位:L30
- 返回类型:void
- 修饰符:public
参数:
- 无
说明:
TODO
public SingleQuadParticle.Layer getLayer() @ L42
- 方法名:getLayer
- 源码定位:L42
- 返回类型:SingleQuadParticle.Layer
- 修饰符:public
参数:
- 无
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class HugeExplosionParticle extends SingleQuadParticle {
private final SpriteSet sprites;
protected HugeExplosionParticle(ClientLevel level, double x, double y, double z, double size, SpriteSet sprites) {
super(level, x, y, z, 0.0, 0.0, 0.0, sprites.first());
this.lifetime = 6 + this.random.nextInt(4);
float col = this.random.nextFloat() * 0.6F + 0.4F;
this.rCol = col;
this.gCol = col;
this.bCol = col;
this.quadSize = 2.0F * (1.0F - (float)size * 0.5F);
this.sprites = sprites;
this.setSpriteFromAge(sprites);
}
@Override
public int getLightCoords(float a) {
return 15728880;
}
@Override
public void tick() {
this.xo = this.x;
this.yo = this.y;
this.zo = this.z;
if (this.age++ >= this.lifetime) {
this.remove();
} else {
this.setSpriteFromAge(this.sprites);
}
}
@Override
public SingleQuadParticle.Layer getLayer() {
return SingleQuadParticle.Layer.OPAQUE;
}
@OnlyIn(Dist.CLIENT)
public static class Provider implements ParticleProvider<SimpleParticleType> {
private final SpriteSet sprites;
public Provider(SpriteSet sprites) {
this.sprites = sprites;
}
public Particle createParticle(
SimpleParticleType options, ClientLevel level, double x, double y, double z, double xAux, double yAux, double zAux, RandomSource random
) {
return new HugeExplosionParticle(level, x, y, z, xAux, this.sprites);
}
}
}引用的其他类
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
继承/返回值
- 引用位置:
-
- 引用位置:
参数/字段
- 引用位置: