Merge remote-tracking branch 'origin/mc1.10' into mc1.10
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package refinedstorage.api.autocrafting;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -71,5 +72,16 @@ public interface ICraftingPattern {
|
||||
* @param requested the item requested
|
||||
* @return the quantity
|
||||
*/
|
||||
int getQuantityPerRequest(ItemStack requested);
|
||||
default int getQuantityPerRequest(ItemStack requested) {
|
||||
return getQuantityPerRequest(requested, IComparer.COMPARE_DAMAGE | IComparer.COMPARE_NBT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the quantity of items that this crafting task yields per request.
|
||||
*
|
||||
* @param requested the item requested
|
||||
* @param compare the {@link refinedstorage.api.util.IComparer} flags
|
||||
* @return the quantity
|
||||
*/
|
||||
int getQuantityPerRequest(ItemStack requested, int compare);
|
||||
}
|
||||
|
||||
@@ -150,11 +150,11 @@ public class CraftingPattern implements ICraftingPattern {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getQuantityPerRequest(ItemStack requested) {
|
||||
public int getQuantityPerRequest(ItemStack requested, int compare) {
|
||||
int quantity = 0;
|
||||
|
||||
for (ItemStack output : outputs) {
|
||||
if (API.instance().getComparer().isEqualNoQuantity(requested, output)) {
|
||||
if (API.instance().getComparer().isEqual(requested, output, compare)) {
|
||||
quantity += output.stackSize;
|
||||
|
||||
if (!ItemPattern.isProcessing(stack)) {
|
||||
|
||||
@@ -132,7 +132,7 @@ public class CraftingTask implements ICraftingTask {
|
||||
} else {
|
||||
ICraftingPattern inputPattern = network.getPattern(input, compare);
|
||||
if (inputPattern != null) {
|
||||
int craftQuantity = Math.min(inputPattern.getQuantityPerRequest(input), input.stackSize);
|
||||
int craftQuantity = Math.min(inputPattern.getQuantityPerRequest(input, compare), input.stackSize);
|
||||
ItemStack inputCrafted = ItemHandlerHelper.copyStackWithSize(input, craftQuantity);
|
||||
toCraft.add(inputCrafted.copy());
|
||||
actualInputs.add(inputCrafted.copy());
|
||||
|
||||
@@ -125,6 +125,7 @@ public class GuiCraftingPreview extends GuiBase {
|
||||
int slot = scrollbar.getOffset() * 2;
|
||||
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GlStateManager.enableDepth();
|
||||
|
||||
ItemStack hoveringStack = null;
|
||||
FluidStack hoveringFluid = null;
|
||||
|
||||
Reference in New Issue
Block a user