src/main/java/me/senseiwells/arucas/utils/ValueConverter.java
private Object[] boxPrimitiveArray(Object object) {
		if (object instanceof Object[] objects) {
			return objects;
		}
		if (object instanceof double[] doubles) {
			Double[] objects = new Double[doubles.length];
			for (int i = 0; i < doubles.length; i++) {
				objects[i] = doubles[i];
			}
			return objects;
		}
		if (object instanceof long[] longs) {
			Long[] objects = new Long[longs.length];
			for (int i = 0; i < longs.length; i++) {
				objects[i] = longs[i];
			}
			return objects;
		}
		if (object instanceof int[] ints) {
			Integer[] objects = new Integer[ints.length];
			for (int i = 0; i < ints.length; i++) {
				objects[i] = ints[i];
			}
			return objects;
		}
		if (object instanceof short[] shorts) {
			Short[] objects = new Short[shorts.length];
			for (int i = 0; i < shorts.length; i++) {
				objects[i] = shorts[i];
			}
			return objects;
		}
		if (object instanceof byte[] bytes) {
			Byte[] objects = new Byte[bytes.length];
			for (int i = 0; i < bytes.length; i++) {
				objects[i] = bytes[i];
			}
			return objects;
		}
		if (object instanceof float[] floats) {
			Float[] objects = new Float[floats.length];
			for (int i = 0; i < floats.length; i++) {
				objects[i] = floats[i];
			}
			return objects;
		}
		if (object instanceof boolean[] bools) {
			Boolean[] objects = new Boolean[bools.length];
			for (int i = 0; i < bools.length; i++) {
				objects[i] = bools[i];
			}
			return objects;
		}
		if (object instanceof char[] chars) {
			Character[] objects = new Character[chars.length];
			for (int i = 0; i < chars.length; i++) {
				objects[i] = chars[i];
			}
			return objects;
		}
		throw new IllegalArgumentException("%s is not an array".formatted(object));
	}
/**
	 * This is not a very 'clean' way of converting it, but primitive
	 * arrays do not count as Object[] so we must check for every
	 * array type and convert it to Object[] by boxing it.
	 */
This is not a very 'clean' way of converting it, but primitive
arrays do not count as Object[] so we must check for every
array type and convert it to Object[] by boxing it.
This is not a very ' clean ' way of converting it but primitive arrays do not count as Object [] so we must check for every array type and convert it to Object [] by boxing it .
private Object[] boxPrimitiveArray(Object object) {
		if (object instanceof Object[] objects) {
			return objects;
		}
		if (object instanceof double[] doubles) {
			Double[] objects = new Double[doubles.length];
			for (int i = 0; i < doubles.length; i++) {
				objects[i] = doubles[i];
			}
			return objects;
		}
		if (object instanceof long[] longs) {
			Long[] objects = new Long[longs.length];
			for (int i = 0; i < longs.length; i++) {
				objects[i] = longs[i];
			}
			return objects;
		}
		if (object instanceof int[] ints) {
			Integer[] objects = new Integer[ints.length];
			for (int i = 0; i < ints.length; i++) {
				objects[i] = ints[i];
			}
			return objects;
		}
		if (object instanceof short[] shorts) {
			Short[] objects = new Short[shorts.length];
			for (int i = 0; i < shorts.length; i++) {
				objects[i] = shorts[i];
			}
			return objects;
		}
		if (object instanceof byte[] bytes) {
			Byte[] objects = new Byte[bytes.length];
			for (int i = 0; i < bytes.length; i++) {
				objects[i] = bytes[i];
			}
			return objects;
		}
		if (object instanceof float[] floats) {
			Float[] objects = new Float[floats.length];
			for (int i = 0; i < floats.length; i++) {
				objects[i] = floats[i];
			}
			return objects;
		}
		if (object instanceof boolean[] bools) {
			Boolean[] objects = new Boolean[bools.length];
			for (int i = 0; i < bools.length; i++) {
				objects[i] = bools[i];
			}
			return objects;
		}
		if (object instanceof char[] chars) {
			Character[] objects = new Character[chars.length];
			for (int i = 0; i < chars.length; i++) {
				objects[i] = chars[i];
			}
			return objects;
		}
		throw new IllegalArgumentException("%s is not an array".formatted(object));
	}
private Object [ ] boxPrimitiveArray ( Object object ) { if ( object instanceof Object [ ] objects ) { return objects ; } if ( object instanceof double [ ] doubles ) { Double [ ] objects = new Double [ doubles . length ] ; for ( int i = 0 ; i < doubles . length ; i ++ ) { objects [ i ] = doubles [ i ] ; } return objects ; } if ( object instanceof long [ ] longs ) { Long [ ] objects = new Long [ longs . length ] ; for ( int i = 0 ; i < longs . length ; i ++ ) { objects [ i ] = longs [ i ] ; } return objects ; } if ( object instanceof int [ ] ints ) { Integer [ ] objects = new Integer [ ints . length ] ; for ( int i = 0 ; i < ints . length ; i ++ ) { objects [ i ] = ints [ i ] ; } return objects ; } if ( object instanceof short [ ] shorts ) { Short [ ] objects = new Short [ shorts . length ] ; for ( int i = 0 ; i < shorts . length ; i ++ ) { objects [ i ] = shorts [ i ] ; } return objects ; } if ( object instanceof byte [ ] bytes ) { Byte [ ] objects = new Byte [ bytes . length ] ; for ( int i = 0 ; i < bytes . length ; i ++ ) { objects [ i ] = bytes [ i ] ; } return objects ; } if ( object instanceof float [ ] floats ) { Float [ ] objects = new Float [ floats . length ] ; for ( int i = 0 ; i < floats . length ; i ++ ) { objects [ i ] = floats [ i ] ; } return objects ; } if ( object instanceof boolean [ ] bools ) { Boolean [ ] objects = new Boolean [ bools . length ] ; for ( int i = 0 ; i < bools . length ; i ++ ) { objects [ i ] = bools [ i ] ; } return objects ; } if ( object instanceof char [ ] chars ) { Character [ ] objects = new Character [ chars . length ] ; for ( int i = 0 ; i < chars . length ; i ++ ) { objects [ i ] = chars [ i ] ; } return objects ; } throw new IllegalArgumentException ( "%s is not an array" . formatted ( object ) ) ; }
This is not a very 'clean' way of converting it, but primitive
 arrays do not count as Object[] so we must check for every
 array type and convert it to Object[] by boxing it.
This is not a very ' clean ' way of converting it but primitive arrays do not count as Object [] so we must check for every array type and convert it to Object [] by boxing it .