mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-16 10:34:40 +00:00
Cleanup (#253)
This commit is contained in:
1 parent
4a39cf4ece
commit
0df88f2305
63 files changed
+123
-187
No files matched your search
@@ -6,8 +6,6 @@ public class FCGuiLineField extends FCGuiTextField {
|
||||
|
||||
private final int _xPos;
|
||||
private final int _yPos;
|
||||
private final int _width;
|
||||
private final FontRenderer _fontRender;
|
||||
|
||||
public FCGuiLineField(FontRenderer fontRenderer, int xPos, int yPos, int width) {
|
||||
this(fontRenderer, xPos, yPos, width, 5);
|
||||
@@ -17,8 +15,6 @@ public class FCGuiLineField extends FCGuiTextField {
|
||||
super(fontRenderer, xPos, yPos, width, height);
|
||||
this._xPos = xPos;
|
||||
this._yPos = yPos;
|
||||
this._width = width;
|
||||
this._fontRender = fontRenderer;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -71,9 +71,9 @@ public class FCGuiTextField extends GuiTextField {
|
||||
mouseY = 15;
|
||||
}
|
||||
if (mouseX + length + 20 >= gui.width) {
|
||||
gui.drawTooltip(mouseX - length - 20, mouseY + 4 + offsetY, 0, this.getMessage());
|
||||
gui.drawTooltip(mouseX - length - 20, mouseY + 4 + offsetY, this.getMessage());
|
||||
} else {
|
||||
gui.drawTooltip(mouseX, mouseY + 4 + offsetY, 0, this.getMessage());
|
||||
gui.drawTooltip(mouseX, mouseY + 4 + offsetY, this.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,6 @@ public class GuiDualInterface extends GuiUpgradeable {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
protected void addButtons() {
|
||||
this.priority = new GuiTabButton(
|
||||
this.guiLeft + 154,
|
||||
@@ -244,10 +243,6 @@ public class GuiDualInterface extends GuiUpgradeable {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isPart() {
|
||||
return this.host instanceof PartFluidInterface;
|
||||
}
|
||||
|
||||
private boolean isTile() {
|
||||
return this.host instanceof TileFluidInterface;
|
||||
}
|
||||
|
||||
@@ -74,9 +74,9 @@ public class GuiFluidCraftAmount extends FCGuiAmount {
|
||||
if (btn == this.craftingMode) {
|
||||
GuiImgButton iBtn = ((GuiImgButton) btn);
|
||||
|
||||
final Enum cv = iBtn.getCurrentValue();
|
||||
final Enum<?> cv = iBtn.getCurrentValue();
|
||||
final boolean backwards = Mouse.isButtonDown(1);
|
||||
final Enum next = Platform.rotateEnum(cv, backwards, iBtn.getSetting().getPossibleValues());
|
||||
final Enum<?> next = Platform.rotateEnum(cv, backwards, iBtn.getSetting().getPossibleValues());
|
||||
|
||||
iBtn.set(next);
|
||||
} else if (btn == this.submit && this.submit.enabled) {
|
||||
|
||||
@@ -55,7 +55,6 @@ public class GuiFluidCraftingWireless extends GuiItemMonitor {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
this.buttonList.add(
|
||||
|
||||
@@ -66,7 +66,6 @@ public class GuiFluidInterface extends AEBaseGui {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
this.switcher = new GuiTabButton(
|
||||
|
||||
@@ -36,7 +36,6 @@ public class GuiFluidPatternTerminal extends FCGuiEncodeTerminal {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
this.tabCraftButton = new GuiTabButton(
|
||||
|
||||
@@ -37,7 +37,6 @@ public class GuiFluidPatternTerminalEx extends FCGuiEncodeTerminal {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ public class GuiFluidStorageBus extends GuiUpgradeable {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
protected void addButtons() {
|
||||
this.clear = new GuiImgButton(this.guiLeft - 18, this.guiTop + 8, Settings.ACTIONS, ActionItems.CLOSE);
|
||||
this.partition = new GuiImgButton(this.guiLeft - 18, this.guiTop + 28, Settings.ACTIONS, ActionItems.WRENCH);
|
||||
|
||||
@@ -182,7 +182,6 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
@@ -382,7 +381,6 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(offsetX + VIEW_LEFT, offsetY + HEADER_HEIGHT, 0);
|
||||
tooltipStack = null;
|
||||
masterList.hoveredEntry = null;
|
||||
drawViewport(mouseX - offsetX - VIEW_LEFT, mouseY - offsetY - HEADER_HEIGHT - 1);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopAttrib();
|
||||
@@ -636,8 +634,6 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText
|
||||
GL11.glTranslatef(0.0f, 0.0f, SLOT_HOVER_Z);
|
||||
drawRect(colLeft, viewY + 1 + rowYTop, -2 + colRight, viewY - 1 + rowYBot, 0x77FFFFFF);
|
||||
GL11.glTranslatef(0.0f, 0.0f, -SLOT_HOVER_Z);
|
||||
masterList.hoveredEntry = entry;
|
||||
entry.hoveredSlotIdx = slotIdx;
|
||||
}
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
}
|
||||
@@ -659,9 +655,8 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText
|
||||
/**
|
||||
* A copy of super method, but modified to allow for depth testing.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void drawHoveringText(List textLines, int x, int y, FontRenderer font) {
|
||||
public void drawHoveringText(List<String> textLines, int x, int y, FontRenderer font) {
|
||||
if (!textLines.isEmpty()) {
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
@@ -971,7 +966,6 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText
|
||||
private final List<InterfaceWirelessSection> visibleSections = new ArrayList<>();
|
||||
private boolean isDirty;
|
||||
private int height;
|
||||
private InterfaceWirelessEntry hoveredEntry;
|
||||
|
||||
InterfaceWirelessList() {
|
||||
this.isDirty = true;
|
||||
@@ -1229,8 +1223,6 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText
|
||||
GuiFCImgButton optionsButton;
|
||||
GuiFCImgButton renameButton;
|
||||
|
||||
/** Nullable - icon that represents the interface */
|
||||
ItemStack selfRep;
|
||||
/** Nullable - icon that represents the interface's "target" */
|
||||
ItemStack dispRep;
|
||||
InterfaceWirelessSection section;
|
||||
@@ -1245,7 +1237,6 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText
|
||||
int numItems = 0;
|
||||
/** Should recipe be filtered out/grayed out? */
|
||||
boolean[] filteredRecipes;
|
||||
private int hoveredSlotIdx = -1;
|
||||
|
||||
InterfaceWirelessEntry(long id, String name, int rows, int rowSize, boolean online, boolean p2pOutput) {
|
||||
this.id = id;
|
||||
@@ -1284,8 +1275,6 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText
|
||||
}
|
||||
|
||||
InterfaceWirelessEntry setIcons(ItemStack selfRep, ItemStack dispRep) {
|
||||
// Kotlin would make this pretty easy :(
|
||||
this.selfRep = selfRep;
|
||||
this.dispRep = dispRep;
|
||||
|
||||
return this;
|
||||
|
||||
@@ -157,7 +157,6 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
this.lastWorkingTick = this.refreshTick;
|
||||
@@ -395,9 +394,8 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
private final FCGuiLineField line;
|
||||
private State state;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Component(Widget qtyInput, Widget batchInput, GuiFCImgButton submitBtn, GuiFCImgButton enableBtn,
|
||||
GuiFCImgButton disableBtn, FCGuiLineField line, List buttonList) {
|
||||
GuiFCImgButton disableBtn, FCGuiLineField line, List<GuiButton> buttonList) {
|
||||
this.qty = qtyInput;
|
||||
this.batch = batchInput;
|
||||
this.enable = enableBtn;
|
||||
|
||||
@@ -119,7 +119,6 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
private final LevelTerminalList masterList = new LevelTerminalList();
|
||||
private final List<String> extraOptionsText = new ArrayList<>(2);
|
||||
private static final float ITEM_STACK_Z = 100.0f;
|
||||
private static final float SLOT_Z = 0.5f;
|
||||
private static final float ITEM_STACK_OVERLAY_Z = 200.0f;
|
||||
private static final float SLOT_HOVER_Z = 310.0f;
|
||||
private static final float TOOLTIP_Z = 410.0f;
|
||||
@@ -175,7 +174,6 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
@@ -282,7 +280,6 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void drawScreen(final int mouseX, final int mouseY, final float btn) {
|
||||
terminalStyleBox.set(AEConfig.instance.settings.getSetting(Settings.TERMINAL_STYLE));
|
||||
@@ -385,7 +382,6 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(offsetX + VIEW_LEFT, offsetY + HEADER_HEIGHT, 0);
|
||||
tooltipStack = null;
|
||||
masterList.hoveredEntry = null;
|
||||
drawViewport(mouseX - offsetX - VIEW_LEFT, mouseY - offsetY - HEADER_HEIGHT - 1);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopAttrib();
|
||||
@@ -588,7 +584,6 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
long quantity = data.getLong(TLMTags.Quantity.tagName);
|
||||
long batch = data.getLong(TLMTags.Batch.tagName);
|
||||
State state = State.values()[data.getInteger(TLMTags.State.tagName)];
|
||||
NBTTagCompound linkTag = data.getCompoundTag(TLMTags.Link.tagName);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(colLeft, viewY + rowYTop + 1, ITEM_STACK_Z);
|
||||
@@ -641,8 +636,6 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
GL11.glTranslatef(0.0f, 0.0f, SLOT_HOVER_Z);
|
||||
drawRect(colLeft, viewY + 1 + rowYTop, -2 + colRight, viewY - 1 + rowYBot, 0x77FFFFFF);
|
||||
GL11.glTranslatef(0.0f, 0.0f, -SLOT_HOVER_Z);
|
||||
masterList.hoveredEntry = entry;
|
||||
entry.hoveredSlotIdx = slotIdx;
|
||||
}
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
}
|
||||
@@ -699,9 +692,8 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void drawHoveringText(List textLines, int x, int y, FontRenderer font) {
|
||||
public void drawHoveringText(List<String> textLines, int x, int y, FontRenderer font) {
|
||||
if (!textLines.isEmpty()) {
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
@@ -887,10 +879,6 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
return;
|
||||
}
|
||||
|
||||
if (owCmd.onlineValid) {
|
||||
entry.online = owCmd.online;
|
||||
}
|
||||
|
||||
if (owCmd.itemsValid) {
|
||||
if (owCmd.allItemUpdate) {
|
||||
entry.fullItemUpdate(owCmd.items, owCmd.validIndices.length);
|
||||
@@ -981,7 +969,6 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
private final List<LevelTerminalSection> visibleSections = new ArrayList<>();
|
||||
private boolean isDirty;
|
||||
private int height;
|
||||
private LevelTerminalEntry hoveredEntry;
|
||||
|
||||
LevelTerminalList() {
|
||||
isDirty = true;
|
||||
@@ -1223,8 +1210,6 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
GuiFCImgButton highlightButton;
|
||||
GuiFCImgButton renameButton;
|
||||
GuiFCImgButton configButton;
|
||||
/** Nullable - icon that represents the interface */
|
||||
ItemStack selfItemStack;
|
||||
/** Nullable - icon that represents the interface's "target" */
|
||||
ItemStack displayItemStack;
|
||||
LevelTerminalSection section;
|
||||
@@ -1233,16 +1218,13 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
int rows, rowSize;
|
||||
int guiHeight;
|
||||
int dispY = -9999;
|
||||
boolean online;
|
||||
boolean[] filteredRecipes;
|
||||
int numItems = 0;
|
||||
private int hoveredSlotIdx = -1;
|
||||
|
||||
LevelTerminalEntry(long id, String name, int rows, int rowSize, boolean online) {
|
||||
this.id = id;
|
||||
this.rows = rows;
|
||||
this.rowSize = rowSize;
|
||||
this.online = online;
|
||||
if (StatCollector.canTranslate(name)) {
|
||||
customName = StatCollector.translateToLocal(name);
|
||||
} else {
|
||||
@@ -1272,7 +1254,6 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
}
|
||||
|
||||
LevelTerminalEntry setIcons(ItemStack selfItemStack, ItemStack displayItemStack) {
|
||||
this.selfItemStack = selfItemStack;
|
||||
this.displayItemStack = displayItemStack;
|
||||
|
||||
return this;
|
||||
|
||||
@@ -46,7 +46,6 @@ public class GuiRenamer extends AEBaseGui implements IDropToFillTextField {
|
||||
this.textField.setMaxStringLength(32);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
@@ -61,7 +61,6 @@ public abstract class FCBaseMEGui extends AEBaseMEGui {
|
||||
|
||||
public abstract void setOffsetY(int y);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected void drawSwitchGuiBtns() {
|
||||
if (!drawSwitchGuiBtn) return;
|
||||
if (!termBtns.isEmpty()) {
|
||||
@@ -131,7 +130,6 @@ public abstract class FCBaseMEGui extends AEBaseMEGui {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected void addSwitchGuiBtns() {
|
||||
if (!drawSwitchGuiBtn) return;
|
||||
this.buttonList.addAll(termBtns);
|
||||
|
||||
@@ -39,7 +39,6 @@ public abstract class FCGuiAmount extends AEBaseGui {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
|
||||
@@ -170,7 +170,6 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends FCBaseMEGui
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void initGui() {
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
|
||||
@@ -685,12 +684,13 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends FCBaseMEGui
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getTypeFilter() {
|
||||
public Enum<?> getTypeFilter() {
|
||||
return this.configSrc.getSetting(Settings.TYPE_FILTER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSetting(final IConfigManager manager, final Enum settingName, final Enum newValue) {
|
||||
public void updateSetting(final IConfigManager manager, @SuppressWarnings("rawtypes") final Enum settingName,
|
||||
@SuppressWarnings("rawtypes") final Enum newValue) {
|
||||
if (this.SortByBox != null) {
|
||||
this.SortByBox.set(this.configSrc.getSetting(Settings.SORT_BY));
|
||||
}
|
||||
|
||||
+1
@@ -165,6 +165,7 @@ public class ContainerFluidPatternEncoder extends AEBaseContainer implements IPa
|
||||
.putConvertedStack(Objects.requireNonNull(Util.copyStackWithSize(stack, 1)));
|
||||
}
|
||||
}
|
||||
default -> {}
|
||||
}
|
||||
} else {
|
||||
super.doAction(player, action, slotId, id);
|
||||
|
||||
@@ -93,6 +93,7 @@ public class ContainerLevelMaintainer extends AEBaseContainer {
|
||||
createLevelValues(Objects.requireNonNull(Util.copyStackWithSize(stack, 1))));
|
||||
}
|
||||
}
|
||||
default -> {}
|
||||
}
|
||||
} else {
|
||||
super.doAction(player, action, slotId, id);
|
||||
|
||||
+1
@@ -155,6 +155,7 @@ public abstract class FCContainerEncodeTerminal extends ContainerItemMonitor
|
||||
slot.putStack(ItemFluidPacket.newStack(fluid));
|
||||
return;
|
||||
}
|
||||
default -> {}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -224,7 +224,8 @@ public abstract class FCContainerMonitor<T extends IAEStack<T>> extends FCBaseCo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSetting(final IConfigManager manager, final Enum settingName, final Enum newValue) {
|
||||
public void updateSetting(final IConfigManager manager, @SuppressWarnings("rawtypes") final Enum settingName,
|
||||
@SuppressWarnings("rawtypes") final Enum newValue) {
|
||||
if (this.getGui() != null) {
|
||||
this.getGui().updateSetting(manager, settingName, newValue);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ public class EssentiaRepo extends FluidRepo {
|
||||
super(src, sortSrc);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void updateView() {
|
||||
this.view.clear();
|
||||
|
||||
@@ -97,6 +97,7 @@ public class FluidRepo implements IDisplayRepo {
|
||||
this.updateView();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void updateView() {
|
||||
this.view.clear();
|
||||
|
||||
Reference in new issue
Block a user