BubblePopParticle.java
net.minecraft.client.particle.BubblePopParticle
信息
- 全限定名:net.minecraft.client.particle.BubblePopParticle
- 类型:public class
- 包:net.minecraft.client.particle
- 源码路径:src/main/java/net/minecraft/client/particle/BubblePopParticle.java
- 起始行号:L10
- 继承:SingleQuadParticle
- 职责:
TODO
字段/常量
sprites- 类型:
SpriteSet - 修饰符:
private final - 源码定位:
L11 - 说明:
TODO
- 类型:
内部类/嵌套类型
net.minecraft.client.particle.BubblePopParticle.Provider- 类型:
class - 修饰符:
public static - 源码定位:
L44 - 说明:
TODO
- 类型:
构造器
private BubblePopParticle(ClientLevel level, double x, double y, double z, double xa, double ya, double za, SpriteSet sprites) @ L13
- 构造器名:BubblePopParticle
- 源码定位:L13
- 修饰符:private
参数:
- level: ClientLevel
- x: double
- y: double
- z: double
- xa: double
- ya: double
- za: double
- sprites: SpriteSet
说明:
TODO
方法
下面的方法块按源码顺序生成。
public void tick() @ L24
- 方法名:tick
- 源码定位:L24
- 返回类型:void
- 修饰符:public
参数:
- 无
说明:
TODO
public SingleQuadParticle.Layer getLayer() @ L38
- 方法名:getLayer
- 源码定位:L38
- 返回类型:SingleQuadParticle.Layer
- 修饰符:public
参数:
- 无
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class BubblePopParticle extends SingleQuadParticle {
private final SpriteSet sprites;
private BubblePopParticle(ClientLevel level, double x, double y, double z, double xa, double ya, double za, SpriteSet sprites) {
super(level, x, y, z, sprites.first());
this.sprites = sprites;
this.lifetime = 4;
this.gravity = 0.008F;
this.xd = xa;
this.yd = ya;
this.zd = za;
this.setSpriteFromAge(sprites);
}
@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.yd = this.yd - this.gravity;
this.move(this.xd, this.yd, this.zd);
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 BubblePopParticle(level, x, y, z, xAux, yAux, zAux, this.sprites);
}
}
}引用的其他类
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
继承/返回值
- 引用位置:
-
- 引用位置:
参数/字段
- 引用位置: