Merge branch 'upstream' into bugfix

This commit is contained in:
Yang Xizhi authored and GitHub committed 2022-07-30 22:36:03 +08:00
commit 63d12aa759
23 files changed
+556 -272

No files matched your search

@@ -11,6 +11,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.Constants;
import javax.annotation.Nullable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@@ -87,7 +88,9 @@ public class FluidPatternDetails implements ICraftingPatternDetails, Comparable<
if (condensed.length == 0) {
return false;
}
this.outputs = outputs;
this.outputs = Arrays.stream(outputs)
.filter(Objects::nonNull)
.toArray(IAEItemStack[]::new);
this.outputsCond = condensed;
return true;
}
@@ -159,12 +162,11 @@ public class FluidPatternDetails implements ICraftingPatternDetails, Comparable<
public static NBTTagList writeStackArray(IAEItemStack[] stacks) {
NBTTagList listTag = new NBTTagList();
for (IAEItemStack stack : stacks) {
if (stack != null) {
// see note at top of class
NBTTagCompound stackTag = new NBTTagCompound();
stack.writeToNBT(stackTag);
listTag.appendTag(stackTag);
}
// see note at top of class
NBTTagCompound stackTag = new NBTTagCompound();
if (stack != null) stack.writeToNBT(stackTag);
listTag.appendTag(stackTag);
}
return listTag;
}
@@ -22,6 +22,7 @@ public final class ModAndClassUtil {
public static boolean WCT = false;
public static boolean IC2 = false;
public static boolean NEI = false;
public static boolean GTPP = false;
public static boolean isDoubleButton;
public static boolean isSaveText;
@@ -118,6 +119,7 @@ public final class ModAndClassUtil {
IC2 = true;
if (Loader.isModLoaded("NotEnoughItems"))
NEI = true;
if (Loader.isModLoaded("miscutils"))
GTPP = true;
}
}