36 lines
		
	
	
	
		
			1.2 KiB
		
	
	
	
		
			Java
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
	
		
			1.2 KiB
		
	
	
	
		
			Java
		
	
	
	
	
	
| package net.minecraft.client.particle;
 | |
| 
 | |
| import net.fabricmc.api.EnvType;
 | |
| import net.fabricmc.api.Environment;
 | |
| import net.minecraft.client.Minecraft;
 | |
| import net.minecraft.client.multiplayer.ClientLevel;
 | |
| import net.minecraft.core.particles.BlockParticleOption;
 | |
| import net.minecraft.world.level.block.state.BlockState;
 | |
| 
 | |
| @Environment(EnvType.CLIENT)
 | |
| public class BlockMarker extends TextureSheetParticle {
 | |
| 	BlockMarker(ClientLevel level, double x, double y, double z, BlockState state) {
 | |
| 		super(level, x, y, z);
 | |
| 		this.setSprite(Minecraft.getInstance().getBlockRenderer().getBlockModelShaper().getParticleIcon(state));
 | |
| 		this.gravity = 0.0F;
 | |
| 		this.lifetime = 80;
 | |
| 		this.hasPhysics = false;
 | |
| 	}
 | |
| 
 | |
| 	@Override
 | |
| 	public ParticleRenderType getRenderType() {
 | |
| 		return ParticleRenderType.TERRAIN_SHEET;
 | |
| 	}
 | |
| 
 | |
| 	@Override
 | |
| 	public float getQuadSize(float scaleFactor) {
 | |
| 		return 0.5F;
 | |
| 	}
 | |
| 
 | |
| 	@Environment(EnvType.CLIENT)
 | |
| 	public static class Provider implements ParticleProvider<BlockParticleOption> {
 | |
| 		public Particle createParticle(BlockParticleOption blockParticleOption, ClientLevel clientLevel, double d, double e, double f, double g, double h, double i) {
 | |
| 			return new BlockMarker(clientLevel, d, e, f, blockParticleOption.getState());
 | |
| 		}
 | |
| 	}
 | |
| }
 |