TerraFirmaCraft

TerraFirmaCraft

2M Downloads

Crash when crafting with TFC tools on primaltech's workstumps

ChaosTheLegend opened this issue ยท 5 comments

commented

Description:
I tried to craft a TFC sandwich on primaltech's workstump
the game crashed, world got corrupted...

upon further inspection, crash happens every time someone tries to craft something on workstump(both tiers) with TFC tool in the recipe
crash does not happen with tools from other mods(tested with Immersive engineering)

To Reproduce:

  1. Craft anything involving a TFC tool in the recipe on a workstump

Modpack:
custom pack with 40-ish mods

TFC version - 1.7.6.164
primaltech version - 0.3.5

Modlist:
modlist

Log:
latest.log

Crash report:
crash-2020-10-28_07.35.53-server.txt

commented

If you want to re-enter your world, you can go to config/forge.cfg and flip removeErroringTileEntities=false to true.

commented

I believe I know what's happening here:

In vanilla, calling CraftingManger#getRemainingItems is done in exactly one place, and it is guarded by two forge hooks:

net.minecraftforge.common.ForgeHooks.setCraftingPlayer(thePlayer);
NonNullList<ItemStack> nonnulllist = CraftingManager.getRemainingItems(this.craftMatrix, thePlayer.world);
net.minecraftforge.common.ForgeHooks.setCraftingPlayer(null);

Resulting in the fact that ForgeHooks.getCraftingPlayer() is not null during the process of getting the remaining items. TFC's shapeless damage recipe uses this fact - damaging items requires access to a player (e.g. to test if the player is in creative mode).

In Primal Tech, it calls CraftingManager.getRemainingItems without setting the crafting player at all, and moreover, does not seem to have any access to a player at the point where this is called. So while I strongly think this is their issue and should be resolved as such, we can also assume that other modders may not properly handle the crafting player and also screw this up.

So:

  • Please also report this to primal tech with the description above of what they should be doing to set the crafting player.
  • We'll need to add null checks to everything that uses this method I guess.
commented

I fixed the world by removing and reinstalling primaltech. Few items got deleted, but I'm not playing seriously anyways, so not a big deal

commented

Update from vadis(primaltech dev):
image

so yeah... rather null checks or finding a primal alternative...

commented

It's a shame since it's their issue. Guess we'll have to do something along those lines.