Fix stack size overflow in NEI overlay handlers (#36)

* Fix stack size overflow in NEI overlay handlers

* update gradle+bs+deps

* fix wci

---------

Co-authored-by: Martin Robertz <[email protected]>
This commit is contained in:
tth05andMartin Robertz authored and GitHub committed 2023-12-03 14:06:38 +01:00
1 parent 233f2460ac
commit 13e0e65fc4
26 files changed
+348 -147

No files matched your search

@@ -1,6 +1,8 @@
package com.github.vfyjxf.nee.utils;
import static com.github.vfyjxf.nee.config.NEEConfig.*;
import static com.github.vfyjxf.nee.config.NEEConfig.transformBlacklist;
import static com.github.vfyjxf.nee.config.NEEConfig.transformPriorityList;
import static com.github.vfyjxf.nee.config.NEEConfig.transformPriorityModList;
import java.util.ArrayList;
import java.util.List;
@@ -210,6 +212,19 @@ public final class ItemUtils {
+ "}";
}
public static NBTTagCompound writeItemStackToNBT(ItemStack itemStack, NBTTagCompound tag) {
itemStack.writeToNBT(tag);
tag.setInteger("Count", itemStack.stackSize);
return tag;
}
public static ItemStack loadItemStackFromNBT(NBTTagCompound tag) {
ItemStack itemStack = ItemStack.loadItemStackFromNBT(tag);
if (itemStack == null) return null;
itemStack.stackSize = tag.getInteger("Count");
return itemStack;
}
public static boolean hasRecipeProcessor(String processorId) {
for (IRecipeProcessor processor : RecipeProcessor.recipeProcessors) {
if (processor.getRecipeProcessorId().equals(processorId)) {