From edfcc502145c3ae774e359e59e1b89cf457159f8 Mon Sep 17 00:00:00 2001 From: themode Date: Thu, 6 Jan 2022 08:28:22 +0100 Subject: [PATCH] Avoid recomputing palette --- .../java/net/minestom/server/instance/palette/PaletteImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/minestom/server/instance/palette/PaletteImpl.java b/src/main/java/net/minestom/server/instance/palette/PaletteImpl.java index fdbc14e86..88be64f50 100644 --- a/src/main/java/net/minestom/server/instance/palette/PaletteImpl.java +++ b/src/main/java/net/minestom/server/instance/palette/PaletteImpl.java @@ -265,7 +265,7 @@ final class PaletteImpl implements Palette, Cloneable { final int newValue = function.apply(x, y, z, value); final int index = count.getPlain(); count.setPlain(index + 1); - cache[index] = getPaletteIndex(newValue); + cache[index] = newValue != value ? getPaletteIndex(newValue) : value; }); // Set values to final array count.setPlain(0);