add input-sensitive expansion calls to IIntegrationRecipe, fix #2710
This commit is contained in:
parent
8570b2b58a
commit
f336e4d86d
|
@ -18,11 +18,11 @@ public interface IIntegrationRecipe {
|
|||
List<List<ItemStack>> getExampleExpansions();
|
||||
List<ItemStack> getExampleOutput();
|
||||
boolean isValidInput(ItemStack input);
|
||||
boolean isValidExpansion(ItemStack expansion);
|
||||
boolean isValidExpansion(ItemStack input, ItemStack expansion);
|
||||
ItemStack craft(ItemStack input, List<ItemStack> expansions, boolean preview);
|
||||
|
||||
/**
|
||||
* @return -1 for no limit, a different number otherwise
|
||||
*/
|
||||
int getMaximumExpansionCount();
|
||||
int getMaximumExpansionCount(ItemStack input);
|
||||
}
|
|
@ -59,7 +59,7 @@ public abstract class IntegrationRecipeBC implements IIntegrationRecipe {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getMaximumExpansionCount() {
|
||||
public int getMaximumExpansionCount(ItemStack input) {
|
||||
return maxExpansionCount;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ public class RobotIntegrationRecipe extends IntegrationRecipeBC {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidExpansion(ItemStack expansion) {
|
||||
public boolean isValidExpansion(ItemStack input, ItemStack expansion) {
|
||||
return expansion.getItem() instanceof ItemRedstoneBoard;
|
||||
}
|
||||
|
||||
|
|
|
@ -158,7 +158,7 @@ public class TileIntegrationTable extends TileLaserTableBase {
|
|||
}
|
||||
|
||||
public int getMaxExpansionCount() {
|
||||
return worldObj.isRemote ? maxExpCountClient : (activeRecipe != null ? activeRecipe.getMaximumExpansionCount() : 0);
|
||||
return worldObj.isRemote ? maxExpCountClient : (activeRecipe != null ? activeRecipe.getMaximumExpansionCount(getStackInSlot(0)) : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -178,12 +178,12 @@ public class TileIntegrationTable extends TileLaserTableBase {
|
|||
} else if (activeRecipe == null) {
|
||||
return false;
|
||||
} else if (slot < 9) {
|
||||
if (activeRecipe.getMaximumExpansionCount() > 0) {
|
||||
if (slot > activeRecipe.getMaximumExpansionCount()) {
|
||||
if (activeRecipe.getMaximumExpansionCount(getStackInSlot(0)) > 0) {
|
||||
if (slot > activeRecipe.getMaximumExpansionCount(getStackInSlot(0))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return activeRecipe.isValidExpansion(stack);
|
||||
return activeRecipe.isValidExpansion(getStackInSlot(0), stack);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public class AdvancedFacadeRecipe extends IntegrationRecipeBC {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidExpansion(ItemStack expansion) {
|
||||
public boolean isValidExpansion(ItemStack input, ItemStack expansion) {
|
||||
return (expansion.getItem() instanceof ItemFacade &&
|
||||
((IFacadeItem) expansion.getItem()).getFacadeType(expansion) == FacadeType.Basic) ||
|
||||
expansion.getItem() == BuildCraftTransport.plugItem ||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class GateExpansionRecipe extends IntegrationRecipeBC {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidExpansion(ItemStack expansion) {
|
||||
public boolean isValidExpansion(ItemStack input, ItemStack expansion) {
|
||||
if (StackHelper.isMatchingItem(ItemRedstoneChipset.Chipset.RED.getStack(), expansion, true, true)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -829,6 +829,7 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
|
|||
}
|
||||
|
||||
if (color != null) {
|
||||
bindTexture(TextureMap.locationBlocksTexture);
|
||||
RenderInfo block = new RenderInfo();
|
||||
|
||||
block.texture = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.TYPE.ItemBox.ordinal());
|
||||
|
|
Loading…
Reference in a new issue