Fix ME Interface Terminal localization (#522)

This commit is contained in:
Forever-178
2025-03-10 14:06:22 +08:00
committed by GitHub
parent 37e7c02c3c
commit 9749faa692
3 changed files with 14 additions and 3 deletions
@@ -69,7 +69,7 @@ public class GuiInterfaceTerminal extends AEBaseGui {
private static final int OFFSET_X = 21; private static final int OFFSET_X = 21;
private static final int MAGIC_HEIGHT_NUMBER = 52 + 99; private static final int MAGIC_HEIGHT_NUMBER = 52 + 99;
private static final String MOLECULAR_ASSEMBLER = "molecular assembler"; private static final String MOLECULAR_ASSEMBLER = "tile.appliedenergistics2.molecular_assembler";
private final boolean jeiEnabled; private final boolean jeiEnabled;
private final int jeiButtonPadding; private final int jeiButtonPadding;
@@ -536,7 +536,8 @@ public class GuiInterfaceTerminal extends AEBaseGui {
continue; continue;
} }
// Exit if molecular assembler filter is on and this is not a molecular assembler // Exit if molecular assembler filter is on and this is not a molecular assembler
if (onlyMolecularAssemblers && !entry.getName().toLowerCase().contains(MOLECULAR_ASSEMBLER)) { // Forge documantation said unlocalized name shouldn't be use for logic, so we might need a better way......
if (onlyMolecularAssemblers && !entry.getUnlocalizedName().equals(MOLECULAR_ASSEMBLER)) {
cachedSearch.remove(entry); cachedSearch.remove(entry);
continue; continue;
} }
@@ -55,6 +55,10 @@ public class ClientDCInternalInv implements Comparable<ClientDCInternalInv> {
return s; return s;
} }
public String getUnlocalizedName() {
return this.unlocalizedName;
}
@Override @Override
public int compareTo(@Nonnull final ClientDCInternalInv o) { public int compareTo(@Nonnull final ClientDCInternalInv o) {
return Long.compare(this.sortBy, o.sortBy); return Long.compare(this.sortBy, o.sortBy);
@@ -1455,7 +1455,13 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
} }
if (what.getItem() != Items.AIR) { if (what.getItem() != Items.AIR) {
return what.getItem().getItemStackDisplayName(what); /* getTranslationKey() and getUnlocalizedNameInefficiently() have different return values in some mod
* For the Thermal Expansion
* getTranslationKey() returns complete key ending with ".name".
* getUnlocalizedNameInefficiently() returns localized name
* Because CoFH Core overrides method getTranslationKey()
*/
return what.getItem().getTranslationKey(what);
} }
final Item item = Item.getItemFromBlock(directedBlock); final Item item = Item.getItemFromBlock(directedBlock);