Darkhax-Minecraft / WAWLA

What Are We Looking At (WAWLA) is a mod aimed and drawing more attention to providing in-game documentation for players.
GNU Lesser General Public License v2.1
32 stars 22 forks source link

Crash when looking at a Tinkers' Mechworks Signal Bus #36

Closed KnightMiner closed 8 years ago

KnightMiner commented 8 years ago

Whenever I look at a signal bus from Tinkers' Mechworks, the game crashes. This happens even when WAILA is hidden, along with when all WAWLA options are turned off. It works when I remove WAWLA, so I assume the issue is here.

Here is a crash report, I'm using the latest version of all relevant mods, and just the minimum list of mods to reproduce the bug. Happens on both the latest (10.13.4.1566) and recommended (10.13.4.1558) versions of Forge.

Darkhax commented 8 years ago

This issue is related to two issues within Waila. The first issue, is that Waila doesn't stop running in the background if the player has it disabled, it only prevents the tooltip from rendering. This is actually a pretty big waste of the players system resources, and the servers resources, if applicable.

The second issue, I believe comes from an oversight in the Waila code. When a player looks at a block, if Waila has a data provider registered to that block, the Waila mod will request some data about that block. In this case, Wawla requests basic data about all blocks in the game, for the generic features, such as light levels, harvestability, hardness, blast resistance and so on. I have actually loaded up the code, and have found exactly where this crash is coming from, and can show how to fix it, however this would be on ProfMobius's end to fix. A few of the Waila Addon developers were talking about writing a core mod to rewrite parts of Waila to fix these sorts of bugs, however nothing has been worked out yet.

Crash Source

public Message0x01TERequest (TileEntity ent, HashSet<String> keys) {

    this.dim = ent.getWorldObj().provider.dimensionId;
    this.posX = ent.xCoord;
    this.posY = ent.yCoord;
    this.posZ = ent.zCoord;
    this.keys = keys;
}

How to Fix

public Message0x01TERequest (TileEntity ent, HashSet<String> keys) {

    if (ent != null) {

        this.dim = ent.getWorldObj().provider.dimensionId;
        this.posX = ent.xCoord;
        this.posY = ent.yCoord;
        this.posZ = ent.zCoord;
        this.keys = keys;
    }
}

Additional code may be required*

Darkhax commented 8 years ago

My patch in 1b23afd was enough to fix the issue. (Tested with the mechworks bus), however the underlying instability within Waila still exists. A new release will be published soon.