GregTechCEu / GregTech

GregTech CE 1.12 fork continuing progression and development
GNU Lesser General Public License v3.0
237 stars 178 forks source link

Crash when extracting fluids from HBM-E drum via a gt pipe and pump #2056

Open freedom-cry opened 1 year ago

freedom-cry commented 1 year ago

GregTech CEu Version

gregtech-1.12.2-2.7.3-beta

Modpack Used

TerrFirmaGreg:NewHorizons v4.3.6

Addons Installed

NTM-Extended-1.12.2-1.9.8

Environment

Singleplayer

Side Crashed

Client

New Worlds

Yes

Steps to Reproduce

When I use HBM1.9.8 with GTCEu (gregtech-1.12.2-2.7.3-beta) in 1.12.2, I found two unpleasant bugs in the game, the first one is when I use GTCEu's Metal Fluid When piped into HBM's fluid container, (any kind, I used a steel drum in the bug report,Then try using GTCEu's pipes to import or export fluids), the game crashes. The second is that when I deploy a steam mining machine to mine HBM deep minerals in the main world, the game crashes.

Crash Report

mining_machine_problem.txt pipe_problem.txt

Additional Information

I've done a preliminary analysis with AI, here are the specific instructions.

Specifically, the crash happens when GregTech's TileEntityPipeBase class calls its isFaceBlocked() method. This method is then called by the fillFluid() method in your mod's FFUtils class, and ultimately bubbles up from an update to an HBM Barrel entity. The root cause appears to be that somewhere in the isFaceBlocked() implementation, GregTech is retrieving a null reference and attempting to use it without null checking. My suggestion would be to take a closer look at the interfaces between the two mods in this area, specifically how block/entity types are defined and passed between them. Adding proper null checks in GregTech's code would also help prevent further crashes.

When using a GregTech mining machine to mine blocks added by HBM, a ClassCastException is thrown, causing the game to crash. Based on the crash report, it seems this is happening because GregTech is trying to cast the HBM block object to the GregTech block class, but they are incompatible types. Specifically, the crash occurs in the MinerLogic class of GregTech API, in the getRegularBlockDrops method. This method is called to obtain block drops when mining, but fails when encountering an HBM block.

htmlcsjs commented 1 year ago

The miner issue seems to be caused by a mixin from tfgmod, which i presume is the core mod of the pack you are using, could you please report it there.

htmlcsjs commented 1 year ago

Can reproduce the pipe issue in an instance with just HBM & GT in it, it only happens on extraction into gt pipes using a pump and the drum needs to be set to bidirectional mode

Here is my crashlog attached crash-2023-08-24_20.37.13-server.txt