GregTechCEu Modern

GregTechCEu Modern

6M Downloads

Large miners crash the game

Fabizocker456 opened this issue ยท 0 comments

commented

Checked for existing issues

  • I have checked for existing issues, and have found none.

Tested latest version

  • I have checked that this occurs on the latest version.

GregTech CEu Version

7.1.0 SNAPSHOT 25a88a3

Minecraft Version

1.21.1 NeoForge

Recipe Viewer Installed

None

Environment

Singleplayer

Cross-Mod Interaction

No

Other Installed Mods

None

Expected Behavior

The miner mines ores it finds in the world.

Actual Behavior

The game crashes.
The crash report is supplied here: https://gist.github.com/Fabizocker456/cc15a1f5bb728292742c791e3065f8a1
(some information has been redacted, if it's needed for further debugging, I will supply it)

Steps to Reproduce

  1. Build one of the large miners (normal miners, not bedrock miners). The tier of miner, hatch, bus or energy do not matter
  2. Supply it with energy and drillling fluid
  3. Wait a few seconds. Some items may appear in the output slot. After that, the game crashes.

Additional Information

This happens due to line 152 in LargeMinerLogic.java (src/[..]/gtceu/common/machine/trait/miner/): LootContext context = new LootContext.Builder(params).create(null);, where LootContext.Builder.create takes @NotNull Optional<ResourceLocation>, not @Nullable ResourceLocation. Replacing null with Optional.empty() (and importing java.util.Optional) fixes this bug, at least for me.