mirror of
https://github.com/GTNewHorizons/NotEnoughEnergistics.git
synced 2026-11-26 14:52:59 +00:00
Add the function of mouse wheel to switch materials
This commit is contained in:
1 parent
30df907002
commit
5dc0c6d338
12 files changed
+159
-40
No files matched your search
@@ -1,5 +1,6 @@
|
||||
package com.github.vfyjxf.nee.utils;
|
||||
|
||||
import codechicken.nei.PositionedStack;
|
||||
import com.github.vfyjxf.nee.NotEnoughEnergistics;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
@@ -10,7 +11,6 @@ import net.minecraft.nbt.JsonToNBT;
|
||||
import net.minecraft.nbt.NBTException;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -88,7 +88,6 @@ public final class ItemUtils {
|
||||
return transformItemPriorityList;
|
||||
}
|
||||
|
||||
|
||||
public static boolean isPreferItems(ItemStack itemStack, String recipeProcessor, String identifier) {
|
||||
for (StackProcessor processor : ItemUtils.transformItemPriorityList) {
|
||||
ItemStack copyStack = itemStack.copy();
|
||||
@@ -149,4 +148,18 @@ public final class ItemUtils {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int getIngredientIndex(ItemStack stack, PositionedStack positionedStack){
|
||||
ItemStack stackInput = stack.copy();
|
||||
stackInput.stackSize = 1;
|
||||
for(int i = 0; i < positionedStack.items.length; i++){
|
||||
ItemStack currentStack = positionedStack.items[i].copy();
|
||||
currentStack.stackSize = 1;
|
||||
if(ItemStack.areItemStacksEqual(currentStack,stackInput)){
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user