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