From 5017d4bbb322c667ca2b58fe7c368ef5ea7e1f89 Mon Sep 17 00:00:00 2001 From: RK_01 <50594595+RaphiMC@users.noreply.github.com> Date: Thu, 29 Aug 2024 15:32:28 +0200 Subject: [PATCH] Add Particle#copy (#4126) --- .../viaversion/api/minecraft/Particle.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/Particle.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/Particle.java index 6df27415a..af86da467 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/Particle.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/Particle.java @@ -72,6 +72,14 @@ public final class Particle implements IdHolder { arguments.set(index, new ParticleData<>(type, value)); } + public Particle copy() { + final Particle particle = new Particle(id); + for (ParticleData argument : arguments) { + particle.arguments.add(argument.copy()); + } + return particle; + } + @Override public String toString() { return "Particle{" + @@ -109,6 +117,10 @@ public final class Particle implements IdHolder { wrapper.write(type, value); } + public ParticleData copy() { + return new ParticleData<>(type, value); + } + @Override public String toString() { return "ParticleData{" +