SlimeKnights / IguanaTweaksTConstruct

The old IguanaTweaks for TCon for 1.7.10. Not further developed, check out TinkersToolLeveling for 1.10+
https://github.com/SlimeKnights/TinkersToolLeveling
26 stars 28 forks source link

Client crash on 2nd tool part replacement when tool has redstone modifier from XP upgrade #136

Open twenisch opened 9 years ago

twenisch commented 9 years ago

I am getting a client crash when attempting to replace two tool parts on a tool that has a redstone modifier that was added via an XP upgrade. Since the modifier came from XP, there isn't actually any redstone on the item. The first part replacement works correctly. But, when I place the second part into the tool table, a crash occurs as soon as the part is placed in the table.

The crash is due to an ArrayIndexOutOfBoundsException at ReplacementLogic.java:333 (in mod version 2.1.4).

Looking at the code, at head, the offending line is probably ReplacementLogic.java:345. When I replace the first tool part, reapplyRedstone() pulls the redstone modifier off the item, but since there actually isn't any redstone on the item, qLvl==0 and the modRedstone.modify() on line 357 never gets called, so the redstone tag never gets re-added to the item. Somehow, when I attempt to replace the second part, this leads to the redstone tag not having an IntArray (or an empty one) as its value and a crash at the array access on line 345.

If I add one redstone to the tool before attempting the second replacement, the crash doesn't happen.

bonii-xx commented 9 years ago

Full crashlog.

twenisch commented 9 years ago

crashlog follows.

---- Minecraft Crash Report ---- // Uh... Did I do that?

Time: 5/5/15 7:39 PM Description: Updating screen events

java.lang.ArrayIndexOutOfBoundsException: 0 at iguanaman.iguanatweakstconstruct.replacing.ReplacementLogic.reapplyRedstone(ReplacementLogic.java:333) at iguanaman.iguanatweakstconstruct.replacing.ReplacementLogic.exchangeToolPart(ReplacementLogic.java:185) at iguanaman.iguanatweakstconstruct.replacing.ModPartReplacement.modify(ModPartReplacement.java:183) at tconstruct.library.crafting.ModifyBuilder.modifyItem(ModifyBuilder.java:34) at tconstruct.tools.logic.ToolStationLogic.buildTool(ToolStationLogic.java:84) at tconstruct.tools.logic.ToolStationLogic.func_70296_d(ToolStationLogic.java:65) at net.minecraft.inventory.Slot.func_75218_e(Slot.java:83) at net.minecraft.inventory.Slot.func_75215_d(Slot.java:78) at net.minecraft.inventory.Container.func_75144_a(SourceFile:222) at net.minecraft.client.multiplayer.PlayerControllerMP.func_78753_a(PlayerControllerMP.java:419) at codechicken.nei.guihook.GuiContainerManager.handleSlotClick(GuiContainerManager.java:504) at net.minecraft.client.gui.inventory.GuiContainer.func_146984_a(GuiContainer.java:638) at net.minecraft.client.gui.inventory.GuiContainer.public_func_146984_a(GuiContainer.java) at codechicken.nei.guihook.DefaultSlotClickHandler.callHandleMouseClick(DefaultSlotClickHandler.java) at codechicken.nei.guihook.DefaultSlotClickHandler.handleSlotClick(DefaultSlotClickHandler.java:17) at codechicken.nei.guihook.GuiContainerManager.handleMouseClick(GuiContainerManager.java:453) at net.minecraft.client.gui.inventory.GuiContainer.managerHandleMouseClick(GuiContainer.java) at net.minecraft.client.gui.inventory.GuiContainer.func_146286_b(GuiContainer.java:607) at net.minecraft.client.gui.GuiScreen.func_146274_d(GuiScreen.java:306) at net.minecraft.client.gui.inventory.GuiContainer.func_146274_d(GuiContainer.java) at net.minecraft.client.gui.GuiScreen.func_146269_k(GuiScreen.java:268) at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1628) at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:961) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:887) at net.minecraft.client.main.Main.main(SourceFile:148) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

A detailed walkthrough of the error, its code path and all known details is as follows:

