Skip to content

Commit

Permalink
Update Jade plugin to directly check for interface and pattern provid…
Browse files Browse the repository at this point in the history
…er instances (#44)
  • Loading branch information
62832 committed Oct 22, 2023
1 parent e3957d4 commit b45b5d4
Showing 1 changed file with 8 additions and 10 deletions.
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

0 comments on commit b45b5d4

Please sign in to comment.