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

Update Jade plugin to directly check for interface and pattern provider instances #44

Merged
merged 3 commits into from
Oct 22, 2023
Merged
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import snownee.jade.api.IWailaPlugin;
import snownee.jade.api.WailaPlugin;

import appeng.helpers.InterfaceLogicHost;
import appeng.helpers.patternprovider.PatternProviderLogicHost;

/**
* Plugin to remove the mekanism-added chemical handler lines for interfaces and pattern providers.
*/
Expand All @@ -21,17 +24,12 @@ public class AMJadePlugin implements IWailaPlugin {
@Override
public void registerClient(IWailaClientRegistration registration) {
registration.addTooltipCollectedCallback((tooltip, accessor) -> {
// This is ugly, but nothing else worked perfectly due to Jade using old server data for new blocks.
// TODO: check if this is still needed in 1.19+
for (var loc : CHEMICALS) {
if (tooltip.get(loc).size() != 9) {
return;
}
}
var target = accessor.getTarget();

// If we have 9 of each 4, remove them.
for (var loc : CHEMICALS) {
tooltip.remove(loc);
if (target instanceof InterfaceLogicHost || target instanceof PatternProviderLogicHost) {
for (var loc : CHEMICALS) {
tooltip.remove(loc);
}
}
});
}
Expand Down