From bb4b5d3080865a4cc31013f90ca2a20041e08300 Mon Sep 17 00:00:00 2001 From: Gerrygames Date: Sat, 21 Jul 2018 11:18:14 +0200 Subject: [PATCH] Fix reddust particle color for 1.13 clients --- .../packets/WorldPackets.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/WorldPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/WorldPackets.java index 788ac54f4..c31b47278 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/WorldPackets.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/WorldPackets.java @@ -24,6 +24,8 @@ import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.PaintingProv import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage.BlockStorage; import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.types.Chunk1_13Type; +import java.util.List; + public class WorldPackets { public static void register(Protocol protocol) { // Outgoing packets @@ -242,6 +244,24 @@ public class WorldPackets { return; } + //Handle reddust particle color + ifStatement: + if (particle.getId() == 11) { + int count = wrapper.get(Type.INT, 1); + float speed = wrapper.get(Type.FLOAT, 6); + if (count != 0 || speed != 1) break ifStatement; + + wrapper.set(Type.INT, 1, 1); + wrapper.set(Type.FLOAT, 6, 0f); + + List arguments = particle.getArguments(); + for (int i = 0; i < 3; i++) { + //RGB values are represented by the X/Y/Z offset + arguments.get(i).setValue(wrapper.get(Type.FLOAT, i + 3)); + wrapper.set(Type.FLOAT, i + 3, 0f); + } + } + // System.out.println("Old particle " + particleId + " " + Arrays.toString(data) + " new Particle" + particle);