1.5.27 - Fixed non-oredict patterns not consuming resources, fixes #1570

This commit is contained in:
raoulvdberge
2017-12-09 17:06:31 +01:00
parent 50eaa4f4ce
commit 020e92c6a1
5 changed files with 31 additions and 28 deletions

View File

@@ -1,5 +1,8 @@
# Refined Storage Changelog # Refined Storage Changelog
### 1.5.27
- Fixed non-oredict patterns not consuming resources (raoulvdberge)
### 1.5.26 ### 1.5.26
- Added Funky Locomotion integration (raoulvdberge) - Added Funky Locomotion integration (raoulvdberge)
- Minor fixes to autocrafting (raoulvdberge) - Minor fixes to autocrafting (raoulvdberge)

View File

@@ -20,7 +20,7 @@ apply plugin: 'maven'
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
apply plugin: 'net.minecraftforge.gradle.forge' apply plugin: 'net.minecraftforge.gradle.forge'
version = "1.5.26" version = "1.5.27"
group = "refinedstorage" group = "refinedstorage"
archivesBaseName = "refinedstorage" archivesBaseName = "refinedstorage"

View File

@@ -23,7 +23,7 @@ public final class RS {
} }
public static final String ID = "refinedstorage"; public static final String ID = "refinedstorage";
public static final String VERSION = "1.5.26"; public static final String VERSION = "1.5.27";
public static final String DEPENDENCIES = "required-after:forge@[14.21.0.2363,);after:mcmultipart@[2.2.1,);after:storagedrawers@[1.12-5.2.2,);"; public static final String DEPENDENCIES = "required-after:forge@[14.21.0.2363,);after:mcmultipart@[2.2.1,);after:storagedrawers@[1.12-5.2.2,);";
public static final String GUI_FACTORY = "com.raoulvdberge.refinedstorage.gui.config.ModGuiFactory"; public static final String GUI_FACTORY = "com.raoulvdberge.refinedstorage.gui.config.ModGuiFactory";
public static final String UPDATE_JSON = "https://refinedstorage.raoulvdberge.com/update"; public static final String UPDATE_JSON = "https://refinedstorage.raoulvdberge.com/update";

View File

@@ -96,33 +96,33 @@ public class CraftingPattern implements ICraftingPattern {
} }
} else { } else {
outputs = ItemPattern.getOutputs(stack); outputs = ItemPattern.getOutputs(stack);
}
if (oreInputs.isEmpty()) { if (oreInputs.isEmpty()) {
for (ItemStack input : inputs) { for (ItemStack input : inputs) {
if (input == null || input.isEmpty()) { if (input == null || input.isEmpty()) {
oreInputs.add(Collections.emptyList()); oreInputs.add(Collections.emptyList());
} else {
int[] ids = OreDictionary.getOreIDs(input);
if (ids.length == 0) {
oreInputs.add(Collections.singletonList(Comparer.stripTags(input)));
} else if (isOredict()) {
List<ItemStack> oredictInputs = Arrays.stream(ids)
.mapToObj(OreDictionary::getOreName)
.map(OreDictionary::getOres)
.flatMap(List::stream)
.map(ItemStack::copy)
.map(Comparer::stripTags)
.peek(s -> s.setCount(input.getCount()))
.collect(Collectors.toList());
// Add original stack as first, should prevent some issues
oredictInputs.add(0, Comparer.stripTags(input.copy()));
oreInputs.add(oredictInputs);
} else { } else {
int[] ids = OreDictionary.getOreIDs(input); oreInputs.add(Collections.singletonList(Comparer.stripTags(input)));
if (ids.length == 0) {
oreInputs.add(Collections.singletonList(Comparer.stripTags(input)));
} else if (isOredict()) {
List<ItemStack> oredictInputs = Arrays.stream(ids)
.mapToObj(OreDictionary::getOreName)
.map(OreDictionary::getOres)
.flatMap(List::stream)
.map(ItemStack::copy)
.map(Comparer::stripTags)
.peek(s -> s.setCount(input.getCount()))
.collect(Collectors.toList());
// Add original stack as first, should prevent some issues
oredictInputs.add(0, Comparer.stripTags(input.copy()));
oreInputs.add(oredictInputs);
} else {
oreInputs.add(Collections.singletonList(Comparer.stripTags(input)));
}
} }
} }
} }

View File

@@ -3,7 +3,7 @@
"modid": "refinedstorage", "modid": "refinedstorage",
"name": "Refined Storage", "name": "Refined Storage",
"description": "An elegant solution to your hoarding problem", "description": "An elegant solution to your hoarding problem",
"version": "1.5.26", "version": "1.5.27",
"mcversion": "1.12.2", "mcversion": "1.12.2",
"url": "https://refinedstorage.raoulvdberge.com", "url": "https://refinedstorage.raoulvdberge.com",
"updateUrl": "", "updateUrl": "",