Panel settings (#240)

* panel settings

* Highlight hidden items; mark item with recipe

* open gui usage with recipeId

* small  changes

* restore gl after draw item

Co-authored-by: Serghei Borovetchi <[email protected]>
This commit is contained in:
slprimeandSerghei Borovetchi authored and GitHub committed 2022-05-06 21:41:45 +02:00
1 parent 96e4fe55e8
commit 91e9b2a5ae
22 files changed
+1334 -624

No files matched your search

@@ -5,7 +5,6 @@ import com.google.gson.JsonElement;
import com.google.gson.JsonArray;
import com.google.gson.JsonPrimitive;
import codechicken.nei.util.NBTJson;
import codechicken.nei.NEIClientConfig;
import codechicken.nei.PositionedStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.item.ItemStack;
@@ -25,15 +24,24 @@ public class BookmarkRecipeId
public List<NBTTagCompound> ingredients = new ArrayList<>();
public BookmarkRecipeId(String handlerName, List<PositionedStack> stacks)
public BookmarkRecipeId(String handlerName, List<?> stacks)
{
this.handlerName = handlerName;
for (PositionedStack pos : stacks) {
final NBTTagCompound nbt = StackInfo.itemStackToNBT(getItemStackWithMinimumDamage(pos.items));
if (nbt != null) {
ingredients.add(nbt);
for (Object pos : stacks) {
if (pos instanceof PositionedStack) {
pos = getItemStackWithMinimumDamage(((PositionedStack) pos).items);
}
if (pos instanceof ItemStack) {
pos = StackInfo.itemStackToNBT((ItemStack) pos);
}
if (pos instanceof NBTTagCompound) {
ingredients.add((NBTTagCompound) pos);
}
}
}
@@ -57,6 +65,11 @@ public class BookmarkRecipeId
}
public BookmarkRecipeId()
{
}
public boolean equalsIngredients(List<PositionedStack> stacks)
{
@@ -70,7 +83,7 @@ public class BookmarkRecipeId
final NBTTagCompound tagCompoundA = StackInfo.itemStackToNBT(getItemStackWithMinimumDamage(pStack.items));
final NBTTagCompound tagCompoundB = ingredients.get(idx);
if (tagCompoundB == null || !tagCompoundA.equals(tagCompoundB)) {
if (tagCompoundB == null || !tagCompoundB.equals(tagCompoundA)) {
return false;
}
@@ -166,4 +179,9 @@ public class BookmarkRecipeId
return false;
}
public BookmarkRecipeId copy()
{
return new BookmarkRecipeId(handlerName, ingredients);
}
}