mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-16 01:54:59 +00:00
update
This commit is contained in:
1 parent
1bbc575f6e
commit
f81fab984a
4 files changed
+157
-39
No files matched your search
@@ -49,8 +49,10 @@ import codechicken.nei.LayoutManager;
|
||||
import codechicken.nei.util.TextHistory;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.FCGuiTextField;
|
||||
import com.glodblock.github.client.gui.*;
|
||||
import com.glodblock.github.client.gui.container.base.FCContainerMonitor;
|
||||
import com.glodblock.github.common.item.ItemWirelessUltraTerminal;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.network.CPacketInventoryAction;
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
@@ -85,6 +87,11 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
protected GuiImgButton searchBoxSettings;
|
||||
protected GuiImgButton terminalStyleBox;
|
||||
protected GuiImgButton searchStringSave;
|
||||
protected GuiFCImgButton FluidTerminal;
|
||||
protected GuiFCImgButton CraftingTerminal;
|
||||
protected GuiFCImgButton PatternTerminal;
|
||||
protected GuiFCImgButton EssentiaTerminal;
|
||||
protected boolean drawSwitchGuiIcon = true;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public FCGuiMonitor(final InventoryPlayer inventoryPlayer, final ITerminalHost te, final FCContainerMonitor<T> c) {
|
||||
@@ -114,7 +121,17 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
if (btn == this.craftingStatusBtn || btn == this.craftingStatusImgBtn) {
|
||||
NetworkHandler.instance.sendToServer(new PacketSwitchGuis(GuiBridge.GUI_CRAFTING_STATUS));
|
||||
}
|
||||
|
||||
if (btn instanceof GuiFCImgButton) {
|
||||
if (btn == this.FluidTerminal) {
|
||||
ItemWirelessUltraTerminal.switchTerminal(this.mc.thePlayer, GuiType.WIRELESS_FLUID_TERMINAL);
|
||||
} else if (btn == this.CraftingTerminal) {
|
||||
ItemWirelessUltraTerminal.switchTerminal(this.mc.thePlayer, GuiType.WIRELESS_CRAFTING_TERMINAL);
|
||||
} else if (btn == this.EssentiaTerminal) {
|
||||
ItemWirelessUltraTerminal.switchTerminal(this.mc.thePlayer, GuiType.WIRELESS_ESSENTIA_TERMINAL);
|
||||
} else if (btn == this.PatternTerminal) {
|
||||
ItemWirelessUltraTerminal.switchTerminal(this.mc.thePlayer, GuiType.WIRELESS_FLUID_PATTERN_TERMINAL);
|
||||
}
|
||||
}
|
||||
if (btn instanceof GuiImgButton) {
|
||||
final boolean backwards = Mouse.isButtonDown(1);
|
||||
final GuiImgButton iBtn = (GuiImgButton) btn;
|
||||
@@ -323,6 +340,52 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
|
||||
craftingGridOffsetX -= 25;
|
||||
craftingGridOffsetY -= 6;
|
||||
if (drawSwitchGuiIcon) drawSwitchGuiBtn();
|
||||
}
|
||||
|
||||
private void drawSwitchGuiBtn() {
|
||||
if (this.mc.thePlayer.inventory.getCurrentItem().getItem() instanceof ItemWirelessUltraTerminal) {
|
||||
if (!(this instanceof GuiFluidCraftingWireless)) {
|
||||
this.buttonList.add(
|
||||
this.CraftingTerminal = new GuiFCImgButton(
|
||||
this.guiLeft - 18,
|
||||
this.offsetY,
|
||||
"CRAFT_TEM",
|
||||
"YES",
|
||||
false));
|
||||
this.offsetY += 20;
|
||||
}
|
||||
if (!(this instanceof GuiFluidPatternWireless)) {
|
||||
this.buttonList.add(
|
||||
this.PatternTerminal = new GuiFCImgButton(
|
||||
this.guiLeft - 18,
|
||||
this.offsetY,
|
||||
"PATTERN_TEM",
|
||||
"YES",
|
||||
false));
|
||||
this.offsetY += 20;
|
||||
}
|
||||
if (!(this instanceof GuiFluidPortableCell)) {
|
||||
this.buttonList.add(
|
||||
this.FluidTerminal = new GuiFCImgButton(
|
||||
this.guiLeft - 18,
|
||||
this.offsetY,
|
||||
"FLUID_TEM",
|
||||
"YES",
|
||||
false));
|
||||
this.offsetY += 20;
|
||||
}
|
||||
if (!(this instanceof GuiEssentiaTerminal)) {
|
||||
this.buttonList.add(
|
||||
this.EssentiaTerminal = new GuiFCImgButton(
|
||||
this.guiLeft - 18,
|
||||
this.offsetY,
|
||||
"ESSENTIA_TEM",
|
||||
"YES",
|
||||
false));
|
||||
this.offsetY += 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setSearchString(String memoryText, boolean updateView) {
|
||||
|
||||
+14
-12
@@ -79,19 +79,21 @@ public abstract class FCContainerMonitor<T extends IAEStack<T>> extends AEBaseCo
|
||||
if (isInvalid()) {
|
||||
this.setValidContainer(false);
|
||||
}
|
||||
for (final Settings set : this.serverCM.getSettings()) {
|
||||
final Enum<?> sideLocal = this.serverCM.getSetting(set);
|
||||
final Enum<?> sideRemote = this.clientCM.getSetting(set);
|
||||
if (this.serverCM != null) {
|
||||
for (final Settings set : this.serverCM.getSettings()) {
|
||||
final Enum<?> sideLocal = this.serverCM.getSetting(set);
|
||||
final Enum<?> sideRemote = this.clientCM.getSetting(set);
|
||||
|
||||
if (sideLocal != sideRemote) {
|
||||
this.clientCM.putSetting(set, sideLocal);
|
||||
for (final Object crafter : this.crafters) {
|
||||
try {
|
||||
NetworkHandler.instance.sendTo(
|
||||
new PacketValueConfig(set.name(), sideLocal.name()),
|
||||
(EntityPlayerMP) crafter);
|
||||
} catch (final IOException e) {
|
||||
AELog.debug(e);
|
||||
if (sideLocal != sideRemote) {
|
||||
this.clientCM.putSetting(set, sideLocal);
|
||||
for (final Object crafter : this.crafters) {
|
||||
try {
|
||||
NetworkHandler.instance.sendTo(
|
||||
new PacketValueConfig(set.name(), sideLocal.name()),
|
||||
(EntityPlayerMP) crafter);
|
||||
} catch (final IOException e) {
|
||||
AELog.debug(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user