Skip to content

Commit 5cd40b3

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 23ab1d9 + 26bb598 commit 5cd40b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+798
-164
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@ jobs:
66
build:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v4
1010
- name: Set up OpenJDK 17
11-
uses: actions/setup-java@v2
11+
uses: actions/setup-java@v4
1212
with:
1313
java-version: '17'
1414
distribution: 'adopt' # You can choose other OpenJDK distributions.
15+
- name: Update Build Script (Before Build)
16+
run: ./gradlew updateBuildScript
1517
- name: Build with Gradle
16-
run: ./gradlew build # Ensure your gradlew script is executable
18+
run: ./gradlew build
1719
- name: Upload Artifact
18-
uses: actions/upload-artifact@v2
20+
uses: actions/upload-artifact@v4
1921
with:
2022
name: AE2-UEL
2123
path: build/libs/*.jar # Make sure this path matches the location of your build artifacts

src/api/java/appeng/api/config/LockCraftingMode.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ public enum LockCraftingMode {
66
*/
77
NONE,
88
/**
9-
* After pushing a pattern to an adjacent machine, the pattern provider will not accept further crafts until a
9+
* After pushing a pattern to an adjacent machine, the interface will not accept further crafts until a
1010
* redstone pulse is received.
1111
*/
1212
LOCK_UNTIL_PULSE,
1313
/**
14-
* Crafting is locked while the pattern provider is receiving a redstone signal.
14+
* Crafting is locked while the interface is receiving a redstone signal.
1515
*/
1616
LOCK_WHILE_HIGH,
1717
/**
18-
* Crafting is locked while the pattern provider is not receiving a redstone signal.
18+
* Crafting is locked while the interface is not receiving a redstone signal.
1919
*/
2020
LOCK_WHILE_LOW,
2121
/**
22-
* After pushing a pattern to an adjacent machine, the pattern provider will not accept further crafts until the
23-
* primary pattern result is returned to the network through the pattern provider.
22+
* After pushing a pattern to an adjacent machine, the interface will not accept further crafts until the
23+
* primary pattern result is returned to the network through the interface.
2424
*/
2525
LOCK_UNTIL_RESULT
2626
}

src/api/java/appeng/api/definitions/IItems.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ public interface IItems {
6767

6868
IItemDefinition wirelessPatternTerminal();
6969

70+
IItemDefinition wirelessInterfaceTerminal();
71+
7072
IItemDefinition wirelessFluidTerminal();
7173

7274
IItemDefinition biometricCard();

src/main/java/appeng/client/ClientHelper.java

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,13 @@
4646
import appeng.hooks.TickHandler;
4747
import appeng.hooks.TickHandler.PlayerColor;
4848
import appeng.items.tools.powered.Terminal;
49-
import appeng.items.tools.powered.ToolWirelessTerminal;
5049
import appeng.server.ServerHelper;
5150
import appeng.util.Platform;
5251
import net.minecraft.client.Minecraft;
5352
import net.minecraft.client.gui.GuiScreen;
5453
import net.minecraft.client.renderer.GlStateManager;
5554
import net.minecraft.client.settings.KeyBinding;
5655
import net.minecraft.entity.player.EntityPlayer;
57-
import net.minecraft.entity.player.EntityPlayerMP;
5856
import net.minecraft.init.Items;
5957
import net.minecraft.tileentity.TileEntity;
6058
import net.minecraft.util.EnumHand;
@@ -63,8 +61,6 @@
6361
import net.minecraft.world.World;
6462
import net.minecraftforge.client.event.*;
6563
import net.minecraftforge.client.model.ModelLoaderRegistry;
66-
import net.minecraftforge.client.settings.KeyConflictContext;
67-
import net.minecraftforge.client.settings.KeyModifier;
6864
import net.minecraftforge.common.ForgeModContainer;
6965
import net.minecraftforge.common.MinecraftForge;
7066
import net.minecraftforge.fml.client.FMLClientHandler;
@@ -73,22 +69,12 @@
7369
import net.minecraftforge.fml.common.eventhandler.EventPriority;
7470
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
7571
import net.minecraftforge.fml.common.gameevent.InputEvent;
76-
import net.minecraftforge.fml.relauncher.Side;
77-
import net.minecraftforge.fml.relauncher.SideOnly;
78-
import org.lwjgl.input.Keyboard;
7972
import org.lwjgl.input.Mouse;
8073

8174
import java.io.IOException;
82-
import java.util.ArrayList;
83-
import java.util.EnumMap;
84-
import java.util.List;
85-
import java.util.Random;
86-
import java.util.UUID;
75+
import java.util.*;
8776

88-
import static appeng.client.KeyBindings.WCT;
89-
import static appeng.client.KeyBindings.WFT;
90-
import static appeng.client.KeyBindings.WPT;
91-
import static appeng.client.KeyBindings.WT;
77+
import static appeng.client.KeyBindings.*;
9278

9379

9480
public class ClientHelper extends ServerHelper {
@@ -354,6 +340,8 @@ public void onInputEvent(final InputEvent.KeyInputEvent event) {
354340
NetworkHandler.instance().sendToServer(new PacketTerminalUse(Terminal.WIRELESS_PATTERN_TERMINAL));
355341
} else if (k == WFT.getKeyBinding()) {
356342
NetworkHandler.instance().sendToServer(new PacketTerminalUse(Terminal.WIRELESS_FLUID_TERMINAL));
343+
} else if (k == WIT.getKeyBinding()) {
344+
NetworkHandler.instance().sendToServer(new PacketTerminalUse(Terminal.WIRELESS_INTERFACE_TERMINAL));
357345
}
358346
}
359347
}

