diff --git a/src/main/java/me/jellysquid/mods/lithium/common/config/LithiumConfig.java b/src/main/java/me/jellysquid/mods/lithium/common/config/LithiumConfig.java index 8e39393e9..2bf56e376 100644 --- a/src/main/java/me/jellysquid/mods/lithium/common/config/LithiumConfig.java +++ b/src/main/java/me/jellysquid/mods/lithium/common/config/LithiumConfig.java @@ -68,7 +68,7 @@ private LithiumConfig() { this.addMixinRule("chunk.entity_class_groups", true); this.addMixinRule("chunk.no_locking", true); this.addMixinRule("chunk.no_validation", true); - this.addMixinRule("chunk.palette", true); + this.addMixinRule("chunk.palette", false); //causes a pretty mess being rendered this.addMixinRule("chunk.section_update_tracking", true); this.addMixinRule("chunk.serialization", true); diff --git a/src/main/java/me/jellysquid/mods/lithium/common/world/chunk/LithiumHashPalette.java b/src/main/java/me/jellysquid/mods/lithium/common/world/chunk/LithiumHashPalette.java index 942d75b05..665969c30 100644 --- a/src/main/java/me/jellysquid/mods/lithium/common/world/chunk/LithiumHashPalette.java +++ b/src/main/java/me/jellysquid/mods/lithium/common/world/chunk/LithiumHashPalette.java @@ -9,7 +9,6 @@ import net.minecraft.world.chunk.Palette; import net.minecraft.world.chunk.PaletteResizeListener; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.function.Predicate; @@ -31,6 +30,15 @@ public class LithiumHashPalette implements Palette { private T[] entries; private int size = 0; + public LithiumHashPalette(IndexedIterable idList, PaletteResizeListener resizeHandler, int indexBits, T[] entries, Reference2IntMap table, int size) { + this.idList = idList; + this.resizeHandler = resizeHandler; + this.indexBits = indexBits; + this.entries = entries; + this.table = table; + this.size = size; + } + public LithiumHashPalette(IndexedIterable idList, int bits, PaletteResizeListener resizeHandler, List list) { this(idList, bits, resizeHandler); @@ -157,8 +165,7 @@ public int getSize() { @Override public Palette copy() { - var clone = new ArrayList<>(this.table.keySet()); - return new LithiumHashPalette<>(this.idList, this.indexBits, this.resizeHandler, clone); + return new LithiumHashPalette<>(this.idList, this.resizeHandler, this.indexBits, this.entries.clone(), new Reference2IntOpenHashMap<>(this.table), this.size); } private void clear() {