Add support for the Advanced Blocking Card to Dual Interfaces (#123)

* Update ae2 to latest (beta-203)

* Add support for the Advanced Blocking Card to Dual Interfaces

Behavior: The Dual Interface acts in the same way as the regular ME
interface when the advanced blocking card is used, but has an additional
check for fluids on top of items contained in the ME system.
This commit is contained in:
firenoo authored and GitHub committed 2023-05-05 20:19:55 +02:00
1 parent d2df9beb31
commit 97c7533ffb
4 files changed
+32 -13

No files matched your search

@@ -6,10 +6,7 @@ import net.minecraft.util.StatCollector;
import org.lwjgl.input.Mouse;
import appeng.api.config.InsertionMode;
import appeng.api.config.Settings;
import appeng.api.config.SidelessMode;
import appeng.api.config.YesNo;
import appeng.api.config.*;
import appeng.client.gui.implementations.GuiUpgradeable;
import appeng.client.gui.widgets.GuiImgButton;
import appeng.client.gui.widgets.GuiTabButton;
@@ -38,6 +35,7 @@ public class GuiDualInterface extends GuiUpgradeable {
private GuiToggleButton interfaceMode;
private GuiImgButton insertionMode;
private GuiImgButton sidelessMode;
private GuiImgButton advancedBlockingMode;
private final IInterfaceHost host;
public GuiDualInterface(InventoryPlayer inventoryPlayer, IInterfaceHost te) {
@@ -85,10 +83,17 @@ public class GuiDualInterface extends GuiUpgradeable {
InsertionMode.DEFAULT);
this.buttonList.add(this.insertionMode);
this.advancedBlockingMode = new GuiImgButton(
this.guiLeft - 18,
this.guiTop + 62,
Settings.ADVANCED_BLOCKING_MODE,
AdvancedBlockingMode.DEFAULT);
this.buttonList.add(this.advancedBlockingMode);
if (isTile()) {
this.sidelessMode = new GuiImgButton(
this.guiLeft - 18,
this.guiTop + 62,
this.guiTop + 80,
Settings.SIDELESS_MODE,
SidelessMode.SIDELESS);
this.buttonList.add(this.sidelessMode);
@@ -110,7 +115,9 @@ public class GuiDualInterface extends GuiUpgradeable {
if (this.sidelessMode != null) {
this.sidelessMode.set(((ContainerDualInterface) this.cvb).getSidelessMode());
}
if (this.advancedBlockingMode != null) {
this.advancedBlockingMode.set(((ContainerDualInterface) this.cvb).getAdvancedBlockingMode());
}
this.fontRendererObj.drawString(
getGuiDisplayName(StatCollector.translateToLocal(NameConst.GUI_FLUID_INTERFACE)),
8,
@@ -160,6 +167,10 @@ public class GuiDualInterface extends GuiUpgradeable {
if (btn == this.sidelessMode) {
NetworkHandler.instance.sendToServer(new PacketConfigButton(this.sidelessMode.getSetting(), backwards));
}
if (btn == this.advancedBlockingMode) {
NetworkHandler.instance
.sendToServer(new PacketConfigButton(this.advancedBlockingMode.getSetting(), backwards));
}
}
private boolean isPart() {