Skip to content

Commit 06bd2e6

Browse files
committed
Merge branch 'main' of github.com:0xC4DE/AE2-Extended-Crafting-Tables
2 parents a76bc4e + 24972c2 commit 06bd2e6

File tree

13 files changed

+283
-132
lines changed

13 files changed

+283
-132
lines changed

.github/workflows/publish.yml

Lines changed: 88 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,88 @@
1-
# thanks to @notmywing for the .yml (this is stolen)
2-
# Publishes built jars to distribution platforms
3-
name: Publish
4-
5-
on:
6-
push:
7-
tags:
8-
- 'v[0-9]+.[0-9]+.[0-9]+' # any semver tag, e.g. 1.2.3
9-
10-
env:
11-
# type of release
12-
RELEASE_TYPE: "release"
13-
14-
jobs:
15-
Publish:
16-
runs-on: ubuntu-latest
17-
18-
permissions:
19-
contents: write # needed to create GitHub releases
20-
21-
steps:
22-
- name: Checkout Repository
23-
uses: actions/checkout@v3
24-
25-
- name: Check for Duplicate Tags
26-
run: |
27-
if git rev-parse -q --verify "refs/tags/${{ github.ref }}" >/dev/null; then
28-
echo "Tag already exists. A version bump is required."
29-
exit 1
30-
fi
31-
32-
- name: Setup Java
33-
uses: actions/setup-java@v3
34-
with:
35-
distribution: 'zulu'
36-
java-version: '17'
37-
38-
- name: Grant execute permissions for gradlew
39-
run: chmod +x gradlew
40-
41-
- name: Build Project
42-
uses: gradle/gradle-build-action@v2
43-
with:
44-
arguments: 'build --build-cache --daemon' # use the daemon here so the rest of the process is faster
45-
generate-job-summary: false
46-
gradle-home-cache-includes: |
47-
caches
48-
jdks
49-
notifications
50-
wrapper
51-
52-
- name: Publish to GitHub
53-
uses: softprops/action-gh-release@v1
54-
with:
55-
files: "build/libs/*.jar"
56-
generate_release_notes: true
57-
fail_on_unmatched_files: true
58-
59-
### TODO: I dont know how to maven, so make a maven?
60-
# - name: Publish to Maven
61-
# uses: gradle/gradle-build-action@v2
62-
# env:
63-
# MAVEN_USER: "${{secrets.MAVEN_USER}}"
64-
# MAVEN_PASSWORD: "${{secrets.MAVEN_PASSWORD}}"
65-
# with:
66-
# arguments: 'publish --daemon'
67-
# generate-job-summary: false
68-
# gradle-home-cache-includes: |
69-
# caches
70-
# jdks
71-
# notifications
72-
# wrapper
73-
###
74-
75-
- name: Publish to Curseforge
76-
uses: gradle/gradle-build-action@v2
77-
env:
78-
CURSEFORGE_API_KEY: "${{secrets.CURSEFORGE_API_KEY}}"
79-
CURSEFORGE_PROJECT_ID: "${{secrets.CURSEFORGE_PROJECT_ID}}"
80-
RELEASE_TYPE: "${{env.RELEASE_TYPE}}"
81-
with:
82-
arguments: 'curseforge --daemon'
83-
generate-job-summary: false
84-
gradle-home-cache-includes: |
85-
caches
86-
jdks
87-
notifications
88-
wrapper
1+
# thanks to @notmywing for the .yml (this is stolen)
2+
# Publishes built jars to distribution platforms
3+
name: Publish
4+
5+
on:
6+
push:
7+
tags:
8+
- 'v[0-9]+.[0-9]+.[0-9]+' # any semver tag, e.g. 1.2.3
9+
10+
env:
11+
# type of release
12+
RELEASE_TYPE: "release"
13+
14+
jobs:
15+
Publish:
16+
runs-on: ubuntu-latest
17+
18+
permissions:
19+
contents: write # needed to create GitHub releases
20+
21+
steps:
22+
- name: Checkout Repository
23+
uses: actions/checkout@v3
24+
25+
- name: Check for Duplicate Tags
26+
run: |
27+
if git rev-parse -q --verify "refs/tags/${{ github.ref }}" >/dev/null; then
28+
echo "Tag already exists. A version bump is required."
29+
exit 1
30+
fi
31+
32+
- name: Setup Java
33+
uses: actions/setup-java@v3
34+
with:
35+
distribution: 'zulu'
36+
java-version: '17'
37+
38+
- name: Grant execute permissions for gradlew
39+
run: chmod +x gradlew
40+
41+
- name: Build Project
42+
uses: gradle/gradle-build-action@v2
43+
with:
44+
arguments: 'build --build-cache --daemon' # use the daemon here so the rest of the process is faster
45+
generate-job-summary: false
46+
gradle-home-cache-includes: |
47+
caches
48+
jdks
49+
notifications
50+
wrapper
51+
52+
- name: Publish to GitHub
53+
uses: softprops/action-gh-release@v1
54+
with:
55+
files: "build/libs/*.jar"
56+
generate_release_notes: true
57+
fail_on_unmatched_files: true
58+
59+
### TODO: I dont know how to maven, so make a maven?
60+
# - name: Publish to Maven
61+
# uses: gradle/gradle-build-action@v2
62+
# env:
63+
# MAVEN_USER: "${{secrets.MAVEN_USER}}"
64+
# MAVEN_PASSWORD: "${{secrets.MAVEN_PASSWORD}}"
65+
# with:
66+
# arguments: 'publish --daemon'
67+
# generate-job-summary: false
68+
# gradle-home-cache-includes: |
69+
# caches
70+
# jdks
71+
# notifications
72+
# wrapper
73+
###
74+
75+
- name: Publish to Curseforge
76+
uses: gradle/gradle-build-action@v2
77+
env:
78+
CURSEFORGE_API_KEY: "${{secrets.CURSEFORGE_API_KEY}}"
79+
CURSEFORGE_PROJECT_ID: "${{secrets.CURSEFORGE_PROJECT_ID}}"
80+
RELEASE_TYPE: "${{env.RELEASE_TYPE}}"
81+
with:
82+
arguments: 'curseforge --daemon'
83+
generate-job-summary: false
84+
gradle-home-cache-includes: |
85+
caches
86+
jdks
87+
notifications
88+
wrapper
Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
# Updates the Gradle Cache when relevant files change
2-
name: Update Gradle Cache
3-
4-
on:
5-
workflow_dispatch:
6-
push:
7-
branches:
8-
- main
9-
paths:
10-
- "gradle**" # covers gradle folder, gradle.properties, gradlew
11-
- "build.gradle*"
12-
- "settings.gradle*"
13-
- "src/main/resources/*_at.cfg" # access transformers
14-
15-
jobs:
16-
Update_Cache:
17-
runs-on: ubuntu-latest
18-
19-
steps:
20-
- name: Checkout Repository
21-
uses: actions/checkout@v3
22-
23-
- name: Setup Java
24-
uses: actions/setup-java@v3
25-
with:
26-
distribution: 'zulu'
27-
java-version: '17'
28-
29-
- name: Update Cache
30-
uses: gradle/gradle-build-action@v2
31-
with:
32-
arguments: 'test --build-cache --no-daemon' # disable daemon since only one gradle operation will happen
33-
generate-job-summary: false
34-
gradle-home-cache-includes: |
35-
caches
36-
jdks
37-
notifications
38-
wrapper
1+
# Updates the Gradle Cache when relevant files change
2+
name: Update Gradle Cache
3+
4+
on:
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- main
9+
paths:
10+
- "gradle**" # covers gradle folder, gradle.properties, gradlew
11+
- "build.gradle*"
12+
- "settings.gradle*"
13+
- "src/main/resources/*_at.cfg" # access transformers
14+
15+
jobs:
16+
Update_Cache:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout Repository
21+
uses: actions/checkout@v3
22+
23+
- name: Setup Java
24+
uses: actions/setup-java@v3
25+
with:
26+
distribution: 'zulu'
27+
java-version: '17'
28+
29+
- name: Update Cache
30+
uses: gradle/gradle-build-action@v2
31+
with:
32+
arguments: 'test --build-cache --no-daemon' # disable daemon since only one gradle operation will happen
33+
generate-job-summary: false
34+
gradle-home-cache-includes: |
35+
caches
36+
jdks
37+
notifications
38+
wrapper
3939
cache-write-only: true
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com._0xc4de.ae2exttable.client;
2+
3+
import net.minecraft.client.settings.KeyBinding;
4+
import net.minecraftforge.client.settings.KeyConflictContext;
5+
import net.minecraftforge.client.settings.KeyModifier;
6+
import org.lwjgl.input.Keyboard;
7+
8+
import static com._0xc4de.ae2exttable.proxy.ClientProxy.KEY_CATEGORY;
9+
10+
public enum KeyBindings {
11+
basic(new KeyBinding("key.open_basic_extended_wireless_crafting_terminal", KeyConflictContext.UNIVERSAL, KeyModifier.NONE, Keyboard.KEY_NONE, KEY_CATEGORY)),
12+
advanced(new KeyBinding("key.open_advanced_extended_wireless_crafting_terminal", KeyConflictContext.UNIVERSAL, KeyModifier.NONE, Keyboard.KEY_NONE, KEY_CATEGORY)),
13+
elite(new KeyBinding("key.open_elite_extended_wireless_crafting_terminal", KeyConflictContext.UNIVERSAL, KeyModifier.NONE, Keyboard.KEY_NONE, KEY_CATEGORY)),
14+
ultimate(new KeyBinding("key.open_ultimate_extended_wireless_crafting_terminal", KeyConflictContext.UNIVERSAL, KeyModifier.NONE, Keyboard.KEY_NONE, KEY_CATEGORY));
15+
16+
private KeyBinding binding;
17+
18+
KeyBindings(KeyBinding keyBinding) {
19+
this.binding = keyBinding;
20+
}
21+
22+
public KeyBinding get() {
23+
return this.binding;
24+
}
25+
}

