mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-16 18:44:42 +00:00
fix bugs
This commit is contained in:
1 parent
f22bebbf21
commit
c1b2400549
23 files changed
+252
-105
No files matched your search
@@ -1,36 +0,0 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
|
||||
public class FCGuiSwitchTerminal {
|
||||
|
||||
private GuiFCImgButton fluidBtn;
|
||||
private GuiFCImgButton essentiaBtn;
|
||||
private GuiFCImgButton craftBtn;
|
||||
private GuiFCImgButton patternBtn;
|
||||
private final GuiType originGui;
|
||||
|
||||
public FCGuiSwitchTerminal(GuiType gui) {
|
||||
this.originGui = gui;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public void addButtons(List buttonList, int offsetX, int offsetY) {
|
||||
int y = 0;
|
||||
if (this.originGui != GuiType.WIRELESS_FLUID_TERMINAL) {
|
||||
buttonList.add(fluidBtn = new GuiFCImgButton(offsetX, offsetY + y, "FLUID_TEM", "YES"));
|
||||
y += 20;
|
||||
}
|
||||
if (ModAndClassUtil.ThE && this.originGui != GuiType.WIRELESS_ESSENTIA_TERMINAL) {
|
||||
buttonList.add(essentiaBtn = new GuiFCImgButton(offsetX, offsetY + y, "ESSENTIA_TEM", "YES"));
|
||||
y += 20;
|
||||
}
|
||||
buttonList.add(craftBtn = new GuiFCImgButton(offsetX, offsetY + y, "CRAFT_TEM", "YES"));
|
||||
y += 20;
|
||||
buttonList.add(patternBtn = new GuiFCImgButton(offsetX, offsetY + y, "PATTERN_TEM", "YES"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,6 +4,9 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
@@ -90,6 +93,15 @@ public class GuiEssentiaTerminal extends GuiFluidMonitor {
|
||||
super.handleMouseClick(slot, slotIdx, ctrlDown, mouseButton);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(final GuiButton btn) {
|
||||
if (btn == craftingStatusBtn) {
|
||||
InventoryHandler.switchGui(GuiType.CRAFTING_STATUS);
|
||||
} else {
|
||||
super.actionPerformed(btn);
|
||||
}
|
||||
}
|
||||
|
||||
public void update(ItemStack itemStack) {
|
||||
this.player.inventory.setItemStack(itemStack);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import com.glodblock.github.common.item.ItemWirelessUltraTerminal;
|
||||
import com.glodblock.github.inventory.item.IWirelessTerminal;
|
||||
import com.glodblock.github.inventory.item.WirelessFluidTerminalInventory;
|
||||
import com.glodblock.github.inventory.item.WirelessPatternTerminalInventory;
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -64,14 +69,18 @@ public class GuiFluidCraftAmount extends FCGuiAmount {
|
||||
if (target instanceof PartFluidPatternTerminal) {
|
||||
this.myIcon = new ItemStack(ItemAndBlockHolder.FLUID_TERMINAL, 1);
|
||||
this.originalGui = GuiType.FLUID_PATTERN_TERMINAL;
|
||||
}
|
||||
if (target instanceof PartFluidPatternTerminalEx) {
|
||||
} else if (target instanceof PartFluidPatternTerminalEx) {
|
||||
this.myIcon = new ItemStack(ItemAndBlockHolder.FLUID_TERMINAL_EX, 1);
|
||||
this.originalGui = GuiType.FLUID_PATTERN_TERMINAL_EX;
|
||||
}
|
||||
if (target instanceof PartFluidTerminal) {
|
||||
} else if (target instanceof PartFluidTerminal) {
|
||||
this.myIcon = new ItemStack(ItemAndBlockHolder.FLUID_TERM, 1);
|
||||
this.originalGui = GuiType.FLUID_TERMINAL;
|
||||
} else if (target instanceof IWirelessTerminal && ((IWirelessTerminal) target).isUniversal(target)) {
|
||||
this.myIcon = new ItemStack(ItemAndBlockHolder.WIRELESS_ULTRA_TERM, 1);
|
||||
this.originalGui = ItemWirelessUltraTerminal.readMode(((IWirelessTerminal) target).getItemStack());
|
||||
} else if (target instanceof WirelessPatternTerminalInventory) {
|
||||
this.myIcon = new ItemStack(ItemAndBlockHolder.WIRELESS_PATTERN_TERM, 1);
|
||||
this.originalGui = GuiType.FLUID_TERMINAL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ package com.glodblock.github.client.gui;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.*;
|
||||
|
||||
import com.glodblock.github.common.item.ItemWirelessUltraTerminal;
|
||||
import com.glodblock.github.inventory.item.IWirelessTerminal;
|
||||
import com.glodblock.github.inventory.item.WirelessPatternTerminalInventory;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -62,9 +65,12 @@ public class GuiFluidCraftConfirm extends AEBaseGui {
|
||||
|
||||
if (te instanceof PartFluidPatternTerminal) {
|
||||
this.OriginalGui = GuiType.FLUID_PATTERN_TERMINAL;
|
||||
}
|
||||
if (te instanceof PartFluidPatternTerminalEx) {
|
||||
} else if (te instanceof PartFluidPatternTerminalEx) {
|
||||
this.OriginalGui = GuiType.FLUID_PATTERN_TERMINAL_EX;
|
||||
} else if (te instanceof IWirelessTerminal && ((IWirelessTerminal) te).isUniversal(te)) {
|
||||
this.OriginalGui = ItemWirelessUltraTerminal.readMode(((IWirelessTerminal) te).getItemStack());
|
||||
} else if (te instanceof WirelessPatternTerminalInventory) {
|
||||
this.OriginalGui = GuiType.FLUID_TERMINAL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
@@ -29,18 +31,22 @@ public class GuiFluidCraftingWireless extends GuiItemMonitor {
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(final GuiButton btn) {
|
||||
super.actionPerformed(btn);
|
||||
if (this.clearBtn == btn) {
|
||||
Slot s = null;
|
||||
final Container c = this.inventorySlots;
|
||||
for (final Object j : c.inventorySlots) {
|
||||
if (j instanceof SlotCraftingMatrix) {
|
||||
s = (Slot) j;
|
||||
if (btn == craftingStatusBtn) {
|
||||
InventoryHandler.switchGui(GuiType.CRAFTING_STATUS);
|
||||
} else {
|
||||
super.actionPerformed(btn);
|
||||
if (this.clearBtn == btn) {
|
||||
Slot s = null;
|
||||
final Container c = this.inventorySlots;
|
||||
for (final Object j : c.inventorySlots) {
|
||||
if (j instanceof SlotCraftingMatrix) {
|
||||
s = (Slot) j;
|
||||
}
|
||||
}
|
||||
if (s != null) {
|
||||
final PacketInventoryAction p = new PacketInventoryAction(InventoryAction.MOVE_REGION, s.slotNumber, 0);
|
||||
NetworkHandler.instance.sendToServer(p);
|
||||
}
|
||||
}
|
||||
if (s != null) {
|
||||
final PacketInventoryAction p = new PacketInventoryAction(InventoryAction.MOVE_REGION, s.slotNumber, 0);
|
||||
NetworkHandler.instance.sendToServer(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
-1
@@ -1,5 +1,7 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import com.glodblock.github.common.item.ItemWirelessUltraTerminal;
|
||||
import com.glodblock.github.inventory.item.IWirelessTerminal;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -36,12 +38,13 @@ public class GuiFluidPatternTerminalCraftingStatus extends GuiCraftingStatus {
|
||||
Ae2ReflectClient.rewriteIcon(this, new ItemStack(ItemAndBlockHolder.FLUID_TERMINAL_EX, 1));
|
||||
else if (host instanceof PartFluidTerminal) {
|
||||
Ae2ReflectClient.rewriteIcon(this, new ItemStack(ItemAndBlockHolder.FLUID_TERM, 1));
|
||||
} else if (host instanceof IWirelessTerminal && ((IWirelessTerminal) host).isUniversal(host)) {
|
||||
Ae2ReflectClient.rewriteIcon(this, new ItemStack(ItemAndBlockHolder.WIRELESS_ULTRA_TERM, 1));
|
||||
} else if (host instanceof WirelessFluidTerminalInventory) {
|
||||
Ae2ReflectClient.rewriteIcon(this, new ItemStack(ItemAndBlockHolder.WIRELESS_FLUID_TERM, 1));
|
||||
} else if (host instanceof WirelessPatternTerminalInventory) {
|
||||
Ae2ReflectClient.rewriteIcon(this, new ItemStack(ItemAndBlockHolder.WIRELESS_PATTERN_TERM, 1));
|
||||
}
|
||||
|
||||
super.initGui();
|
||||
originalGuiBtn = Ae2ReflectClient.getOriginalGuiButton(this);
|
||||
}
|
||||
@@ -53,6 +56,8 @@ public class GuiFluidPatternTerminalCraftingStatus extends GuiCraftingStatus {
|
||||
else if (host instanceof PartFluidPatternTerminalEx)
|
||||
InventoryHandler.switchGui(GuiType.FLUID_PATTERN_TERMINAL_EX);
|
||||
else if (host instanceof PartFluidTerminal) InventoryHandler.switchGui(GuiType.FLUID_TERMINAL);
|
||||
else if (host instanceof IWirelessTerminal && ((IWirelessTerminal) host).isUniversal(host))
|
||||
InventoryHandler.switchGui(ItemWirelessUltraTerminal.readMode(((IWirelessTerminal) host).getItemStack()));
|
||||
else if (host instanceof WirelessFluidTerminalInventory)
|
||||
InventoryHandler.switchGui(GuiType.WIRELESS_FLUID_TERMINAL);
|
||||
else if (host instanceof WirelessPatternTerminalInventory)
|
||||
|
||||
@@ -9,5 +9,4 @@ public class GuiFluidPatternWireless extends GuiFluidPatternTerminal {
|
||||
public GuiFluidPatternWireless(InventoryPlayer inventoryPlayer, IWirelessTerminal te) {
|
||||
super(inventoryPlayer, te);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import com.glodblock.github.common.item.ItemWirelessUltraTerminal;
|
||||
import com.glodblock.github.inventory.item.IWirelessTerminal;
|
||||
import com.glodblock.github.inventory.item.WirelessPatternTerminalInventory;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -66,10 +69,15 @@ public class GuiPatternValueAmount extends FCGuiAmount {
|
||||
if (target instanceof PartFluidPatternTerminal) {
|
||||
this.myIcon = new ItemStack(ItemAndBlockHolder.FLUID_TERMINAL, 1);
|
||||
this.originalGui = GuiType.FLUID_PATTERN_TERMINAL;
|
||||
}
|
||||
if (target instanceof PartFluidPatternTerminalEx) {
|
||||
} else if (target instanceof PartFluidPatternTerminalEx) {
|
||||
this.myIcon = new ItemStack(ItemAndBlockHolder.FLUID_TERMINAL_EX, 1);
|
||||
this.originalGui = GuiType.FLUID_PATTERN_TERMINAL_EX;
|
||||
} else if (target instanceof IWirelessTerminal && ((IWirelessTerminal) target).isUniversal(target)) {
|
||||
this.myIcon = new ItemStack(ItemAndBlockHolder.WIRELESS_ULTRA_TERM, 1);
|
||||
this.originalGui = ItemWirelessUltraTerminal.readMode(((IWirelessTerminal) target).getItemStack());
|
||||
} else if (target instanceof WirelessPatternTerminalInventory) {
|
||||
this.myIcon = new ItemStack(ItemAndBlockHolder.WIRELESS_PATTERN_TERM, 1);
|
||||
this.originalGui = GuiType.WIRELESS_FLUID_PATTERN_TERMINAL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
protected int rows = 0;
|
||||
protected int maxRows = Integer.MAX_VALUE;
|
||||
protected int standardSize;
|
||||
protected int offsetY;
|
||||
protected GuiImgButton ViewBox;
|
||||
protected GuiImgButton SortByBox;
|
||||
protected GuiImgButton SortDirBox;
|
||||
@@ -200,60 +201,60 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
final int unusedSpace = this.height - this.ySize;
|
||||
this.guiTop = (int) Math.floor(unusedSpace / (unusedSpace < 0 ? 3.8f : 2.0f));
|
||||
|
||||
int offset = this.guiTop + 8;
|
||||
this.offsetY = this.guiTop + 8;
|
||||
|
||||
if (this.customSortOrder) {
|
||||
this.buttonList.add(
|
||||
this.SortByBox = new GuiImgButton(
|
||||
this.guiLeft - 18,
|
||||
offset,
|
||||
this.offsetY,
|
||||
Settings.SORT_BY,
|
||||
this.configSrc.getSetting(Settings.SORT_BY)));
|
||||
offset += 20;
|
||||
this.offsetY += 20;
|
||||
}
|
||||
if (this.showViewBtn) {
|
||||
this.buttonList.add(
|
||||
this.ViewBox = new GuiImgButton(
|
||||
this.guiLeft - 18,
|
||||
offset,
|
||||
this.offsetY,
|
||||
Settings.VIEW_MODE,
|
||||
this.configSrc.getSetting(Settings.VIEW_MODE)));
|
||||
offset += 20;
|
||||
this.offsetY += 20;
|
||||
}
|
||||
|
||||
this.buttonList.add(
|
||||
this.SortDirBox = new GuiImgButton(
|
||||
this.guiLeft - 18,
|
||||
offset,
|
||||
this.offsetY,
|
||||
Settings.SORT_DIRECTION,
|
||||
this.configSrc.getSetting(Settings.SORT_DIRECTION)));
|
||||
offset += 20;
|
||||
this.offsetY += 20;
|
||||
|
||||
this.buttonList.add(
|
||||
this.searchBoxSettings = new GuiImgButton(
|
||||
this.guiLeft - 18,
|
||||
offset,
|
||||
this.offsetY,
|
||||
Settings.SEARCH_MODE,
|
||||
AEConfig.instance.settings.getSetting(Settings.SEARCH_MODE)));
|
||||
offset += 20;
|
||||
this.offsetY += 20;
|
||||
|
||||
if (ModAndClassUtil.isSaveText) {
|
||||
this.buttonList.add(
|
||||
this.searchStringSave = new GuiImgButton(
|
||||
this.guiLeft - 18,
|
||||
offset,
|
||||
this.offsetY,
|
||||
Settings.SAVE_SEARCH,
|
||||
AEConfig.instance.preserveSearchBar ? YesNo.YES : YesNo.NO));
|
||||
offset += 20;
|
||||
this.offsetY += 20;
|
||||
}
|
||||
|
||||
this.buttonList.add(
|
||||
this.terminalStyleBox = new GuiImgButton(
|
||||
this.guiLeft - 18,
|
||||
offset,
|
||||
this.offsetY,
|
||||
Settings.TERMINAL_STYLE,
|
||||
AEConfig.instance.settings.getSetting(Settings.TERMINAL_STYLE)));
|
||||
offset += 20;
|
||||
this.offsetY += 20;
|
||||
|
||||
this.searchField = new FCGuiTextField(
|
||||
this.fontRendererObj,
|
||||
@@ -274,9 +275,10 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
this.buttonList.add(
|
||||
this.craftingStatusImgBtn = new GuiImgButton(
|
||||
this.guiLeft - 18,
|
||||
offset,
|
||||
this.offsetY,
|
||||
Settings.CRAFTING_STATUS,
|
||||
AEConfig.instance.settings.getSetting(Settings.CRAFTING_STATUS)));
|
||||
this.offsetY += 20;
|
||||
} else {
|
||||
this.buttonList.add(
|
||||
this.craftingStatusBtn = new GuiTabButton(
|
||||
|
||||
Reference in new issue
Block a user