RayTrace082 / untamedwilds

GNU General Public License v3.0
14 stars 11 forks source link

Crash when Hovering over certain items [tooltip issue] #233

Open Davoleo opened 1 year ago

Davoleo commented 1 year ago

When hovering over a certain item from this mod in REI the game crashes, this also breaks REI's tooltip search with the same exceptions, but they don't terminate the game since they're not on the main thread

Minecraft Version: 1.18.2 Untamed Wilds Version: 2.4.0 REI Version: 8.3.594

Logs: https://paste.atlauncher.com/view/a605091d-3201-49ee-926d-2f2fa895da1c Stacktrace Excerpt:

Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 8 out of bounds for length 8
[20/05/2023 23:39:02 PM]    at MC-BOOTSTRAP/com.google.common@31.0.1-jre/com.google.common.collect.RegularImmutableList.get(RegularImmutableList.java:77)
[20/05/2023 23:39:02 PM]    at TRANSFORMER/untamedwilds@2.4.0/untamedwilds.util.EntityDataHolder.getName(EntityDataHolder.java:82)
[20/05/2023 23:39:02 PM]    at TRANSFORMER/untamedwilds@2.4.0/untamedwilds.util.EntityUtils.getVariantName(EntityUtils.java:353)
[20/05/2023 23:39:02 PM]    at TRANSFORMER/untamedwilds@2.4.0/untamedwilds.item.MobBottledItem.m_7626_(MobBottledItem.java:46)
[20/05/2023 23:39:02 PM]    at TRANSFORMER/minecraft@1.18.2/net.minecraft.world.item.ItemStack.m_41786_(ItemStack.java:593)
[20/05/2023 23:39:02 PM]    at TRANSFORMER/minecraft@1.18.2/net.minecraft.world.item.ItemStack.m_41651_(ItemStack.java:629)
[20/05/2023 23:39:02 PM]    at TRANSFORMER/roughlyenoughitems@8.3.594/me.shedaniel.rei.plugin.client.entry.ItemEntryDefinition.tryGetItemStackToolTip(ItemEntryDefinition.java:226)
[20/05/2023 23:39:02 PM]    at TRANSFORMER/roughlyenoughitems@8.3.594/me.shedaniel.rei.plugin.client.entry.ItemEntryDefinition$ItemEntryRenderer.getTooltip(ItemEntryDefinition.java:371)
[20/05/2023 23:39:02 PM]    at TRANSFORMER/roughlyenoughitems@8.3.594/me.shedaniel.rei.impl.common.entry.AbstractEntryStack.getTooltip(AbstractEntryStack.java:211)
[20/05/2023 23:39:02 PM]    ... 8 more

Extra Notes: I'm not able to reproduce it in a new world with only Untamed Wilds and REI or Untamed Wilds alone, so I'm thinking it has something to do with existing worlds and some saved information that in some way is invalid and results in the out of bounds access, although I don't know much else, furthermore I think the crash happened while hovering over some of the eggs, so it might be related to the tooltips that in a new world are all set to '???'

RayTrace082 commented 1 year ago

I can pretty much guarantee it is an UntamedWilds issue I save the variants as numbers (0 to n), but positions start from 1, something got lost in the translation for REI and it crashes

Doesn't seem anything too bad

SettingDust commented 1 year ago

I save the variants as numbers (0 to n), but positions start from 1

Which part of code caused it start from 1?

SettingDust commented 1 year ago

Should be fixed with https://www.curseforge.com/minecraft/mc-mods/mod-compat-fixes 0.5.0