mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-16 10:14:40 +00:00
fluid terminal add "use substitutions" button
This commit is contained in:
1 parent
b576e4b178
commit
fd6eb37369
12 files changed
+198
-107
No files matched your search
@@ -2,6 +2,7 @@ package com.glodblock.github.client.gui;
|
||||
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.api.config.ItemSubstitution;
|
||||
import appeng.api.config.PatternBeSubstitution;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.client.gui.widgets.GuiImgButton;
|
||||
@@ -37,13 +38,14 @@ public class GuiBaseFluidPatternTerminal extends GuiFCBaseMonitor {
|
||||
private GuiImgButton encodeBtn;
|
||||
private GuiImgButton clearBtn;
|
||||
private GuiImgButton doubleBtn;
|
||||
private GuiImgButton beSubstitutionsEnabledBtn;
|
||||
private GuiImgButton beSubstitutionsDisabledBtn;
|
||||
|
||||
private GuiFCImgButton combineEnableBtn;
|
||||
private GuiFCImgButton combineDisableBtn;
|
||||
|
||||
public GuiBaseFluidPatternTerminal(final InventoryPlayer inventoryPlayer, final ITerminalHost te )
|
||||
{
|
||||
super( inventoryPlayer, te, new FCBasePartContainer( inventoryPlayer, te ) );
|
||||
public GuiBaseFluidPatternTerminal(final InventoryPlayer inventoryPlayer, final ITerminalHost te) {
|
||||
super(inventoryPlayer, te, new FCBasePartContainer(inventoryPlayer, te));
|
||||
this.container = (FCBasePartContainer) this.inventorySlots;
|
||||
setReservedSpace(81);
|
||||
}
|
||||
@@ -73,9 +75,12 @@ public class GuiBaseFluidPatternTerminal extends GuiFCBaseMonitor {
|
||||
{
|
||||
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminal.Combine", this.combineDisableBtn == btn ? "1" : "0" ) );
|
||||
}
|
||||
else if (ModAndClassUtil.isDoubleButton && doubleBtn == btn)
|
||||
{
|
||||
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminal.Double", Keyboard.isKeyDown( Keyboard.KEY_LSHIFT ) ? "1": "0") );
|
||||
else if (ModAndClassUtil.isDoubleButton && doubleBtn == btn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns("PatternTerminal.Double", Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ? "1" : "0"));
|
||||
} else if (ModAndClassUtil.isBeSubstitutionsButton && beSubstitutionsDisabledBtn == btn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns("PatternTerminal.beSubstitute", "1"));
|
||||
} else if (ModAndClassUtil.isBeSubstitutionsButton && beSubstitutionsEnabledBtn == btn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns("PatternTerminal.beSubstitute", "0"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,24 +108,37 @@ public class GuiBaseFluidPatternTerminal extends GuiFCBaseMonitor {
|
||||
this.buttonList.add( this.clearBtn );
|
||||
|
||||
this.encodeBtn = new GuiImgButton( this.guiLeft + 147, this.guiTop + this.ySize - 142, Settings.ACTIONS, ActionItems.ENCODE );
|
||||
this.buttonList.add( this.encodeBtn );
|
||||
this.buttonList.add(this.encodeBtn);
|
||||
|
||||
int combineLeft = 74;
|
||||
|
||||
int combineTop = 153;
|
||||
if (ModAndClassUtil.isDoubleButton) {
|
||||
this.doubleBtn = new GuiImgButton( this.guiLeft + 74, this.guiTop + this.ySize - 153, Settings.ACTIONS, ActionItems.DOUBLE );
|
||||
this.doubleBtn.setHalfSize( true );
|
||||
this.buttonList.add( this.doubleBtn );
|
||||
this.doubleBtn = new GuiImgButton(this.guiLeft + 74, this.guiTop + this.ySize - 153, Settings.ACTIONS, ActionItems.DOUBLE);
|
||||
this.doubleBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.doubleBtn);
|
||||
combineLeft = 84;
|
||||
}
|
||||
if (ModAndClassUtil.isBeSubstitutionsButton) {
|
||||
combineLeft = 74;
|
||||
combineTop -= 11;
|
||||
this.beSubstitutionsEnabledBtn = new GuiImgButton(
|
||||
this.guiLeft + 84, this.guiTop + this.ySize - 153, Settings.ACTIONS, PatternBeSubstitution.ENABLED);
|
||||
this.beSubstitutionsEnabledBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.beSubstitutionsEnabledBtn);
|
||||
|
||||
this.combineEnableBtn = new GuiFCImgButton( this.guiLeft + combineLeft, this.guiTop + this.ySize - 153, "FORCE_COMBINE", "DO_COMBINE" );
|
||||
this.combineEnableBtn.setHalfSize( true );
|
||||
this.buttonList.add( this.combineEnableBtn );
|
||||
this.beSubstitutionsDisabledBtn = new GuiImgButton(
|
||||
this.guiLeft + 84, this.guiTop + this.ySize - 153, Settings.ACTIONS, PatternBeSubstitution.DISABLED);
|
||||
this.beSubstitutionsDisabledBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.beSubstitutionsDisabledBtn);
|
||||
|
||||
this.combineDisableBtn = new GuiFCImgButton( this.guiLeft + combineLeft, this.guiTop + this.ySize - 153, "NOT_COMBINE", "DONT_COMBINE" );
|
||||
this.combineDisableBtn.setHalfSize( true );
|
||||
this.buttonList.add( this.combineDisableBtn );
|
||||
}
|
||||
this.combineEnableBtn = new GuiFCImgButton(this.guiLeft + combineLeft, this.guiTop + this.ySize - combineTop, "FORCE_COMBINE", "DO_COMBINE");
|
||||
this.combineEnableBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.combineEnableBtn);
|
||||
|
||||
this.combineDisableBtn = new GuiFCImgButton(this.guiLeft + combineLeft, this.guiTop + this.ySize - combineTop, "NOT_COMBINE", "DONT_COMBINE");
|
||||
this.combineDisableBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.combineDisableBtn);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -159,20 +177,26 @@ public class GuiBaseFluidPatternTerminal extends GuiFCBaseMonitor {
|
||||
this.combineEnableBtn.visible = true;
|
||||
this.combineDisableBtn.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
this.combineEnableBtn.visible = false;
|
||||
this.combineDisableBtn.visible = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.combineEnableBtn.visible = false;
|
||||
this.combineDisableBtn.visible = false;
|
||||
}
|
||||
if (ModAndClassUtil.isBeSubstitutionsButton) {
|
||||
if (this.container.beSubstitute) {
|
||||
this.beSubstitutionsEnabledBtn.visible = true;
|
||||
this.beSubstitutionsDisabledBtn.visible = false;
|
||||
} else {
|
||||
this.beSubstitutionsEnabledBtn.visible = false;
|
||||
this.beSubstitutionsDisabledBtn.visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
super.drawFG( offsetX, offsetY, mouseX, mouseY );
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal(NameConst.GUI_FLUID_PATTERN_TERMINAL), 8, this.ySize - 96 + 2 - getReservedSpace(), 4210752 );
|
||||
super.drawFG(offsetX, offsetY, mouseX, mouseY);
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal(NameConst.GUI_FLUID_PATTERN_TERMINAL), 8, this.ySize - 96 + 2 - getReservedSpace(), 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.api.config.ItemSubstitution;
|
||||
import appeng.api.config.PatternSlotConfig;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.*;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.client.gui.widgets.GuiImgButton;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
@@ -36,14 +33,15 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
|
||||
private GuiImgButton invertBtn;
|
||||
private GuiImgButton clearBtn;
|
||||
private GuiImgButton doubleBtn;
|
||||
private GuiImgButton beSubstitutionsEnabledBtn;
|
||||
private GuiImgButton beSubstitutionsDisabledBtn;
|
||||
|
||||
private GuiFCImgButton combineEnableBtn;
|
||||
private GuiFCImgButton combineDisableBtn;
|
||||
private final GuiScrollbar processingScrollBar = new GuiScrollbar();
|
||||
|
||||
public GuiBaseFluidPatternTerminalEx(final InventoryPlayer inventoryPlayer, final ITerminalHost te )
|
||||
{
|
||||
super( inventoryPlayer, te, new FCBasePartContainerEx( inventoryPlayer, te ) );
|
||||
public GuiBaseFluidPatternTerminalEx(final InventoryPlayer inventoryPlayer, final ITerminalHost te) {
|
||||
super(inventoryPlayer, te, new FCBasePartContainerEx(inventoryPlayer, te));
|
||||
this.container = (FCBasePartContainerEx) this.inventorySlots;
|
||||
setReservedSpace(81);
|
||||
|
||||
@@ -80,9 +78,12 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
|
||||
{
|
||||
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminalEx.Combine", this.combineDisableBtn == btn ? "1" : "0" ) );
|
||||
}
|
||||
else if (ModAndClassUtil.isDoubleButton && doubleBtn == btn)
|
||||
{
|
||||
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminalEx.Double", Keyboard.isKeyDown( Keyboard.KEY_LSHIFT ) ? "1": "0") );
|
||||
else if (ModAndClassUtil.isDoubleButton && doubleBtn == btn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns("PatternTerminalEx.Double", Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ? "1" : "0"));
|
||||
} else if (ModAndClassUtil.isBeSubstitutionsButton && beSubstitutionsDisabledBtn == btn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns("PatternTerminalEx.beSubstitute", "1"));
|
||||
} else if (ModAndClassUtil.isBeSubstitutionsButton && beSubstitutionsEnabledBtn == btn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns("PatternTerminalEx.beSubstitute", "0"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,17 +123,27 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
|
||||
if (ModAndClassUtil.isDoubleButton) {
|
||||
this.doubleBtn = new GuiImgButton( this.guiLeft + 97, this.guiTop + this.ySize - 153, Settings.ACTIONS, ActionItems.DOUBLE );
|
||||
this.doubleBtn.setHalfSize( true );
|
||||
this.buttonList.add( this.doubleBtn );
|
||||
this.buttonList.add(this.doubleBtn);
|
||||
}
|
||||
|
||||
this.combineEnableBtn = new GuiFCImgButton( this.guiLeft + 87, this.guiTop + this.ySize - 143, "FORCE_COMBINE", "DO_COMBINE" );
|
||||
this.combineEnableBtn.setHalfSize( true );
|
||||
this.buttonList.add( this.combineEnableBtn );
|
||||
this.combineEnableBtn = new GuiFCImgButton(this.guiLeft + 87, this.guiTop + this.ySize - 143, "FORCE_COMBINE", "DO_COMBINE");
|
||||
this.combineEnableBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.combineEnableBtn);
|
||||
|
||||
this.combineDisableBtn = new GuiFCImgButton( this.guiLeft + 87, this.guiTop + this.ySize - 143, "NOT_COMBINE", "DONT_COMBINE" );
|
||||
this.combineDisableBtn.setHalfSize( true );
|
||||
this.buttonList.add( this.combineDisableBtn );
|
||||
this.combineDisableBtn = new GuiFCImgButton(this.guiLeft + 87, this.guiTop + this.ySize - 143, "NOT_COMBINE", "DONT_COMBINE");
|
||||
this.combineDisableBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.combineDisableBtn);
|
||||
if (ModAndClassUtil.isBeSubstitutionsButton) {
|
||||
this.beSubstitutionsEnabledBtn = new GuiImgButton(
|
||||
this.guiLeft + 87, this.guiTop + this.ySize - 133, Settings.ACTIONS, PatternBeSubstitution.ENABLED);
|
||||
this.beSubstitutionsEnabledBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.beSubstitutionsEnabledBtn);
|
||||
|
||||
this.beSubstitutionsDisabledBtn = new GuiImgButton(
|
||||
this.guiLeft + 87, this.guiTop + this.ySize - 133, Settings.ACTIONS, PatternBeSubstitution.DISABLED);
|
||||
this.beSubstitutionsDisabledBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.beSubstitutionsDisabledBtn);
|
||||
}
|
||||
processingScrollBar.setTop(this.ySize - 164);
|
||||
}
|
||||
|
||||
@@ -163,19 +174,25 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
|
||||
this.fluidPrioritizedDisabledBtn.visible = false;
|
||||
}
|
||||
|
||||
if ( this.container.combine )
|
||||
{
|
||||
if (this.container.combine) {
|
||||
this.combineEnableBtn.visible = true;
|
||||
this.combineDisableBtn.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.combineEnableBtn.visible = false;
|
||||
this.combineDisableBtn.visible = true;
|
||||
}
|
||||
if (ModAndClassUtil.isBeSubstitutionsButton) {
|
||||
if (this.container.beSubstitute) {
|
||||
this.beSubstitutionsEnabledBtn.visible = true;
|
||||
this.beSubstitutionsDisabledBtn.visible = false;
|
||||
} else {
|
||||
this.beSubstitutionsEnabledBtn.visible = false;
|
||||
this.beSubstitutionsDisabledBtn.visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
super.drawFG( offsetX, offsetY, mouseX, mouseY );
|
||||
this.fontRendererObj.drawString( StatCollector.translateToLocal(NameConst.GUI_FLUID_PATTERN_TERMINAL_EX), 8, this.ySize - 96 + 2 - getReservedSpace(), 4210752 );
|
||||
super.drawFG(offsetX, offsetY, mouseX, mouseY);
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal(NameConst.GUI_FLUID_PATTERN_TERMINAL_EX), 8, this.ySize - 96 + 2 - getReservedSpace(), 4210752);
|
||||
this.processingScrollBar.draw(this);
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -119,6 +119,7 @@ public class ContainerFluidPatternTerminal extends FCBasePartContainer implement
|
||||
FluidPatternDetails pattern = new FluidPatternDetails(patternStack);
|
||||
pattern.setInputs(collectInventory(craftingSlots));
|
||||
pattern.setOutputs(collectInventory(outputSlots));
|
||||
pattern.setCanBeSubstitute(this.beSubstitute ? 1 : 0);
|
||||
patternSlotOUT.putStack(pattern.writeToStack());
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -116,6 +116,7 @@ public class ContainerFluidPatternTerminalEx extends FCBasePartContainerEx imple
|
||||
pattern.setCombine(this.combine ? 1:0);
|
||||
pattern.setInputs(collectInventory(craftingSlots));
|
||||
pattern.setOutputs(collectInventory(outputSlots));
|
||||
pattern.setCanBeSubstitute(this.beSubstitute ? 1 : 0);
|
||||
patternSlotOUT.putStack(pattern.writeToStack());
|
||||
}
|
||||
|
||||
|
||||
@@ -54,20 +54,22 @@ public class FCBasePartContainer extends FCBaseMonitorContain implements IAEAppE
|
||||
protected final SlotPatternTerm craftSlot;
|
||||
protected final SlotRestrictedInput patternSlotIN;
|
||||
protected final SlotRestrictedInput patternSlotOUT;
|
||||
@GuiSync( 97 )
|
||||
@GuiSync(97)
|
||||
public boolean craftingMode = true;
|
||||
@GuiSync( 96 )
|
||||
@GuiSync(96)
|
||||
public boolean substitute = false;
|
||||
@GuiSync( 95 )
|
||||
@GuiSync(95)
|
||||
public boolean combine = false;
|
||||
@GuiSync(94)
|
||||
public boolean beSubstitute = false;
|
||||
|
||||
public FCBasePartContainer(final InventoryPlayer ip, final ITerminalHost monitorable )
|
||||
{
|
||||
super( ip, monitorable, false );
|
||||
|
||||
public FCBasePartContainer(final InventoryPlayer ip, final ITerminalHost monitorable) {
|
||||
super(ip, monitorable, false);
|
||||
this.patternTerminal = (PartFluidPatternTerminal) monitorable;
|
||||
|
||||
final IInventory patternInv = this.getPatternTerminal().getInventoryByName( "pattern" );
|
||||
final IInventory output = this.getPatternTerminal().getInventoryByName( "output" );
|
||||
final IInventory patternInv = this.getPatternTerminal().getInventoryByName("pattern");
|
||||
final IInventory output = this.getPatternTerminal().getInventoryByName("output");
|
||||
|
||||
this.crafting = this.getPatternTerminal().getInventoryByName( "crafting" );
|
||||
|
||||
@@ -238,9 +240,9 @@ public class FCBasePartContainer extends FCBaseMonitorContain implements IAEAppE
|
||||
encodedValue.setTag( "in", tagIn );
|
||||
encodedValue.setTag( "out", tagOut );
|
||||
encodedValue.setBoolean( "crafting", this.isCraftingMode() );
|
||||
encodedValue.setBoolean( "substitute", this.isSubstitute() );
|
||||
|
||||
output.setTagCompound( encodedValue );
|
||||
encodedValue.setBoolean("substitute", this.isSubstitute());
|
||||
encodedValue.setBoolean("beSubstitute", this.canBeSubstitute());
|
||||
output.setTagCompound(encodedValue);
|
||||
}
|
||||
|
||||
private ItemStack[] getInputs()
|
||||
@@ -460,6 +462,7 @@ public class FCBasePartContainer extends FCBaseMonitorContain implements IAEAppE
|
||||
|
||||
this.substitute = this.patternTerminal.isSubstitution();
|
||||
this.combine = this.patternTerminal.shouldCombine();
|
||||
this.beSubstitute = this.patternTerminal.canBeSubstitute();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -543,23 +546,23 @@ public class FCBasePartContainer extends FCBaseMonitorContain implements IAEAppE
|
||||
return this.craftingMode;
|
||||
}
|
||||
|
||||
private void setCraftingMode( final boolean craftingMode )
|
||||
{
|
||||
private void setCraftingMode(final boolean craftingMode) {
|
||||
this.craftingMode = craftingMode;
|
||||
}
|
||||
|
||||
public PartFluidPatternTerminal getPatternTerminal()
|
||||
{
|
||||
public PartFluidPatternTerminal getPatternTerminal() {
|
||||
return this.patternTerminal;
|
||||
}
|
||||
|
||||
private boolean isSubstitute()
|
||||
{
|
||||
private boolean canBeSubstitute() {
|
||||
return this.beSubstitute;
|
||||
}
|
||||
|
||||
private boolean isSubstitute() {
|
||||
return this.substitute;
|
||||
}
|
||||
|
||||
public void setSubstitute( final boolean substitute )
|
||||
{
|
||||
public void setSubstitute(final boolean substitute) {
|
||||
this.substitute = substitute;
|
||||
}
|
||||
|
||||
|
||||
+21
-17
@@ -63,25 +63,26 @@ public class FCBasePartContainerEx extends FCBaseMonitorContain implements IAEAp
|
||||
protected final ProcessingSlotFake[] outputSlots = new ProcessingSlotFake[CRAFTING_GRID_SLOTS * CRAFTING_GRID_PAGES];
|
||||
protected final SlotRestrictedInput patternSlotIN;
|
||||
protected final SlotRestrictedInput patternSlotOUT;
|
||||
@GuiSync( 96 + (17-9) + 11 )
|
||||
@GuiSync(96 + (17 - 9) + 11)
|
||||
public boolean combine = false;
|
||||
@GuiSync( 96 + (17-9) + 12 )
|
||||
@GuiSync(96 + (17 - 9) + 12)
|
||||
public boolean substitute = false;
|
||||
@GuiSync( 96 + (17-9) + 16 )
|
||||
@GuiSync(96 + (17 - 9) + 16)
|
||||
public boolean inverted;
|
||||
@GuiSync( 96 + (17-9) + 17 )
|
||||
@GuiSync(96 + (17 - 9) + 17)
|
||||
public int activePage = 0;
|
||||
@GuiSync( 96 + (17-9) + 13 )
|
||||
@GuiSync(96 + (17 - 9) + 13)
|
||||
public boolean prioritize = false;
|
||||
@GuiSync(96 + (17 - 9) + 14)
|
||||
public boolean beSubstitute = false;
|
||||
|
||||
public FCBasePartContainerEx(final InventoryPlayer ip, final ITerminalHost monitorable )
|
||||
{
|
||||
super( ip, monitorable, false );
|
||||
public FCBasePartContainerEx(final InventoryPlayer ip, final ITerminalHost monitorable) {
|
||||
super(ip, monitorable, false);
|
||||
this.patternTerminal = (PartFluidPatternTerminalEx) monitorable;
|
||||
this.inverted = patternTerminal.isInverted();
|
||||
|
||||
final IInventory patternInv = this.getPatternTerminal().getInventoryByName( "pattern" );
|
||||
final IInventory output = this.getPatternTerminal().getInventoryByName( "output" );
|
||||
final IInventory patternInv = this.getPatternTerminal().getInventoryByName("pattern");
|
||||
final IInventory output = this.getPatternTerminal().getInventoryByName("output");
|
||||
IInventory crafting = this.getPatternTerminal().getInventoryByName("crafting");
|
||||
|
||||
for (int page = 0; page < CRAFTING_GRID_PAGES; page++) {
|
||||
@@ -210,9 +211,9 @@ public class FCBasePartContainerEx extends FCBaseMonitorContain implements IAEAp
|
||||
|
||||
encodedValue.setTag( "in", tagIn );
|
||||
encodedValue.setTag( "out", tagOut );
|
||||
encodedValue.setBoolean( "substitute", this.isSubstitute() );
|
||||
|
||||
encodedValue.setTag( "in", tagIn );
|
||||
encodedValue.setBoolean("substitute", this.isSubstitute());
|
||||
encodedValue.setBoolean("beSubstitute", this.canBeSubstitute());
|
||||
encodedValue.setTag("in", tagIn);
|
||||
encodedValue.setTag( "out", tagOut );
|
||||
encodedValue.setBoolean( "prioritize", this.isPrioritize() );
|
||||
|
||||
@@ -315,6 +316,7 @@ public class FCBasePartContainerEx extends FCBaseMonitorContain implements IAEAp
|
||||
{
|
||||
this.substitute = this.patternTerminal.isSubstitution();
|
||||
this.combine = this.patternTerminal.shouldCombine(); //Check out
|
||||
this.beSubstitute = this.patternTerminal.canBeSubstitute();
|
||||
this.prioritize = this.patternTerminal.isPrioritize();
|
||||
if (inverted != patternTerminal.isInverted() || activePage != patternTerminal.getActivePage()) {
|
||||
inverted = patternTerminal.isInverted();
|
||||
@@ -451,10 +453,8 @@ public class FCBasePartContainerEx extends FCBaseMonitorContain implements IAEAp
|
||||
{
|
||||
doubleStacksInternal(this.craftingSlots);
|
||||
doubleStacksInternal(this.outputSlots);
|
||||
if (isShift && !containsFluid(outputSlots) && !containsFluid(craftingSlots))
|
||||
{
|
||||
while (canDoubleStacks(craftingSlots) && canDoubleStacks(outputSlots))
|
||||
{
|
||||
if (isShift && !containsFluid(outputSlots) && !containsFluid(craftingSlots)) {
|
||||
while (canDoubleStacks(craftingSlots) && canDoubleStacks(outputSlots)) {
|
||||
doubleStacksInternal(this.craftingSlots);
|
||||
doubleStacksInternal(this.outputSlots);
|
||||
}
|
||||
@@ -463,6 +463,10 @@ public class FCBasePartContainerEx extends FCBaseMonitorContain implements IAEAp
|
||||
}
|
||||
}
|
||||
|
||||
private boolean canBeSubstitute() {
|
||||
return this.beSubstitute;
|
||||
}
|
||||
|
||||
static boolean containsFluid(SlotFake[] slots) {
|
||||
List<SlotFake> enabledSlots = Arrays.stream(slots).filter(SlotFake::isEnabled).collect(Collectors.toList());
|
||||
long fluid = enabledSlots.stream().filter(s -> Util.isFluidPacket(s.getStack())).count();
|
||||
|
||||
Reference in new issue
Block a user