Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
Fix EoH NPE (#277)
Browse files Browse the repository at this point in the history
* fix scanner info NPE

* fluidstack can't be null either

* another fluidstack check
  • Loading branch information
GDCloudstrike authored Mar 23, 2024
1 parent b2a84ae commit 7a0d054
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1560,7 +1560,7 @@ public String[] getInfoData() {
str.add("EU Output: " + RED + toStandardForm(outputEU_BigInt) + RESET + " EU");
str.add("EU Input: " + RED + toStandardForm(usedEU.abs()) + RESET + " EU");
int currentMaxProgresstime = Math.max(maxProgresstime(), 1);
if (outputFluids.size() > 0) {
if (starMatter != null && starMatter.fluidStack != null) {
FluidStackLong starMatterOutput = new FluidStackLong(
starMatter.fluidStack,
(long) (starMatter.amount * yield * successChance * parallelAmount));
Expand All @@ -1577,7 +1577,7 @@ public String[] getInfoData() {
+ " L/s");

FluidStackLong stellarPlasmaOutput = new FluidStackLong(
stellarPlasma.fluidStack,
MaterialsUEVplus.RawStarMatter.getFluid(0),
(long) (stellarPlasma.amount * yield * successChance * parallelAmount));
str.add(
"Average " + stellarPlasmaOutput.fluidStack.getLocalizedName()
Expand Down Expand Up @@ -1683,15 +1683,18 @@ public void saveNBTData(NBTTagCompound aNBT) {

aNBT.setTag(FLUID_OUTPUT_NBT_TAG, fluidStackListNBTTag);

NBTTagCompound fixedRecipeOutputs = new NBTTagCompound();
if (starMatter != null && starMatter.fluidStack != null) {

fixedRecipeOutputs.setLong(0 + FLUID_AMOUNT, starMatter.amount);
aNBT.setTag(CURRENT_RECIPE_STAR_MATTER_TAG, starMatter.fluidStack.writeToNBT(new NBTTagCompound()));
NBTTagCompound fixedRecipeOutputs = new NBTTagCompound();

fixedRecipeOutputs.setLong(1 + FLUID_AMOUNT, stellarPlasma.amount);
aNBT.setTag(CURRENT_RECIPE_STELLAR_PLASMA_TAG, stellarPlasma.fluidStack.writeToNBT(new NBTTagCompound()));
fixedRecipeOutputs.setLong(0 + FLUID_AMOUNT, starMatter.amount);
aNBT.setTag(CURRENT_RECIPE_STAR_MATTER_TAG, starMatter.fluidStack.writeToNBT(new NBTTagCompound()));

aNBT.setTag(CURRENT_RECIPE_FIXED_OUTPUTS_TAG, fixedRecipeOutputs);
fixedRecipeOutputs.setLong(1 + FLUID_AMOUNT, stellarPlasma.amount);
aNBT.setTag(CURRENT_RECIPE_STELLAR_PLASMA_TAG, stellarPlasma.fluidStack.writeToNBT(new NBTTagCompound()));

aNBT.setTag(CURRENT_RECIPE_FIXED_OUTPUTS_TAG, fixedRecipeOutputs);
}

super.saveNBTData(aNBT);
}
Expand Down

0 comments on commit 7a0d054

Please sign in to comment.