From 8ad8597ff08ef74e2774a141cba64b8976af7f44 Mon Sep 17 00:00:00 2001 From: mezz Date: Sun, 6 Nov 2016 13:59:42 -0800 Subject: [PATCH] Fix #1499 Server Error when trying to access a GUI --- src/main/java/forestry/core/gui/slots/SlotForestry.java | 6 +++++- src/main/java/forestry/core/render/TextureManager.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/forestry/core/gui/slots/SlotForestry.java b/src/main/java/forestry/core/gui/slots/SlotForestry.java index 6b8d59090..a9d54c1da 100755 --- a/src/main/java/forestry/core/gui/slots/SlotForestry.java +++ b/src/main/java/forestry/core/gui/slots/SlotForestry.java @@ -17,6 +17,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.relauncher.Side; public class SlotForestry extends Slot implements IToolTipProvider { @@ -31,7 +33,9 @@ public class SlotForestry extends Slot implements IToolTipProvider { if (inventory == null) { throw new IllegalArgumentException("Inventory must not be null"); } - setBackgroundLocation(TextureManager.getInstance().getGuiTextureMap()); + if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) { + setBackgroundLocation(TextureManager.getInstance().getGuiTextureMap()); + } this.stackLimit = -1; } diff --git a/src/main/java/forestry/core/render/TextureManager.java b/src/main/java/forestry/core/render/TextureManager.java index ee4171a08..010c2fa14 100755 --- a/src/main/java/forestry/core/render/TextureManager.java +++ b/src/main/java/forestry/core/render/TextureManager.java @@ -28,7 +28,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class TextureManager implements ITextureManager { - public static final ResourceLocation LOCATION_FORESTRY_TEXTURE = new ResourceLocation("textures/atlas/forestry.png"); + public static final ResourceLocation LOCATION_FORESTRY_TEXTURE = new ResourceLocation(Constants.MOD_ID, "textures/atlas/gui"); private static final TextureManager INSTANCE = new TextureManager(); private final List spriteRegisters = new ArrayList<>(); private final TextureMapForestry textureMap;