mirror of
https://github.com/GTNewHorizons/NotEnoughEnergistics.git
synced 2026-11-19 11:49:09 +00:00
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:
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)) {
|
||||
|
||||
Reference in new issue
Block a user