uristmapsj icon indicating copy to clipboard operation
uristmapsj copied to clipboard

ArrayIndexOutOfBoundsException while creating GroupMap

Open emlazzarin opened this issue 8 years ago • 1 comments

The following exception is thrown while running uristmaps.bat in the usual fashion:

C:\uristmaps>java -Dfile.encoding=UTF8 -jar uristmaps.jar
00:00  INFO: Uristmaps 0.3.3
00:00  INFO: [ExportFiles] Resolved date to 00218-01-01
00:00  INFO: Starting full build
00:04  INFO: [BmpConverter] 50% (1/2)
00:06  INFO: [BmpConverter] 100% (2/2)
00:06  INFO: [FileCopier] Copying static resources to output.
00:06  INFO: [BiomeInfo] Reloading biome data from exported image.
00:07  INFO: [BiomeInfo] Done
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.simontuffs.onejar.Boot.run(Boot.java:342)
        at com.simontuffs.onejar.Boot.main(Boot.java:168)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
        at org.uristmaps.StructureGroups.load(StructureGroups.java:100)
        at org.uristmaps.Uristmaps.lambda$main$12(Uristmaps.java:133)
        at org.uristmaps.tasks.AdhocTask.work(AdhocTask.java:47)
        at org.uristmaps.tasks.TaskExecutor.execTask(TaskExecutor.java:170)
        at org.uristmaps.tasks.TaskExecutor.execTask(TaskExecutor.java:159)
        at org.uristmaps.tasks.TaskExecutor.execTask(TaskExecutor.java:159)
        at org.uristmaps.tasks.TaskExecutor.execTask(TaskExecutor.java:159)
        at org.uristmaps.tasks.TaskExecutor.exec(TaskExecutor.java:84)
        at org.uristmaps.Uristmaps.main(Uristmaps.java:163)
        ... 6 more

C:\uristmaps>PAUSE
Press any key to continue . . .

This appears to be the line throwing the exception.

emlazzarin avatar Aug 07 '16 07:08 emlazzarin

The visited array uses the size variable for both it's "length" and "width", so if you have a rectangular shaped map (65 x 129) rather than a square one, it throws an index out of range exception because it either sets 65 for both the x and y index or vice-versa. This only seems to affect advanced world gen parameters when generating a world, not template ones, so making different height and width variables should help, instead of just one "size".

kép_2022-08-03_184237027

kép_2022-08-03_184259259

kép_2022-08-03_184421440

ZsigaBiga avatar Aug 03 '22 16:08 ZsigaBiga