AbyssalCraft

AbyssalCraft

20M Downloads

[1.9] Crash during entity spawning - With Vampirism

maxanier opened this issue ยท 3 comments

commented

Hello,

I have been informed about a really strange crash which occurs if both Vampirism and AbyssalCraft are installed (Issue.
http://paste.ee/p/ELARk

After some investigation it looks like it has to do with Minecraft's EnumCreatureType. Vampirism adds two EnumCreatureType using Forge's methods (EnumHelper#addCreatureType()), which are definitively intended to be used.
Thereby it increases the size of EnumCreatureType to 6. Logging the values (EnumCreatureType#values()) at the end of Vampirism's pre init results in "EnumCreatureTypes 6 [MONSTER, CREATURE, AMBIENT, WATER_CREATURE, VAMPIRISM_HUNTER, VAMPIRISM_VAMPIRE]".

During Minecraft's spawning process the games iterates over all values and with this indirectly invokes BiomeGenBase#getSpawnableList(EnumCreatureType creatureType). Within this method there is a switch statement which seems to throw the ArrayIndexOutOfBoundsException when the iteration is at the 5th element (index 4) of EnumCreatureType#values().

public List<BiomeGenBase.SpawnListEntry> getSpawnableList(EnumCreatureType creatureType)  
    {  
        switch (creatureType)  
        {  
            case MONSTER:  
                return this.spawnableMonsterList;  
            case CREATURE:  
                return this.spawnableCreatureList;  
            case WATER_CREATURE:  
                return this.spawnableWaterCreatureList;  
            case AMBIENT:  
                return this.spawnableCaveCreatureList;  
            default:  
                return Collections.<BiomeGenBase.SpawnListEntry>emptyList();  
        }  
    }

I took a short look at AbyssalCraft's source code, but did not find anything that could be related to this, although it has to have some kind of impact, since the game does not crash without it and the above mentioned switch statement is also called without it.

Maybe you have a idea what is causing this issue? (By the way: It does NOT crash in my deobfuscated development environment.

commented

#77 Was the issue that was initially myself misdiagnosing the issue before hand. Just to bring in that information.

commented

I checked #77 as well, and I can confirm that the game crashes when either AbyssalCraft or Evilcraft is installed together with Vampirism. If neither AbyssalCraft and Evilcraft is installed the game does not crash.
It looks like it is either the same problem with both mods or there is a Forge bug that is triggered by AbysallCraft and Evilcraft.
Of cause there is a tiny chance that Vampirism is causing this issue as well ;)

So if you don't what's causing this issue, I will open a Forge issue.

commented

Solved the problem. It was not AbyssalCraft's mistake, it only triggered the crash.
More information in the discussion of this issue