    001    package cpw.mods.fml.common.modloader;
    002
    003    import net.minecraft.entity.player.EntityPlayer;
    004    import net.minecraft.inventory.Container;
    005    import net.minecraft.world.World;
    006    import cpw.mods.fml.common.network.IGuiHandler;
    007
    008    public class ModLoaderGuiHelper implements IGuiHandler
    009    {
    010
    011        private BaseModProxy mod;
    012        private int id;
    013        private Container container;
    014
    015        ModLoaderGuiHelper(BaseModProxy mod, int id)
    016        {
    017            this.mod = mod;
    018            this.id = id;
    019        }
    020
    021        @Override
    022        public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
    023        {
    024            return container;
    025        }
    026
    027        @Override
    028        public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
    029        {
    030            return ModLoaderHelper.getClientSideGui(mod, player, ID, x, y, z);
    031        }
    032
    033        public void injectContainer(Container container)
    034        {
    035            this.container = container;
    036        }
    037
    038        public Object getMod()
    039        {
    040            return mod;
    041        }
    042
    043    }