Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Buuz135 committed Nov 11, 2018
2 parents 19a040d + 731a77f commit e6b6fa0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/java/com/buuz135/thaumicjei/ThaumcraftJEIPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.nbt.JsonToNBT;
import net.minecraft.nbt.NBTException;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import thaumcraft.api.ThaumcraftApi;
import thaumcraft.api.aspects.Aspect;
Expand Down Expand Up @@ -144,7 +145,11 @@ public void register(IModRegistry registry) {
e.printStackTrace();
}
return null;
}).filter(Objects::nonNull).map(compound -> new ItemStack(compound)).filter(stack -> !stack.isEmpty()).sorted(Comparator.comparing(ItemStack::getCount).reversed()).collect(Collectors.toList());
}).filter(Objects::nonNull).map(compound -> {
ItemStack itemStack = new ItemStack(compound);
itemStack.setCount(compound.getShort("Count"));
return itemStack;
}).filter(stack -> !stack.isEmpty()).sorted(Comparator.comparing(ItemStack::getCount).reversed()).collect(Collectors.toList());
int start = 0;
while (start < items.size()) {
wrappers.add(new AspectFromItemStackCategory.AspectFromItemStackWrapper(new AspectList().add(aspect, 1), items.subList(start, Math.min(start + 36, items.size()))));
Expand Down Expand Up @@ -204,7 +209,9 @@ public void createAspectsFile(Collection<ItemStack> items) {
ItemStack clone = stack.copy();
clone.setCount(list.getAmount(aspect));
AspectCache cache = aspectCacheHashMap.getOrDefault(aspect, new AspectCache(aspect.getTag()));
cache.items.add(clone.serializeNBT().toString());
NBTTagCompound nbtTagCompound = clone.serializeNBT();
nbtTagCompound.setShort("Count", (short) clone.getCount());
cache.items.add(nbtTagCompound.toString());
aspectCacheHashMap.put(aspect, cache);
}
}
Expand Down

0 comments on commit e6b6fa0

Please sign in to comment.