Project: Vibrant Journeys

Project: Vibrant Journeys

13M Downloads

Starfish Entity Causes ArrayIndexOutOfBoundsException

Brittank88 opened this issue ยท 15 comments

commented

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. ๐Ÿ˜„

commented

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.

commented

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.

commented

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).

commented

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

commented

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

commented

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.

commented

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

commented

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

commented

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. โค๏ธ

commented

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.

commented

nvm, I found a way to fix it.

commented

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.

commented

@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.

commented

There are several reasons I keep things open-sourced:

  • People can learn from the source code
  • People can suggest improvements/optimizations
  • People can look through for code that causes issues and notify me
  • GitHub's issue tracker is far better than CurseForge's
  • Let's me directly link Git commits to submitted issues
  • So people know there's nothing malicious

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.

commented

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.