OrderedChaos-Dev / ProjectVibrantJourneys

Minecraft mod that expands in all directions
37 stars 15 forks source link

Starfish Entity Causes ArrayIndexOutOfBoundsException #142

Closed Brittank88 closed 3 years ago

Brittank88 commented 3 years ago

Forge 36.1.16 Project Vibrant Journeys 1.16.5-3.1.0BETA OptiFine 1.16.5 HD U G7 (Might be related, the crash does occur with entity rendering)

Crash Report

I understand Optifine doesn't leave much room for fixes in most cases, however, no other entity causes a crash like this so if there is some workaround or fix that is possible, that would be fantastic! Thanks for your time. 😄

OrderedChaos-Dev commented 3 years ago

Hmmm ok so I honestly have no idea what could be causing this. There's nothing special about starfish rendering and I don't know why it's just starfish since all the other mobs are rendered the exact same way.

Brittank88 commented 3 years ago

I understand, it is a very odd thing. For now, I've used InControl to prevent the Starfish entity from ever spawning into the world, but I'd love a more permanent solution (on the off chance someone summons one and breaks everyone's clients lol).

Brittank88 commented 3 years ago

Hi @OrderedChaos-Dev, just letting you know that I've doubly proven the starfish to be extremely problematic (no idea why). See: https://www.curseforge.com/minecraft/mc-mods/advanced-compass/issues/10

Brittank88 commented 3 years ago

Huh, that Advanced Compass crash just happened again but with your frog entity.

OrderedChaos-Dev commented 3 years ago

Unfortunately the Advanced Compass mod is not open-sourced so I can't read through the source code to find what might be causing the issues. I think it's running into issues trying to create a "head" icon for the compass, but my mobs use Minecraft's segmented models, which have no dedicated head part (like the starfish).

I also found this in the debug log:

[11Jun2021 23:16:45.300] [Render thread/INFO] [advancedcompass/]: Trying to create icon for: projectvibrantjourneys:night_bat
[11Jun2021 23:16:45.311] [Render thread/INFO] [STDOUT/]: [dlovin.advancedcompass.events.EntityEvents:drawModel:636]: Error attempting to render head bits for BatEntity

The projectvibrantjourneys:night_bat is an exact copy of the vanilla bat that is registered to be able to spawn above sea level, unlike vanilla bats. It uses the vanilla model so I don't know why Advanced Compass would run into an issue with it. You can also try testing it with the mod's small spiders, which also uses the vanilla model but scaled down. Either way, if Advanced Compass allows, you'd probably want to blacklist all the mobs from this mod since they'll clutter the compass given how many can spawn in an area.

Brittank88 commented 3 years ago

Thanks for getting back to me! It is kinda odd that AC is struggling like this. It's even more odd that they can't replicate it: image

Brittank88 commented 3 years ago

I've referred them to your message, maybe it'll provide them with some insight: https://www.curseforge.com/minecraft/mc-mods/advanced-compass/issues/10

Brittank88 commented 3 years ago

Oh and just for clarification, the initial crash that I reported in this issue was not caused by AC, it's still a separate issue that requires attention (if possible).

Thanks for your time and consistent responses. ❤️

DmitryLovin commented 3 years ago

Error attempting to render head bits ^ is not an error which cause crash, it is catched exception, nothing wrong with it. I really have no clue why his jre is crashing.

DmitryLovin commented 3 years ago

nvm, I found a way to fix it.

Brittank88 commented 3 years ago

Awesome! From what I can gather with my pea-sized knowledge of all of this, there's some render call with possibly malformed data that really messes with OpenGL.

Also, this occurred across two different Nvidia driver updates, so despite it occurring in nvoglv64.dll I don't think it's related to the drivers.

Brittank88 commented 3 years ago

@DmitryLovin This is unrelated to the issue but I am generally curious - what's the motivation behind not open-sourcing a project like Advanced Compass? I ask because I aspire to be a mod dev one day and would like to know if open-sourcing has any hidden downsides to be aware of.

I guess actually you both would have some valuable experiences relating to a question like this.

OrderedChaos-Dev commented 3 years ago

There are several reasons I keep things open-sourced:

I learned a lot on mod development from reading through the source codes of other mods and I hope people can learn from mine. The only downsides is that everyone can see any piece of code that is written lazily, which is basically the entire 1.12 version of this mod.

Brittank88 commented 3 years ago

GitHub's issue tracker is far better than CurseForge's

Oh my god, I could not agree with this more, the CF issue tracker feels terrible compared to the GH one.

I understand, though, that downside doesn't seem like much of a downside, because it ties into that whole improvement/optimisation point. I guess the only downside part of it is if people learn the "lazy way" from code, and it causes issues down the line.

Also, I despise when people do selfish or rash things like what you linked to. I get it, it's their property, but it makes no sense to tear it all down like that basically with the goal of inconveniencing others. It's very short-sighted and I'm glad to only know of a handful of cases in MC modding ever where something like this has happened.

OrderedChaos-Dev commented 3 years ago

Ok so after a while, I'm still unsure what could be causing this crash. My guess is that the mobs were creating a new texture instance every time they were rendered, which is not what they're supposed to do. The latest version fixes that, so hopefully this fixes your crash.