Skip to content

Commit

Permalink
add null checks to the replacement logs (#3128)
Browse files Browse the repository at this point in the history
  • Loading branch information
chochem authored and miozune committed Sep 14, 2024
1 parent 89cd103 commit 69d1113
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -752,29 +752,45 @@ public static String displayRecipe(GTRecipe recipe) {
// item inputs
result.append("Item inputs: ");
for (ItemStack itemstack : recipe.mInputs) {
result.append(itemstack.getUnlocalizedName());
result.append(", ");
if (itemstack == null) {
result.append("nullstack, ");
} else {
result.append(itemstack.getUnlocalizedName());
result.append(", ");
}
}

// fluid inputs
result.append(" Fluid inputs: ");
for (FluidStack fluidStack : recipe.mFluidInputs) {
result.append(fluidStack.getUnlocalizedName());
result.append(", ");
if (fluidStack == null) {
result.append("nullstack, ");
} else {
result.append(fluidStack.getUnlocalizedName());
result.append(", ");
}
}

// item outputs
result.append(" Item outputs: ");
for (ItemStack itemstack : recipe.mOutputs) {
result.append(itemstack.getUnlocalizedName());
result.append(", ");
if (itemstack == null) {
result.append("nullstack, ");
} else {
result.append(itemstack.getUnlocalizedName());
result.append(", ");
}
}

// fluid outputs
result.append(" Fluid outputs: ");
for (FluidStack fluidStack : recipe.mFluidOutputs) {
result.append(fluidStack.getUnlocalizedName());
result.append(", ");
if (fluidStack == null) {
result.append("nullstack, ");
} else {
result.append(fluidStack.getUnlocalizedName());
result.append(", ");
}
}

return result.toString();
Expand Down
32 changes: 24 additions & 8 deletions src/main/java/goodgenerator/loader/NaquadahReworkRecipeLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -582,29 +582,45 @@ public static String displayRecipe(GTRecipe recipe) {
// item inputs
result.append("Item inputs: ");
for (ItemStack itemstack : recipe.mInputs) {
result.append(itemstack.getUnlocalizedName());
result.append(", ");
if (itemstack == null) {
result.append("nullstack, ");
} else {
result.append(itemstack.getUnlocalizedName());
result.append(", ");
}
}

// fluid inputs
result.append(" Fluid inputs: ");
for (FluidStack fluidStack : recipe.mFluidInputs) {
result.append(fluidStack.getUnlocalizedName());
result.append(", ");
if (fluidStack == null) {
result.append("nullstack, ");
} else {
result.append(fluidStack.getUnlocalizedName());
result.append(", ");
}
}

// item outputs
result.append(" Item outputs: ");
for (ItemStack itemstack : recipe.mOutputs) {
result.append(itemstack.getUnlocalizedName());
result.append(", ");
if (itemstack == null) {
result.append("nullstack, ");
} else {
result.append(itemstack.getUnlocalizedName());
result.append(", ");
}
}

// fluid outputs
result.append(" Fluid outputs: ");
for (FluidStack fluidStack : recipe.mFluidOutputs) {
result.append(fluidStack.getUnlocalizedName());
result.append(", ");
if (fluidStack == null) {
result.append("nullstack, ");
} else {
result.append(fluidStack.getUnlocalizedName());
result.append(", ");
}
}

return result.toString();
Expand Down

0 comments on commit 69d1113

Please sign in to comment.