src/main/java/appeng/client/KeyBindings.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ public enum KeyBindings {
1212
WT(new KeyBinding("key.open_wireless_terminal.desc", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_T, KEY_CATEGORY)),
1313
WCT(new KeyBinding("key.open_wireless_crafting_terminal.desc", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_E, KEY_CATEGORY)),
1414
WPT(new KeyBinding("key.open_wireless_pattern_terminal.desc", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_R, KEY_CATEGORY)),
15-
WFT(new KeyBinding("key.open_wireless_fluid_terminal.desc", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_F, KEY_CATEGORY));
15+
WFT(new KeyBinding("key.open_wireless_fluid_terminal.desc", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_F, KEY_CATEGORY)),
16+
WIT(new KeyBinding("key.open_wireless_interface_terminal.desc",KeyConflictContext.UNIVERSAL,KeyModifier.SHIFT,Keyboard.KEY_I,KEY_CATEGORY));
1617

1718
private KeyBinding keyBinding;
1819

src/main/java/appeng/client/gui/AEBaseGui.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ public void drawScreen(final int mouseX, final int mouseY, final float partialTi
183183
this.drawTooltip((ITooltip) c, mouseX, mouseY);
184184
}
185185
}
186+
187+
for (final Object o : this.labelList) {
188+
if (o instanceof ITooltip) {
189+
this.drawTooltip((ITooltip) o, mouseX, mouseY);
190+
}
191+
}
186192
GlStateManager.enableDepth();
187193
if (Platform.isModLoaded("jei")) {
188194
bookmarkedJEIghostItem(mouseX, mouseY);

src/main/java/appeng/client/gui/implementations/GuiInterface.java

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import appeng.api.config.Settings;
2424
import appeng.api.config.YesNo;
2525
import appeng.client.gui.widgets.GuiImgButton;
26+
import appeng.client.gui.widgets.GuiImgLabel;
2627
import appeng.client.gui.widgets.GuiTabButton;
2728
import appeng.client.gui.widgets.GuiToggleButton;
2829
import appeng.container.implementations.ContainerInterface;
@@ -45,12 +46,19 @@ public class GuiInterface extends GuiUpgradeable {
4546
private GuiImgButton UnlockMode;
4647
private GuiImgButton BlockMode;
4748
private GuiToggleButton interfaceMode;
49+
private GuiImgLabel lockReason;
4850

4951
public GuiInterface(final InventoryPlayer inventoryPlayer, final IInterfaceHost te) {
5052
super(new ContainerInterface(inventoryPlayer, te));
5153
this.ySize = 256;
5254
}
5355

56+
@Override
57+
public void initGui() {
58+
super.initGui();
59+
this.addLabel();
60+
}
61+
5462
@Override
5563
protected void addButtons() {
5664
this.priority = new GuiTabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), this.itemRender);
@@ -59,13 +67,22 @@ protected void addButtons() {
5967
this.BlockMode = new GuiImgButton(this.guiLeft - 18, this.guiTop + 8, Settings.BLOCK, YesNo.NO);
6068
this.buttonList.add(this.BlockMode);
6169

62-
this.UnlockMode = new GuiImgButton(this.guiLeft - 18,this.guiTop + 26 ,Settings.UNLOCK, LockCraftingMode.NONE);
70+
this.UnlockMode = new GuiImgButton(this.guiLeft - 18, this.guiTop + 26, Settings.UNLOCK, LockCraftingMode.NONE);
6371
this.buttonList.add(this.UnlockMode);
6472

6573
this.interfaceMode = new GuiToggleButton(this.guiLeft - 18, this.guiTop + 44, 84, 85, GuiText.InterfaceTerminal.getLocal(), GuiText.InterfaceTerminalHint.getLocal());
6674
this.buttonList.add(this.interfaceMode);
6775
}
6876

77+
protected void addLabel() {
78+
if (lockReason != null) {
79+
labelList.remove(this.lockReason);
80+
}
81+
this.lockReason = new GuiImgLabel(this.fontRenderer, guiLeft + 40, guiTop + 12, Settings.UNLOCK, LockCraftingMode.NONE);
82+
this.lockReason.setVisibility(false);
83+
labelList.add(lockReason);
84+
}
85+
6986
@Override
7087
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
7188
if (this.BlockMode != null) {
@@ -74,6 +91,15 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final
7491

7592
if (this.UnlockMode != null) {
7693
this.UnlockMode.set(((ContainerInterface) this.cvb).getUnlockMode());
94+
95+
if (this.lockReason != null) {
96+
if (this.UnlockMode.getCurrentValue() == LockCraftingMode.NONE) {
97+
this.lockReason.setVisibility(false);
98+
} else {
99+
this.lockReason.setVisibility(true);
100+
this.lockReason.set(((ContainerInterface) this.cvb).getCraftingLockedReason());
101+
}
102+
}
77103
}
78104

79105
if (this.interfaceMode != null) {

src/main/java/appeng/client/gui/implementations/GuiInterfaceTerminal.java

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import appeng.client.me.ClientDCInternalInv;
3232
import appeng.client.me.SlotDisconnected;
3333
import appeng.container.implementations.ContainerInterfaceTerminal;
34+
import appeng.container.implementations.ContainerWirelessInterfaceTerminal;
3435
import appeng.container.slot.AppEngSlot;
3536
import appeng.core.AEConfig;
3637
import appeng.core.AppEng;
@@ -39,6 +40,7 @@
3940
import appeng.core.localization.PlayerMessages;
4041
import appeng.helpers.DualityInterface;
4142
import appeng.helpers.PatternHelper;
43+
import appeng.helpers.WirelessTerminalGuiObject;
4244
import appeng.parts.reporting.PartInterfaceTerminal;
4345
import appeng.util.BlockPosUtils;
4446
import appeng.util.Platform;
@@ -67,9 +69,10 @@
6769

6870
public class GuiInterfaceTerminal extends AEBaseGui {
6971

70-
private static final int OFFSET_X = 21;
72+
protected static final int OFFSET_X = 21;
73+
protected final GuiText guiTitle;
7174
private static final int MAGIC_HEIGHT_NUMBER = 52 + 99;
72-
private static final String MOLECULAR_ASSEMBLER = "molecular assembler";
75+
private static final String MOLECULAR_ASSEMBLER = "tile.appliedenergistics2.molecular_assembler";
7376

7477
private final boolean jeiEnabled;
7578
private final int jeiButtonPadding;
@@ -121,6 +124,29 @@ public GuiInterfaceTerminal(final InventoryPlayer inventoryPlayer, final PartInt
121124
guiButtonHideFull = new GuiImgButton(0, 0, Settings.ACTIONS, null);
122125
guiButtonBrokenRecipes = new GuiImgButton(0, 0, Settings.ACTIONS, null);
123126
terminalStyleBox = new GuiImgButton(0, 0, Settings.TERMINAL_STYLE, null);
127+
guiTitle = GuiText.InterfaceTerminal;
128+
}
129+
130+
public GuiInterfaceTerminal(final InventoryPlayer inventoryPlayer, final WirelessTerminalGuiObject guiObject) {
131+
super(new ContainerWirelessInterfaceTerminal(inventoryPlayer, guiObject));
132+
133+
final GuiScrollbar scrollbar = new GuiScrollbar();
134+
this.setScrollBar(scrollbar);
135+
this.xSize = 208;
136+
this.ySize = 255;
137+
this.jeiEnabled = Platform.isModLoaded("jei");
138+
this.jeiButtonPadding = jeiEnabled ? 22 : 0;
139+
140+
searchFieldInputs = createTextField(86, 12, ButtonToolTips.SearchFieldInputs.getLocal());
141+
searchFieldOutputs = createTextField(86, 12, ButtonToolTips.SearchFieldOutputs.getLocal());
142+
searchFieldNames = createTextField(71, 12, ButtonToolTips.SearchFieldNames.getLocal());
143+
searchFieldNames.setFocused(true);
144+
145+
guiButtonAssemblersOnly = new GuiImgButton(0, 0, Settings.ACTIONS, null);
146+
guiButtonHideFull = new GuiImgButton(0, 0, Settings.ACTIONS, null);
147+
guiButtonBrokenRecipes = new GuiImgButton(0, 0, Settings.ACTIONS, null);
148+
terminalStyleBox = new GuiImgButton(0, 0, Settings.TERMINAL_STYLE, null);
149+
guiTitle = GuiText.WirelessTerminal;
124150
}
125151

126152
private MEGuiTooltipTextField createTextField(final int width, final int height, final String tooltip) {
@@ -199,7 +225,7 @@ public List<Rectangle> getJEIExclusionArea() {
199225

200226
@Override
201227
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
202-
this.fontRenderer.drawString(this.getGuiDisplayName(GuiText.InterfaceTerminal.getLocal()), OFFSET_X + 2, 6, 4210752);
228+
this.fontRenderer.drawString(this.getGuiDisplayName(guiTitle.getLocal()), OFFSET_X + 2, 6, 4210752);
203229
this.fontRenderer.drawString(GuiText.inventory.getLocal(), OFFSET_X + 2, this.ySize - 96, 4210752);
204230

205231
final int currentScroll = this.getScrollBar().getCurrentScroll();
@@ -536,7 +562,8 @@ private void refreshList() {
536562
continue;
537563
}
538564
// Exit if molecular assembler filter is on and this is not a molecular assembler
539-
if (onlyMolecularAssemblers && !entry.getName().toLowerCase().contains(MOLECULAR_ASSEMBLER)) {
565+
// Forge documantation said unlocalized name shouldn't be use for logic, so we might need a better way......
566+
if (onlyMolecularAssemblers && !entry.getUnlocalizedName().equals(MOLECULAR_ASSEMBLER)) {
540567
cachedSearch.remove(entry);
541568
continue;
542569
}

src/main/java/appeng/client/gui/implementations/GuiMEPortableCell.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020

2121

2222
import appeng.api.implementations.guiobjects.IPortableCell;
23+
import appeng.container.implementations.ContainerMEPortableCell;
2324
import net.minecraft.entity.player.InventoryPlayer;
2425

2526

2627
public class GuiMEPortableCell extends GuiMEMonitorable {
2728

2829
public GuiMEPortableCell(final InventoryPlayer inventoryPlayer, final IPortableCell te) {
29-
super(inventoryPlayer, te);
30+
super(inventoryPlayer, te, new ContainerMEPortableCell(inventoryPlayer, te));
3031
}
3132

3233
@Override
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package appeng.client.gui.implementations;
2+
3+
import appeng.helpers.WirelessTerminalGuiObject;
4+
import net.minecraft.client.gui.Gui;
5+
import net.minecraft.entity.player.InventoryPlayer;
6+
7+
public class GuiWirelessInterfaceTerminal extends GuiInterfaceTerminal {
8+
public GuiWirelessInterfaceTerminal(InventoryPlayer inventoryPlayer, final WirelessTerminalGuiObject te) {
9+
super(inventoryPlayer, te);
10+
}
11+
12+
@Override
13+
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) {
14+
this.bindTexture("guis/wirelessupgrades.png");
15+
Gui.drawModalRectWithCustomSizedTexture(offsetX + 189, offsetY + 165, 0, 0, 32, 32, 32, 32);
16+
super.drawBG(offsetX, offsetY, mouseX, mouseY);
17+
}
18+
}

0 commit comments

Comments
 (0)