Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Client crashes when inserting renamed crafting module into chassis. #82

Merged
merged 2 commits into from
Mar 10, 2025

Conversation

godrja
Copy link

@godrja godrja commented Mar 9, 2025

How to reproduce:

  1. Rename any crafting module in an anvil.
  2. Insert the module into any chassis.
  3. Have a nice crash

LogisticsPipes removes mod-specific NBT tags from the module in the process of inserting it into a chassis. The method has a bug which set all the non mod-specific tags' values to null. This upsets Minecraft when copying the said NBT tags later in the process.

The exception:

java.lang.NullPointerException: Cannot invoke "net.minecraft.nbt.NBTBase.func_74737_b()" because "nbtBase" is null
    at logisticspipes.utils.FinalNBTTagCompound.copy(FinalNBTTagCompound.java:34)
    at logisticspipes.utils.item.ItemIdentifier.getOrCreateTag(ItemIdentifier.java:332)
    at logisticspipes.utils.item.ItemIdentifier.get(ItemIdentifier.java:357)
    at logisticspipes.utils.item.ItemIdentifier.get(ItemIdentifier.java:382)
    at logisticspipes.utils.item.ItemIdentifierStack.getFromStack(ItemIdentifierStack.java:33)
    at logisticspipes.utils.item.ItemIdentifierInventory.setInventorySlotContents(ItemIdentifierInventory.java:129)
    at logisticspipes.pipes.PipeLogisticsChassi.InventoryChanged(PipeLogisticsChassi.java:369)
    at logisticspipes.pipes.PipeLogisticsChassi.tryInsertingModule(PipeLogisticsChassi.java:433)
    at logisticspipes.pipes.PipeLogisticsChassi.handleClick(PipeLogisticsChassi.java:463)
    at logisticspipes.pipes.basic.CoreRoutedPipe.blockActivated(CoreRoutedPipe.java:920)
    at logisticspipes.pipes.basic.LogisticsBlockGenericPipe.onBlockActivated(LogisticsBlockGenericPipe.java:828)
    at net.minecraft.server.management.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:376)
    at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:556)
    at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(SourceFile:60)
    at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(SourceFile:9)
    at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:212)
    at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:165)
    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:659)
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:547)
    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:111)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427)
    at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)

godrja added 2 commits March 9, 2025 23:45
How to reproduce:
1. Rename any crafting module in an anvil.
2. Insert the module into any chassis.
3. Have a nice crash

LogisticsPipes removes mod-specific NBT tags from the module in the
process of inserting it into a chassis. The method has a bug which
set all the non mod-specific tags' values to null. This upsets Minecraft
when copying the said NBT tags later in the process.
@godrja godrja force-pushed the fix/null-nbt-values-crash branch from 85ed0c8 to d08a7d3 Compare March 9, 2025 23:45
@Dream-Master Dream-Master merged commit 0559f6d into GTNewHorizons:master Mar 10, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants