mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-17 10:55:06 +00:00
Fix crash when trying to open wireless magnet filter when terminal in baubles (#404)
This commit is contained in:
1 parent
59e596b0ba
commit
62117facd5
6 files changed
+16
-53
No files matched your search
@@ -9,10 +9,10 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.glodblock.github.inventory.item.IItemInventory;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.ContainerOpenContext;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public abstract class ItemGuiFactory<T> implements IGuiFactory {
|
||||
|
||||
@@ -30,7 +30,7 @@ public abstract class ItemGuiFactory<T> implements IGuiFactory {
|
||||
@Nullable
|
||||
@Override
|
||||
public Object createServerGui(EntityPlayer player, World world, int x, int y, int z, ForgeDirection face) {
|
||||
ItemStack item = Util.getWirelessTerminal(player, x);
|
||||
ItemStack item = Platform.getItemFromPlayerInventoryBySlotIndex(player, x);
|
||||
if (item == null || !(item.getItem() instanceof IItemInventory)) {
|
||||
return null;
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public abstract class ItemGuiFactory<T> implements IGuiFactory {
|
||||
@Nullable
|
||||
@Override
|
||||
public Object createClientGui(EntityPlayer player, World world, int x, int y, int z, ForgeDirection face) {
|
||||
ItemStack item = Util.getWirelessTerminal(player, x);
|
||||
ItemStack item = Platform.getItemFromPlayerInventoryBySlotIndex(player, x);
|
||||
if (item == null || !(item.getItem() instanceof IItemInventory)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.glodblock.github.util.Util;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.ContainerOpenContext;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public abstract class PartOrItemGuiFactory<T> extends PartGuiFactory<T> {
|
||||
|
||||
@@ -31,7 +32,7 @@ public abstract class PartOrItemGuiFactory<T> extends PartGuiFactory<T> {
|
||||
public Object createServerGui(EntityPlayer player, World world, int x, int y, int z, ForgeDirection face) {
|
||||
ImmutablePair<Util.GuiHelper.GuiType, Integer> result = Util.GuiHelper.decodeType(y);
|
||||
if (result.getLeft() == Util.GuiHelper.GuiType.ITEM) {
|
||||
ItemStack item = Util.getWirelessTerminal(player, x);
|
||||
ItemStack item = Platform.getItemFromPlayerInventoryBySlotIndex(player, x);
|
||||
if (item == null || !(item.getItem() instanceof IItemInventory)) {
|
||||
return null;
|
||||
}
|
||||
@@ -62,7 +63,7 @@ public abstract class PartOrItemGuiFactory<T> extends PartGuiFactory<T> {
|
||||
public Object createClientGui(EntityPlayer player, World world, int x, int y, int z, ForgeDirection face) {
|
||||
ImmutablePair<Util.GuiHelper.GuiType, Integer> result = Util.GuiHelper.decodeType(y);
|
||||
if (result.left == Util.GuiHelper.GuiType.ITEM) {
|
||||
ItemStack item = Util.getWirelessTerminal(player, x);
|
||||
ItemStack item = Platform.getItemFromPlayerInventoryBySlotIndex(player, x);
|
||||
if (item == null || !(item.getItem() instanceof IItemInventory)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
+1
-1
@@ -266,7 +266,7 @@ public class WirelessMagnetCardFilterInventory extends BaseWirelessInventory imp
|
||||
public static WirelessMagnetCardFilterInventory getFilter(ItemStack is, int slot, IGridNode gridNode,
|
||||
EntityPlayer player) {
|
||||
WirelessMagnetCardFilterInventory cachedInv = cache.get(player.getUniqueID());
|
||||
if (cachedInv != null && cachedInv.checkCache(is)) {
|
||||
if (cachedInv != null && cachedInv.checkCache(is) && gridNode == cachedInv.grid) {
|
||||
return cachedInv;
|
||||
} else {
|
||||
WirelessMagnetCardFilterInventory newInv = new WirelessMagnetCardFilterInventory(
|
||||
|
||||
Reference in new issue
Block a user