3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-16 04:50:08 +01:00

Add Particle#copy (#4126)

Dieser Commit ist enthalten in:
RK_01 2024-08-29 15:32:28 +02:00 committet von GitHub
Ursprung 32e51b52aa
Commit 5017d4bbb3
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194

Datei anzeigen

@ -72,6 +72,14 @@ public final class Particle implements IdHolder {
arguments.set(index, new ParticleData<>(type, value)); 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 @Override
public String toString() { public String toString() {
return "Particle{" + return "Particle{" +
@ -109,6 +117,10 @@ public final class Particle implements IdHolder {
wrapper.write(type, value); wrapper.write(type, value);
} }
public ParticleData<T> copy() {
return new ParticleData<>(type, value);
}
@Override @Override
public String toString() { public String toString() {
return "ParticleData{" + return "ParticleData{" +