Oredict doesn't work in 1.11 anymore
See original GitHub issueThanks to my optimization in 69d92c4164dbe3af90a1fb08d7fbaf712282d7ef storages now use a multimap instead of a list. Thanks to that, we no longer have to iterate over every item in the storage.
This has an unintended side-effect that oredict extractions don’t work anymore because when using the oredict the item will differ thus it won’t be found in the multimap.
This only affects the StorageDiskItem
class, since all other storage classes have to iterate over every item (for example the item handler external storage handler).
I have this patch laying around, but it appears to show weird behavior (unlimited extractions):
--- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/StorageDiskItem.java
+++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/StorageDiskItem.java
@@ -5,12 +5,14 @@ import com.google.common.collect.Multimap;
import com.raoulvdberge.refinedstorage.api.storage.AccessType;
import com.raoulvdberge.refinedstorage.api.storage.IStorageDisk;
import com.raoulvdberge.refinedstorage.api.storage.StorageDiskType;
+import com.raoulvdberge.refinedstorage.api.util.IComparer;
import com.raoulvdberge.refinedstorage.apiimpl.API;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.items.ItemHandlerHelper;
+import net.minecraftforge.oredict.OreDictionary;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -190,7 +192,27 @@ public class StorageDiskItem implements IStorageDisk<ItemStack> {
@Override
@Nullable
public synchronized ItemStack extract(@Nonnull ItemStack stack, int size, int flags, boolean simulate) {
- for (ItemStack otherStack : stacks.get(stack.getItem())) {
+ Collection<ItemStack> toAttempt = null;
+
+ if ((flags & IComparer.COMPARE_OREDICT) == IComparer.COMPARE_OREDICT) {
+ for (int id : OreDictionary.getOreIDs(stack)) {
+ Collection<ItemStack> ores = OreDictionary.getOres(OreDictionary.getOreName(id));
+
+ for (ItemStack ore : ores) {
+ if (toAttempt == null) {
+ toAttempt = stacks.get(ore.getItem());
+ } else {
+ toAttempt.addAll(stacks.get(ore.getItem()));
+ }
+ }
+ }
+ }
+
+ if (toAttempt == null) {
+ toAttempt = stacks.get(stack.getItem());
+ }
+
+ for (ItemStack otherStack : toAttempt) {
if (API.instance().getComparer().isEqual(otherStack, stack, flags)) {
if (size > otherStack.getCount()) {
size = otherStack.getCount();
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
oredict bug? - Support - IC² Forum
Seems, that IC2 is messing with ore dictionary - if loaded, it removes randomly dictionary ... It is not just a graphic glitch,...
Read more >Update 1.11 rolling out now! Full patch notes inside - Reddit
Update 1.11 for F1 Manager 2022 is now rolling out across all platforms! All changes made in Update 1.11 will apply in existing...
Read more >Minecraft Modding Tutorial | Ore Dictionary (1.10.2,1.11.2)
Today we are in Minecraft 1.11 and we are using the Ore Dictionary to improve our crafting recipes and compatibility with other mods....
Read more >TreeOres 1.12.2 - Finally Back? Version 0.1 | 1.11.2
Always wanted to update the mod and I did. Unfortunately, between work and university I don't have much time to continue working on...
Read more >MCOpts/forge-1.11.2-13.20.0.2304-changelog.txt at master
The new launcher's GUI for logs WILL NOT WORK until they add ... Remove oredict for Bone Block recipe, stop white dye to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Dykam Thanks, that was the cause.
getOreIds
is the slowdown, but I’m caching it now.Yes, it has to do that or it will convert stacks of an other type to the equivalent oredict type, which is not allowed