LordFokas / StargateTech2

http://mod-stargatetech.com
Other
29 stars 10 forks source link

Respawn Crash #78

Closed Matchlighter closed 10 years ago

Matchlighter commented 10 years ago

Their seems to be a bug where TileEntities render before the world is fully loaded. This result in Block block = Block.blocksList[w.getBlockId(pos.x, pos.y, pos.z)]; in BaseTESR returning null and raising and NPE a few lines down.

LordFokas commented 10 years ago

It has been detected a few days ago. I wasn't sure what was causing it. Are you sure it's because the chunk isn't fully loaded?

Matchlighter commented 10 years ago

The only way is if block is null, which either means your block isn't registered, or getBlockId() is returning 0.

LordFokas commented 10 years ago

what is happening is that it's returning 0 (because most times I'm getting the block 2 blocks above the TE), but 0 should be Forge's fake air block :|

Matchlighter commented 10 years ago

In 1.7.2+, yes, but I don't think there is anything like that in 1.6.4 - you have to do a null check. Although it doesn't normally crash... A null check always seems to work when I want to check if it's air.

Edit: Ok, there is something in 1.6.4. I did not know that. So this is weird.

LordFokas commented 10 years ago

Ok, now that we agree, how could we possibly fix that? Null check and fall back to air / stone block?

Matchlighter commented 10 years ago

That's what I would say.

LordFokas commented 10 years ago

Potentially fixed here: https://github.com/LordFokas/StargateTech2/commit/f4eb3acfb9bfa219bb9c62d55cfe6ad94c0ea82b

Matchlighter commented 10 years ago

Oh, eh, my guess is it should be fixed. I'll pull and try it when I get a chance.

LordFokas commented 10 years ago

I'll close it for now. If it isn't gone let me know and I'll reopen.