Server crash when flipping a scanned shape card
kerzenhans opened this issue ยท 5 comments
Setup:
Pack: ATM3 v5.6
RFTools 7.15
what I did:
2 shape cards dim 10 20 20
1st card type scan and scanned with scanner.
Then inserted both cards into the composer. Before setting an axis clicking Flip-> crash.
After server restart using the composer resulted in another crash.
The Log is from a singleplayer test I did later to recreate.
http://www.candlekeep.de/temp/shapecardScanFlip.txt
I think I found the cause for the out of bounds exception. Discrete coordinates and the y dimension beeing an even number.
As the flipY() needs a center to flip around. If I flip an Array of coordinates Y[-10,9] (dim 20) if becomes Y'[-9,10], hence the 10 would be out of bounds.
Here's a new log from a dev environment that reflects the changes I just made:
java.lang.ArrayIndexOutOfBoundsException: 4000
at mcjty.rftools.shapes.Formulas$FormulaScan.isInsideInternal(Formulas.java:156) ~[Formulas$FormulaScan.class:?]
at mcjty.rftools.shapes.Formulas$FormulaScan.isInside(Formulas.java:179) ~[Formulas$FormulaScan.class:?]
at mcjty.rftools.shapes.Formulas$FormulaComposition.isInside(Formulas.java:323) ~[Formulas$FormulaComposition.class:?]
at mcjty.rftools.items.builder.ShapeCardItem.getRenderPositions(ShapeCardItem.java:664) ~[ShapeCardItem.class:?]
at mcjty.rftools.shapes.ShapeDataManagerServer.handleWork(ShapeDataManagerServer.java:96) ~[ShapeDataManagerServer.class:?]
at mcjty.rftools.ForgeEventHandlers.onWorldTick(ForgeEventHandlers.java:98) ~[ForgeEventHandlers.class:?]
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_22_ForgeEventHandlers_onWorldTick_WorldTickEvent.invoke(.dynamic) ~[?:?]
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?]
at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179) [EventBus.class:?]
at net.minecraftforge.fml.common.FMLCommonHandler.onPreWorldTick(FMLCommonHandler.java:285) [FMLCommonHandler.class:?]
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:825) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:741) [MinecraftServer.class:?]
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192) [IntegratedServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:590) [MinecraftServer.class:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]