2025-11-24 22:52:51 +03:00

47 lines
1.6 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package net.minecraft.client.particle;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.particle.ParticleProvider;
import net.minecraft.client.particle.SingleQuadParticle;
import net.minecraft.client.renderer.texture.TextureAtlas;
import net.minecraft.core.particles.BlockParticleOption;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.block.state.BlockState;
public class BlockMarker
extends SingleQuadParticle {
private final SingleQuadParticle.Layer layer;
private BlockMarker(ClientLevel level, double x, double y, double z, BlockState state) {
super(level, x, y, z, Minecraft.getInstance().getBlockRenderer().getBlockModelShaper().getParticleIcon(state));
this.gravity = 0.0f;
this.lifetime = 80;
this.hasPhysics = false;
this.layer = this.sprite.atlasLocation() == TextureAtlas.LOCATION_BLOCKS ? SingleQuadParticle.Layer.TERRAIN : SingleQuadParticle.Layer.ITEMS;
}
@Override
public SingleQuadParticle.Layer getLayer() {
return this.layer;
}
@Override
public float getQuadSize(float a) {
return 0.5f;
}
public static class Provider
implements ParticleProvider<BlockParticleOption> {
@Override
public Particle createParticle(BlockParticleOption option, ClientLevel level, double x, double y, double z, double xAux, double yAux, double zAux, RandomSource random) {
return new BlockMarker(level, x, y, z, option.getState());
}
}
}