mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-25 03:25:11 +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));
|
||||
}
|
||||
|
||||
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<T> copy() {
|
||||
return new ParticleData<>(type, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ParticleData{" +
|
||||
|
Loading…
Reference in New Issue
Block a user