Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebase #2

Merged
merged 38 commits into from
Jul 28, 2024
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
d5d534c
Fix GUI for formation plane, import bus and export bus (#7989)
Mithi83 Jun 30, 2024
15954ab
Re-add cullface to fix lighting of ME drives (#7990)
shartte Jun 30, 2024
ea5de7f
Remove the ability to craft from a pattern encoding terminal, fixing …
shartte Jun 30, 2024
1038776
Rename "Chest" to "MEChest" in the code wherever possible. (#7994)
shartte Jun 30, 2024
7756c19
Removed concept of "ICellGuiHandler". ME chests will now always open …
shartte Jun 30, 2024
c9729c5
Fix quartz knives being immediately consumed on use (#8001)
shartte Jul 1, 2024
f997c45
Updated Crowdin Translations (#7997)
github-actions[bot] Jul 1, 2024
6a66970
Set a minimum row count of 2 for the Pattern Access Terminal (#8010)
Mari023 Jul 5, 2024
c3fc494
Bump NeoForge
shartte Jul 5, 2024
42e2257
add a getter for visible rows in terminal screens (#8009)
Mari023 Jul 10, 2024
110c1ac
Update to NeoForge 21.0.86-beta (#8023)
shartte Jul 11, 2024
1f8ee9b
Bump parchment.
shartte Jul 11, 2024
c064404
Addressed most left-over deprecations from 1.20.4+ (#8024)
shartte Jul 11, 2024
5febbff
Improve recipe update performance in crating terminal (#8028)
shartte Jul 12, 2024
82aaea4
Refactor initialization to align better with NeoForge standards (#8025)
shartte Jul 12, 2024
f0e3c85
Fix EMI recipe widgets (#8030)
Mithi83 Jul 12, 2024
1868505
Port to NeoForge config system to benefit from automatic config scree…
shartte Jul 12, 2024
cc4a475
Renames (#8031)
shartte Jul 12, 2024
f156505
Fixes packet encoding for items in ME terminals (#8032)
shartte Jul 13, 2024
f575d73
Remove dependency on unreleased NeoForge config screen
shartte Jul 13, 2024
d60da7b
Remove dependency on unreleased NeoForge config screen
shartte Jul 13, 2024
6194fd0
Fix NeoForge version
shartte Jul 13, 2024
958f149
Add the ability for addons to use their own Mod-ID when registering …
shartte Jul 13, 2024
d9a5b99
Fix formatting
shartte Jul 13, 2024
0ab5d2d
Move entity types to use DR
shartte Jul 13, 2024
3b5153d
Fix QNB GUI (#8036)
Mithi83 Jul 16, 2024
66a44dc
Fix synchronizing configuration data after the config is loaded (#8040)
shartte Jul 17, 2024
5162d58
Use correct item tag for wrenches (#8048)
shartte Jul 20, 2024
d8408ec
No Slimeballs (#8050)
shartte Jul 20, 2024
2013ac5
Fix resuming crafting recipe jobs after a world load (#8043)
Mithi83 Jul 20, 2024
5149e23
Fix fluid block display in throw-in-water recipes in EMI/REI not show…
shartte Jul 21, 2024
1e96092
Fix slot highlights being drawn on top of the held item (#8053)
shartte Jul 21, 2024
f73c2d4
Fix saving of config when terminal settings are changed (#8054)
shartte Jul 21, 2024
6a45f04
Disabled DarkModeEverywhere for the AE Screens due to it not uniforml…
shartte Jul 21, 2024
3fdc763
Added logo to guidebook (#8071)
shartte Jul 27, 2024
3c4ad97
Fix memory card claiming device incompatibility on import (#8070)
shartte Jul 27, 2024
5fbd612
Allow item upgrades to be added/removed by crafting them together. (F…
shartte Jul 27, 2024
0fc341d
Enable upgrading via crafting for wireless terminals too (#8073)
shartte Jul 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add the ability for addons to use their own Mod-ID when registering m…
…enu types.
shartte committed Jul 13, 2024
commit 958f1497ebc5ac27e4b515cbd6d7141938d4c911
35 changes: 18 additions & 17 deletions src/main/java/appeng/menu/implementations/MenuTypeBuilder.java
Original file line number Diff line number Diff line change
@@ -18,12 +18,13 @@

package appeng.menu.implementations;

import java.util.function.Function;

import appeng.core.AppEng;
import appeng.init.InitMenuTypes;
import appeng.menu.AEBaseMenu;
import appeng.menu.MenuOpener;
import appeng.menu.locator.MenuHostLocator;
import appeng.menu.locator.MenuLocators;
import com.google.common.base.Preconditions;

import org.jetbrains.annotations.Nullable;

import net.minecraft.client.Minecraft;
import net.minecraft.network.RegistryFriendlyByteBuf;
import net.minecraft.network.chat.Component;
@@ -37,13 +38,9 @@
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.MenuType;
import net.neoforged.neoforge.common.extensions.IMenuTypeExtension;
import org.jetbrains.annotations.Nullable;

import appeng.core.AppEng;
import appeng.init.InitMenuTypes;
import appeng.menu.AEBaseMenu;
import appeng.menu.MenuOpener;
import appeng.menu.locator.MenuHostLocator;
import appeng.menu.locator.MenuLocators;
import java.util.function.Function;

/**
* Builder that allows creation of menu types which can be opened from multiple types of hosts.
@@ -79,12 +76,12 @@ private MenuTypeBuilder(Class<I> hostInterface, MenuFactory<M, I> factory) {
}

public static <C extends AEBaseMenu, I> MenuTypeBuilder<C, I> create(MenuFactory<C, I> factory,
Class<I> hostInterface) {
Class<I> hostInterface) {
return new MenuTypeBuilder<>(hostInterface, factory);
}

public static <C extends AEBaseMenu, I> MenuTypeBuilder<C, I> create(TypedMenuFactory<C, I> factory,
Class<I> hostInterface) {
Class<I> hostInterface) {
return new MenuTypeBuilder<>(hostInterface, factory);
}

@@ -103,7 +100,7 @@ public MenuTypeBuilder<M, I> withMenuTitle(Function<I, Component> menuTitleStrat
* menu is being first opened.
*/
public MenuTypeBuilder<M, I> withInitialData(InitialDataSerializer<I> initialDataSerializer,
InitialDataDeserializer<M, I> initialDataDeserializer) {
InitialDataDeserializer<M, I> initialDataDeserializer) {
this.initialDataSerializer = initialDataSerializer;
this.initialDataDeserializer = initialDataDeserializer;
return this;
@@ -122,7 +119,7 @@ private M fromNetwork(int containerId, Inventory inv, RegistryFriendlyByteBuf pa
connection.send(new ServerboundContainerClosePacket(containerId));
}
throw new IllegalStateException("Couldn't find menu host at " + locator + " for " + this.id
+ " on client. Closing menu.");
+ " on client. Closing menu.");
}
M menu = factory.create(containerId, inv, host);
menu.setReturnedFromSubScreen(packetBuf.readBoolean());
@@ -181,14 +178,18 @@ public boolean shouldTriggerClientSideContainerClosingOnOpen() {
return true;
}

public MenuType<M> build(String id) {
return build(AppEng.makeId(id));
}

/**
* Creates a menu type that uses this helper as a factory and network deserializer.
*/
public MenuType<M> build(String id) {
public MenuType<M> build(ResourceLocation id) {
Preconditions.checkState(menuType == null, "build was already called");
Preconditions.checkState(this.id == null, "id should not be set");

this.id = AppEng.makeId(id);
this.id = id;
menuType = IMenuTypeExtension.create(this::fromNetwork);
InitMenuTypes.queueRegistration(this.id, menuType);
MenuOpener.addOpener(menuType, this::open);