From 10905a968d82598ce4ac5abead1a91c238b4e112 Mon Sep 17 00:00:00 2001 From: covers1624 Date: Thu, 19 Sep 2024 00:22:08 +0930 Subject: [PATCH] Fix AttributeKey copy for non object arrays. --- .../lib/render/pipeline/attribute/AttributeKey.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/codechicken/lib/render/pipeline/attribute/AttributeKey.java b/src/main/java/codechicken/lib/render/pipeline/attribute/AttributeKey.java index 2cc2a4a3..f54b73f3 100644 --- a/src/main/java/codechicken/lib/render/pipeline/attribute/AttributeKey.java +++ b/src/main/java/codechicken/lib/render/pipeline/attribute/AttributeKey.java @@ -6,6 +6,7 @@ import codechicken.lib.util.ArrayUtils; import codechicken.lib.util.Copyable; +import java.lang.reflect.Array; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -44,7 +45,7 @@ public T createDefault(int length) { @Override public T copy(T src, int length) { T dst = createDefault(length); - ArrayUtils.arrayCopy(src, 0, dst, 0, ((Object[]) src).length); + ArrayUtils.arrayCopy(src, 0, dst, 0, Array.getLength(src)); return dst; }