Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-27 16:40:10 +01:00
Copy item in Particle#copy (#4130)
Dieser Commit ist enthalten in:
Ursprung
7cd5514b90
Commit
0b2dac9056
@ -22,6 +22,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.viaversion.viaversion.api.minecraft;
|
package com.viaversion.viaversion.api.minecraft;
|
||||||
|
|
||||||
|
import com.viaversion.viaversion.api.minecraft.item.Item;
|
||||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||||
import com.viaversion.viaversion.api.type.Type;
|
import com.viaversion.viaversion.api.type.Type;
|
||||||
import com.viaversion.viaversion.util.IdHolder;
|
import com.viaversion.viaversion.util.IdHolder;
|
||||||
@ -118,8 +119,12 @@ public final class Particle implements IdHolder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ParticleData<T> copy() {
|
public ParticleData<T> copy() {
|
||||||
|
if (value instanceof Item item) {
|
||||||
|
return new ParticleData<>(type, (T) item.copy());
|
||||||
|
} else {
|
||||||
return new ParticleData<>(type, value);
|
return new ParticleData<>(type, value);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren