Merge pull request #17 from GTNewHorizons/fix_crash

fix crash
This commit is contained in:
Alexdoru authored and GitHub committed 2022-09-10 15:09:45 +02:00
commit 1eceb6e050
5 files changed
+15 -24

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@ dependencies {
compile("com.github.GTNewHorizons:CodeChickenCore:1.1.3:dev")
compile("com.github.GTNewHorizons:NotEnoughItems:2.2.15-GTNH:dev")
compile("com.github.GTNewHorizons:Baubles:1.0.1.14:dev")
compile("com.github.GTNewHorizons:WirelessCraftingTerminal:1.8.8.5:dev")
compile("com.github.GTNewHorizons:WirelessCraftingTerminal:1.8.8.8:dev")
compileOnly("com.github.GTNewHorizons:Avaritiaddons:1.5.3-GTNH:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:BuildCraftCompat:7.1.11:dev") { transitive = false }
@@ -83,7 +83,7 @@ public class NEEContainerDrawHandler {
if (this.isCraftingTerm || this.isPatternTerm) {
GuiRecipe gui = (GuiRecipe) event.gui;
IRecipeHandler currentHandler = gui.currenthandlers.get(gui.recipetype);
IRecipeHandler currentHandler = (IRecipeHandler) gui.currenthandlers.get(gui.recipetype);
if (NEECraftingHandler.isCraftingTableRecipe(currentHandler)) {
@@ -189,7 +189,7 @@ public class NEEContainerDrawHandler {
for (int i = 0; i < overlayButtons.size(); i++) {
GuiButton overlayButton = overlayButtons.get(i);
if (overlayButton.visible) {
IRecipeHandler handler = gui.currenthandlers.get(gui.recipetype);
IRecipeHandler handler = (IRecipeHandler) gui.currenthandlers.get(gui.recipetype);
int recipeIndex = -1;
if (isGtnhNei) {
try {
@@ -1,11 +1,11 @@
package com.github.vfyjxf.nee.container;
import appeng.api.storage.ITerminalHost;
import appeng.container.implementations.ContainerCraftConfirm;
import appeng.util.Platform;
import com.github.vfyjxf.nee.block.tile.TilePatternInterface;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.p455w0rd.wirelesscraftingterminal.common.container.ContainerCraftConfirm;
public class WCTContainerCraftingConfirm extends ContainerCraftConfirm {
@@ -214,10 +214,7 @@ public class NEECraftingHelper implements IOverlayHandler {
if (gui instanceof GuiCraftingTerm) {
return slot instanceof SlotCraftingMatrix || slot instanceof SlotFakeCraftingMatrix;
} else if (GuiUtils.isGuiWirelessCrafting(gui)) {
return slot instanceof net.p455w0rd.wirelesscraftingterminal.common.container.slot.SlotCraftingMatrix
|| slot
instanceof
net.p455w0rd.wirelesscraftingterminal.common.container.slot.SlotFakeCraftingMatrix;
return slot instanceof SlotCraftingMatrix || slot instanceof SlotFakeCraftingMatrix;
}
return false;
}
@@ -274,7 +271,7 @@ public class NEECraftingHelper implements IOverlayHandler {
|| GuiUtils.isGuiWirelessCrafting(guiRecipe.firstGui);
if (isCraftingTerm || isPatternTerm) {
int recipesPerPage = 2;
IRecipeHandler handler = guiRecipe.currenthandlers.get(guiRecipe.recipetype);
IRecipeHandler handler = (IRecipeHandler) guiRecipe.currenthandlers.get(guiRecipe.recipetype);
if (isGtnhNei) {
try {
recipesPerPage = (int) ReflectionHelper.findMethod(
@@ -291,7 +288,7 @@ public class NEECraftingHelper implements IOverlayHandler {
Minecraft.getMinecraft().displayGuiScreen(guiRecipe.firstGui);
overlayHandler.overlayRecipe(
guiRecipe.firstGui,
guiRecipe.currenthandlers.get(guiRecipe.recipetype),
(IRecipeHandler) guiRecipe.currenthandlers.get(guiRecipe.recipetype),
recipe,
NEIClientUtils.shiftKey());
event.setCanceled(true);
@@ -88,13 +88,10 @@ public class IngredientTracker {
ReflectionHelper.findField(ItemRepo.class, "list").get(repo);
} else {
// wireless crafting terminal support
net.p455w0rd.wirelesscraftingterminal.client.me.ItemRepo repo =
(net.p455w0rd.wirelesscraftingterminal.client.me.ItemRepo)
ReflectionHelper.findField(GuiWirelessCraftingTerminal.class, "repo")
.get(termGui);
list = (IItemList<IAEItemStack>) ReflectionHelper.findField(
net.p455w0rd.wirelesscraftingterminal.client.me.ItemRepo.class, "list")
.get(repo);
ItemRepo repo = (ItemRepo) ReflectionHelper.findField(GuiWirelessCraftingTerminal.class, "repo")
.get(termGui);
list = (IItemList<IAEItemStack>)
ReflectionHelper.findField(ItemRepo.class, "list").get(repo);
}
} catch (IllegalAccessException e) {
e.printStackTrace();
@@ -124,13 +121,10 @@ public class IngredientTracker {
}
} else {
// wireless crafting terminal support
net.p455w0rd.wirelesscraftingterminal.client.me.ItemRepo repo =
(net.p455w0rd.wirelesscraftingterminal.client.me.ItemRepo)
ReflectionHelper.findField(GuiWirelessCraftingTerminal.class, "repo")
.get(termGui);
for (IAEItemStack stack : (IItemList<IAEItemStack>) ReflectionHelper.findField(
net.p455w0rd.wirelesscraftingterminal.client.me.ItemRepo.class, "list")
.get(repo)) {
ItemRepo repo = (ItemRepo) ReflectionHelper.findField(GuiWirelessCraftingTerminal.class, "repo")
.get(termGui);
for (IAEItemStack stack : (IItemList<IAEItemStack>)
ReflectionHelper.findField(ItemRepo.class, "list").get(repo)) {
list.add(stack.copy());
}
}