From 63d3dcb31b75c1efe1e1c96f4c6ba60c3b6e2531 Mon Sep 17 00:00:00 2001 From: KennyTV Date: Tue, 30 Jun 2020 12:41:09 +0200 Subject: [PATCH] Make this more readable with the base colors --- .../packets/BlockItemPackets1_16.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/packets/BlockItemPackets1_16.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/packets/BlockItemPackets1_16.java index f7d86ef7..472df4ba 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/packets/BlockItemPackets1_16.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/packets/BlockItemPackets1_16.java @@ -235,31 +235,31 @@ public class BlockItemPackets1_16 extends nl.matsv.viabackwards.api.rewriters.It wrapper.passthrough(Type.BYTE); // Z byte[] data = wrapper.passthrough(Type.BYTE_ARRAY_PRIMITIVE); for (int i = 0; i < data.length; i++) { - int color = data[i] & 0xFF; + int color = (data[i] & 0xFF) / 4; int newColor = -1; switch (color) { - case 208: - newColor = 112; + case 52: + newColor = 28; break; - case 212: - newColor = 152; + case 53: + newColor = 38; break; - case 216: - newColor = 140; + case 54: + newColor = 35; break; - case 220: - newColor = 128; + case 55: + newColor = 32; break; - case 224: - case 232: - newColor = 92; + case 56: + case 58: + newColor = 23; break; - case 228: - newColor = 96; + case 57: + newColor = 24; break; } if (newColor != -1) { - data[i] = (byte) newColor; + data[i] = (byte) (newColor * 4); } } });