ExplosionParticleInfo .java

net.minecraft.core.particles.ExplosionParticleInfo (record, 29 lines): members: particle, scaling, speed, STREAM_CODEC, CODEC. strings: "scaling", "speed".

net.minecraft.core.particlesrecord29 linescommon1.2 KB

API Surface (1)

record ExplosionParticleInfo(ParticleOptions particle, float scaling, float speed)

Fields & Constants (2)

CODEC
STREAM_CODEC

String literals (3)

"particle"
"scaling"
"speed"

Code Graph: Dependencies (4)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

ExplosionParticleInfo.java29 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.core.particles;
2
3
import com.mojang.serialization.Codec;
4
import com.mojang.serialization.MapCodec;
5
import com.mojang.serialization.codecs.RecordCodecBuilder;
6
import net.minecraft.network.RegistryFriendlyByteBuf;
7
import net.minecraft.network.codec.ByteBufCodecs;
8
import net.minecraft.network.codec.StreamCodec;
9
10
public record ExplosionParticleInfo(ParticleOptions particle, float scaling, float speed) {
11
	public static final MapCodec<ExplosionParticleInfo> CODEC = RecordCodecBuilder.mapCodec(
12
		i -> i.group(
13
				ParticleTypes.CODEC.fieldOf("particle").forGetter(ExplosionParticleInfo::particle),
14
				Codec.FLOAT.optionalFieldOf("scaling", 1.0F).forGetter(ExplosionParticleInfo::scaling),
15
				Codec.FLOAT.optionalFieldOf("speed", 1.0F).forGetter(ExplosionParticleInfo::speed)
16
			)
17
			.apply(i, ExplosionParticleInfo::new)
18
	);
19
	public static final StreamCodec<RegistryFriendlyByteBuf, ExplosionParticleInfo> STREAM_CODEC = StreamCodec.composite(
20
		ParticleTypes.STREAM_CODEC,
21
		ExplosionParticleInfo::particle,
22
		ByteBufCodecs.FLOAT,
23
		ExplosionParticleInfo::scaling,
24
		ByteBufCodecs.FLOAT,
25
		ExplosionParticleInfo::speed,
26
		ExplosionParticleInfo::new
27
	);
28
}
29

Decompiled Minecraft 26.3 source of ExplosionParticleInfo (net/minecraft/core/particles/ExplosionParticleInfo.java) with Mojang official mappings, stored verbatim on the site.