Skip to content

Commit

Permalink
Remove chemical tooltips from all AE2 inventories
Browse files Browse the repository at this point in the history
  • Loading branch information
ramidzkh committed Aug 24, 2024
1 parent 84fc3fd commit 0803212
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public final class ChemicalIngredientConverter implements EmiStackConverter {

@Override
public Class<?> getKeyType() {
// It doesn't really matter, AE2 only checks that no two converters have the same type.
return Chemical.class;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import net.minecraft.resources.ResourceLocation;

import mekanism.api.MekanismAPI;
import snownee.jade.api.BlockAccessor;
import snownee.jade.api.IWailaClientRegistration;
import snownee.jade.api.IWailaPlugin;
import snownee.jade.api.WailaPlugin;

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

/**
* Plugin to remove the mekanism-added chemical handler lines for interfaces and pattern providers.
Expand All @@ -22,10 +22,13 @@ public class AMJadePlugin implements IWailaPlugin {
@Override
public void registerClient(IWailaClientRegistration registration) {
registration.addTooltipCollectedCallback((box, accessor) -> {
var target = accessor.getTarget();
if (accessor instanceof BlockAccessor block) {
var cap = AECapabilities.GENERIC_INTERNAL_INV.getCapability(block.getLevel(), block.getPosition(),
block.getBlockState(), block.getBlockEntity(), block.getSide());

if (target instanceof InterfaceLogicHost || target instanceof PatternProviderLogicHost) {
box.getTooltip().remove(CHEMICAL);
if (cap != null) {
box.getTooltip().remove(CHEMICAL);
}
}
});
}
Expand Down

0 comments on commit 0803212

Please sign in to comment.