src/main/java/com/_0xc4de/ae2exttable/client/container/ContainerMEMonitorableTwo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public abstract class ContainerMEMonitorableTwo extends ContainerMEMonitorable
4444
private IRecipe currentRecipe;
4545
protected final int slotWidth;
4646
protected final int slotHeight;
47-
private final SlotCraftingTerm outputSlot;
47+
public final SlotCraftingTerm outputSlot;
4848
final ExtendedCraftingGUIConstants guiConst;
4949
private PartSharedCraftingTerminal ct;
5050
protected WirelessTerminalGuiObjectTwo wt;

src/main/java/com/_0xc4de/ae2exttable/client/container/ContainerSharedWirelessTerminals.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ public ContainerSharedWirelessTerminals(
6464

6565
this.upgrades = new StackUpgradeInventory(guiItemObject.getItemStack(), this, 2);
6666
this.loadFromNBT();
67-
6867
this.setupUpgrades();
69-
7068
this.onCraftMatrixChanged(new WrapperInvItemHandler(this.getInventoryByName("crafting")));
7169
}
7270

src/main/java/com/_0xc4de/ae2exttable/client/gui/GuiCraftingTerm.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final
7777
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) {
7878
if (PartGuiHandler.guiIsWirelessTerminal(this.getGuiType())) {
7979
this.bindTexture("guis/wirelessupgrades.png");
80-
// Maybe this should be a GUIConstant? I dont really care, it works
80+
// Maybe this should be a GUIConstant? I don't really care, it works
8181
int upgradeSlotOffset = 127 - 24;
8282
if (this.getGuiConst() == ExtendedCraftingGUIConstants.ULTIMATE_CRAFTING_TERMINAL) {
8383
upgradeSlotOffset = -34;

src/main/java/com/_0xc4de/ae2exttable/client/gui/GuiMEMonitorableTwo.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
import appeng.integration.Integrations;
3030
import appeng.util.IConfigManagerHost;
3131
import appeng.util.Platform;
32+
import com._0xc4de.ae2exttable.client.container.ContainerMEMonitorableTwo;
33+
import com._0xc4de.ae2exttable.client.container.ContainerSharedWirelessTerminals;
34+
import com._0xc4de.ae2exttable.client.container.terminals.ContainerUltimateCraftingTerminal;
35+
import com._0xc4de.ae2exttable.client.container.wireless.ContainerUltimateWirelessTerminal;
3236
import com.blakebr0.cucumber.helper.RenderHelper;
3337
import com.blakebr0.cucumber.util.Utils;
3438
import com._0xc4de.ae2exttable.Tags;
@@ -288,6 +292,11 @@ public void initGui() {
288292
craftingGridOffsetX = Integer.MAX_VALUE;
289293
craftingGridOffsetY = Integer.MAX_VALUE;
290294

295+
if (this.inventorySlots instanceof ContainerUltimateWirelessTerminal || this.inventorySlots instanceof ContainerUltimateCraftingTerminal) {
296+
AppEngSlot s = ((ContainerMEMonitorableTwo)this.inventorySlots).outputSlot;
297+
s.yPos = s.getY() + (this.rows - this.getMinRows()) * 18;
298+
}
299+
291300
for (final Object s : this.inventorySlots.inventorySlots) {
292301
if (s instanceof AppEngSlot) {
293302
if (((Slot) s).xPos < 197) {

src/main/java/com/_0xc4de/ae2exttable/items/ItemRegistry.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
public class ItemRegistry {
2222
private static final Map<Item, AE2ExtendedGUIs> FORWARD_LOOKUP = new HashMap<>();
2323
private static final Map<AE2ExtendedGUIs, Item> REVERSE_LOOKUP = new HashMap<>();
24+
private static final Map<AE2ExtendedGUIs, Item> WIRELESS_REVERSE_LOOKUP = new HashMap<>();
2425

2526
// Wired terms go here
2627
public static ItemBasicCraftingTerminal BASIC_TERMINAL = new ItemBasicCraftingTerminal("basic_crafting_terminal");
@@ -51,6 +52,7 @@ public static void init() {
5152
registry.register(WIRELESS_BASIC_TERMINAL, "wireless_basic_crafting_terminal");
5253
FORWARD_LOOKUP.put(WIRELESS_BASIC_TERMINAL, AE2ExtendedGUIs.WIRELESS_BASIC_CRAFTING_TERMINAL);
5354
REVERSE_LOOKUP.put(AE2ExtendedGUIs.WIRELESS_BASIC_CRAFTING_TERMINAL, WIRELESS_BASIC_TERMINAL);
55+
WIRELESS_REVERSE_LOOKUP.put(AE2ExtendedGUIs.BASIC_CRAFTING_TERMINAL, BASIC_TERMINAL);
5456

5557
registry.register(WIRELESS_ADVANCED_TERMINAL, "wireless_advanced_crafting_terminal");
5658
FORWARD_LOOKUP.put(WIRELESS_ADVANCED_TERMINAL, AE2ExtendedGUIs.WIRELESS_ADVANCED_CRAFTING_TERMINAL);
@@ -90,7 +92,13 @@ public static Item partByGuiType(AE2ExtendedGUIs guiType) {
9092
return REVERSE_LOOKUP.get(guiType);
9193
}
9294

95+
// ONLY returns the ITEM for the GUI type, ONLY does wireless terminals
96+
public static Item wirelessByGuiType(AE2ExtendedGUIs guiType) {
97+
return WIRELESS_REVERSE_LOOKUP.get(guiType);
98+
}
99+
93100
public static AE2ExtendedGUIs guiByItem(Item item) {
94101
return FORWARD_LOOKUP.get(item);
95102
}
103+
96104
}

src/main/java/com/_0xc4de/ae2exttable/network/PacketHandler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com._0xc4de.ae2exttable.network;
22

3+
import com._0xc4de.ae2exttable.network.packets.PacketOpenWirelessGui;
34
import com._0xc4de.ae2exttable.network.packets.PacketSwitchGui;
45
import io.netty.buffer.ByteBuf;
56

@@ -12,7 +13,8 @@ public class PacketHandler {
1213
private static final Map<Class<? extends ExtendedTerminalPacket>, PacketTypes> REVERSE_LOOKUP = new HashMap<>();
1314
public enum PacketTypes {
1415
DEFAULT,
15-
PACKET_SWITCH_GUI(PacketSwitchGui.class);
16+
PACKET_SWITCH_GUI(PacketSwitchGui.class),
17+
PACKET_OPEN_WIRELESS_GUI(PacketOpenWirelessGui.class);
1618

1719
private final Constructor<? extends ExtendedTerminalPacket> packetConstructor;
1820

0 commit comments

Comments
 (0)