mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-11 07:47:55 +00:00
more careful ae2 check and obs field check
This commit is contained in:
1 parent
170e8c4a3b
commit
39b089805c
6 files changed
+76
-18
No files matched your search
@@ -1,23 +1,66 @@
|
||||
package com.glodblock.github.util;
|
||||
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.ButtonToolTips;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
public final class ModAndClassUtil {
|
||||
|
||||
public static boolean GT5 = false;
|
||||
public static boolean GT6 = false;
|
||||
|
||||
public static boolean isDoubleButton;
|
||||
public static boolean isSaveText;
|
||||
public static boolean isSearchStringTooltip;
|
||||
public static boolean isCraftStatus;
|
||||
public static boolean isSearchBar;
|
||||
|
||||
public static void init() {
|
||||
|
||||
try {
|
||||
ActionItems x = ActionItems.DOUBLE;
|
||||
Field d = AEConfig.instance.getClass().getDeclaredField("preserveSearchBar");
|
||||
if (d == null) isSearchBar = false;
|
||||
isSearchBar = true;
|
||||
} catch (NoSuchFieldException e) {
|
||||
isSearchBar = false;
|
||||
}
|
||||
|
||||
try {
|
||||
Field d = ActionItems.class.getDeclaredField("DOUBLE");
|
||||
if (d == null) isDoubleButton = false;
|
||||
isDoubleButton = true;
|
||||
} catch (Exception e) {
|
||||
} catch (NoSuchFieldException e) {
|
||||
isDoubleButton = false;
|
||||
}
|
||||
|
||||
try {
|
||||
Field d = Settings.class.getDeclaredField("SAVE_SEARCH");
|
||||
if (d == null) isSaveText = false;
|
||||
isSaveText = true;
|
||||
} catch (NoSuchFieldException e) {
|
||||
isSaveText = false;
|
||||
}
|
||||
|
||||
try {
|
||||
Field d = ButtonToolTips.class.getDeclaredField("SearchStringTooltip");
|
||||
if (d == null) isSearchStringTooltip = false;
|
||||
isSearchStringTooltip = true;
|
||||
} catch (NoSuchFieldException e) {
|
||||
isSearchStringTooltip = false;
|
||||
}
|
||||
|
||||
try {
|
||||
Field d = Settings.class.getDeclaredField("CRAFTING_STATUS");
|
||||
if (d == null) isCraftStatus = false;
|
||||
isCraftStatus = true;
|
||||
} catch (NoSuchFieldException e) {
|
||||
isCraftStatus = false;
|
||||
}
|
||||
|
||||
if (Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi"))
|
||||
GT5 = true;
|
||||
if (Loader.isModLoaded("gregapi") && Loader.isModLoaded("gregapi_post"))
|
||||
|
||||
Reference in new issue
Block a user