mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-01 19:46:42 +01:00
Clean up particle code a little
This commit is contained in:
parent
aec9692439
commit
2489ea7769
7 changed files with 130 additions and 154 deletions
|
@ -44,9 +44,9 @@ public class SphereParticle extends Particle implements Attachment {
|
||||||
super(w, x, y, z);
|
super(w, x, y, z);
|
||||||
|
|
||||||
this.radius = effect.getRadius();
|
this.radius = effect.getRadius();
|
||||||
this.colorRed = effect.getRed() / 255F;
|
this.colorRed = effect.getColor().getX() / 255F;
|
||||||
this.colorGreen = effect.getGreen() / 255F;
|
this.colorGreen = effect.getColor().getY() / 255F;
|
||||||
this.colorBlue = effect.getBlue() / 255F;
|
this.colorBlue = effect.getColor().getZ() / 255F;
|
||||||
this.colorAlpha = effect.getAlpha();
|
this.colorAlpha = effect.getAlpha();
|
||||||
|
|
||||||
setMaxAge(10);
|
setMaxAge(10);
|
||||||
|
|
|
@ -3,35 +3,23 @@ package com.minelittlepony.unicopia.particle;
|
||||||
import com.mojang.brigadier.StringReader;
|
import com.mojang.brigadier.StringReader;
|
||||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
|
|
||||||
import net.minecraft.particle.ParticleEffect;
|
|
||||||
import net.minecraft.particle.ParticleType;
|
|
||||||
import net.minecraft.network.PacketByteBuf;
|
import net.minecraft.network.PacketByteBuf;
|
||||||
|
import net.minecraft.particle.ParticleType;
|
||||||
|
import net.minecraft.util.math.Vec3f;
|
||||||
|
|
||||||
public class DiskParticleEffect extends SphereParticleEffect {
|
public class DiskParticleEffect extends SphereParticleEffect {
|
||||||
public static final ParticleEffect.Factory<DiskParticleEffect> FACTORY = new ParticleEffect.Factory<DiskParticleEffect>() {
|
public static final Factory<DiskParticleEffect> FACTORY = ParticleFactoryHelper.of(DiskParticleEffect::new, DiskParticleEffect::new);
|
||||||
@Override
|
|
||||||
public DiskParticleEffect read(ParticleType<DiskParticleEffect> particleType, StringReader reader) throws CommandSyntaxException {
|
|
||||||
reader.expect(' ');
|
|
||||||
float g = (float)reader.readDouble();
|
|
||||||
reader.expect(' ');
|
|
||||||
float h = (float)reader.readDouble();
|
|
||||||
reader.expect(' ');
|
|
||||||
float i = (float)reader.readDouble();
|
|
||||||
reader.expect(' ');
|
|
||||||
float j = (float)reader.readDouble();
|
|
||||||
reader.expect(' ');
|
|
||||||
float k = (float)reader.readDouble();
|
|
||||||
return new DiskParticleEffect(g, h, i, j, k);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
protected DiskParticleEffect(ParticleType<DiskParticleEffect> type, StringReader reader) throws CommandSyntaxException {
|
||||||
public DiskParticleEffect read(ParticleType<DiskParticleEffect> particleType, PacketByteBuf buf) {
|
super(type, reader);
|
||||||
return new DiskParticleEffect(buf.readFloat(), buf.readFloat(), buf.readFloat(), buf.readFloat(), buf.readFloat());
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
public DiskParticleEffect(float red, float green, float blue, float alpha, float rad) {
|
protected DiskParticleEffect(ParticleType<DiskParticleEffect> type, PacketByteBuf buf) {
|
||||||
super(red, green, blue, alpha, rad);
|
super(type, buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DiskParticleEffect(Vec3f color, float alpha, float rad) {
|
||||||
|
super(color, alpha, rad);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -13,25 +13,7 @@ import net.minecraft.util.registry.Registry;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class FollowingParticleEffect implements ParticleEffect {
|
public class FollowingParticleEffect implements ParticleEffect {
|
||||||
public static final ParticleEffect.Factory<FollowingParticleEffect> FACTORY = new ParticleEffect.Factory<>() {
|
public static final Factory<FollowingParticleEffect> FACTORY = ParticleFactoryHelper.of(FollowingParticleEffect::new, FollowingParticleEffect::new);
|
||||||
@Override
|
|
||||||
public FollowingParticleEffect read(ParticleType<FollowingParticleEffect> type, StringReader reader) throws CommandSyntaxException {
|
|
||||||
reader.expect(' ');
|
|
||||||
double x = reader.readDouble();
|
|
||||||
reader.expect(' ');
|
|
||||||
double y = reader.readDouble();
|
|
||||||
reader.expect(' ');
|
|
||||||
double z = reader.readDouble();
|
|
||||||
reader.expect(' ');
|
|
||||||
float speed = reader.readFloat();
|
|
||||||
return new FollowingParticleEffect(type, -1, new Vec3d(x, y, z), speed);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public FollowingParticleEffect read(ParticleType<FollowingParticleEffect> particleType, PacketByteBuf buf) {
|
|
||||||
return new FollowingParticleEffect(particleType, buf.readInt(), new Vec3d(buf.readDouble(), buf.readDouble(), buf.readDouble()), buf.readFloat());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private final ParticleType<FollowingParticleEffect> type;
|
private final ParticleType<FollowingParticleEffect> type;
|
||||||
|
|
||||||
|
@ -41,6 +23,14 @@ public class FollowingParticleEffect implements ParticleEffect {
|
||||||
|
|
||||||
private final float followSpeed;
|
private final float followSpeed;
|
||||||
|
|
||||||
|
protected FollowingParticleEffect(ParticleType<FollowingParticleEffect> type, StringReader reader) throws CommandSyntaxException {
|
||||||
|
this(type, -1, ParticleFactoryHelper.readVector(reader), ParticleFactoryHelper.readFloat(reader));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected FollowingParticleEffect(ParticleType<FollowingParticleEffect> particleType, PacketByteBuf buf) {
|
||||||
|
this(particleType, buf.readInt(), new Vec3d(buf.readDouble(), buf.readDouble(), buf.readDouble()), buf.readFloat());
|
||||||
|
}
|
||||||
|
|
||||||
public FollowingParticleEffect(ParticleType<FollowingParticleEffect> type, Vec3d target, float followSpeed) {
|
public FollowingParticleEffect(ParticleType<FollowingParticleEffect> type, Vec3d target, float followSpeed) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.fixedTarget = target;
|
this.fixedTarget = target;
|
||||||
|
|
|
@ -6,69 +6,47 @@ import com.minelittlepony.common.util.Color;
|
||||||
import com.mojang.brigadier.StringReader;
|
import com.mojang.brigadier.StringReader;
|
||||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
|
|
||||||
|
import net.minecraft.particle.AbstractDustParticleEffect;
|
||||||
import net.minecraft.particle.ParticleEffect;
|
import net.minecraft.particle.ParticleEffect;
|
||||||
import net.minecraft.particle.ParticleType;
|
import net.minecraft.particle.ParticleType;
|
||||||
import net.minecraft.network.PacketByteBuf;
|
import net.minecraft.network.PacketByteBuf;
|
||||||
|
import net.minecraft.util.math.Vec3f;
|
||||||
import net.minecraft.util.registry.Registry;
|
import net.minecraft.util.registry.Registry;
|
||||||
|
|
||||||
public class MagicParticleEffect implements ParticleEffect {
|
public class MagicParticleEffect implements ParticleEffect {
|
||||||
|
public static final MagicParticleEffect UNICORN = new MagicParticleEffect(false, Vec3f.ZERO);
|
||||||
public static final MagicParticleEffect UNICORN = new MagicParticleEffect(false, 0, 0, 0);
|
public static final ParticleEffect.Factory<MagicParticleEffect> FACTORY = ParticleFactoryHelper.of(MagicParticleEffect::new, MagicParticleEffect::new);
|
||||||
public static final ParticleEffect.Factory<MagicParticleEffect> FACTORY = new ParticleEffect.Factory<MagicParticleEffect>() {
|
|
||||||
@Override
|
|
||||||
public MagicParticleEffect read(ParticleType<MagicParticleEffect> particleType, StringReader reader) throws CommandSyntaxException {
|
|
||||||
reader.expect(' ');
|
|
||||||
boolean f = reader.readBoolean();
|
|
||||||
reader.expect(' ');
|
|
||||||
float g = (float)reader.readDouble();
|
|
||||||
reader.expect(' ');
|
|
||||||
float h = (float)reader.readDouble();
|
|
||||||
reader.expect(' ');
|
|
||||||
float i = (float)reader.readDouble();
|
|
||||||
return new MagicParticleEffect(f, g, h, i);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public MagicParticleEffect read(ParticleType<MagicParticleEffect> particleType, PacketByteBuf buf) {
|
|
||||||
return new MagicParticleEffect(buf.readBoolean(), buf.readFloat(), buf.readFloat(), buf.readFloat());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private final boolean tinted;
|
private final boolean tinted;
|
||||||
private final float red;
|
private final Vec3f color;
|
||||||
private final float green;
|
|
||||||
private final float blue;
|
protected MagicParticleEffect(ParticleType<MagicParticleEffect> particleType, StringReader reader) throws CommandSyntaxException {
|
||||||
|
this(ParticleFactoryHelper.readBoolean(reader), AbstractDustParticleEffect.readColor(reader));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected MagicParticleEffect(ParticleType<MagicParticleEffect> particleType, PacketByteBuf buf) {
|
||||||
|
this(buf.readBoolean(), AbstractDustParticleEffect.readColor(buf));
|
||||||
|
}
|
||||||
|
|
||||||
public MagicParticleEffect(int tint) {
|
public MagicParticleEffect(int tint) {
|
||||||
this(true, Color.r(tint), Color.g(tint), Color.b(tint));
|
this(true, new Vec3f(Color.r(tint), Color.g(tint), Color.b(tint)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public MagicParticleEffect(float r, float g, float b) {
|
public MagicParticleEffect(Vec3f color) {
|
||||||
this(true, r, g, b);
|
this(true, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected MagicParticleEffect(boolean tint, float r, float g, float b) {
|
protected MagicParticleEffect(boolean tint, Vec3f color) {
|
||||||
tinted = tint;
|
tinted = tint;
|
||||||
red = r;
|
this.color = color;
|
||||||
green = g;
|
|
||||||
blue = b;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean hasTint() {
|
public boolean hasTint() {
|
||||||
return tinted;
|
return tinted;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getRed() {
|
public Vec3f getColor() {
|
||||||
return red;
|
return color;
|
||||||
}
|
|
||||||
|
|
||||||
public float getGreen() {
|
|
||||||
return green;
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getBlue() {
|
|
||||||
return blue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -79,14 +57,14 @@ public class MagicParticleEffect implements ParticleEffect {
|
||||||
@Override
|
@Override
|
||||||
public void write(PacketByteBuf buf) {
|
public void write(PacketByteBuf buf) {
|
||||||
buf.writeBoolean(tinted);
|
buf.writeBoolean(tinted);
|
||||||
buf.writeFloat(red);
|
buf.writeFloat(color.getX());
|
||||||
buf.writeFloat(green);
|
buf.writeFloat(color.getY());
|
||||||
buf.writeFloat(blue);
|
buf.writeFloat(color.getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String asString() {
|
public String asString() {
|
||||||
return String.format(Locale.ROOT, "%s %.2f %.2f %.2f", Registry.PARTICLE_TYPE.getId(getType()), red, green, blue);
|
return String.format(Locale.ROOT, "%s %.2f %.2f %.2f", Registry.PARTICLE_TYPE.getId(getType()), color.getX(), color.getY(), color.getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,23 +12,7 @@ import net.minecraft.util.math.Vec3d;
|
||||||
import net.minecraft.util.registry.Registry;
|
import net.minecraft.util.registry.Registry;
|
||||||
|
|
||||||
public class OrientedBillboardParticleEffect implements ParticleEffect {
|
public class OrientedBillboardParticleEffect implements ParticleEffect {
|
||||||
public static final ParticleEffect.Factory<OrientedBillboardParticleEffect> FACTORY = new ParticleEffect.Factory<OrientedBillboardParticleEffect>() {
|
public static final ParticleEffect.Factory<OrientedBillboardParticleEffect> FACTORY = ParticleFactoryHelper.of(OrientedBillboardParticleEffect::new, OrientedBillboardParticleEffect::new);
|
||||||
@Override
|
|
||||||
public OrientedBillboardParticleEffect read(ParticleType<OrientedBillboardParticleEffect> type, StringReader reader) throws CommandSyntaxException {
|
|
||||||
reader.expect(' ');
|
|
||||||
boolean fixed = reader.readBoolean();
|
|
||||||
reader.expect(' ');
|
|
||||||
float yaw = (float)reader.readDouble();
|
|
||||||
reader.expect(' ');
|
|
||||||
float pitch = (float)reader.readDouble();
|
|
||||||
return new OrientedBillboardParticleEffect(type, fixed, yaw, pitch);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public OrientedBillboardParticleEffect read(ParticleType<OrientedBillboardParticleEffect> particleType, PacketByteBuf buf) {
|
|
||||||
return new OrientedBillboardParticleEffect(particleType, buf.readBoolean(), buf.readFloat(), buf.readFloat());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private final boolean fixed;
|
private final boolean fixed;
|
||||||
private final float yaw;
|
private final float yaw;
|
||||||
|
@ -36,6 +20,14 @@ public class OrientedBillboardParticleEffect implements ParticleEffect {
|
||||||
|
|
||||||
private final ParticleType<OrientedBillboardParticleEffect> type;
|
private final ParticleType<OrientedBillboardParticleEffect> type;
|
||||||
|
|
||||||
|
protected OrientedBillboardParticleEffect(ParticleType<OrientedBillboardParticleEffect> type, StringReader reader) throws CommandSyntaxException {
|
||||||
|
this(type, ParticleFactoryHelper.readBoolean(reader), ParticleFactoryHelper.readFloat(reader), ParticleFactoryHelper.readFloat(reader));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected OrientedBillboardParticleEffect(ParticleType<OrientedBillboardParticleEffect> particleType, PacketByteBuf buf) {
|
||||||
|
this(particleType, buf.readBoolean(), buf.readFloat(), buf.readFloat());
|
||||||
|
}
|
||||||
|
|
||||||
public OrientedBillboardParticleEffect(ParticleType<OrientedBillboardParticleEffect> type, Vec3d orientation) {
|
public OrientedBillboardParticleEffect(ParticleType<OrientedBillboardParticleEffect> type, Vec3d orientation) {
|
||||||
this(type, (float)orientation.getX(), (float)orientation.getY());
|
this(type, (float)orientation.getX(), (float)orientation.getY());
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.minelittlepony.unicopia.particle;
|
||||||
|
|
||||||
|
import com.mojang.brigadier.StringReader;
|
||||||
|
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
|
|
||||||
|
import net.minecraft.network.PacketByteBuf;
|
||||||
|
import net.minecraft.particle.ParticleEffect;
|
||||||
|
import net.minecraft.particle.ParticleType;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
|
public interface ParticleFactoryHelper {
|
||||||
|
|
||||||
|
static Vec3d readVector(StringReader reader) throws CommandSyntaxException {
|
||||||
|
return new Vec3d(readDouble(reader), readDouble(reader), readDouble(reader));
|
||||||
|
}
|
||||||
|
|
||||||
|
static boolean readBoolean(StringReader reader) throws CommandSyntaxException {
|
||||||
|
reader.expect(' ');
|
||||||
|
return reader.readBoolean();
|
||||||
|
}
|
||||||
|
|
||||||
|
static double readDouble(StringReader reader) throws CommandSyntaxException {
|
||||||
|
reader.expect(' ');
|
||||||
|
return reader.readDouble();
|
||||||
|
}
|
||||||
|
static float readFloat(StringReader reader) throws CommandSyntaxException {
|
||||||
|
reader.expect(' ');
|
||||||
|
return reader.readFloat();
|
||||||
|
}
|
||||||
|
|
||||||
|
static <T extends ParticleEffect> ParticleEffect.Factory<T> of(CommandReader<T> commandReader, PacketReader<T> packetReader) {
|
||||||
|
return new ParticleEffect.Factory<>() {
|
||||||
|
@Override
|
||||||
|
public T read(ParticleType<T> type, StringReader reader) throws CommandSyntaxException {
|
||||||
|
return commandReader.read(type, reader);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public T read(ParticleType<T> type, PacketByteBuf buf) {
|
||||||
|
return packetReader.read(type, buf);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
interface CommandReader<T extends ParticleEffect> {
|
||||||
|
T read(ParticleType<T> type, StringReader reader) throws CommandSyntaxException;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface PacketReader<T extends ParticleEffect> {
|
||||||
|
T read(ParticleType<T> type, PacketByteBuf buf);
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,62 +6,40 @@ import com.minelittlepony.common.util.Color;
|
||||||
import com.mojang.brigadier.StringReader;
|
import com.mojang.brigadier.StringReader;
|
||||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
|
|
||||||
|
import net.minecraft.particle.AbstractDustParticleEffect;
|
||||||
import net.minecraft.particle.ParticleEffect;
|
import net.minecraft.particle.ParticleEffect;
|
||||||
import net.minecraft.particle.ParticleType;
|
import net.minecraft.particle.ParticleType;
|
||||||
import net.minecraft.network.PacketByteBuf;
|
import net.minecraft.network.PacketByteBuf;
|
||||||
|
import net.minecraft.util.math.Vec3f;
|
||||||
import net.minecraft.util.registry.Registry;
|
import net.minecraft.util.registry.Registry;
|
||||||
|
|
||||||
public class SphereParticleEffect implements ParticleEffect {
|
public class SphereParticleEffect implements ParticleEffect {
|
||||||
public static final ParticleEffect.Factory<SphereParticleEffect> FACTORY = new ParticleEffect.Factory<SphereParticleEffect>() {
|
public static final Factory<SphereParticleEffect> FACTORY = ParticleFactoryHelper.of(SphereParticleEffect::new, SphereParticleEffect::new);
|
||||||
@Override
|
|
||||||
public SphereParticleEffect read(ParticleType<SphereParticleEffect> particleType, StringReader reader) throws CommandSyntaxException {
|
|
||||||
reader.expect(' ');
|
|
||||||
float g = (float)reader.readDouble();
|
|
||||||
reader.expect(' ');
|
|
||||||
float h = (float)reader.readDouble();
|
|
||||||
reader.expect(' ');
|
|
||||||
float i = (float)reader.readDouble();
|
|
||||||
reader.expect(' ');
|
|
||||||
float j = (float)reader.readDouble();
|
|
||||||
reader.expect(' ');
|
|
||||||
float k = (float)reader.readDouble();
|
|
||||||
return new SphereParticleEffect(g, h, i, j, k);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
private final Vec3f color;
|
||||||
public SphereParticleEffect read(ParticleType<SphereParticleEffect> particleType, PacketByteBuf buf) {
|
|
||||||
return new SphereParticleEffect(buf.readFloat(), buf.readFloat(), buf.readFloat(), buf.readFloat(), buf.readFloat());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private final float red;
|
|
||||||
private final float green;
|
|
||||||
private final float blue;
|
|
||||||
private final float alpha;
|
private final float alpha;
|
||||||
private final float radius;
|
private final float radius;
|
||||||
|
|
||||||
public SphereParticleEffect(int tint, float alpha, float rad) {
|
protected SphereParticleEffect(ParticleType<? extends SphereParticleEffect> type, StringReader reader) throws CommandSyntaxException {
|
||||||
this(Color.r(tint), Color.g(tint), Color.b(tint), alpha, rad);
|
this(AbstractDustParticleEffect.readColor(reader), ParticleFactoryHelper.readFloat(reader), ParticleFactoryHelper.readFloat(reader));
|
||||||
}
|
}
|
||||||
|
|
||||||
public SphereParticleEffect(float red, float green, float blue, float alpha, float rad) {
|
protected SphereParticleEffect(ParticleType<? extends SphereParticleEffect> type, PacketByteBuf buf) {
|
||||||
this.red = red;
|
this(AbstractDustParticleEffect.readColor(buf), buf.readFloat(), buf.readFloat());
|
||||||
this.green = green;
|
}
|
||||||
this.blue = blue;
|
|
||||||
|
public SphereParticleEffect(int tint, float alpha, float rad) {
|
||||||
|
this(new Vec3f(Color.r(tint), Color.g(tint), Color.b(tint)), alpha, rad);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SphereParticleEffect(Vec3f color, float alpha, float rad) {
|
||||||
|
this.color = color;
|
||||||
this.alpha = alpha;
|
this.alpha = alpha;
|
||||||
this.radius = rad;
|
this.radius = rad;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getRed() {
|
public Vec3f getColor() {
|
||||||
return red;
|
return color;
|
||||||
}
|
|
||||||
|
|
||||||
public float getGreen() {
|
|
||||||
return green;
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getBlue() {
|
|
||||||
return blue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getAlpha() {
|
public float getAlpha() {
|
||||||
|
@ -79,16 +57,15 @@ public class SphereParticleEffect implements ParticleEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(PacketByteBuf buf) {
|
public void write(PacketByteBuf buf) {
|
||||||
buf.writeFloat(red);
|
buf.writeFloat(color.getX());
|
||||||
buf.writeFloat(green);
|
buf.writeFloat(color.getY());
|
||||||
buf.writeFloat(blue);
|
buf.writeFloat(color.getZ());
|
||||||
buf.writeFloat(alpha);
|
buf.writeFloat(alpha);
|
||||||
buf.writeFloat(radius);
|
buf.writeFloat(radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String asString() {
|
public String asString() {
|
||||||
return String.format(Locale.ROOT, "%s %.2f %.2f %.2f %.2f", Registry.PARTICLE_TYPE.getId(getType()), red, green, blue, alpha, radius);
|
return String.format(Locale.ROOT, "%s %.2f %.2f %.2f %.2f", Registry.PARTICLE_TYPE.getId(getType()), color.getX(), color.getY(), color.getZ(), alpha, radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue