Fix issues with the expanded pattern terminal and its patterns crafting
This commit is contained in:
@@ -26,6 +26,7 @@ import java.util.concurrent.Future;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import appeng.parts.reporting.PartExpandedProcessingPatternTerminal;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -345,11 +346,15 @@ public class ContainerCraftConfirm extends AEBaseContainer
|
||||
originalGui = GuiBridge.GUI_PATTERN_TERMINAL;
|
||||
}
|
||||
|
||||
if( ah instanceof PartExpandedProcessingPatternTerminal )
|
||||
{
|
||||
originalGui = GuiBridge.GUI_EXPANDED_PROCESSING_PATTERN_TERMINAL;
|
||||
}
|
||||
|
||||
if( this.result != null && !this.isSimulation() )
|
||||
{
|
||||
final ICraftingGrid cc = this.getGrid().getCache( ICraftingGrid.class );
|
||||
final ICraftingLink g = cc.submitJob( this.result, null, this.getSelectedCpu() == -1 ? null : this.cpus.get( this.getSelectedCpu() ).getCpu(), true,
|
||||
this.getActionSrc() );
|
||||
final ICraftingLink g = cc.submitJob( this.result, null, this.getSelectedCpu() == -1 ? null : this.cpus.get( this.getSelectedCpu() ).getCpu(), true, this.getActionSrc() );
|
||||
this.setAutoStart( false );
|
||||
if( g != null && originalGui != null && this.getOpenContext() != null )
|
||||
{
|
||||
|
||||
@@ -47,7 +47,9 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
|
||||
|
||||
private static final int CRAFTING_GRID_DIMENSION = 3;
|
||||
private static final int CRAFTING_INPUT_LIMIT = CRAFTING_GRID_DIMENSION * CRAFTING_GRID_DIMENSION;
|
||||
public static final int PROCESSING_INPUT_LIMIT = 16;
|
||||
public static final int PROCESSING_INPUT_HEIGHT = 4;
|
||||
public static final int PROCESSING_INPUT_WIDTH = 4;
|
||||
public static final int PROCESSING_INPUT_LIMIT = PROCESSING_INPUT_HEIGHT * PROCESSING_INPUT_WIDTH;
|
||||
private static final int CRAFTING_OUTPUT_LIMIT = 1;
|
||||
public static final int PROCESSING_OUTPUT_LIMIT = 6;
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.helpers.DualityInterface;
|
||||
import appeng.helpers.PatternHelper;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
@@ -742,24 +743,35 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if( details.isCraftable() )
|
||||
{
|
||||
ic = new InventoryCrafting( new ContainerNull(), 3, 3 );
|
||||
}
|
||||
else
|
||||
{
|
||||
ic = new InventoryCrafting( new ContainerNull(), PatternHelper.PROCESSING_INPUT_WIDTH, PatternHelper.PROCESSING_INPUT_HEIGHT );
|
||||
}
|
||||
|
||||
ic = new InventoryCrafting( new ContainerNull(), 3, 3 );
|
||||
boolean found = false;
|
||||
|
||||
for (int x = 0; x < input.length; x++) {
|
||||
if (input[x] != null) {
|
||||
for( int x = 0; x < input.length; x++ )
|
||||
{
|
||||
if( input[x] != null )
|
||||
{
|
||||
found = false;
|
||||
|
||||
if (details.isCraftable()) {
|
||||
if( details.isCraftable() )
|
||||
{
|
||||
final Collection<IAEItemStack> itemList;
|
||||
|
||||
if (details.canSubstitute()) {
|
||||
final List<IAEItemStack> substitutes = details.getSubstituteInputs(x);
|
||||
itemList = new ArrayList<>(substitutes.size());
|
||||
if( details.canSubstitute() )
|
||||
{
|
||||
final List<IAEItemStack> substitutes = details.getSubstituteInputs( x );
|
||||
itemList = new ArrayList<>( substitutes.size() );
|
||||
|
||||
for (IAEItemStack stack : substitutes) {
|
||||
itemList.addAll(this.inventory.getItemList().findFuzzy(stack,
|
||||
FuzzyMode.IGNORE_ALL));
|
||||
for( IAEItemStack stack : substitutes )
|
||||
{
|
||||
itemList.addAll( this.inventory.getItemList().findFuzzy( stack, FuzzyMode.IGNORE_ALL ) );
|
||||
}
|
||||
} else {
|
||||
itemList = new ArrayList<>(1);
|
||||
|
||||
Reference in New Issue
Block a user