Skip to content

Commit

Permalink
Fix AttributeKey copy for non object arrays.
Browse files Browse the repository at this point in the history
  • Loading branch information
covers1624 committed Sep 18, 2024
1 parent 83b1a01 commit 10905a9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 10905a9

Please sign in to comment.