-
Notifications
You must be signed in to change notification settings - Fork 19
Add wireless requester terminal support #48
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
Add wireless requester terminal support #48
Conversation
Based on original PR by Mari023 found here: AlmostReliable#11
|
On first glance, this looks pretty good. I will investigate further next week and make it an optional dependency. Thanks a lot for contributing! |
the intended way is to JiJ the api mod, that way it'll work with and without ae2wtlib without having to duplicate any code |
|
I'd (personally) go even further to say that JiJ-ing isn't necessary, as long as any code involving AE2WTLib is gated behind separate classes which are only referenced and class-loaded conditionally (if the relevant mod is present). This is the approach that e.g. MEGA Cells has used from the very start for all the other add-ons that it provides integration for. EDIT:
Typically this is done with |
that would be an option, but it would mean that you either:
The api mod was specifically made so addons implementing terminals can just JiJ it and don't have to deal with ae2wtlib being maybe present or maybe not |
|
Up until now I've already had a general "dummy item" class to use in the event that another add-on wasn't present to provide full integration for. AppliedE, for example, doesn't JiJ AE2WTLib's API either, but it still provides a wireless terminal when the latter isn't installed which simply does nothing as an item. I assume then that the API also provides its own mechanism for that now? |
|
I am not a huge fan of JiJ'ing myself personally. Also, not a fan of hard dependencies. It makes maintenance and porting more complicated. If it's a soft dependency, I can just kick it out if it's not ported yet or if it has any issues. Since the wireless terminal library isn't a dependency that is only available if someone JiJs it, it's not a big deal to make it a soft dependency in my opinion. If people want wireless terminals, they can simply install the mod, and the integration will load. That way, you let the users decide. Is there something I am missing here? Do you plan to remove the library as a standalone mod? Or do you just suggest JiJ for convenience? @Mari023 |
Mari023
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks mostly good from the ae2wtlib side, some minor changes
you also need a translation for key.ae2.wireless_requester_terminal
src/main/java/com/almostreliable/merequester/wireless/WRMenuHost.java
Outdated
Show resolved
Hide resolved
src/main/java/com/almostreliable/merequester/wireless/WRScreen.java
Outdated
Show resolved
Hide resolved
src/main/java/com/almostreliable/merequester/wireless/WRScreen.java
Outdated
Show resolved
Hide resolved
src/main/java/com/almostreliable/merequester/wireless/WRScreen.java
Outdated
Show resolved
Hide resolved
src/main/resources/assets/ae2/screens/wireless_requester_terminal.json
Outdated
Show resolved
Hide resolved
src/main/java/com/almostreliable/merequester/wireless/WRScreen.java
Outdated
Show resolved
Hide resolved
Yes and no.
Nowadays, there are two parts to ae2wtlib: the main mod ("ae2wtlib") and the api mod ("ae2wtlib_api"). ae2wtlib (and some addons which add their own wireless terminal) JiJ the api mod. The main mod will always stay a standalone mod. I'd personally recommend to JiJ the api mod, but you can also do it like 90 and and use a dummy item if the api mod isn't present. |
Co-authored-by: Mari023 <38946771+Mari023@users.noreply.github.com>
Co-authored-by: Mari023 <38946771+Mari023@users.noreply.github.com>
Co-authored-by: Mari023 <38946771+Mari023@users.noreply.github.com>
Co-authored-by: Mari023 <38946771+Mari023@users.noreply.github.com>
|
Hm, I wanted to check those changes and implement the last one by hand but somehow modmaven is not working, getting error code 502 from cloudflare. I'll try again eventually. |
I don't think I can follow. Why would I need such a translation? |
if you don't have that, the keybind will have the raw translation key instead of a proper name |
|
Keybind was the bit of information I was missing. Is that added by ae2wtlib automatically? |
yes |
|
Okay, I made a few adjustments, but your base implementation was an excellent foundation. Thanks a lot! I decided to go the full soft-dependency route and make everything optional. The mod does not ship the lib nor the API. The recipe is now conditional as well, and the item, menu, and screen is only registered if the Wireless Terminal Library mod is installed by the player. I marked the wtlib mod as an optional dependency with a minimum version range. I think you forgot to test this once again after bumping the version since the new wtlib version actually required a newer AE2 version, which required a newer NeoForge version, but it's all settled now. The interfaces on the terminal host were unnecessary. The marker interface was an addition by 90 to make the menu work in his full block add-on. The other interface was already implemented by the extended class. The main crafting recipe had two issues. It had no advancement as an unlock criterion, and the result was using the old As a remaining issue, I noticed that menu types were registered twice, but only for the terminal and the wireless terminal, not for the requester itself. This is due to WTLib loading the menu class when passing it to the For the future, try to run the mod after all changes have been implemented. Not only to see if all dependencies are there, but also to check for remaining errors or warnings in the logs. I appreciate the contribution. Thanks again! Also, thanks to all the people involved in the discussion. |
Based on original PR by @Mari023 found here: #11
Open issues