mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 10:05:12 +01:00
Add Particle#copy (#4126)
This commit is contained in:
parent
32e51b52aa
commit
5017d4bbb3
@ -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{" +
|
||||||
|
Loading…
Reference in New Issue
Block a user