mirror of
https://github.com/GTNewHorizons/NotEnoughEnergistics.git
synced 2026-11-26 23:03:05 +00:00
add Processing Pattern Terminal
This commit is contained in:
1 parent
52db9ed9ed
commit
b062cac5ed
4 files changed
+31
-10
No files matched your search
@@ -2,7 +2,9 @@ package com.github.vfyjxf.nee.utils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
@@ -15,7 +17,7 @@ public class GuiUtils {
|
||||
public static Slot getSlotUnderMouse(GuiContainer guiContainer, int mouseX, int mouseY) {
|
||||
Method getSlotMethod = ReflectionHelper.findMethod(AEBaseGui.class, (AEBaseGui) guiContainer, new String[]{"getSlot"}, int.class, int.class);
|
||||
try {
|
||||
return (Slot) getSlotMethod.invoke(guiContainer,mouseX,mouseY);
|
||||
return (Slot) getSlotMethod.invoke(guiContainer, mouseX, mouseY);
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -23,5 +25,22 @@ public class GuiUtils {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean isPatternTermExGui(GuiScreen container) {
|
||||
try {
|
||||
Class<?> patternTermExClz = Class.forName("appeng.client.gui.implementations.GuiPatternTermEx");
|
||||
return patternTermExClz.isInstance(container);
|
||||
} catch (ClassNotFoundException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isPatternTermExContainer(Container container){
|
||||
try {
|
||||
Class<?> patternTermExClz = Class.forName("appeng.container.implementations.ContainerPatternTermEx");
|
||||
return patternTermExClz.isInstance(container);
|
||||
} catch (ClassNotFoundException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user