-- Head -- Stacktrace: at iguanaman.iguanatweakstconstruct.replacing.ReplacementLogic.reapplyRedstone(ReplacementLogic.java:333) at iguanaman.iguanatweakstconstruct.replacing.ReplacementLogic.exchangeToolPart(ReplacementLogic.java:185) at iguanaman.iguanatweakstconstruct.replacing.ModPartReplacement.modify(ModPartReplacement.java:183) at tconstruct.library.crafting.ModifyBuilder.modifyItem(ModifyBuilder.java:34) at tconstruct.tools.logic.ToolStationLogic.buildTool(ToolStationLogic.java:84) at tconstruct.tools.logic.ToolStationLogic.func_70296_d(ToolStationLogic.java:65) at net.minecraft.inventory.Slot.func_75218_e(Slot.java:83) at net.minecraft.inventory.Slot.func_75215_d(Slot.java:78) at net.minecraft.inventory.Container.func_75144_a(SourceFile:222) at net.minecraft.client.multiplayer.PlayerControllerMP.func_78753_a(PlayerControllerMP.java:419) at codechicken.nei.guihook.GuiContainerManager.handleSlotClick(GuiContainerManager.java:504) at net.minecraft.client.gui.inventory.GuiContainer.func_146984_a(GuiContainer.java:638) at net.minecraft.client.gui.inventory.GuiContainer.public_func_146984_a(GuiContainer.java) at codechicken.nei.guihook.DefaultSlotClickHandler.callHandleMouseClick(DefaultSlotClickHandler.java) at codechicken.nei.guihook.DefaultSlotClickHandler.handleSlotClick(DefaultSlotClickHandler.java:17) at codechicken.nei.guihook.GuiContainerManager.handleMouseClick(GuiContainerManager.java:453) at net.minecraft.client.gui.inventory.GuiContainer.managerHandleMouseClick(GuiContainer.java) at net.minecraft.client.gui.inventory.GuiContainer.func_146286_b(GuiContainer.java:607) at net.minecraft.client.gui.GuiScreen.func_146274_d(GuiScreen.java:306) at net.minecraft.client.gui.inventory.GuiContainer.func_146274_d(GuiContainer.java) at net.minecraft.client.gui.GuiScreen.func_146269_k(GuiScreen.java:268)

-- Affected screen -- Details: Screen name: tconstruct.tools.gui.ToolStationGui

-- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityClientPlayerMP['BaconTabernacle'/2827, l='MpServer', x=-116.17, y=64.62, z=57.47]] Chunk stats: MultiplayerChunkCache: 441, 441 Level seed: 0 Level generator: ID 05 - Highlands, ver 0. Features enabled: false Level generator options: Level spawn location: World: (-107,64,83), Chunk: (at 5,4,3 in -7,5; contains blocks -112,0,80 to -97,255,95), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511) Level time: 736712 game time, 752423 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false Forced entities: 93 total; [EntityClientPlayerMP['BaconTabernacle'/2827, l='MpServer', x=-116.17, y=64.62, z=57.47], EntityCreeper['Creeper'/5126, l='MpServer', x=-83.50, y=25.00, z=14.50], EntityCreeper['Creeper'/5127, l='MpServer', x=-82.50, y=25.00, z=14.50], EntityZombie['Zombie'/4620, l='MpServer', x=-94.50, y=17.00, z=117.50], EntityZombie['Zombie'/4621, l='MpServer', x=-94.34, y=20.00, z=123.16], EntityZombie['Zombie'/4622, l='MpServer', x=-93.56, y=17.00, z=119.56], EntityCreeper['Creeper'/3344, l='MpServer', x=-90.50, y=38.00, z=22.50], EntitySheep['Sheep'/274, l='MpServer', x=-149.66, y=69.00, z=12.28], EntityMobEnderman['Enderman'/3346, l='MpServer', x=-79.50, y=38.00, z=25.50], EntitySheep['Sheep'/275, l='MpServer', x=-155.84, y=76.00, z=5.03], EntityCow['Cow'/276, l='MpServer', x=-144.63, y=65.00, z=15.25], EntityPig['Pig'/277, l='MpServer', x=-154.69, y=70.00, z=14.50], EntityCow['Cow'/279, l='MpServer', x=-149.94, y=65.00, z=87.97], EntityPig['Pig'/281, l='MpServer', x=-149.47, y=68.00, z=108.66], EntityConcussionCreeper['Concussion Creeper'/4902, l='MpServer', x=-168.50, y=32.00, z=37.50], EntityHorse['Horse'/299, l='MpServer', x=-130.03, y=73.00, z=9.06], EntitySquid['Squid'/303, l='MpServer', x=-142.50, y=61.00, z=69.65], EntityBat['Bat'/3119, l='MpServer', x=-194.25, y=13.10, z=4.75], EntityMobEnderman['Enderman'/2611, l='MpServer', x=-59.00, y=22.00, z=141.41], EntityBat['Bat'/4927, l='MpServer', x=-168.38, y=22.30, z=92.25], EntityBat['Bat'/4929, l='MpServer', x=-119.91, y=49.01, z=127.81], EntityFallenKnight['Fallen Knight'/4419, l='MpServer', x=-125.03, y=20.00, z=117.44], EntityBat['Bat'/3908, l='MpServer', x=-66.63, y=37.74, z=-13.35], EntityPig['Pig'/327, l='MpServer', x=-129.50, y=70.00, z=11.47], EntityCow['Cow'/328, l='MpServer', x=-110.94, y=64.00, z=-0.84], EntitySkeleton['Skeleton'/3656, l='MpServer', x=-99.31, y=23.00, z=21.50], EntityCow['Cow'/329, l='MpServer', x=-113.63, y=72.00, z=29.38], EntityCreeper['Creeper'/332, l='MpServer', x=-123.14, y=41.00, z=74.10], EntityBat['Bat'/333, l='MpServer', x=-116.63, y=38.10, z=75.50], EntityZombie['Zombie'/4949, l='MpServer', x=-135.50, y=40.00, z=86.50], EntityXPOrb['Experience Orb'/345, l='MpServer', x=-127.94, y=39.25, z=158.13], EntityConcussionCreeper['Concussion Creeper'/3424, l='MpServer', x=-120.50, y=38.00, z=77.25], EntityCow['Cow'/357, l='MpServer', x=-102.50, y=63.00, z=11.50], EntitySheep['Sheep'/358, l='MpServer', x=-111.47, y=64.00, z=6.06], EntityHorse['Horse'/359, l='MpServer', x=-97.44, y=71.00, z=16.59], EntityCow['Cow'/360, l='MpServer', x=-105.72, y=69.00, z=18.47], EntityBat['Bat'/875, l='MpServer', x=-123.72, y=29.10, z=76.25], EntitySkeleton['Skeleton'/3181, l='MpServer', x=-113.50, y=31.00, z=20.50], EntityEnderminy['Enderminy'/366, l='MpServer', x=-107.59, y=74.00, z=72.59], EntityConcussionCreeper['Concussion Creeper'/3696, l='MpServer', x=-97.50, y=58.00, z=114.50], EntityZombie['Zombie'/4211, l='MpServer', x=-140.50, y=16.00, z=68.50], EntityXPOrb['Experience Orb'/117, l='MpServer', x=-229.59, y=19.25, z=110.91], EntitySkeleton['Skeleton'/2682, l='MpServer', x=-40.50, y=26.00, z=130.50], EntityTrail['unknown'/637, l='MpServer', x=-116.17, y=64.62, z=57.47], EntitySlime['Slime'/1408, l='MpServer', x=-47.38, y=13.00, z=120.63], EntityCreeper['Creeper'/3712, l='MpServer', x=-76.00, y=27.00, z=87.34], EntityCreeper['Creeper'/3458, l='MpServer', x=-129.47, y=35.00, z=126.34], EntityHorse['Horse'/387, l='MpServer', x=-81.28, y=70.00, z=12.28], EntityCreeper['Creeper'/3718, l='MpServer', x=-79.50, y=20.00, z=22.50], EntityCow['Cow'/392, l='MpServer', x=-88.53, y=63.00, z=16.69], EntityZombie['Zombie'/3721, l='MpServer', x=-109.13, y=44.00, z=10.69], EntitySkeleton['Skeleton'/3722, l='MpServer', x=-118.94, y=44.00, z=18.47], EntitySpider['Spider'/3723, l='MpServer', x=-114.09, y=44.00, z=12.28], EntityZombie['Zombie'/400, l='MpServer', x=-81.75, y=49.00, z=132.25], EntityXPOrb['Experience Orb'/408, l='MpServer', x=-72.91, y=41.25, z=-35.41], EntityZombie['Zombie'/4762, l='MpServer', x=-85.50, y=29.00, z=116.50], EntityGoblin['Hobgoblin'/417, l='MpServer', x=-76.09, y=68.00, z=115.53], EntityItem['item.item.rottenFlesh'/418, l='MpServer', x=-75.69, y=65.13, z=118.66], EntityCreeper['Creeper'/3491, l='MpServer', x=-142.50, y=20.00, z=70.50], EntityBat['Bat'/4260, l='MpServer', x=-96.43, y=20.99, z=15.20], EntitySheep['Sheep'/440, l='MpServer', x=-56.50, y=71.00, z=8.50], EntitySheep['Sheep'/441, l='MpServer', x=-60.47, y=70.00, z=11.53], EntitySheep['Sheep'/442, l='MpServer', x=-56.13, y=71.00, z=9.91], EntitySheep['Sheep'/443, l='MpServer', x=-63.50, y=86.00, z=11.50], EntityBat['Bat'/1467, l='MpServer', x=-153.60, y=38.17, z=126.42], EntitySheep['Sheep'/444, l='MpServer', x=-49.28, y=70.00, z=20.16], EntitySheep['Sheep'/453, l='MpServer', x=-47.38, y=70.00, z=16.03], EntitySheep['Sheep'/454, l='MpServer', x=-44.50, y=69.00, z=18.50], EntitySheep['Sheep'/455, l='MpServer', x=-48.50, y=70.00, z=16.28], EntitySkeleton['Skeleton'/1995, l='MpServer', x=-188.50, y=11.00, z=-4.50], EntityBat['Bat'/4555, l='MpServer', x=-119.06, y=38.25, z=101.66], EntityBat['Bat'/2508, l='MpServer', x=-111.28, y=51.10, z=134.31], EntityBat['Bat'/4556, l='MpServer', x=-123.69, y=38.13, z=101.98], EntityZombie['Zombie'/4050, l='MpServer', x=-72.84, y=31.00, z=21.66], EntityZombie['Zombie'/4052, l='MpServer', x=-71.50, y=31.00, z=22.50], EntityBat['Bat'/2267, l='MpServer', x=-74.30, y=21.21, z=24.75], EntityPig['Pig'/220, l='MpServer', x=-179.78, y=69.00, z=39.50], EntityXPOrb['Experience Orb'/476, l='MpServer', x=-11.50, y=15.25, z=72.50], EntityPig['Pig'/221, l='MpServer', x=-176.97, y=61.00, z=50.38], EntityBat['Bat'/2013, l='MpServer', x=-135.25, y=48.10, z=133.28], EntityPig['Pig'/223, l='MpServer', x=-191.97, y=63.00, z=97.09], EntityCreeper['Creeper'/2786, l='MpServer', x=-159.28, y=18.00, z=114.28], EntitySpider['Spider'/4079, l='MpServer', x=-77.06, y=21.00, z=24.22], EntityZombie['Zombie'/4338, l='MpServer', x=-117.50, y=26.00, z=74.50], EntitySkeleton['Skeleton'/3828, l='MpServer', x=-106.50, y=44.00, z=21.50], EntitySheep['Sheep'/245, l='MpServer', x=-165.44, y=67.00, z=3.34], EntityItem['item.item.plasticPlant5'/248, l='MpServer', x=-162.13, y=17.13, z=22.13], EntityItem['item.item.plasticPlant5'/249, l='MpServer', x=-164.19, y=18.13, z=25.81], EntitySkeleton['Skeleton'/2810, l='MpServer', x=-76.94, y=38.00, z=19.44], EntityCow['Cow'/251, l='MpServer', x=-168.53, y=66.00, z=19.53], EntityHorse['Horse'/252, l='MpServer', x=-165.41, y=64.00, z=70.81], EntityPig['Pig'/253, l='MpServer', x=-165.88, y=64.00, z=96.28], EntityZombie['Zombie'/4607, l='MpServer', x=-69.50, y=39.00, z=124.50]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Non-integrated multiplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.func_72914_a(WorldClient.java:373) at net.minecraft.client.Minecraft.func_71396_d(Minecraft.java:2432) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:909) at net.minecraft.client.main.Main.main(SourceFile:148) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

-- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Mac OS X (x86_64) version 10.10.2 Java Version: 1.8.0_31, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 1223572536 bytes (1166 MB) / 2242428928 bytes (2138 MB) up to 4260102144 bytes (4062 MB) Mod Pack: Unknown / None LiteLoader Mods: 1 loaded mod(s)

Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: []
Current Language: English (US)
Profiler Position: N/A (disabled)
Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Anisotropic Filtering: Off (1)
bonii-xx commented 9 years ago

It does not matter if the redstone was added manually or via levelup. It's the same. It also doesn't happen for anybody else. I can only assume that either something broke the data on your tool, or some other mod is messing with it.

bonii-xx commented 9 years ago

I see you have tinkers modifiers in there too. Might be there's some interaction that causes this.

twenisch commented 9 years ago

Good thought on tinker's modifiers. I'll pull that out and see if I can reproduce the crash without it. Might be there is a broken code path in there that strips the "redstone" tag off the tool.