mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-21 04:22:32 +00:00
Fix #1499 Server Error when trying to access a GUI
This commit is contained in:
1 parent
4c8d5e2f43
commit
8ad8597ff0
2 files changed
+6
-2
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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<ISpriteRegister> spriteRegisters = new ArrayList<>();
|
||||
private final TextureMapForestry textureMap;
|
||||
|
||||
Reference in new issue
Block a user