BubbleParticle.java
net.minecraft.client.particle.BubbleParticle
信息
- 全限定名:net.minecraft.client.particle.BubbleParticle
- 类型:public class
- 包:net.minecraft.client.particle
- 源码路径:src/main/java/net/minecraft/client/particle/BubbleParticle.java
- 起始行号:L13
- 继承:SingleQuadParticle
- 职责:
TODO
字段/常量
- 无
内部类/嵌套类型
net.minecraft.client.particle.BubbleParticle.Provider- 类型:
class - 修饰符:
public static - 源码定位:
L49 - 说明:
TODO
- 类型:
构造器
private BubbleParticle(ClientLevel level, double x, double y, double z, double xa, double ya, double za, TextureAtlasSprite sprite) @ L14
- 构造器名:BubbleParticle
- 源码定位:L14
- 修饰符:private
参数:
- level: ClientLevel
- x: double
- y: double
- z: double
- xa: double
- ya: double
- za: double
- sprite: TextureAtlasSprite
说明:
TODO
方法
下面的方法块按源码顺序生成。
public void tick() @ L24
- 方法名:tick
- 源码定位:L24
- 返回类型:void
- 修饰符:public
参数:
- 无
说明:
TODO
public SingleQuadParticle.Layer getLayer() @ L43
- 方法名:getLayer
- 源码定位:L43
- 返回类型:SingleQuadParticle.Layer
- 修饰符:public
参数:
- 无
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class BubbleParticle extends SingleQuadParticle {
private BubbleParticle(ClientLevel level, double x, double y, double z, double xa, double ya, double za, TextureAtlasSprite sprite) {
super(level, x, y, z, sprite);
this.setSize(0.02F, 0.02F);
this.quadSize = this.quadSize * (this.random.nextFloat() * 0.6F + 0.2F);
this.xd = xa * 0.2F + (this.random.nextFloat() * 2.0F - 1.0F) * 0.02F;
this.yd = ya * 0.2F + (this.random.nextFloat() * 2.0F - 1.0F) * 0.02F;
this.zd = za * 0.2F + (this.random.nextFloat() * 2.0F - 1.0F) * 0.02F;
this.lifetime = (int)(8.0 / (this.random.nextFloat() * 0.8 + 0.2));
}
@Override
public void tick() {
this.xo = this.x;
this.yo = this.y;
this.zo = this.z;
if (this.lifetime-- <= 0) {
this.remove();
} else {
this.yd += 0.002;
this.move(this.xd, this.yd, this.zd);
this.xd *= 0.85F;
this.yd *= 0.85F;
this.zd *= 0.85F;
if (!this.level.getFluidState(BlockPos.containing(this.x, this.y, this.z)).is(FluidTags.WATER)) {
this.remove();
}
}
}
@Override
public SingleQuadParticle.Layer getLayer() {
return SingleQuadParticle.Layer.OPAQUE;
}
@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 BubbleParticle(level, x, y, z, xAux, yAux, zAux, this.sprite.get(random));
}
}
}引用的其他类
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
继承/返回值
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
BlockPos.containing()
- 引用位置: