Tech Reborn

Tech Reborn

30M Downloads

[1.11] Error Handling Needed to avoid Crash: java.security.InvalidParameterException: The gem redGarnet could not be found.

securitycopper opened this issue ยท 3 comments

commented

TechReborn Version: 2.0.6.71
Running 'All the mods' pack: https://mods.curse.com/modpacks/minecraft/253707-all-the-mods-2
Description: When using the 'vertical digger', the game crashes and save file is corrupted. The corrupted save file doesn't concern me because my save backs up every 10 min.

Based on the stack trace, it looks like there is an error when mining redGarnet. I would like error handling put into place around techreborn.items.ItemGems.getGemByName(ItemGems.java:28) so that it doesn't crash the game if this line fails. Leaving the brick in place when an error is detected would be a good way in my opinion on handling this error.

Crash Report Included for refrence
`---- Minecraft Crash Report ----

WARNING: coremods are present:
ShetiPhian-ASM (shetiphiancore-1.11.0-3.4.1.jar)
CoreMod (Aroma1997Core-1.11-1.2.0.0.b79.jar)
literalascension (literalascension-1.11-1.0.0.1.jar)
LoadingPlugin (Bloodmoon-MC1.11-1.5.jar)
FMLPlugin (InventoryTweaks-1.62-dev-74.jar)
Do not report to Forge! Remove FoamFix (or replace with FoamFix-Lawful) and try again. (foamfix-0.4.2-anarchy.jar)
ForgelinPlugin (Forgelin-1.1.0.jar)
llibrary (llibrary-1.7.2-1.11.jar)
LoadingPlugin (ResourceLoader-MC1.11-1.5.1.jar)
Contact their authors BEFORE contacting forge

// Uh... Did I do that?

Time: 12/18/16 12:51 AM
Description: Ticking block entity

java.security.InvalidParameterException: The gem redGarnet could not be found.
at techreborn.items.ItemGems.getGemByName(ItemGems.java:28)
at techreborn.items.ItemGems.getGemByName(ItemGems.java:32)
at techreborn.blocks.BlockOre.getDrops(BlockOre.java:92)
at techreborn.blocks.BlockOre.getDrops(BlockOre.java:36)
at de.ellpeck.actuallyadditions.mod.tile.TileEntityMiner.mine(TileEntityMiner.java:129)
at de.ellpeck.actuallyadditions.mod.tile.TileEntityMiner.updateEntity(TileEntityMiner.java:95)
at de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.func_73660_a(TileEntityBase.java:230)
at net.minecraft.world.World.func_72939_s(World.java:1827)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:621)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:720)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:624)
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:149)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482)
at java.lang.Thread.run(Unknown Source)

`

commented

Additional Thought. I suggested leaving the error brick in place, however I think it would be unreasonable to ask the player to retrieve the block. Instead, removing the brick at point mind and then placing the full brick item in the digger's inventory will then allow the player to retrieve the error bricks.

commented

Ah, it looks like I missed another one of them. Perhaps what we can do is convert any camelCase strings to snake_case as well so either works

commented

Fixed in next update