connor135246 / Campfire-Backport

Backports Minecraft 1.14/1.16 campfires to 1.7.10
GNU General Public License v3.0
9 stars 4 forks source link

Ticking block entity #5

Closed KibaTheBarbarian closed 3 years ago

KibaTheBarbarian commented 3 years ago

https://pastebin.com/atBUNAuq a crash i got

connor135246 commented 3 years ago

Block data value: 10

Odd, I'm not sure how you managed to have a campfire block with a data value of 10. Did you perhaps use an item from another mod to rotate the campfire block?

KibaTheBarbarian commented 3 years ago

only mod i think that do that is Village Names

AstroTibs commented 3 years ago

That might be my fault. Village Names 4 generates your campfires in Taiga villages. To save on complexity, I used a function that determines sign rotation meta when determining campfire rotation meta. The issue is that I have isHangingOnWall accidentally flagged as false, which of course is going to result in values between 0 and 15.

The thing I'm confused about is why this has never happened in all my testing—it should be crashing most of the time?

I'm fixing this issue on my end right now. But as a failsafe, can you wrap or clamp OOB render/other values wherever possible?

connor135246 commented 3 years ago

I had something there that would prevent a crash for metas 0 and 1, but nothing else. Maybe those were just more common? But yeah I'll make sure to clamp them.

AstroTibs commented 3 years ago

I took another look at Kiba's comment on your curseforge page and noticed he mentioned a block entity.

I now think I understand the reason that I never got a crash before.

My mod may have been generating tons of campfires with meta > 5, but it wouldn't cause a crash unless the campfire was then broken and dropped. (This is a hypothesis)

Village generation causes village components to re-generate on top of themselves a few times. That, combined with random worldgen decoration, may have caused the block to be broken and dropped, after the village was created—which is comparatively rare.