Skip to content

Commit

Permalink
fix creative tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Mari023 committed Jun 6, 2024
1 parent b71721c commit 72ec967
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- don't send items to me when sneaking (fix #275)
- fix bug where picking up to me wouldn't reward the statistics, and not trigger the advancement criterion
- fix a bug where all modded creative tabs were broken
2 changes: 2 additions & 0 deletions src/main/java/de/mari_023/ae2wtlib/AE2wtlib.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public static void onAe2Initialized() {
}

static void addToCreativeTab() {
if (AE2wtlibCreativeTab.registrationHappened())
return;
AE2wtlibCreativeTab.addTerminal(AEItems.WIRELESS_CRAFTING_TERMINAL.asItem());
AE2wtlibCreativeTab.addTerminal(AE2wtlibItems.PATTERN_ENCODING_TERMINAL);
AE2wtlibCreativeTab.addTerminal(AE2wtlibItems.PATTERN_ACCESS_TERMINAL);
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/de/mari_023/ae2wtlib/AE2wtlibCreativeTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public static void init() {
Registry.register(BuiltInRegistries.CREATIVE_MODE_TAB, AE2wtlib.id("main"), tab);
}

public static boolean registrationHappened() {
return !items.isEmpty();
}

public static synchronized void add(Item item) {
items.add(new ItemStack(item));
}
Expand All @@ -41,7 +45,7 @@ public static synchronized void addTerminal(WirelessTerminalItem terminal) {
var stack = new ItemStack(terminal);
items.add(stack.copy());
terminal.injectAEPower(stack, terminal.getAEMaxPower(stack), Actionable.MODULATE);
items.add(stack);
items.add(stack.copy());
}

public static synchronized void addUniversalTerminal(ItemWUT wut) {
Expand Down

0 comments on commit 72ec967

Please sign in to comment.